27 July 2016

Preface to Microservices

As the pace of IT technology evolving and its dynamic nature increased, more scalable and durable architecture for solution become relevant. As time went by we came across single tier standalone applications to distributed computing models like client server architecture, N-tier application architecture, Service oriented Architecture to build stable and durable and maintainable solutions. However many of these architecture was having limited life span due to its co-related bindings or tightly coupled nature. Lot of these architecture has limitation to scale par with the usage needs or resilience. Time has reached to re-think of the sustainability of architecture that avoid complete rewrite with technology changes and support patching and resilience for durability and scaling.
Microservices is an approach to application architecture in which a large application is built as a suite of modular services. Each module supports a specific business goal and uses a simple, well-defined interface to communicate with other modules. Because of the modularity this architecture not only increase the reusability also support to scale out nature, maintainability and sustainability.

Principle behind Microservices
Microservices are based on Scale Cube principle for scalability which emphasis on the Y axis Scaling – An approach of modularizing a program based on its verb nature or noun characteristic of functions. For example “Login mechanism” is a verbal function, “Payment gateway” is a noun function.
Microservices also emphasis is Single Responsibility Principle (SRP) which help to decouple a unit function and give it an identity and hence it can be reused.
Another principle is based on the light weight interfaces that the services use to communicate with the external components or users.
Yet another principle to ensure the identity of a Microservice is Self-contained system. An autonomous, isolated unit that includes its own data, logic, and UI.

Scalability
Other than Y axis Scaling X and Z axis scaling also are considered in Microservices architecture to bring out the higher potential of scaling and application rigidity and high availability.
X Scaling is a way of scaling by replication of the same instance in a kiosk way so that the requests will be load balanced.
Z Scaling is a way of data sharing-based approach. When using Z-axis scaling each server runs an identical copy of the code. In this respect, it’s similar to X-axis scaling. The difference is that each unit is responsible for only a subset of the data. Many a time a routing mechanism is used to route the query to the specific subset of data.

Single Responsibility Principle
SRP is derived as the principle behind object oriented programing the way how a class is derived. The intention behind using SRP in Microservices to design the services with maximum modularity so that it can be reused , scale and maintain than an interrelated service, this Microservices are modular, compose able and fine-grained units that do one thing and one thing only.

Light weight interfaces for communication
An asynchronous is the preferred communication mode for Microservices as it won’t create an IO block in comparison with a synchronous communication. However there will be situation where synchronous communication is unavoidable like the database will usually have to be synchronous in the sense that it happens within the request-response cycle. Remote calls are more expensive than in-process calls, and thus remote APIs need to be coarser-grained.
REST APIs are mostly used in Microservices interfaces. HTTP and REST synchronous calls should be minimized between Microservices because of its co-related nature. Advanced Message Queuing Protocol (AMQP) for asynchronous communications are also widely used between Microservices.
Message bus technologies like RabbitMQ and Apache Kafka for asynchronous communication between Microservices are also widely used. In case the message-passing is done on the same host, then the containers can communicate with each other by way of system calls, as they all share the same kernel.

Containerization
Containers is an operating-system-level virtualization method for running multiple isolated systems (containers) on a control host using a single kernel. The Container concept was first introduced in Linux. Containerization is Light Weight Virtualization, which will eliminate wastage of resources compared to normal server virtualization. As Containers will share resources, it results in optimize resources utilization and void latency due to OS booting.  Each Container will have its own IP and network settings. Containers extend the decoupling, separating software from the underlying hardware in micro service architecture.
Containers decouples software from the underlying hardware, bringing us portability and speed not seen before in VM-based solutions. Containers are easily packaged, lightweight and designed to run anywhere. Multiple containers can be deployed in a single VM. Microservices encourages to decouple our software into smaller functional pieces which are expected to fail, bringing us agility and resilience. Thus bringing a blend of Microservices architecture with Containerization will result in better resilience and modularity for maintenance. 
A composition of Containers can logically form an application. Application orchestrating multiple containers will achieve the desired output.

