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.