Monday, November 22, 2010

Workflow Links

This are the good links available for workflows,

http://blogs.msdn.com/b/sharepoint/archive/tags/workflow/

For creating State machine workflow
http://blogs.msdn.com/b/sharepoint/archive/tags/workflow/

Integrating infopath with workflows
http://nisha081.spaces.live.com/Blog/cns!6F578843FD095913!1265.entry

Wednesday, November 3, 2010

How to access web.config in timer job code

This is common scenario where some times we may need to access the web.config file in sharepoint custom timer job. But timer job is running under OWSTIMER.EXE, but sharepoint is running under the context of w3wp process, So its difficult to access the web.config file in the timer job code. To overcome this we need to create the instance of the webapp and Configuration and then we can access the web config file.

Below is the sample snippet code where we can access the web.config file.

//Get the instance of the current webapplication
SPWebApplication webApp = this.Parent as SPWebApplication;

//Create the webconfig instance by using web application name
Configuration webconfig = WebConfigurationManager.OpenWebConfiguration("/", webApp.Name);
//Get the configured value from web config using the key value in my case its "MYKEY"

string appValue = webconfig.AppSettings.Settings["MYKEY"].Value.ToString();

The above code needs to written in Execute method of the timer job definition file.

Monday, November 1, 2010

Updating Master Page and Page layout

Updating MAster page and page layout through feature receiver

http://narunkumar.wordpress.com/2010/06/25/updating-a-sharepoint-master-page-page-layout-via-a-solution-wsp/