Some best practices while Microservices Design
Asynchronous communication- Avoid IO blocks using asynchronous communication as much as possible. Using synchronous communication might cause IO blocks in case the serving service is not available to complete the loop of communication. Using the asynchronous pattern the services are more decoupled compared to the synchronous pattern and which preserves the autonomy of the service. Ultimately, the goal is for your service to be available to the end-user even if other services that are part of the whole system are offline or unhealthy.
Clean Separation of Stateless and State full Services- Microservices scale better when they are stateless. In such circumstances where we need to use state full services we have to keep persistence layer or data caching mechanisms.
Avoid Sharing and Avoid Host Affinity and Reduce dependency- When one or more containers rely on the same library, it may be tempting to share the dependencies by centrally configuring them on the host. This model introduces complexities in the long run. It not only it brings host affinity, but also breaks the Continuous Integration Continuous Deployment pipeline. Also need to consider to keep only the required library for the unit of function to work.It is almost impossible to reduce the dependency due to the atomicity of Microservice, but the design should take care to reduce the co-related interdependency as much as possible.
Well defined APIs – The APIs should be well defined for entry and exit, also should have proper exception handling by the service.
Self-Registration and Discovery Mechanism using central registry- A central registry is maintained for looking up all available services. Central service registry is used to handle registration. The registry plays a critical role in orchestrating Microservices. Netflix Eureka, Consul and Apache Zookeeper are examples of commonly used registries for Microservices.

Benefits of Microservices Architecture
RAD-From a project engineering perspective. When the different components of an application are separated, they can be developed concurrently independently and faster.
Resilience - Rather than relying upon a single virtual or physical machine, components can be spread around multiple severs or even multiple data centers and support failovers and hence continuity.
Scaling-Rather than scaling up with bigger and more powerful machines, or just more copies of the entire application, you can scale out with duplicate copies of the heaviest-used parts.
Polyglot over Single Stack-One advantage of using Microservices is the ability to choose the best of breed OS, languages, runtimes and libraries. For example, With Microsoft adding native container support to Windows, it is also possible to mix and match Linux containers with Win32 and .NET containers within the same environment so that .net as well as java programs or shell scripts together can orchestrate an end to end application.
Code Maintainability-Each micro service is an Independent unit of code which is configured with identity in configuration management system. This makes it possible to deploy newer versions of services without disrupting the application.

Challenges
Basically there are two categories of problems arising with moving to Microservice patterns. One is software architecture mindset/pattern related problems, e.g. how do we define a Microservice, how big or thin should it be, how communication handled, etc.
The other is Testing, deployment and operations production related problems. The concepts like DevOps are supportive to address the later to a greater extend. 

20 January 2014

Provider Hosted App in SharePoint 2013

Create a windows azure empty web site
Down load the publishing profile (we will be using this to publishing setting to publish the app to azure)
Create a new SharePoint 2013 app in Visual Studio.
Visual studio will create app project and azure web application project in this solution.
The next thing required is to create the Client Id.
Client Id and Client Secret is used to connect Window azure web sites / azure cloud services with Office 365 App.
 In the SharePoint site go to _layouts/15/appregnew.aspx to create client ID , Client Secret and register the app.
