Raghu's SharePoint Corner: September 2009

My blog has moved!

You will be automatically redirected to the new address. If that does not occur, visit
http://www.sharepointcolumn.com
and update your bookmarks.

September 27, 2009

SharePoint Guidance for Developing SharePoint Application

Last month the updated version of SharePoint Guidance for Developing SharePoint Application has been released. I didn’t get much time to explore this but thought of blogging it, may be in near future I will explore and blog few things about it. Here’s the brief description about the goals behind this release.

You can download the latest version here

This goal of patterns & practices Developing SharePoint Applications guidance is to help customers understand how to develop large scale, content-driven SharePoint applications that extend the value of existing line of business systems. We achieve this goal through the Partner Portal reference implementation and general guidance. We had three primary objectives to meet this goal:

Large Scale – Show customers how to build a large scale SharePoint application. This includes guidance on building in the manageability, configurability, and performance expected from large scale applications.

Content Driven – More advanced SharePoint applications often include many sites and combine custom coded logic with created content. We demonstrate areas like custom navigation and publishing, composing Web parts with published information, and managing a consistent user experience.

Extend LOB Systems – SharePoint can aggregate and extend information from Line of Business systems to end users, enhancing structured business processes with informal processes through collaboration. We show how to integrate security considerations into business services, and demonstrate how to create collaborative sites that help manage business events like incident escalations and order exceptions.

The following topics may help in understanding the guidance and how it applies to your scenarios:
When to Use This Guidance
Intended Audience
Evaluating the SharePoint Guidance
Developing SharePoint Applications

Videos
Channel 9 videos
Setting up the Contoso RI
Walkthrough of the Contoso Reference Implementation
How to use the configuration component?
How to use the logging components?
How to use the SharePoint Service Locator?

September 22, 2009

Linked Sources in SharePoint

Here in this post I will be talking on Linked Sources in SharePoint. To begin with I will give a brief introduction on different data source library.

In SharePoint there is a repository for all the data sources known as Data Source Library. It’s a location where we can manage and access different data sources. All the data sources present here can be accessed using SharePoint Designer.

Given below are the lists of data sources available.
1. SharePoint Lists: All the lists in a SharePoint site reside here.
2. SharePoint Libraries: Consist of libraries across the SharePoint Site.
3. Database Connections: database for all the SharePoint Site.
4. XML Files: Files used across SharePoint.
5. Server Side Scripts: like RSS
6. XML Web services.
7. BDC: Business Data Catalog, we can store different view.
8. Linked Sources: linked sources across SharePoint site

Linked sources are used when you want to aggregated data from different list i.e. joining or merging data from different list. You can achieve the following 2 things using linked sources.

1. Merge: in this you merge data from different list into a single data source.
2. Join: in this you perform a join between two lists which as a common filed between them.

Sahil Malik as written a very good article here which describes how to perform joins between lists.

UnKnown Error Page in SharePoint

I am sure most of the SharePoint developers would have come across the most common error page i.e. UnKnown Error Page while developing some custom web parts in SharePoint. In this post I am going to talk about 2 different ways to display exception details on the UnKnown Error Page.
Method 1: Turning the mode On/Off/RemoteOnly mode for the CustomErrors attribute in the web.config file. This is the most common way of displaying the exception details on the UnKnown error page.
Method 2: The other approach to catch this exception detail is by using this wonderful tool named Rapid-tools. There are 4 components in this tool which increase a developer’s productivity.
1. SPDeploy is a client side component that extends MSBuild to include targets that allow you to create a SharePoint solution file (.wsp) from a standard C# class library project inside Visual Studio. In addition, SPDeploy allows you to deploy your compiled wsp file to a remote SharePoint server. This allows you to develop locally and deploy to SharePoint remotely.
2. Provisioning Framework is set of APIs that allow you provision SharePoint assets including Site Collections, Sites, Pages and Files.
3. Exception Display is a component allows you to control the SharePoint's unhandled exception behavior.
4. Data Cache allows you to cache data inside the SharePoint content database. This provides high performance data caching in web applications and also non-web applications, including SPtimer Jobs, stsadm command, WinForms applications and console applications.
The tool which I am going to use for displaying exception detail is Exception Display. You can download this tool from here. The installation is pretty simple just run the RapidTools-Server-Install.bat file in the server folder.
Enabling Exception Display
1. Exception display with minimal detail:
stsadm -o rapidtools-EnableExceptionDisplay -url siteurlhere




2. Exception display with the stack trace included:
stsadm -o rapidtools-EnableExceptionDisplay -url siteurlhere -printstack



3. Exception display with stack trace and http response terminated. In this case no UI is rendered, only the formatted exception is print to the http stream and the response is ended:
stsadm -o rapidtools-EnableExceptionDisplay -url siteurlhere -endresponse


Disabling Exception Display
stsadm -o rapidtools-DisableExceptionDisplay -url siteurlhere

September 17, 2009

Get DLL From GAC Or Assembly

I am sure most of the people will be knowing but this is for few crazy people like me who are always behind learning new things. Recently i ran into a scenario where i need to build a sharepoint project on a local machine (one which has windows XP and no SharePoint Server installed). Obviously the build will fail coz of missing reference's for Microsoft.SharePoint.dll. Since my sharepoint development server was down for some time i had to get the dll from my colleague.

Given below are the steps to take a backup of a dll from the GAC or Assembly

1. To get dll from assembly, open run window and type “cmd” to open command window.
2. Navigate it to c:\windows\assembly in the command prompt
3. Type “cd GAC_MSIL”
4. Then type cd dllname; [Eg: In my case since dll name is Policies, it will be “cd Policies”]
5. Then type “cd “ and then space and press tab so that it will automatically populate the directories(Version) associated with that dll . Usually it will be only one. In the below picture you can see that it starts with “1.0.0.0_…..”




6. For copying that dll to c:\ , type “copy dllname.dll c:\destfoldername
7. Important: Type “del dllname.dll” in the command prompt as the last step. If you did not delete the dll from this folder, you cannot install the dll with same name of another version. You might get the error “Cannot create/shadow copy ‘File Name’ when that file already exists”.