Policy Resource Overview in SharePoint Server 2010 (ECM)

Applies to: SharePoint Server 2010

In this article
Specifying Global Custom Settings Control
Specifying Custom Settings Control
Specifying Assembly and Class Name
Adding a Policy Resource

Each policy feature has its own Resource Definition List, which lists the policy resources available to it.

For a policy resource to be available for use by a policy feature, the policy resource must install a Policy Resource Definition to that policy feature's Policy Resource Definition List. This XML document enables Microsoft SharePoint Server 2010 to include the configuration of the policy resource in the SharePoint Server 2010 administration interface.

As with the Policy Feature Definition, the Policy Resource Definition can include the URLs of two Web controls:

  • A Web control that enables administrators to customize server farm-level policy resource settings

  • A Web control for policy instance-level policy resource settings

Specifying Global Custom Settings Control

Only the server farm–level Web control, for global settings, is hosted within the administration pages. These settings are saved within the Policy Resource Definition.

The server farm–level Web control must implement the GlobalCustomSettingsControl class.

If you do not specify a global custom settings control, administrators do not have the ability to overwrite or edit the default global data specified for the policy resource, and therefore cannot customize the resource at the administrator level.

Specifying Custom Settings Control

Because the user cannot directly customize a policy resource at the policy item–level, SharePoint Server 2010 does not host the policy instance–level Web control. However, the Web control for the policy feature may host this control. If the policy resource specifies a policy item–level control, that control can implement any classes or interfaces it requires, if the policy feature understands how to communicate with the control.

Specifying Assembly and Class Name

The Policy Resource Definition also contains two other pointers:

  • A pointer to the location of the Policy Resource assembly in the global assembly cache

  • A pointer to the class within that assembly that implements the interface that the associated policy feature requires to communicate with the resource

Because SharePoint Server 2010 does not call the policy resource directly, the resource is not required to implement a specific interface, if the associated policy feature understands the interfaces that the policy resource is implementing. The resource assembly must have a strong name and must reside in the global assembly cache.

Figure 1 shows the information contained within the Policy Resource Definition, and the items that information references.

Figure 1. Policy resource definition conceptual structure

Policy resource definition conceptual structure

Adding a Policy Resource

Each policy feature's Policy Resource Definition List includes the Policy Resource Definitions for each policy resource that is available for use by that policy feature.

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

This is usually done as part of deploying the policy resource as a SharePoint Foundation Feature. For more information, see Using Features in SharePoint Foundation.

After you add a Policy Resource Definition to the Policy Resource Definition List, you can work with the policy resource programmatically as a PolicyResource object in the object model.

See Also

Concepts

Managing Information Management Policy in SharePoint Server 2010 (ECM)

Policy Feature Overview in SharePoint Server 2010 (ECM)

Policy Resource Definition Schema (ECM)