Deploying Policy Features and Resources

Policy features and resources are best installed and enabled through the installation and activation of a Feature. Feature packaging is a way of encapsulating Windows SharePoint Services or Office SharePoint Server 2007 solutions and functionality for ease of deployment. It provides a mechanism by which developers can package the files needed for a solution—such as Web Parts, lists, and site definitions—for ease of distribution and deployment.

For more information about Features in general, see Working with Features in the Microsoft Windows SharePoint Services 3.0 SDK.

Install a policy feature first, and then install any policy resources it requires. Activate the policy feature after you have installed any required policy resources. If you install a policy feature that requires a policy resource of a specific type, and no policy resources of that type are installed on the server farm, then you cannot activate that policy feature.

The Feature you create to install and enable your policy features and resources should perform the following actions:

  • Install the policy feature or resource assembly to the global assembly cache.

  • Install any Web controls that the policy feature or resource needs to the appropriate locations.

    For global controls needed by policy features and resources, the appropriate location is…

    …\web server extensions\12\template\admin

    …where …\web server extensions\12 is the root of the Office SharePoint Server 2007 installation location.

    For item-level controls needed by policy features and resources, the appropriate location is…

    …\web server extensions\12\template\layouts

    …where …\web server extensions\12 is the root of the Office SharePoint Server 2007 installation location.

  • Include code that adds the policy feature or resource to the Office SharePoint Server 2007 installation.

    For policy features, add the policy feature definition to the policy feature list. You can add a site policy by calling the Add method of the PolicyFeatureCollection class. This method adds the XML passed to it to the Policy Feature List as the Policy Feature Definition for the policy feature.

    For policy resources, add the policy resource definition to the policy resource list of the specified policy feature. To add a policy resource to a policy feature's resource list, use the Add method of the PolicyResourceCollection class, passing the XML of the policy resource definition as an argument.

See Also

Concepts

Introduction to Information Management Policy
Policy Feature Overview
Policy Resource Overview
Policy Namespace Overview