Policy Resource Overview

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 Office SharePoint Server 2007 to include the configuration of the policy resource in the Office SharePoint Server 2007 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 itself.

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 lack the ability to 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, Office SharePoint Server 2007 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 does specify a policy item-level control, that control can implement any classes or interfaces it requires, as long as the policy feature understands how to communicate with the control.

Specifying Assembly and Class Name

The Policy Resource Definition also contains two other pointers:

  • One to the location of the Policy Resource assembly in the global assembly cache.

  • One to the class within that assembly that implements whatever interface the associated policy feature requires to communicate with the resource.

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

The following figure shows the information contained within the Policy Resource Definition, and the items that information references.

Policy resource definition conceptual structure

Adding a Policy Resource to a Policy Feature's Policy Resource Definition List

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, passing the XML of the policy resource definition as an argument.

You would usually do this as part of deploying the policy resource as a Windows SharePoint Services Feature. For more information, see Working with Features in the Microsoft Windows SharePoint Services 3.0 SDK.

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. For more information, see Policy Namespace Overview.

See Also

Community Additions