Skip Ribbon Commands
Skip to main content

Robin | zevenseas | SharePoint Blog

:

The zevenseas Community > Blogs > Robin | zevenseas | SharePoint Blog > Posts > FeaturePushdownJob
April 02
FeaturePushdownJob

While I was browsing through the Central Administration Page of SharePoint 2010 I couldn’t help noticing the screen you can below:

image

Basically it’s a page when you upgrade from SharePoint Foundation to SharePoint Server and you wish to activate all the new features that you get extra with the new license. But wouldn’t it be great if you set your own set of custom features in there to make sure that your features are automatically installed at every sitecollection and site? I created such a timerjob myself for the LCM tool to install an eventhandler to each web and site within a WebApplication, but I rather trust Microsoft applying these changes then if my code does ;)

I opened up Reflector to see what is being used behind the scenes, turns out that there is a specific timerjob that executes and loops through every WebApplication and then SiteCollection and every Site. But when I tried to instantiate the class in my project it immediately says :

image

Aargh! Well.. maybe we can see what it’s internally using. Seems it’s using the FeaturePushDownManager class that’s part of the Microsoft.Office.Server namespace, let’s open that with Reflector to see what it is about..

internal sealed class FeaturePushdownManager
{
    // Methods
    public FeaturePushdownManager();
    internal static void ActivateSiteScopedFeature(SPSite site, Guid featureId);
    internal static bool ActivateSiteScopedFeature(SPSite site, Guid[] featureIds, bool eatException);
    internal static void ActivateWebApplicationScopedFeature(SPWebApplication webApplication, Guid featureId);
    internal static bool ActivateWebApplicationScopedFeature(SPWebApplication webApplication, Guid[] featureIds, bool eatException);
    internal static void ActivateWebScopedFeature(SPWeb web, Guid featureId);
    internal static bool ActivateWebScopedFeature(SPWeb web, Guid[] featureIds, bool eatException);
    internal static bool FeatureStaplingAllowed(SPSite site, SPWeb rootWeb);
}

Aaarrgh.. again an internal method we can’t (re) use!

Are you thinking the same thing I’m thinking? We should make this public and available for re use in our code! Yes.. I see a nice little Codeplex project in the near future (if in the mean time this nice little class isn’t made public in the RTM version)! What do you think?

Comments

There are no comments for this post.
 

 Statistics

 
Views: 791
Comments: 0
Tags:
Published:777 Days Ago