Monthly Archive January 2012

AvatarByRashid Aziz

SharePoint 2010 WSRP Viewer WebPart Configuration

In SharePoint only a user can connect a WSRP viewer web part to a trusted producer. Any producer that has been configured for use in the farm by the SharePoint administrator is known as trusted producer. End users are restricted to add trusted producers and cannot override the settings so that end users and sharepoint environment can be protected from malicious remote portlet.

How to add a trusted:

SharePoint administrator have to create a TrustedWSRPProducers.config file in the “C:\program files\Microsoft Office Server\14.0\Config” folder on the SharePoint web front ends.  

TrustedWSRPProducers.config  sample file: 

<Configuration >
<Producer Name="NetUnity" AllowScripts="true">

 Now place the file “C:\program files\Microsoft Office Server\14.0\Config” folder on the SharePoint web front ends a user can configure the WSRP Viewer web part.

After adding WSRP viewer web part to a site the designer or administrator have to open up the web parts configuration panel to modify a few settings.

Producer Modification:  

A drop down lists out available producers TrustedWSRPProducers.config file.   After the producer is selected the portlet drop down selector will populate with the available values for the selected producer. Select the desired portlet, click the OK button to save these settings. 


For additional configuration SharePoint site must be switched to edit mode and then the Edit Web Part option needs to be selected from the WSRP viewer web part drop down menu.

Edit mode display the web parts configuration tool pane along with displaying additional portlet configuration information in the location of the web part on the SharePoint site.

The webpart will display the news feed from yahoo as shown below.

WSRP is one of many portals when working with SharePoint 2010. SharePoint’s business connectivity services and creating custom data view webParts from web services  using SharePoint Designer.  

AvatarByRashid Aziz

Get SharePoint 2010 Publishing Site Page Layout Programmatically

I have come across a business requirement, while implementing this I need to get publishing site page layout on sharepoint 2010 using server object model.

After a little research I managed to do this, I think it is worth to share code with you guys.

The code below was used to get the default page layout of a publishing web site in SharePoint 2010.

private static void GetPageLayout()
using (SPSite site = new SPSite("Publishing Site Collection URL"))
using (SPWeb web = site.OpenWeb())
PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);

PageLayout pageLayout = publishingWeb.DefaultPageLayout;
Console.WriteLine("Layout Name: "+pageLayout.Name + " Site URL: " + pageLayout.ServerRelativeUrl);


AvatarByRashid Aziz

SharePoint 2010 List Throttling Feature Explained

The List Throttling is a brand new concept in sharepoint 2010.  The concept of this functionality is to set the limit on the row of data can be retrieved from a SharePoint List at on time. This concept is same for Sharepoint document library for retrieving data.

Use Case: The list throttling setting will be applied on list views created by users and queries executed by custom code. When someone runs the query to retrieve all items, the number of items returns will be determined by the throttling setting for the given list and the user rights.

Throttling Settings: You can set the throttling settings via central admin.

In order to go to these settings, follow this path, Central Administration > Application Management  >  Manage Web Application. Once in the Web Application List, select the web application and click General Settings > Resource throttling.