You will need .NET developers Bramastra(The ultimate wepone), the Red Gate's .NET Reflector. you can download this from http://www.red-gate.com/products/reflector/
Now you are ready for the discovery of your lifetime.
We will run through the steps using an example. In our case lets say we want to find out how to remove a workflow association with no new instance option. If you directly look in the SPWorkflowAssociation class, there is a remove association option but it does not have a option for No New instance. We are going to find it how Sharepoint does it.
Before we start, let's list out all the location where to look for web pages source and assemblies:
- Web pages:
- \Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS
- \Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\ADMIN
- Assemblies
- \WINDOWS\assembly
- \Inetpub\wwwroot\wss\VirtualDirectories\[yourwebsitename or port]\_app_bin
We can find this file in \Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS
Open this file in any text editor.
Lets open the assembly using Reflector. We can find the assembly in \Inetpub\wwwroot\wss\VirtualDirectories\[yourwebsitename or port]\_app_bin. In our case the assembly name is Microsoft.SharePoint.ApplicationPages.dll
After you drill down to the Microsoft.SharePoint. ApplicationPages.RemWrkflPage class and BtnSubmit_Click event handler the code looks like as shown in the image on the right side.
If we look carefully, we ca see that for No New Instance option it's simply setting association.Enabled = false;
So that's the magical thing. We have to disable the association instead of removing it.
We are done!
And using the same approach you can discover all functionality, as long as an example is available.
A bit of caution, some MOSS functionality is not developed using managed code. You wont be able to see code for those functionality.
No comments:
Post a Comment