Oracle© Collaboration Suite Workspaces Web Services API Reference
10g Release 1 (10.1.2.2)

Part No. B28209-01


oracle.workspaces.ws
Interface TemplateService


public interface TemplateService

TemplateService provides methods to perform operations on workspace templates.

A workspace template defines a blueprint of a workspace and typically captures the best practice for a specific activity, e.g., a consulting project, a RFP response, etc. A set of pre-defined templates is provided to create a workspace.

Only users with Application Administrator role can access the methods exposed in TemplateService.

The Axis specific code snippet given below illustrates template creation for a workspace.

   // Invoke an instance of the template service locator and get a handle to template service.
   TemplateServiceService tss = new TemplateServiceServiceLocator();
   TemplateService templateService = tss.getTemplateService();
   // Instantiate a template definition object and set attributes.
   WorkspaceTemplateDefinition templateDef = new WorkspaceTemplateDefinition;
   templateDef.setMembersIncluded(false);
   templateDef.setSubworkspacesIncluded(false);
   //Settings for all workspace resources
   templateDef.setCalendarSetting("ALL_CALENDAR_EVENTS_NO_TASK");
   templateDef.setDiscussionsSetting("ALL_ITEMS");
   templateDef.setEmailSetting("NO_ITEMS");
   templateDef.setFilesSetting("ALL_ITEMS_NO_FILE_CONTENT");
   // The template name has to be unique
   templateDef.setTemplateName("MyNewTemplate");
   templateDef.setTemplateAboutURL(TEMPLATE_URL);
   templateDef.setTemplateCategory(TEMPLATE_CATEGORY);
   templateDef.setTemplateDescription("MyNewTemplate description");
   templateDef.setViewsSetting("ALL_ITEMS");
   // Invoke method for creation of a workspace template.
   templateDef.setWorkspaceId(wspcId); //wspcId is the id of the workspace used to create the template.
   String strTemplate = templateService.createWorkspaceTemplate(templateDef);
 

Method Summary
 java.lang.String createWorkspaceTemplate(WorkspaceTemplateDefinition tmplDef)
          Creates a template based on a given workspace.
 void deleteWorkspaceTemplate(java.lang.String templateName)
          Delete the template with given name
 WorkspaceTemplateItem getWorkspaceTemplate(java.lang.String templateName)
          Fetches the workspace template named
 java.lang.String getWorkspaceTemplateSchema()
          Retrieve schema for workspace template
 WorkspaceTemplateItem[] listWorkspaceTemplates()
          Returns the list of available workspace templates stored
 void storeWorkspaceTemplate(java.lang.String templateSpecification)
          Stores the given template in CwRepository

 

Method Detail

createWorkspaceTemplate

public java.lang.String createWorkspaceTemplate(WorkspaceTemplateDefinition tmplDef)
                                         throws CwWSException
Creates a template based on a given workspace. The template is not stored in the CW repository (use storeWorkspaceTemplate for storing the template).
Parameters:
tmplDef - - options for creating the template
Returns:
XML string for the template
Throws:
CwWSException - - If the user does not have sufficient privileges or invalid template properties are specified

getWorkspaceTemplateSchema

public java.lang.String getWorkspaceTemplateSchema()
                                            throws CwWSException
Retrieve schema for workspace template
Returns:
XML string for the Workspace Template Schema
Throws:
CwWSException - - If the user does not have sufficient privileges

storeWorkspaceTemplate

public void storeWorkspaceTemplate(java.lang.String templateSpecification)
                            throws CwWSException
Stores the given template in CwRepository
Parameters:
templateSpecification - - XML specification for the template that conforms to the XML schema for workspace templates (http://www.oracle.com/cw/wstemplate)
Throws:
CwWSException - - If the user does not have sufficient privileges, an invalid template specification is passed or the template already exists

deleteWorkspaceTemplate

public void deleteWorkspaceTemplate(java.lang.String templateName)
                             throws CwWSException
Delete the template with given name
Parameters:
templateName - - name of the template to be dropped
Throws:
CwWSException - - If the user does not have sufficient privileges to drop the template or or the the template does not exist.

getWorkspaceTemplate

public WorkspaceTemplateItem getWorkspaceTemplate(java.lang.String templateName)
                                           throws CwWSException
Fetches the workspace template named
Parameters:
templateName - - name of the template to be fetched
Returns:
Java bean representing the template
Throws:
CwWSException - - If the user does not have sufficient privileges to fetch the template or the the template does not exist.

listWorkspaceTemplates

public WorkspaceTemplateItem[] listWorkspaceTemplates()
                                               throws CwWSException
Returns the list of available workspace templates stored
Returns:
Array of workspace templates
Throws:
CwWSException - - If the user does not have sufficient privileges to list the templates

Copyright © 2001, 2006, Oracle. All rights reserved.