464 16.2 SharePoint 2007 Features
complex workflow. When a Feature is installed, an entry is added to the con-
figuration database of the SharePoint farm. The scoping of a Feature deter-
mines where in the farm it can then subsequently be activated; a Feature can
be scoped to the farm, the Web application, the site collection or the Web
site level. For example, if the Feature is scoped at the Web site level, the Fea-
ture is available for activation from the Site Settings page of each individual
site within a site collection; whereas scoping at the site collection level means
that the Feature is available for activation from the Site Collection Settings
page at the root of a site collection.
With Features, you no longer need to create or modify a custom site def-
inition to effect a simple change in your SharePoint environment. Instead,
you can package all the various components needed to provide specific func-
tionality and deploy the package as a Feature. For example, staying with the
branding theme from the previous two chapters, let’s suppose you want to
change the look and feel of all your SharePoint site collections to match the
season. Although this is quite common for a Web site, in SharePoint Portal
Server 2003 this is difficult to achieve. However, in SharePoint 2007 the flex-
ibility of master pages and Features makes this particular scenario quite
straightforward. We will examine the inner workings of the scenario as we
progress through this chapter, but, at a high level, it involves creating a set of
Features containing all the master pages, themes, style sheets, and custom
code and applying the appropriate brand at the appropriate time.
16.2 SharePoint 2007 Features
SharePoint 2007 and WSS 3.0 make extensive use of Features to provide
capabilities ranging from simple file provisioning to fully functional work-
flow components. A quick glance at the Feature pages in a typical site will
give you some idea of the components that have been implemented through
this new capability. For example, if you navigate to the Site Collection Fea-
tures page of a typical collaboration portal installation, you will see a host of
Feature offerings, some active, some inactive (Figure 16.1).
Similarly, if you view the Farm Features, Web Application Features and
Site Features pages, you will see additional components available to activate
and deactivate at will. However, where Features are concerned, what you see
is not actually what you get. Features are much more pervasive in the Share-
Point platform than is visible through the Web interface. For example, the
list of master pages and their associated style sheets and images are provi-
sioned to a site collection through a hidden Feature named PublishingLay-
outs. Features physically reside in the
\Program Files\Common Files\
Microsoft Shared\Web server extensions\12\TEMPLATE\FeatureS
directory. If you examine this folder on a server running SharePoint Server
2007, you will see a folder named PublishingLayouts (Figure 16.2). Inside
16.2 SharePoint 2007 Features 465
Chapter 16
the PublishingLayouts folder are a number of files and folders containing all
the master pages and their associated files. The PublishingLayouts Feature is
a hidden Feature scoped to the site collection level. If you refer back to the
Site Collection Features page for a Collaboration Portal site (Figure 16.1)
you will see that the PublishingLayouts Feature is not listed because it is a
Figure 16.1
Default Site
Collection Features.
Figure 16.2
PublishingLayouts
Feature

Get Microsoft SharePoint 2007 Technologies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.