Site Definitions and Provisioning: the Feature Framework

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Windows SharePoint Services 3.0 implements a new structure known as a Feature, which is an end-user-oriented container of one or more elements. An element is an atomic Windows SharePoint Services concept.

The Feature is defined in XML format by using Introduction to Collaborative Application Markup Language (CAML), similar to other existing structures in Windows SharePoint Services. Each Feature definition includes a set of XML files. Many items that were previously contained within a site definition in Windows SharePoint Services 2.0 are now modular and fit separately as an element.

In Windows SharePoint Services 3.0, a SharePoint site definition is basically transformed into a list of Features plus a layout page and a master page. The goal is that any templated SharePoint site can be transformed by an administrator into another templated SharePoint site simply by toggling Features on the site and possibly switching the layout page or master page.

Upgrading a Windows SharePoint Services 2.0 site definition to a Windows SharePoint Services 3.0 site involves creating an upgrade definition schema that maps previous functionality to new Features.

Definitions

Web Creation   The act of creating an SPWeb object at a specific URL. The act of site creation occurs before site provisioning.

Web Provisioning   The act of selecting a template and, based on the contents of that template, populating the initial page, list, and Web Part structures.

Feature Activation   The act of activating a particular Feature for a Web site.

Site Definition   A site definition provides the base blueprint for a site, what lists it features, the default navigation structure, etc. A site definition involves a set of XML, ASPX, and other files on the front-end Web server. For more information, see Working with Site Templates and Definitions.

Site Template   A site template is a package that contains a set of differences and changes from a base site definition. This package is stored as an .stp file, which is a CAB file that contains XML files that define the differences. The .stp file can be downloaded and uploaded to site collections by users with appropriate rights, meaning that .stp files have some measure of portability. For more information, see Working with Site Templates and Definitions.

Feature   A Feature is a package of Windows SharePoint Services elements that helps a user accomplish a particular goal or task. For example, one Feature might be named "My Favorite Items" and contain the following:

  • A custom list that stores, per user, a list of the user’s favorite items. This list is created as a single hidden list per workspace when a Feature is enabled.

  • A custom menu item, named "Add to Favorites", that is attached to all lists and adds an item to the Favorites list.

  • A Web Part that shows the user the top 10 favorites, with usage and link tracking to bring true favorites to the top.

Each of these individual elements, by themselves, may not be useful, but when you enable all of them on a site they become a complete Feature that solves a particular task. For more information, see Working with Features.

Element   An element is an atomic unit within a Feature. There are different types of element—for example, a custom menu item or an event handler. For more information, see Element Types.

Web Site Feature   A Web site Feature is one that is scoped at the Web site level. Scoping of a Feature is implicitly determined by the Feature developer by the elements he or she packages into the Feature.

Site Collection Feature   A site collection Feature is a Feature that is scoped at the site collection level. Typically, a site collection Feature contains items that apply to the site collection as a whole, such as Web Parts or content types that are global to the site collection.

Farm Feature   A farm Feature is a Feature that is scoped globally for the entire server farm. For this reason, farm Features are also known as "global Features." Unlike other Feature types, a global Feature is activated by default in the farm. A farm Feature contains several elements that are critical for implementing applications and logic.

Web Application Feature   A Web application Feature is a Feature that is scoped to the Web application level. A Web application Feature can be activated and deactivated and can contain the following element types:

  • Web application assemblies

  • Web application administrative links

  • For more information about Feature scope, see Element Scope.

New Callbacks

Features support the following callbacks for event handling:

  • FeatureInstalled/FeatureUninstalled   Feature has been installed or uninstalled through the object model or a command line operation.

  • FeatureActivated    Feature has been activated on a Web site

  • FeatureDeactivating   Feature is being deactivated on a Web site

See Also

Concepts

Working with Features