Basic MOSS Publishing Site Definition

One reason I’ve been so busy lately is the creation of another course for AppDev. This one is all about Web Content Management and I developed it with my friend Matt Ranlett. It should be out in the next couple of months and I’ll post an outline soon and add it to my own courses page.

In the videos, I spend a lot of time covering the features that make up the MOSS publishing feature set and create a solid site definition that you can use as a basis for your own publishing sites. While I very much admire (and have personally benefited from) the work that Scot Hillier has contributed to the community, I think this slightly more complex site definition is a better place for most people to start. It includes the ViewFormPagesLockDown feature I discussed previously, but more importantly, (among other differences) it also initializes the versioning, approval, and navigation properties of the various features within the site definition and includes more comments.

As an aside, Andrew Connell wrote an interesting post a few months ago about the need for site definitions called ‘You don’t need to create site definitions‘. One thing he and a few of his commenters allude to is that publishing site definitions are a little different, but none of them really go into it. The important difference is that the publishing and navigation features have feature receivers that accept properties. You cannot specify property values when using feature receivers.

This is important in the BasicWCM site definition because it takes advantage of this key ability a site definition brings to the table. For example:

<!– Publishing –>

<!– The configuration below specifies a configuration

identical to SimplePublishing=true

To change other options, leave SimplePublishing set to false

and change the Value attribute as needed.

The Properties without values are read by the Publishing feature

receiver.

To specify a value, add the Value attribute–>

<Feature
ID="22A9EF51-737B-4ff2-9346-694633FE4416">

<Properties>

<Property
Key="SimplePublishing"
Value="false"/>

<Property
Key="WelcomePageUrl"
Value="Pages/Welcome.aspx" />

<Property
Key="AlternateCssUrl"
Value=""/>

<Property
Key="AvailablePageLayouts" />

<Property
Key="AvailableWebTemplates" />

<Property
Key="ChromeMasterUrl"
Value="~SiteCollection/_catalogs/masterpage/BasicWCM.master"/>

<Property
Key="PagesListUrl" />

<Property
Key="EnableApprovalWorkflowOnDocuments"
Value="false"/>

<Property
Key="EnableApprovalWorkflowOnImages"
Value="false"/>

<Property
Key="EnableApprovalWorkflowOnPages"
Value="false"/>

<Property
Key="EnableModerationOnDocuments"
Value="false"/>

<Property
Key="EnableModerationOnImages"
Value="false"/>

<Property
Key="EnableModerationOnPages"
Value="false"/>

<Property
Key="EnableSchedulingOnDocuments"
Value="false"/>

<Property
Key="EnableSchedulingOnImages"
Value="false"/>

<Property
Key="EnableSchedulingOnPages"
Value="false"/>

<Property
Key="RequireCheckoutOnDocuments"
Value="false"/>

<Property
Key="RequireCheckoutOnImages"
Value="false"/>

<Property
Key="RequireCheckoutOnPages"
Value="false"/>

<Property
Key="VersioningOnDocuments"
Value="Major"/>

<Property
Key="VersioningOnImages"
Value="Major"/>

<Property
Key="VersioningOnPages"
Value="Major"/>

</Properties>

</Feature>

You can access the CodePlex project here. You can also download everything from my downloads library.

Happy SharePointing…

–Doug

Author: Doug Ware

Atlanta based entrepreneur, author of many SharePoint books and videos, leader of Atlanta .NET user group, founder of InstantQuick, and SharePoint MVP.

One Comment

  • Matthijs

    June 10, 2010, 9:05 am

    This stuff is often done with a feature, settings the options programatically. This is much, much cleaner.
    Thanks!

Comments are closed