Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Policy Namespace Overview

SharePoint 2007

The following figure shows the organization of the major classes of the information policy object model, located in the Microsoft.Office.RecordsManagement.InformationPolicy namespace. The top-level object, PolicyCatalog, represents the catalog containing the site-level Policy and IPolicyFeature collections.

Most of the properties of the various objects are read-only, and cannot be set programmatically. The properties of the various information policies, policy items, policy features, and policy resources are set in the XML specified when the objects are initially added to Office SharePoint Server 2007.

Each Policy object represents an information policy defined for the site and, in turn, includes a collection of PolicyItem objects.

Similarly, each PolicyFeature object represents an installed policy feature, and contains a collection of the PolicyResourceType object that the policy features can use, as well as a collection of the actual policy resources currently installed for the policy feature; each of these policy resources is represented by a PolicyResource object.

PolicyCatalog object hierarchy

Managing Policies Programmatically

Some of the methods you can use to manage policies programmatically include:

  • To add a policy to the site collection-level policy collection, use the Add method, which takes the site as an SPSite object, and a string representing the policy definition XML.

  • To assign a site collection-level policy to a specific content type, use the CreatePolicy method, which takes an SPContentType object representing the content type as a parameter.

  • To export a site collection-level policy, use the Export method, which returns an XmlDocument object representing the XML policy file.

  • Use the ValidateManifest method to determine whether a given string is valid policy definition XML.

  • Use the Update method to commit changes made to a policy.

  • To add a policy item to a policy, use the Add method. This method takes two strings: one representing the associated policy feature ID, and one representing the custom data settings for the policy item.

Managing Policy Features and Resources Programmatically

Some of the methods you can use to manage policy features and resources programmatically include:

  • To add a site collection-level policy feature, use the Add method, which takes a string representing the policy feature definition XML.

  • Use the Validate method to determine if all the assemblies specified in the Policy Feature Definition are actually present.

  • Use the Update method to commit changes to the Policy Feature Definition.

  • To add a policy resource to a specific policy feature, use the Add method, which takes a string representing the policy resource definition XML.

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.