Thursday, August 18, 2011

Understanding SharePoint PageLayouts

Page Layouts and their associated File names:


(Article Page) with Body Only                      pagefromdoclayout.aspx
(Article Page) with Image                             Left articlesleft.aspx
(Article Page) with Image                             Right articlesright.aspx
(Article Page) with Summary                        Links articlelinks.aspx
(Redirect Page) Redirect Page                      redirectpagelayout.aspx
(Welcome Page) Advanced Search              advancedsearchlayout.aspx
(Welcome Page) Blank Webparts Page        blankwebpartpage.aspx
(Welcome Page) People Search Results Page peoplesearchresults.aspx
(Welcome Page) Search Page                      searchmain.aspx
(Welcome Page) Search Results Page          searchresults.aspx
(Welcome Page) Site Directory Home          tabviewpagelayout.aspx
(Welcome Page) Welcome Page with Table of Contents weclometoc.aspx
(Welcome Page) with Summary Links          welcomelinks.aspx
(Welcome Page) with Webpart Zones          welcomelayout.aspx
(Welcome Page) with Splash Page               welcomesplash.aspx

Wednesday, July 20, 2011

Using SharePoint 2010 Processing Page in code

For long operations, one could use the following code in order to display the SharePoint's default processing page.

string

{
      operation.Begin();

      //Your Code

      operation.End(comeBackUrl, Microsoft.SharePoint.Utilities.
}
SPRedirectFlags.DoNotEncodeUrl, System.Web.HttpContext.Current, null);

comeBackUrl = SPContext.Current.Web.Url.ToString();using (SPLongOperation operation = new SPLongOperation(this.Page))

Error: Web site worker process has been terminated by IIS

Error Message: The web server process that was being debugged has been terminated by Internet Information Services (IIS), This can be avoided by configuring Application Pool ping settings in IIS

Solution:
In Internet Information Services (IIS) Manager -> Connections pane -> Application Pools -> Advanced Settings -> Process Model section, do one of this:

Set Ping Enabled to False.

Set Ping Maximum Response Time to a value that is larger than 90 seconds.

Monday, July 18, 2011

Activate a feature programmatically

SPFarmFeatureCollection keeps a list of all activated features on a site or site collection.  Those can be accessed using the Features property of SPWeb or SPSite objects.

WebFeatures or SiteFeatures property of SPContext.Current can also be used.

Add() and Remove() methods with the GUID as the arguement would do the work.  One thing to keep in mind here is that if we try to activate an already activated feature using Add(), an InvalidOperationException is thrown.  The only way to check if it is already activated or not is by using indexer and see if an exception is thrown.

SPWeb spCurrentSite  = SPContext.Current.Web;

spCurrentSite.Features.Add(new GUID("{G__U__I__D}"));
(or)
spCurrentSite.Features.Remove(new GUID("{G__U__I__D}"));


In case the GUID is not known, then we would have to chek out for the name in the FeaturesDefinitions collection of the SPFarm Object.

Saturday, July 16, 2011

2nd Interview Experience

Not much this time around.  The role was of a SharePoint Admin.


  1. New features added to SP2010
  2. Difference between BCS and BDC - Business Connectivity Services (BCS) is the new name for the Busienss Data Catalog technologies from SharePoint 2007. BCS is enhanced in the 2010 release with read/write capabilities, support for Windows Communication Foundation (WCF), and new client capabilities so that you have APIs both on the server and client and can sync Line-of-Business (LOB) data from your backend systems to the client cache and work on that LOB data when offline. BCS will synchronize that data from the client with server when you can reconnect.
  3. Difference between stsadm and PowerShell (Answer is here)  In a nutshell, We recommend that you use Windows PowerShell when performing command-line administrative tasks. The Stsadm command-line tool has been deprecated, but is included to support compatibility with previous product versions.
More questions were on my experience of working on admin project.  

Friday, July 15, 2011

Understanding WorkFlows

2 Types:

  1. Sequential: has predictable paths of execution
  2. State Machine: has many possible ways of execution as it includes conditions such as While, IfElse, Replicator etc.
When we create custom workflows, we get 5 files in our project:
  1. feature.xml - Contains the definition of the feature that will eventually deploy the WF in the server
  2. workflow.xml - defines the WF
  3. install.bat - contains command line instructions to copy the files to TEMPLATE folder and has stsadm commands to install the WF.
  4. workflow.cs - inherits the base class SequentialWorkflowActivity
  5. workflow.designer.cs


Ways of Deploying WebParts

Manual Way



  1. Copy the assembly DLL to either the bin or to the GAC (needs to strong named)
  2. Copy the DWP File to c:\inetpub\wwwroot\wpcatalog
  3. Copy resource files to C:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources for GAC registered Webparts and to C:\Inetpub\wwwroot\wpresources for webparts that are copied to the bin folder
  4. Add SafeControl entries to the web.config