Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-03


oracle.irm.j2ee.jws.rights.context
Interface ContextTemplateOperationsEndpoint


public interface ContextTemplateOperationsEndpoint

Web Service end point interface for Context Template Operations. Template operations include template management methods, such as listing or creating templates. Also included are the operations that allow new Context classifications to be created from those templates.

WSDL

The WSDL for this end point interface can be downloaded from the server using the following URL:

 http://irm.example.com/irm_services/context_template_operations?wsdl
 

Endpoint URL

Requests for this web service should be sent to the following URL:

 https://irm.example.com/irm_services/context_template_operations
 

Method Summary
 ContextTemplate copyContextTemplate(DomainRef domain, ContextTemplateRef template)
          Copy a context template.
 void deleteContextTemplates(ContextTemplateRef[] templates)
          Delete a set of context template.
 ContextTemplate[] listActiveTemplates(DomainRef domain)
          List active templates.
 ContextTemplate[] listTemplates(DomainRef domain)
          List templates.
 ContextTemplate saveChangesToContextTemplate(ContextTemplate template, ContextTemplate delta)
          Save changes to a context template.
 ContextTemplate saveNewContextTemplate(DomainRef domain, ContextTemplate template)
          Save a new context template.

 

Method Detail

listTemplates

ContextTemplate[] listTemplates(DomainRef domain)
                                throws UnknownDomainFault,
                                       AuthorizationDeniedFault
List templates. List the template owned by the specified standard rights domain.

Authorization

This method can be invoked by users that have the Domain Administrator role in the related domain. This role can be assigned using the addDomainAdministrators method. This method can be invoked by users that have the Domain Manager role in the related domain. This role can be assigned using the addDomainManagers method.
Parameters:
domain - the domain.
Returns:
the list of templates. If no templates are available an empty collection is returned.
Throws:
UnknownDomainFault - the domain does not exist.
AuthorizationDeniedFault - authorization denied. The authenticated user is not authorized to call this operation.

listActiveTemplates

ContextTemplate[] listActiveTemplates(DomainRef domain)
                                      throws UnknownDomainFault,
                                             AuthorizationDeniedFault
List active templates. List the active templates owned by the specified standard rights domain. This method is useful when presenting a list of templates that can be used to create contexts. Inactive context templates cannot be used to create contexts.

Authorization

This method can be invoked by users that have the Domain Administrator role in the related domain. This role can be assigned using the addDomainAdministrators method. This method can be invoked by users that have the Domain Manager role in the related domain. This role can be assigned using the addDomainManagers method.
Parameters:
domain - the domain.
Returns:
the list of templates. If there are no active templates an empty collection is returned.
Throws:
UnknownDomainFault - the domain does not exist.
AuthorizationDeniedFault - authorization denied. The authenticated user is not authorized to call this operation.

saveNewContextTemplate

ContextTemplate saveNewContextTemplate(DomainRef domain,
                                       ContextTemplate template)
                                       throws ContextTemplateAlreadyExistsFault,
                                              InvalidDocumentRoleFault,
                                              UnknownDocumentRoleFault,
                                              UnknownDomainFault,
                                              AuthorizationDeniedFault
Save a new context template. The context template will be owned by the specified Domain.

Authorization

This method can be invoked by users that have the Domain Administrator role in the related domain. This role can be assigned using the addDomainAdministrators method.

Impact

Invoking this method may cause the state of the system to change.

Create a new context template

The following code demonstrates how to create a context template. The sample code uses a fixed template UUID so that all sample code can work with a known template. A new template would typically be given a new random UUID value. The sample template has one role and is active. This template is used to create contexts in the create context code sample.
 import static oracle.irm.j2ee.jws.rights.context.ContextTemplateOperations.getContextTemplateOperationsEndpoint;
 
 import java.net.Authenticator;
 import java.net.PasswordAuthentication;
 import java.util.Locale;
 import java.util.UUID;
 
 import oracle.irm.engine.types.core.general.Label;
 import oracle.irm.engine.types.rights.context.ContextTemplate;
 import oracle.irm.engine.types.rights.context.DocumentRoleRef;
 import oracle.irm.engine.types.rights.context.DomainRef;
 import oracle.irm.j2ee.jws.rights.context.ContextTemplateOperationsEndpoint;
 
 public class SaveNewContextTemplateWS {
 
     public static void main(String[] args) throws Exception {
 
         final String hostPort = args[0];
         final String username = args[1];
         final String password = args[2];
         
         // Configure an authenticator to provide the credentials
         // for the web service
         Authenticator.setDefault(new Authenticator() {
             @Override
             protected PasswordAuthentication getPasswordAuthentication() {
                 return new PasswordAuthentication(username, password.toCharArray());
             }
         });
         
         // Context Template UUID is fixed for sample code
         UUID contextTemplateUUID = UUID.fromString("930876e6-a505-4a10-8d93-bc43d9a37c23");
 
         ContextTemplate template = new ContextTemplate();
         
         // The UUID value that identifies this role within the domain
         template.setUuid(contextTemplateUUID);
 
         // Context Template has one English label
         Label label = new Label(Locale.ENGLISH, "Sample Template", "This is a template created from sample code.");
 
         // The human readable labels
         template.setLabels( new Label[] { label } );
 
         // The template is active
         template.setStatus(ContextTemplate.Status.ACTIVE);
         
         // Domain UUID is fixed for sample code
         UUID domainUUID = UUID.fromString("6fab93fd-2858-461a-a0b3-34e261dbf8fd");
 
         DomainRef domain = new DomainRef(domainUUID);
 
         // Document Role UUID is fixed for sample code
         UUID documentRoleUUID = UUID.fromString("ee82c3f9-152b-440d-afd7-dbf36b0c8188");
 
         DocumentRoleRef documentRole = new DocumentRoleRef(documentRoleUUID, domain);
         
         // Template has one role
         template.setRoles( new DocumentRoleRef[] { documentRole });
         
         // Get the context template operations web service
         ContextTemplateOperationsEndpoint templateOperations = getContextTemplateOperationsEndpoint(hostPort);
 
         // Save the new template
         templateOperations.saveNewContextTemplate(domain, template);
     }
 }
