Question:
I've been reading the Best Practices for MOSS book, and am interested in your comments on page 493 about "Feature Site Template Association" as well as the "Global Stapler".
I'm familiar with content type deployment via feature stapling with Object Model code (i.e. Scope = Farm, global template, feature manifest with content type defn.), but could you elaborate on the "global stapler" that you referenced in the book? Is this something from STSADM?
I believe the requirement is to ensure all documents in the Farm collect a few additional columns, which most likely involves adding columns to the "Document" content type. Since we are in a pre-provisioning state, would you also consider a custom list definition?
Answer:
The “Global Template” has a template ID of “GLOBAL”, so when you create a new FeatureSiteTemplateAssociation Feature definition, in which you will payload your event receiver code or content type definitions (I would recommend the definitions in this case, with a single additional unique derivation and staple it to “GLOBAL” rather than just a team site (“STS#0) for example. When you do this, the association will occur for all site definitions in the system, upon creation of a new site, for which that site definition configuration does not have an Onet.xml Configuration attribute “AllowGlobalFeatureAssociations=FALSE” (say for example, the “Blank Site” aka “STS#1” or Central Admin). If you wish to have your feature activated on create for these sites as well, you will need to specifically create an additional stapler for those identified site definitions, as the global stapler will not take effect.
I would strongly recommend against a custom list definition, for many reasons, most of all which is upgradability. There is a much better way of performing list configurations using composite controls. I like to have all site level configuration performed via delegate controls, which I detail in my blog post, and for list configurations I like to use a self-hiding CustomAction feature which tags the root folder property bag. This feature can then perform all the needed changes for the out of box lists you which to control, eliminating the need for a custom list definition.
Sample Solution
The below sample solution includes everything you need to get started with the deployment of content types and site columns to libraries farm-wide using a composite architecture. Please note the code included is not production-ready, and should be tested, have logging added, etc.
http://www.solutionsmark.com/Share/ContosoSolution.zip