The following fields are there in a form , Appid and App Secret are created by clicking the button beside the text box. Title App Domain(will be the windows azure domain you used to create the windows azure web site) and Redirect Url(this will be the full url including default.aspx starting with https://) need to be provided.
AppId,App Secret,Title,App domain and Redirect Url
And then register the new app.
The next thing is to set the client ID in the app manifest and web application config file.
In the web.config we also need to put the client secret.
Note that to put the full url in the Startpage.
We also need to remove the appsettings before publishing to ensure than we will be providing the credential on the fly.
GetContextTokenFromRequest is the key method to get the Context token and to create the context.
TokenHelper class have methods to pass Context  token and get the Refresh token and to pass the refresh token to get the access token.
All this token handling is encapsulated using GetClientContextWithContextToken method of TokenHelper Class.
Once you get the context you can communicate to the web and the SharePoint Objects.
To publish we need to import the profile we downloaded from the azure site after we click publish.

30 December 2013

Videos in SharePoint 2013

There are two ways to deal with videos in SharePoint 2013. There is a content type called video in SharePoint 2013.When you upload the video to this content type it will store as BLOB in the content database. You can store up to 1 GB videos in the content database. The Advantage of storing in the content database is security like other content type. But more video you store more will be the cost of storage as the blob using SQL server for storage.
The other way of storing videos is as a link to other physical locations. The security of the videos needs to be explicitly handled in this case.
When you store the videos in the SharePoint the blob cache need to be optimized for smooth streaming, Like Size the BLOB cache to a certain percentage of the total size of unique videos viewed in a week, this can be 60-80 % of total size of unique videos viewed. To optimize performance, do not place the BLOB cache on the same drive as the system drive, and ensure that the drive where BLOB is cached have enough space.
When the videos are stored in the external locations to the SharePoint like a web severer (IIS server) or a media streaming server the streaming is performed by the external location's source.
With a single WFE with 12 GB ram, 4 core processor and 8 core 16 GB DB server, it supports 400 concurrent video viewing in the acceptance level. As no of WFE increases it support a minimum 200 more additional smooth streaming. The no of smooth streaming is not linear but shows exponential increases by adding additional WFEs.
With a IIS Server same as the configuration of WFE 600 smooth concurrent streaming can be expected. By using media streaming services and media servers this can gain boosted. Bit Rate throttling is another extension to ISS to increases the bandwidth while streaming videos.

26 August 2013

Content Search Web Part to roll up content in SharePoint 2013


SharePoint 2010 has a big limitation with Content Query Web Part to roll up content and we have to do good effort of work around as Content Query Web Part was limited to the Site Collection. In SharePoint 2010 we used the Content Query Web Part which helps us to see content instantly without waiting for the next crawl.

This drawback is eliminated in SharePoint 2013 using Content Search Web Part. Content Search Web part is available in the Web part>Content Roll Up>Content Search. This web part will allow you to create your own query easily and display the results the way.

Change Query in the Property Page will allow you to design your own query. The “Query Builder” has a nice UI that helps us to configure the query. “Switch to the Advanced Mode” in the “Query Builder” will provide more option to narrow down result.

A “Test Query” Option is available with the “Query Builder” which will provide a Preview of Result for whatever you configured.

Now the question is why we need Content Query Web Part in SharePoint 2013 since we are having Content Search Web part. To understand this we need to understand how this both web parts work. CSWP work based on the search index, made by Crawl. The result will be displayed is the data is crawled. CQWP does not depend on Crawl. Again this is less significant since as SharePoint 2013 supports continuous crawl. CSWP will not search minor versions whereas CQWP does.(I am not sure this is a bug and will be rectified later). From a design perspective CSWP no longer requires XSLT, HTML, or JavaScript.

14 August 2013

SharePoint 2013 Geo Location Field & Map

SharePoint 2013 Provide a new field type (column type) called Geo location. This field is used to enter the longitude and latitude data. SharePoint out Of the Box will provide an association to a Bing map to the entered Geo Location. A list Created with Geo Location field will also can have a Map View in which a map will be displayed aside the list with the pinned entered Geo location. When you hover the Geo Location in the list the corresponding location will be highlighted in the map.

The Site column contain a field called “Location” , But this field will not be the right thing to add for Geo Location. We cannot add Geo Location field using SharePoint 2013 UI.
Use the following code to create a Geo Location field to a List.

private static void CreateGeolocationField()
{
  // Replace site URL and List Title with Valid values.
  ClientContext context = new ClientContext("<site url>");
  List myList = context.Web.Lists.GetByTitle("list Title");
  myList.Fields.AddFieldAsXml("<Field Type='Geolocation' DisplayName='Location'/>", true,   AddFieldOptions.AddToAllContentTypes);
  myList.Update();
  context.ExecuteQuery();
}
 
You can also use power shell command for the same.
A map view of the list can be created using UI.

12 August 2013

SharePoint 2013 Device channels - Branding and Content based on Devices and Browsers

Device channels in SharePoint 2013 allow changing the look and feel depending on the browser or the device. This feature helps to implement corresponding Master Page or Page layout designed for the end browser or device.

Device Channels can be implemented only for the publishing sites, which make sense since on publishing sites only we can publish different master pages.

We have to create a “Device inclusion rule” to identify an end browser or Device. The Device inclusion rule that need to be included can be referred from the site “whatismyuseragent.com”.
To implement device channel navigate to Settings > Look And feel > Device Channel and Add a new entry. “Device inclusion rule” is the vital data here. Name, Alias and Active are other columns here once all this entries are added and saved you will get an option in the Master pages settings to select a new master page for the entry you just created.

We can choose to include or exclude portion of any page layout in a channel this will help for including or excluding content based on browser/devices.
Thus Device Channel is a significant feature in SharePoint 2013 that helps to render the appropriate look and fell and content based on browsers and devices.

15 May 2013

Image Renditions in SharePoint 2013 Save Size and boost performance.


Image Renditions Is a facility available in SharePoint 2013 for having different sizes of the image for different content holders? Different renditions can be created like full size, thumb nail etc. Image rendition also helps to adjust the picture to which part to display. This facility will help to reduce the size of the image to be downloaded at the client and hence optimize the performance. Image rendition also helps to store the file in the reduced space in the content database since only one copy of the file is actually getting stored. We need to enable BLOB cache before you can use image renditions.

A  Rendition ID can be used with the image url like this “?RenditionId=n” to assign different rendition.

3 March 2013

C # programming in the Infopath 2010 forms


Infopath forms can give better look and feel for the user interface in SharePoint.
It is recommended to use Infopath for lesser complex user interface and to use minimal coding in the Infopath forms.
How ever c# programming is possible in Infopath forms for the client side validation and presentation purpose or implementation of certain level of business logic.

Xpath objects are used to access the Infopath values.

Before submitting the form we can make the data   to be validated, verified or transformed using c# code. For this we need to enable Perform custom action using code in the submit options.

If we have VSTA (Visual Studio Tools for Applications) and .net framework 3.1 SP1
We can program in Infopath using c#.

The events available in the info path forms are classified as Button events, Data events and Form events. There is a limitation of browser compatibility of some of the events.

Once form is designed and authored the source code, form can be published for publishing we need to configure the form as domain trust or full trust.


Domain trust forms can be published to SharePoint as Sandboxed Solutions directly from the Infopath 2010 Designer. With Sandboxed Solutions, However SharePoint Server farm administrators can control the resources available to the code and developers cannot access resources subject to operating system security. This help Site Collection administrators can publish code with out Farm administrator approval.

Publishing a full trust form to SharePoint requires activating the solution through the SharePoint Central Administration.

From my experience I will recommend to keep InfoPath forms as simple as it can and use visual web parts for complex user interaction screens where code need to implemented.  

28 November 2012

SharePoint 2010 Database Encryption

SQL Server 2008 Transparent Database Encryption is the best encryption technique
to work with sharepoint 2010.

High Level steps Involve
 Create the DMK
 Create the TDE Cert
 Backup the TDE Cert
 Create the DEK
 Encrypt the DB
 Monitor the progress

17 September 2012

SharePoint Logging Location

wss_logging
In special case of requiremnet for auditing we can hit this database and particularly RequestUsage view to audit any request regarding request and access auditing.
.dbo.RequestUsage is a vew in the wss_logging database.

Advantage of REST

Eliminates the need for intermediate layers between client and server.
Read, create, update, and delete operations are mapped directly to GET, POST, PUT, and DELETE HTTP verbs
Introperability.- HTTP protocol.
REST interface uses flexible URL conventions for querying data, which enable you to filter, sort and select information
Easy to use with JavaScript Object Notation (JSON), Atom, and AtomPub standards
REST interface, such as batching multiple operations into a single request, concurrency control through HTTP ETags, paging of large data sets, and access to document streams.

24 July 2012

Welcome to SharePoint 2013 Apps

Along with the Farm solution and sand solution we are familiar with SharePoint 2013 another 3 mode of hosting for SharePoint 2013, this are app hosting model which will be running 100% out of the Farm in either in browser or in a webserver or in cloud.
App model are much cleaner simpler and upgrade process.
App Communicate with SharePoint via REST/OData/CSOM
App are granted permission to SharePoint via OAuth.
SharePoint hosted app – Run at browser implemented using JavaScript-client side app model.
Developer hosted app – Run in the web server or cloud, server side code. Using this model other language implementation says Eclipse or LAMP can be done.
Azure auto hosted app-   similar to developer hosted app but create its own database and web application for each tenant in the multitenant mode.

8 June 2012

Why SharePoint Solutions Fails

SharePoint applications are best suit for bucketed solutions.
SharePoint is powerful, but need to be used for what it is intended for. For All type of web applications SharePoint is not an answer. SharePoint should be best suited for bucketed solutions. Where the major processing take pace beyond SharePoint and SharePoint provides the results of that processing .SharePoint is not a good option for large data processing, large content management, complex ORM models etc. Using SharePoint for a small percentage of what SharePoint is capable of doing will be poor on ROI.
SharePoint is not a closed application but a frame work.
One of the myths on SharePoint is SharePoint is a finished Product capable of doing our entire requirement. Out Of Box is a common terminology that got popular with SharePoint. Many people think that SharePoint is a finished product and don’t need any tweaking or customization to fit our need. This is not absolutely true. For example If a Customer ask us can we have a Document Management System in SharePoint without any customization we will say yes and this is true to an extent , but without customization like applying the policies , retention logics the Document management system in SharePoint  can’t stay for long. Because governance is an important part of SharePoint Solution. A SharePoint solution without a governance plan can’t survive for long or can end in disaster.
SharePoint Capacity planning is important factor
Lack of proper capacity planning A SharePoint solution can fail, SharePoint internally use different patterns and ORM models to make the functionalities. Some of them add complexity if we don’t follow the capacity plans benchmarked by Microsoft. Like any other application servers from Microsoft stack proper infrastructure resources are required for SharePoint for its optimum performance. We also need to consider optimizing the use of servers and the application services running on them in a Farm.  
Performance Tuning and SharePoint
There is lot of room for optimizing SharePoint application from the way OOB SharePoint provides. It include thinning  master pages / web pages, using optimized model, throttling mechanisms, proper and best coding practices while customizations, using best and optimal cashing mechanisms that suit the application. Users will abandon SharePoint applications if it won’t have the expected  performance.
SharePoint is all about delegation
Unlike a.net application SharePoint is a framework that can be extended by the end user for the needs. An end user with the proper permission can extend the functionalities of the SharePoint application by adding new features web parts etc. Lack of knowledge on this will results in using SharePoint as .net application. In most companies SharePoint applications are used AS –IS delivered from a project. If a minor change need to be done like adding an OOB web part or in co-operating an in-house functionality in SharePoint involvement of a developer is not required. Not using the delegation capabilities of SharePoint again is not proper utilization of the SharePoint.
SharePoint is not a permanent storage solution so retention must be in consideration.
SharePoint uses Sql server to store its content, so if we are planning to use SharePoint to store the documents or other assets by time it will impact the Storage and Performance. So we need to implement retention policies for the content, archiving mechanisms etc. to withstand the content growth adhere to the business requirement. There should be proper plan and policy for what should be retained and kept and what duration it should be kept.
Governance in SharePoint is important.
Governance in SharePoint should be an outcome of standard policies, rules and regulation to keep the SharePoint intact optimal and durable. Governance comprises three areas: IT governance, information management, and application management. Training users and users adoption is also a part of Governance. Inadequate or nil governance will end up in SharePoint solution failures.

28 March 2012

Reporting in the SharePoint without SSRS integration

One way to create report in the SharePoint with source as list or external data sources is using rdlc files.
To create report using rdlc files the first thing we need is a rdlc template of the report. Using visual studio we can create a rdlc file referring to a particular data source.
To create a rdlc based report do the following steps.
  • Open the vs create a visual web part project and add a report viewer to the ascx page.
  • Now the next step is to create an rdlc file , for this add a new rdlc file from the Add > New Item > Reporting.
  • Drop a table in the rdlc file this will open a data source selection wizard.
  • Create a data Set and in the data source select sharepoint (in case the data source is from sharepoint)
  • Once this reference is added reselect the Object (where you selected the SharePoint option )in the selection and select particular lineitem template required, this can be a line item template of an existing list , or a new list we create to get the report template (once the rdlc file is created we can remove this list also).
Now map the columns in them as required.
So the design of the template is done.
  • Keep this rdlc file in the app root path.
  • Now the next steps is to bind the data .
//populate the data in a data table either using caml query or linq  (using caml is good for the performance)
DataTable items = dt;
//use server.mappath to direct to the rdlc file.
this.ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/po.rdlc");
// assign the datatable , note that the name parameter (first) will be same as that in the rdlc file(and should be unique for each report to avoid data mapping conflict.)
ReportDataSource rds = new ReportDataSource("PoData", items);
// and add the report data source to the reportviewer control as below.
this.ReportViewer1.LocalReport.DataSources.Add(rds);

  • Deploy the visual webpart to the desired webpart zone.

In case you need parameters to the report design it at the visual webpart so the query will filter out the data.

Happy reporting without sharepoint ssrs integration.

7 February 2012

Multilingual in SharePoint 2010

To Mutliligual Support
1. Install Language pack on all (wfe & app) servers in the farm.
2. Run PSConfig wizard on all servers.
3. Go to Site actions à site settings à site administration à Language Settings 
   and check the required language.
4. New language selection menu in the welcome menu.
To Modifiy Content
 To modify the content with different language export the resource file of that particular site language and import it after modifying the resource file. 
1. Site Actions à Site Settings à Site Administration à Export Translations.
2. Download the .resx file. Open it in a resource editor in vs.
3  After modifying the .resx file import it to the SharePoint website . While uploading make sure to select the exact language.
   Click on Site Actions à Site Settings à Site Administration à Export Translations 

5 October 2011

Accessing web service in SharePoint Online (Cloud –Office 365)

Accessing web service in SharePoint Online (Cloud –Office 365).
It was an end of a tiring day where I tried to consume a web service in the SharePoint online and finally I succeeded. Thanks to Sajid Mohammad who redirected me to the blog of Wictor , and a great thanks  to him for providing  MsOnlineClaimsHelper class.Un like in  Wictor’s  example  my requirement was to consume a web service.
So All need to do is that assign my webservice’s cookicontainer class to the claims helper’s cookiecontainer as follows.
objLists.CookieContainer = claimsHelper.CookieContainer;
The whole code will look like below.
try
{
MsOnlineClaimsHelper claimsHelper = new MsOnlineClaimsHelper("http://......./teamsite/_vti_bin/Lists.asmx", @"<username>", "<password>");
FileGET.Lists objLists = new FileGET.Lists();
objLists.CookieContainer = claimsHelper.CookieContainer;
objLists.Url = "http://dev22.sharepoint.com/TeamSite/_vti_bin/Lists.asmx";
XmlDocument xmlDoc = new System.Xml.XmlDocument();
XmlNode ndQueryOptions = xmlDoc.CreateNode(XmlNodeType.Element, "QueryOptions", "");
XmlNode ndListItems = objLists.GetListItems("test", null, null, null, null, ndQueryOptions, null);
XmlTextReader reader = new XmlTextReader(ndListItems.OuterXml, XmlNodeType.Element, null);
//to display in my windows application
DataSet ds = new DataSet();
ds.ReadXml(reader);
dataGridView1.DataSource = ds.Tables[1];
}
catch (Exception ex)
{
 MessageBox.Show(ex.ToString());
}

----------------------------------------------------------------------------------------------------------------------------
Note : In case you are calling this with in a firewall dont forget to put the following ahead of the script.

if (WebRequest.DefaultWebProxy.Credentials == null)WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultCredentials;

1 September 2011

File Tagging Folks + Taxonomy = Folksonomy

File tagging folks+ taxonomy= folksonomy.
Recently I came across a scenario where individual files need to be tagged by multiple people. So that tag based routing or audience targeting can be done. My initial idea was to add taxonomy to the file.
Using managed metadata column.
But here arise a problem that it is difficult to track that who tagged. The Alternative was to take out the tagging mechanism from the content, but still use the folksonomy taxonomy feature extent to a different list.
The approach is as follows:
Create a separate list with columns like file URI, tag, user who tagged it. There should be a mechanism to make the folksonomy to add to the term store on identification  of new term.my idea here is to travers e the existing taxonomy tree with a like search, or similar. And add valid terms, So added folksonomy will be emerged as taxonomy and help in the file tagging and classification.
Another issue was how to do automatic file tagging, this means by reading the content how a document can be tagged. This can be achieved to an extent only; the base to start with this is the term store management only. By traversing the terms in the hierarchy and hitting no of counts of the same in the file a file can be given an automatic tag. But this reading process may end up with deterministic result too.




12 August 2011

Kind a Gotcha

Problem : Save the site as a template missing.
Resolution : If you have “SharePoint Server Publishing” feature turned active in a SharePoint site (this is a web feature). You cannot Save the site as a template. This is because SharePoint 2010 by default stops creating site definition of a publishing site A Publishing site may have interdependencies that cannot be incorporated in a template when a template is getting created.
Problem : You are geting error while creating a search center site.
 Please check In the site collection fetures "SharePoint Server Publishing Infrastructure is Active", Because when you use a site creation with a new site template that use a diffrent master page , this feature need to be activated, otherwise publishing of the master page wont happen and hence fail the site creation.
Problem :
You are getting message "The operation could not be completed" when you connect to SharePoint from InfoPath.
Reason : The Site You are connecting missing a Root Site.InfoPath works only when you have a root site in the site collection.
Resolution : Create a Root Site in the site collection.
Problem: Error at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_PartitionIDs() and in the error log.Current time is '2012-04-10T13:16:33.496Z' and allowed clock skew is '00:05:00'.
Resolution: All servers in the Farm should have the same time.Check all the servers in the farm have the same clock timing and in synch.

Problem: 503 errors after the credential change.
Resolution: in the iis in the credential reset the password of the app domain account.
Problem:The CLR has been unable to transition from COM context 0x1bd54fb0 to COM context 0x1bd55200 for 60 seconds. The thread that owns the destination

Resolution:This is a configuration change required issue. and need to set in the project propertiesDebug > Exceptions > Managed Debug Assistants (MDA), and then unchecking the ContextSwitchDeadlock option

Problem:Operation is not valid due to the current state of the object
Resolution:In valid assembly reference , comma missing or public key not correct
Problem:Object reference not set to an intance of object - while creating site collection using object model.
Resolution:Use web service to create site colloction
Problem:CREATE DATABASE permission denied in database 'master'.
Resolution:Add the app pool a/c as database creater in sql server.
Problem:While uploading file while migration after a limit getting the error as follows
The URL 'DocVault Library/mail_Sending_wf.wsp' is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.
Resolution:This issue is due to the wrong version of sql server integarted with the share point.
Express edition of sql server does not support files beyond a limt.
Problem:'AllDocStreams_CI' in database 'WSS_Content_44444' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
Resolution:This issue was due to the database growth parameters are not properly set in the development database server.Resolved by setting the correct version of database with proper growth ratio.
Problem:Diffrence of situvation using Static Name and Name with list.
Resolution:Static name will work with the list item , while Name works with after and before properties.
names are used insted of static Name in the code.
Problem:The field you are tying to update is read only,while trung to update Created By(Author).
Resolution:Code defect which is fixed by overriding the normal sharepoint default setting for the Author.
Problem-Resolution:UTC date need to be used while Updating from event reciver.

Problem:Trying to use a SPWeb object that has been closed or disposed and is no longer valid
Resolution: insted of using (SPWeb myWeb = SPContext.Current.Web)  use
Problem: Application error on the webpart page.
Resolution:Put ?content=1 to show which webpart is giving error or fix.
using (SPWeb myWeb = SPControl.GetContextSite(Context).OpenWeb()) (never close SPContext.Current.Web)

Problem: Not able to open webpart page.
Resolution: put <url>?content=1 and then edit and remove errored webpart
or if subsite is not able to open use
_layouts/spcontnt.aspx?url=/<site>/<subsite>/default.aspx to get the web part page of the subsite , edit and edit and remove errored webpart.
or finally try reset the page to site defnition in the sp designer.

Problem: People Search not returning result for https site
Resolution: for https sps3s:// and for http sps3:// on the search location of mysite.
Also reset the crawl and do full crawl.

Problem: People search people image url not set.
Resolution: use powershell script to reset the picture url of the profile for all profiles.

Problem: The text box disabled while adding web reference
Resolution:Add ?wsdl at the end or click the service discription (up to asmx does not create the proxy , need the wsdl)

10 August 2011

Mobile Configuration for SharePoint2010

“compat.browser” within the server’s IIS directory will be "\inetpub\wwwroot\wss\VirtualDirectories\80\App_Browsers\compat.browser").
The configuration file for sharepoint 2010 with Mobiles. For eg. The IsMobileDevice attribute of that mobile browser when set to FALSE will
cause SharePoint to bypass the mobile view for that browser.”

