|
|
When creating a policy using the web service API, you must reference an existing Portable Document Rights Language (PDRL) XML file that describes a policy. As a result, it is not necessary to perform all the steps that you have to perform when using the Java API. That is, it is not necessary to specify permissions or a principal for the policy. These values are defined in the PDRL XML file.
•
• Using the Microsoft .NET client assembly, create a RightsManagementServiceService object by invoking its default constructor.
• Create a PolicySpec object by using its constructor.
•
• Set the policy’s description by assigning a string value to the PolicySpec object’s description data member.
• Set the policy set to which the policy will belong by assigning a string value to the PolicySpec object’s policySetName data member. You must specify an existing policy set name. (You can specify null for this parameter value that results in the policy being added to the global policy set.)
• Set the policy’s offline lease period by assigning an integer value to the PolicySpec object’s offlineLeasePeriod data member.
• Set the PolicySpec object’s policyXml data member with a string value that represents PDRL XML data. To perform this task, create a .NET StreamReader object by using its constructor. Pass the location of a PDRL XML file that represents the policy to the StreamReader constructor. Next, invoke the StreamReader object’s ReadLine method and assign the return value to a string variable. Iterate through the StreamReader object until the ReadLine method returns null. Assign the string variable to the PolicySpec object’s policyXml data member.It is not necessary to create a policy entry when creating a policy using the Rights Management web service API.Register the policy by invoking the RightsManagementServiceService object’s registerPolicy method and passing the following values:
• The PolicySpec object that represents the policy to register.If you use a LiveCycle ES administrator account within connection settings to create the RightsManagementClient object, then you must specify the policy set name when you invoke the registerPolicy method.If you use a Rights Management user within connection settings, then you can invoke the overloaded registerPolicy method that accepts only the policy. That is, you do not need to specify the policy set name. However, the policy will be added to the policy set named My Policies. If you do not want to add the new policy to this policy set, then specify a policy set name when you invoke the registerPolicy method.Note: When creating a new policy, you must reference an existing policy set. If you specify a policy set that does not exist, then you will cause an exception.
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/policiesCreatingPolicies.77.4.html