Monday, December 28, 2009

Sharepoint Connectable Webparts - Easier way than SPS-2003

Found a really helpful method to develop connectable webparts where we can pass objects as reference to another webpart.

http://businessagility.typepad.com/the_edge/2008/11/developing-custom-connectable-web-parts-in-microsoft-office-sharepoint-server-2007.html

The interface which contains the data to pass would look similar to the following:
public interface IDataProviderInterface
{
String myFilterValue { get; set; }
}


The Provider Web Part then implements the data provider interface and provides a method to communicate the data by using the ConnectionProvider method attribute.

[ConnectionProvider("DisplayName", "ID")]
public IDataProviderInterface ProviderMethod()
{
return this as IDataProviderInterface;
}


The Consumer does not directly implement the interface; rather it provides a method to consume the data as specified by the ConnectionConsumer method attribute.

[ConnectionConsumer("DisplayName", "ID")]
public void ConsumerMethod(IDataProviderInterface dataProv)
{
_providedData = dataProv;
}

Wednesday, December 9, 2009

How to find the worker process aka w3wp.exe running for ur Sharepoint Web application

This post has to be modified for IIS 6.

When you require the need of attaching your webpart debugger to the current running instance of W3WP process container for your SharePoint application from Visual Studio, you find only the ID for the W3wp currently running in the server.
To identify the current running worker process in IIS 7.0 for your application to debug under VS 2005 or VS2008.

IIS 7.0 has a wonder administration tool called appcmd.exe from which every tasks for maintaining IIS can be batched process using this command tool.
Located in %systemroot%\system32\inetsrv\

Now to display the list of web application running under W3WP process run appcmd with this parameters:
C:\Windows\System32\inetsrv>appcmd list wp
you will see

WP "4900" (applicationPool:Portal)
WP "4540" (applicationPool:TimeSheet9898)
WP "3600" (applicationPool:SharePoint Central Administration v3)


for IIS 6.0 I'll post later.

Monday, December 7, 2009

Enable Debugging in Sharepoint Site

This comes very handy .. How to enable the debugging in your newly created development Sharepoint Site.
Turn on the call stack (CallStack="true")
Disable custom errors in Visual Studio (<customerrors mode="Off"></customerrors>)
Enable compilation debugging (<compilation debug="true"></compilation>)