Parameters:
domain - the domain.
template - the template.
Returns:
the created context template.
Throws:
ContextTemplateAlreadyExistsFault - a context template already exists with the same Id within the specified domain.
InvalidDocumentRoleFault - invalid role. One of the roles added to this template does not exist.
UnknownDocumentRoleFault - unknown role. One of the roles associated with this template belongs to a different domain.
UnknownDomainFault - the domain does not exist.
AuthorizationDeniedFault - authorization denied. The authenticated user is not authorized to call this operation.

saveChangesToContextTemplate

ContextTemplate saveChangesToContextTemplate(ContextTemplate template,
                                             ContextTemplate delta)
                                             throws CannotRemoveDocumentRoleFault,
                                                    InvalidDocumentRoleFault,
                                                    UnknownDocumentRoleFault,
                                                    UnknownContextTemplateFault,
                                                    AuthorizationDeniedFault
Save changes to a context template. Save changes to a ContextTemplate by providing two copies. Changes are made by comparing the two copies of the template. If there are no differences in a property then no changes are made to persistent storage for that property. Changes in collection based properties cause additions or removals to occur in persistent storage. For example, if the delta contains a new DocumentRole as compared to the template then a new role will be associated with the template.

Changes to the Roles will be immediately visible in any ContextInstance linked to this template. If a role is removed from a template, any accounts assigned to the role will be automatically un-assigned (for contexts linked to this template).

Authorization

This method can be invoked by users that have the Domain Administrator role in the related domain. This role can be assigned using the addDomainAdministrators method.

Impact

Invoking this method may cause the state of the system to change.
Parameters:
template - the context template to compare to the delta.
delta - the changes. The Domain and Uuid properties must match with the template parameter.
Returns:
the context template with the updated changes.
Throws:
CannotRemoveDocumentRoleFault - the role cannot be removed from the template as it is in use. A document role cannot be remove if there are any contexts assignments using the role. The document role can only be removed from the template after the associated rights have been unassigned from all contexts based on the template.
InvalidDocumentRoleFault - invalid role. One of the roles added to this template does not exist.
UnknownDocumentRoleFault - unknown role. One of the roles associated with this template belongs to a different domain.
UnknownContextTemplateFault - the context template does not exist.
AuthorizationDeniedFault - authorization denied. The authenticated user is not authorized to call this operation.

deleteContextTemplates

void deleteContextTemplates(ContextTemplateRef[] templates)
                            throws CannotRemoveContextTemplateFault,
                                   AuthorizationDeniedFault
Delete a set of context template. A context template can only be deleted if there are no contexts linked to the template.

Authorization

This method can be invoked by users that have the Domain Administrator role in the related domain. This role can be assigned using the addDomainAdministrators method.

Impact

Invoking this method may cause the state of the system to change.
Parameters:
templates - the set of template. This parameter is optional, it is valid to pass null or an empty collection.
Throws:
CannotRemoveContextTemplateFault - the template cannot be removed as it is in use. A context template cannot be deleted if there are any contexts linked to the template. The context template can only be deleted after the contexts are deleted.
AuthorizationDeniedFault - authorization denied. The authenticated user is not authorized to call this operation.

copyContextTemplate

ContextTemplate copyContextTemplate(DomainRef domain,
                                    ContextTemplateRef template)
                                    throws UnknownDomainFault,
                                           UnknownContextTemplateFault,
                                           AuthorizationDeniedFault
Copy a context template. Copy a context template to the same or different Domain. Copied templates are set with an inactive status. The template Labels are also copied and altered to reflect that the result is a copy of the template. For example, in English, the template Standard would turn into Copy Of Standard.

Authorization

This method can be invoked by users that have the Domain Administrator role in the related domain. This role can be assigned using the addDomainAdministrators method.

Impact

Invoking this method may cause the state of the system to change.
Parameters:
domain - the domain.
template - the template.
Returns:
the copied template.
Throws:
UnknownDomainFault - the domain does not exist.
UnknownContextTemplateFault - the context template does not exist.
AuthorizationDeniedFault - authorization denied. The authenticated user is not authorized to call this operation.

Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-03


Copyright © 2011, Oracle. All rights reserved.