Note that if you do any modification with sharepoint designer to a site and found that *.browser file got duplicated in another folder , you need to delete this folder

7 August 2011

List web service and Copy web service to down load files from a Folder in SharePoint

/*It is a very common requirement that to down load the files from a folder from a sharepoint library using web service.The following code uses two inbuilt web services of sharepoint two down load files using webservice. This code can be used to create a console application that can be scheduled using a windows service to have scheduled transfer from Sharepoint*/


using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Net;using System.IO;using System.Xml;using System.Configuration;using System.Data;namespace
{
FromSharePointclass Program{

{
static void Main(string[] args)try{
FileGET.
objLists.Credentials = System.Net.


objLists.Url = sitePath +


ndQueryOptions.InnerXml =
Lists objLists = new FileGET.Lists();CredentialCache.DefaultCredentials;string sitePath = ConfigurationManager.AppSettings["SitePath"].ToString();string destPath = ConfigurationManager.AppSettings["DestinationPath"].ToString();"_vti_bin/Lists.asmx";XmlDocument xmlDoc = new System.Xml.XmlDocument();XmlNode ndQueryOptions = xmlDoc.CreateNode(XmlNodeType.Element, "QueryOptions", "");string.Format("<Folder>{0}</Folder>", ConfigurationManager.AppSettings["SourcePath"].ToString());XmlNode ndListItems = objLists.GetListItems("Library", null, null, null, null, ndQueryOptions, null); // you can change the document library name to your custom document library name

ds.ReadXml(reader);

{

{

CopyLIST.
myCopyService.Url = sitePath +
myCopyService.Credentials = System.Net.


CopyLIST.
CopyLIST.
XmlTextReader reader = new XmlTextReader(ndListItems.OuterXml, XmlNodeType.Element, null);DataSet ds = new DataSet();if (ds.Tables.Count > 1)foreach (DataRow dr in ds.Tables[1].Rows)string fpath = dr["ows_FileRef"].ToString().Substring(dr["ows_FileRef"].ToString().IndexOf("/"));Copy myCopyService = new CopyLIST.Copy();"_vti_bin/copy.asmx";CredentialCache.DefaultCredentials;string webURL = sitePath.Substring(0, sitePath.IndexOf("sites/") + 5);string copySource = webURL + fpath;FieldInformation myFieldInfo = new CopyLIST.FieldInformation();FieldInformation[] myFieldInfoArray = { myFieldInfo };byte[] myByteArray;// Call the web service
uint myGetUint = myCopyService.GetItem(copySource, out myFieldInfoArray, out myByteArray);// Convert into Base64 String
base64String =
string base64String;Convert.ToBase64String(myByteArray, 0, myByteArray.Length);// Convert to binary array
byte[] binaryData = Convert.FromBase64String(base64String);// Create a temporary file to write the text of the form to
string tempFileName = destPath + @"\"+ dr["ows_LinkFileName"].ToString();// Write the file to temp folder
fs.Write(binaryData, 0, binaryData.Length);
fs.Close();
}
}
}

{


}
}
}
 
}
 
FileStream fs = new FileStream(tempFileName, FileMode.Create, FileAccess.ReadWrite);catch (Exception ex)Console.WriteLine(ex.ToString());Console.Read();