Recently I have been in the process of performing a migration of a SharePoint internal site over to a new infrastructure. As most of use, during this process, I used many tools to complete the process, but the one thing I noticed is that there were all these migration utilities out there, each doing a pretty specific task, so every time we would migrated we would have to get the tools installed, etc.
This sounded like a great opportunity to start playing around with creating a pluggable type application that could host multiple migration plugins, hopefully written by other sharepoint devs. My purpose here was really to create a host app that others could use to display their pluggable UI’s in and basically have a single UI for a sharepoint migration/upgrade/anything else :). I also wanted to keep the interface definitions really simple so that it could be easy to take existing code, wrap in up using the interfaces and plug it into the app. (Remember this is just beat).
So with that being said, lets dive into the app and talk about how to create the plugins.
First lets take a look at the application. Below is an image of the UI. the host app is divided into two halfs, the top for the plugins and the bottom for the logging. Each plugin that the app finds has it own tab in the upper portion of the application, and a "Loggin” tab in the lower portion of the app. This allows for plugin devs to customize their own logging UI in case they would like to show log information in a different way.
So the next would be to write a plugin for the application. The application includes a shared library called SharePointStuffPluginProvider.dll. this file contains the interface definitions that need to be implemented for each plugin. Before we get into actually writing the plugin code lets talk about the interface definitions first. There are two that need to be implemented for each plugin.
public interface IPlugIn
{
System.Windows.Forms.UserControl Show();
string Name { get; }
string Description { get; }
System.Net.ICrendentials AuthenticationCredential { get; set; }
List LogItems();
}</pre>
public interface ILogItem
{
}
So now that we now what the interfaces are that need to be implemented when writing the plugin let go ahead and write a real simple plugin for the application that lists subsites within a given URL.
The first step is to start a new class library project in your favorite flavor of visual studio, like the following
Once your class library is created will need to add the shared interface DLL so we can create some classes and inherit from them. In your class project add a reference to the SharePointStuffPluginProvider.dll that is shipped with the download for the migration utility