com.ibm.workplace.wcm.api
Interface Workspace


public interface Workspace

Represents a view of the WCM repository for a particular user.


Field Summary
static java.lang.String COPYRIGHT
          Copyright statement
static java.lang.String KEY_DESCRIPTION
           
static java.lang.String KEY_NAME
           
static java.lang.String KEY_PUBLISH_DATE
           
static java.lang.String WCM_ERROR_KEY
           
static java.lang.String WCM_RENDERINGCONTEXT_KEY
           
static java.lang.String WCM_WORKSPACE_KEY
           
 
Method Summary
 DocumentIdIterator contentSearch(DocumentId p_templateId, DocumentId[] p_siteAreaIds, DocumentId[] p_categoryIds, java.lang.String[] p_keywords)
          Returns an iterator of IDs of objects that match the given search criteria.
 DocumentIdIterator contentSearch(DocumentId p_templateId, DocumentId[] p_siteAreaIds, DocumentId[] p_categoryIds, java.lang.String[] p_keywords, boolean p_matchAllKeys)
          Returns an iterator of IDs of objects that match the given search criteria.
 DocumentIdIterator contentSearch(DocumentId p_templateId, DocumentId[] p_siteAreaIds, DocumentId[] p_categoryIds, java.lang.String[] p_keywords, boolean p_matchAllKeys, java.lang.String p_sortKey1, java.lang.String p_sortKey2, java.lang.String p_sortKey3, boolean p_asscending)
          Returns an iterator of IDs of objects that match the given search criteria.
 Content createContent(DocumentId p_authoringTemplateId)
          Creates a new Content object, based on an AuthoringTemplate.
 DocumentId createDocumentId(java.lang.String p_stringId)
          Creates a new DocumentId object from a String representation of the ID.
 LibraryFileComponent createFileComponent()
          Creates a new LibraryFileComponent.
 LibraryHTMLComponent createHTMLComponent()
          Creates a new LibraryHTMLComponent.
 LibraryImageComponent createImageComponent()
          Creates a new LibraryImageComponent.
 RenderingContext createRenderingContext(javax.portlet.PortletRequest p_request, javax.portlet.PortletResponse p_response, java.util.Map p_requestParameters)
          Creates a new rendering context.
 RenderingContext createRenderingContext(javax.portlet.PortletRequest p_request, javax.portlet.PortletResponse p_response, java.util.Map p_requestParameters, java.lang.String p_wcmWebAppPath, java.lang.String p_wcmServletPath)
          Creates a new rendering context.
 RenderingContext createRenderingContext(javax.servlet.ServletRequest p_request, javax.servlet.ServletResponse p_response, java.util.Map p_requestParameters)
          Creates a new rendering context.
 RenderingContext createRenderingContext(javax.servlet.ServletRequest p_request, javax.servlet.ServletResponse p_response, java.util.Map p_requestParameters, java.lang.String p_wcmWebAppPath, java.lang.String p_wcmServletPath)
          Creates a new rendering context.
 Site createSite()
          Creates a new Site.
 SiteArea createSiteArea()
          Creates a new SiteArea.
 java.lang.String[] delete(DocumentId p_id)
          Deletes an editable document from the WCM repository.
 boolean exists(DocumentId p_id)
          Tests the existence of an object in the repository.
 DocumentIdIterator findByName(DocumentType p_type, java.lang.String p_name)
          Returns an iterator of IDs of all objects of the given type with the specified name.
 DocumentIdIterator findByType(DocumentType p_type)
          Returns an iterator of IDs of all objects of the given type.
 DocumentIdIterator findComponentByName(java.lang.String p_name)
          Returns an iterator of IDs of all library components with the specified name.
 DocumentIdIterator findContentByAuthoringTemplate(DocumentId p_id)
          Returns an iterator of IDs of Content which has been created using the specified authoring template.
 DocumentIdIterator findContentByCategory(DocumentId p_id)
          Returns an iterator of IDs of all Content that has the given Category in its profile.
 DocumentIdIterator findContentByPath(java.lang.String p_path)
          Returns an iterator of IDs of Content with the given path.
 DocumentIdIterator findContentByWorkflowStage(DocumentId p_id)
          Returns an iterator of IDs of Content in a specified WorkflowStage.
 DocumentIdIterator findContentModifiedBetween(java.util.Date p_startDate, java.util.Date p_endDate)
          Returns an iterator of IDs of all Content that have been modified between the specified start and end dates.
 DocumentIdIterator findContentModifiedSince(java.util.Date p_modifiedDate)
          Returns an iterator of IDs of all Content that have been modified since the specified date.
 DocumentType fromString(java.lang.String p_typeName)
          Returns the DocumentType for the specified API interface/class name.
 java.lang.String generateURL(RenderingContext p_context, ContentComponent p_component)
          Generate the URL to the given component, in the context of the path in the RenderingContext.
 java.lang.String generateURL(RenderingContext p_context, LibraryComponent p_component)
          Generate the URL to the given component, in the context of the path in the RenderingContext.
 Document getById(DocumentId p_id)
          Retrieves the object with the given ID from the repository.
 java.lang.String[] getMemberNames()
          Returns a list of names of all users and groups available to WCM.
 java.lang.String[] getMemberNames(java.lang.String p_filter)
          Returns a list of names of all users and groups available to WCM.
 UserProfile getUserProfile()
          Returns the UserProfile for the user of this Workspace.
 boolean isDistinguishedNamesUsed()
          Checks whether or not the workspace is set to use DNs for user related methods
 boolean isMemberOfGroup(java.lang.String p_groupName)
          Indicates if the user of this Workspace is a member of the group with the specified name.
 java.lang.String render(RenderingContext p_renderingContext)
          Renders the content, according to the RenderingContext that is passed in.
 java.lang.String render(RenderingContext p_renderingContext, ContentComponent p_component)
          Renders the given WCM content component using the specified rendering context.
 java.lang.String render(RenderingContext p_renderingContext, LibraryComponent p_component)
          Renders the specified WCM LibraryComponent using the specified RenderingContext.
 java.lang.String[] save(Document p_object)
          Saves an editable document to the WCM repository.
 void useDistinguishedNames(boolean shouldUseDn)
          Sets the Workspace to use full distinguished names for get/set methods that use user information.
 void useLiveAccess(boolean liveAccess)
           Sets the Access context to use for the following methods:
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Copyright statement

See Also:
Constant Field Values

WCM_WORKSPACE_KEY

public static final java.lang.String WCM_WORKSPACE_KEY
See Also:
Constant Field Values

WCM_RENDERINGCONTEXT_KEY

public static final java.lang.String WCM_RENDERINGCONTEXT_KEY
See Also:
Constant Field Values

WCM_ERROR_KEY

public static final java.lang.String WCM_ERROR_KEY
See Also:
Constant Field Values

KEY_NAME

public static final java.lang.String KEY_NAME
See Also:
Constant Field Values

KEY_PUBLISH_DATE

public static final java.lang.String KEY_PUBLISH_DATE
See Also:
Constant Field Values

KEY_DESCRIPTION

public static final java.lang.String KEY_DESCRIPTION
See Also:
Constant Field Values
Method Detail

createContent

public Content createContent(DocumentId p_authoringTemplateId)
                      throws DocumentCreationException,
                             AuthorizationException,
                             IllegalDocumentTypeException
Creates a new Content object, based on an AuthoringTemplate. The template ID that is specified must be for a template that already exists in the WCM system.

Parameters:
p_authoringTemplateId - the authoring template ID
Returns:
a new Content object based on the specified template
Throws:
DocumentCreationException - if the object cannot be created
AuthorizationException - if the user does not have access
IllegalDocumentTypeException

createSiteArea

public SiteArea createSiteArea()
                        throws DocumentCreationException,
                               AuthorizationException
Creates a new SiteArea. This simply creates the object, it does not position it in the site framework. The SiteArea may be positioned in the site framework by finding the desired parent object, and calling the insertSiteArea method.

Returns:
the new SiteArea object
Throws:
DocumentCreationException - if the object cannot be created
AuthorizationException - if the user does not have access
See Also:
SiteFrameworkContainer.insertSiteArea(DocumentId p_priorChildId, DocumentId p_siteAreaId)

createSite

public Site createSite()
                throws DocumentCreationException,
                       AuthorizationException
Creates a new Site. The new Site is returned.

Returns:
the new Site object
Throws:
DocumentCreationException - if the object cannot be created
AuthorizationException - if the user does not have access

createFileComponent

public LibraryFileComponent createFileComponent()
                                         throws DocumentCreationException,
                                                AuthorizationException
Creates a new LibraryFileComponent. The file that this library component refers to can then be set through the LibraryFileComponent itself.

Returns:
the new LibraryFileComponent object
Throws:
DocumentCreationException - if the object cannot be created
AuthorizationException - if the user does not have access

createImageComponent

public LibraryImageComponent createImageComponent()
                                           throws DocumentCreationException,
                                                  AuthorizationException
Creates a new LibraryImageComponent. The image that this library component refers to can then be set through the LibraryImageComponent itself.

Returns:
the new LibraryImageComponent object
Throws:
DocumentCreationException - if the object cannot be created
AuthorizationException - if the user does not have access

createHTMLComponent

public LibraryHTMLComponent createHTMLComponent()
                                         throws DocumentCreationException,
                                                AuthorizationException
Creates a new LibraryHTMLComponent. The HTML fragment for this component is to be set on the component once it is created.

Returns:
the new LibraryHTMLComponent object
Throws:
DocumentCreationException - if the object cannot be created
AuthorizationException - if the user does not have access

save

public java.lang.String[] save(Document p_object)
                        throws DocumentSaveException,
                               AuthorizationException
Saves an editable document to the WCM repository. Editable objects are those that implement the Editable interface, or the EditableLibraryComponent interface.

If errors are returned then the object did not pass validation and was not saved. The returned array will be empty if no errors occurred. null will never be returned.

Parameters:
p_object - the object to save
Returns:
errors, if any - empty array if no errors
Throws:
DocumentSaveException - if the object could not be saved, or is not an editable object
AuthorizationException - if the user does not have access

delete

public java.lang.String[] delete(DocumentId p_id)
                          throws DocumentDeleteException,
                                 AuthorizationException
Deletes an editable document from the WCM repository. Editable objects are those that implement the Editable interface, or the EditableLibraryComponent interface. Errors are returned in a String array, as a list of errors. These errors may be caused if, for example, the delete would break referential integrity if it were to occur. These errors are not caused by conditions that would raise exceptions, such as IOExceptions while deleting the item.

Parameters:
p_id - the ID of the object to delete
Throws:
DocumentDeleteException - if the object could not be deleted, or is not an editable object
AuthorizationException - if the user does not have access

exists

public boolean exists(DocumentId p_id)
Tests the existence of an object in the repository. Returns true if object with given ID exists, false otherwise.

Parameters:
p_id - the ID of the object
Returns:
true if object exists

getById

public Document getById(DocumentId p_id)
                 throws DocumentRetrievalException,
                        AuthorizationException
Retrieves the object with the given ID from the repository. This can be any type of object supported by this API.

Parameters:
p_id - the ID of the object to retrieve
Returns:
the retrieved object - never null
Throws:
DocumentRetrievalException - if the object cannot be retrieved
AuthorizationException - if the user does not have access to the requested object

findByType

public DocumentIdIterator findByType(DocumentType p_type)
Returns an iterator of IDs of all objects of the given type. The iterator contains only those IDs for documents the user has access to read. If the user does not have access, the ID will not appear. If the user has access to no documents, then the iterator will contain no elements. null will never be returned.

For library components, if one of the EditableLibraryComponent subclasses are specified, then only components of that type will be returned. If LibraryComponent is specified, all components of all types will be returned, including all editable component types.

Parameters:
p_type - the type of object
Returns:
an iterator of object IDs that are visibile to the current user, of the specified type

findByName

public DocumentIdIterator findByName(DocumentType p_type,
                                     java.lang.String p_name)
Returns an iterator of IDs of all objects of the given type with the specified name. The iterator contains only those IDs for documents the user has access to read. If the user does not have access to an item, the ID for that item will not appear in the iterator. If the user has access to no documents, or there are none with the specified name of the given type, then the iterator will contain no elements. null will never be returned.

Parameters:
p_type - the type of object
p_name - the name of the object to find
Returns:
an iterator of object IDs with the given name of the specified type that are visibile to the current user

findComponentByName

public DocumentIdIterator findComponentByName(java.lang.String p_name)
Returns an iterator of IDs of all library components with the specified name. The iterator contains only those IDs for components the user has access to read. If the user does not have access to any component, the ID for that component will not appear in the iterator. If the user has access to no components, or there are none with the specified name, then the iterator will contain no elements. null will never be returned.

Parameters:
p_name - the name of the library component to retrieve
Returns:
an iterator of IDs for library components with this name that are visibile to the current user

findContentModifiedSince

public DocumentIdIterator findContentModifiedSince(java.util.Date p_modifiedDate)
Returns an iterator of IDs of all Content that have been modified since the specified date. The IDs returned will include those for Content that have been modified on the given date. If no content has been modified since this date, or the user has access to no documents in this set, then the iterator will not return any elements. null will never be returned.

Parameters:
p_modifiedDate - the date with which to compare Content last modified date
Returns:
an iterator over objects modified since the given date that are visibile to the current user

findContentModifiedBetween

public DocumentIdIterator findContentModifiedBetween(java.util.Date p_startDate,
                                                     java.util.Date p_endDate)
Returns an iterator of IDs of all Content that have been modified between the specified start and end dates. The IDs returned will include those for Content that have been modified on the specified dates. If no content has been modified in this date range, or the user has access to no documents in this set, then the iterator will not return any elements. null will never be returned.

Parameters:
p_startDate - the date at the beginning of the range
p_endDate - the data at the end of the range
Returns:
an iterator over objects modified between the given dates that are visibile to the current user

getMemberNames

public java.lang.String[] getMemberNames()
Returns a list of names of all users and groups available to WCM. If there are no members available, then an empty array is returned. null will never be returned.

Returns:
a String array of names of users and groups

getMemberNames

public java.lang.String[] getMemberNames(java.lang.String p_filter)
Returns a list of names of all users and groups available to WCM. If there are no members available, then an empty array is returned. null will never be returned.

Parameters:
p_filter - the filter for searching users and groups
Returns:
a String array of names of users and groups

findContentByPath

public DocumentIdIterator findContentByPath(java.lang.String p_path)
Returns an iterator of IDs of Content with the given path. If the path specified is to a site or site area, returns an ID iterator of the default content for that site or site area if one has been set. The path should not be encoded (URL encoded).

If the user has access to no documents, or there are none on the specified path, then the iterator will contain no elements. null will never be returned.

Parameters:
p_path - the path to the content, site or site area.
Returns:
an ID iterator of the content with the given path, or the default content for the specified site or site area that are visibile to the current user

findContentByAuthoringTemplate

public DocumentIdIterator findContentByAuthoringTemplate(DocumentId p_id)
                                                  throws IllegalDocumentTypeException
Returns an iterator of IDs of Content which has been created using the specified authoring template. If the user does not have access to the specified AuthoringTemplate, or any of the Content based on the specified template, then the iterator will contain no elements. null will never be returned.

Parameters:
p_id - the ID of the AuthoringTemplate
Returns:
an iterator of IDs of Content based on the specified AuthoringTemplate that are visibile to the current user
Throws:
IllegalDocumentTypeException

findContentByWorkflowStage

public DocumentIdIterator findContentByWorkflowStage(DocumentId p_id)
                                              throws IllegalDocumentTypeException
Returns an iterator of IDs of Content in a specified WorkflowStage. This will return documents in that stage, for all workflows that the stage appears in. That is, it does not retrict results to the specified stage in a certain workflow.

If the user does not have access to the specified WorkflowStage, or any of the Content in the specified stage, then the iterator will contain no elements. null will never be returned.

Parameters:
p_id - the ID of the WorkflowStage
Returns:
an iterator of IDs of Content items in the gievn stage that are visibile to the current user
Throws:
IllegalDocumentTypeException

findContentByCategory

public DocumentIdIterator findContentByCategory(DocumentId p_id)
                                         throws IllegalDocumentTypeException
Returns an iterator of IDs of all Content that has the given Category in its profile. If there is no Content with that Category in its profile, or the user does not have access to any of the Content, then the iterator will contain no elements. null will never be returned.

Parameters:
p_id - the ID of the Category
Returns:
an iterator of IDs of Content with this category that are visibile to the current user
Throws:
IllegalDocumentTypeException

contentSearch

public DocumentIdIterator contentSearch(DocumentId p_templateId,
                                        DocumentId[] p_siteAreaIds,
                                        DocumentId[] p_categoryIds,
                                        java.lang.String[] p_keywords)
Returns an iterator of IDs of objects that match the given search criteria. This performs an "or" search, not an "and" search. This means that a search for two different Categories and a Content Template will return Content profiled with at least one of each profile type (one Category and one Template), not just Content that matches all of the parameters. Content that matches only one criteria type (Template only) will not be returned.

All Content documents that meet the specified search criteria will be returned, regardless of their status (search results can include unpublished documents).

The content search behaves in a manner similar to the Menu Component.

If site areas have been specified, all ancestor and descendant site areas are also included in the search.

The order of results is not guaranteed. All parameters are optional.

Parameters:
p_templateId - the ID of the template to match
p_siteAreaIds - the IDs of the site areas to find content in
p_categoryIds - the IDs of categories for content to have in their profile
p_keywords - the IDs of keywords for content to have in its profile
Returns:
an iterator of IDs of content that meet the search criteria

contentSearch

public DocumentIdIterator contentSearch(DocumentId p_templateId,
                                        DocumentId[] p_siteAreaIds,
                                        DocumentId[] p_categoryIds,
                                        java.lang.String[] p_keywords,
                                        boolean p_matchAllKeys)
Returns an iterator of IDs of objects that match the given search criteria. This search can run in "and" or "or" mode by changing the p_matchAllKeys parameter. If true, then a search for two different Categories and a Content Template will return content that is profiled with both Categories and the Content Template. If false, then a search for two different Categories and a Content Template will return Content profiled with at least one of each profile type (one Category and one Template). In either mode, Content that matches only one criteria type (Template only) will not be returned

All Content documents that meet the specified search criteria will be returned, regardless of their status (search results can include unpublished documents).

The content search behaves in a manner similar to the Menu Component.

If site areas have been specified, all ancestor and descendant site areas are also included in the search.

The order of results is not guaranteed. All parameters except matchAllKeys are optional.

Parameters:
p_templateId - the ID of the template to match
p_siteAreaIds - the IDs of the site areas to find content in
p_categoryIds - the IDs of categories for content to have in their profile
p_keywords - the IDs of keywords for content to have in its profile
p_matchAllKeys - indicates whether the search is an "and" search. True for "and", false for "or".
Returns:
an iterator of IDs of content that meet the search criteria

contentSearch

public DocumentIdIterator contentSearch(DocumentId p_templateId,
                                        DocumentId[] p_siteAreaIds,
                                        DocumentId[] p_categoryIds,
                                        java.lang.String[] p_keywords,
                                        boolean p_matchAllKeys,
                                        java.lang.String p_sortKey1,
                                        java.lang.String p_sortKey2,
                                        java.lang.String p_sortKey3,
                                        boolean p_asscending)
Returns an iterator of IDs of objects that match the given search criteria. This search can run in "and" or "or" mode by changing the p_matchAllKeys parameter. If true, then a search for two different Categories and a Content Template will return content that is profiled with both Categories and the Content Template. If false, then a search for two different Categories and a Content Template will return Content profiled with at least one of each profile type (one Category and one Template). In either mode, Content that matches only one criteria type (Template only) will not be returned

All Content documents that meet the specified search criteria will be returned, regardless of their status (search results can include unpublished documents).

The content search behaves in a manner similar to the Menu Component.

If site areas have been specified, all ancestor and descendant site areas are also included in the search.

Specify sort keys order Name, Publish Date, Description using key1, key2, key3 and ascending/descending order

Parameters:
p_templateId - the ID of the template to match
p_siteAreaIds - the IDs of the site areas to find content in
p_categoryIds - the IDs of categories for content to have in their profile
p_keywords - the IDs of keywords for content to have in its profile
p_matchAllKeys - indicates whether the search is an "and" search. True for "and", false for "or".
p_sortKey1 - Specify one of sort keys Workspace.KEY_NAME, Workspace.KEY_PUBLISH_DATE, Workspace.KEY_DESCRIPTION
p_sortKey2 - Specify one of sort keys Workspace.KEY_NAME, Workspace.KEY_PUBLISH_DATE, Workspace.KEY_DESCRIPTION
p_sortKey3 - Specify one of sort keys Workspace.KEY_NAME, Workspace.KEY_PUBLISH_DATE, Workspace.KEY_DESCRIPTION
Returns:
an iterator of IDs of content that meet the search criteria

render

public java.lang.String render(RenderingContext p_renderingContext)
                        throws ServiceNotAvailableException
Renders the content, according to the RenderingContext that is passed in. The RenderingContext should contain enough information to render a desired page, and can be created using the factory methods createRenderingContext() in the Workspace interface.

The rendered content is returned as a String, encoded according to the users locale.

Parameters:
p_renderingContext - the context to render
Returns:
the rendered context as a String
Throws:
ServiceNotAvailableException
See Also:
createRenderingContext(javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.util.Map), createRenderingContext(javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.util.Map, java.lang.String, java.lang.String)

render

public java.lang.String render(RenderingContext p_renderingContext,
                               ContentComponent p_component)
                        throws ServiceNotAvailableException
Renders the given WCM content component using the specified rendering context. It is not enough to just specify the ContentComponent to be rendered, but the path to the item containing the ContentComponent must be specified in the RenderingContext.

For example, to render the ContentComponent named 'test' that resides on the SiteArea named 'AAA', the following code could be used:

         SiteArea siteArea = (SiteArea) myWorkspace.getById(
               ((DocumentId) myWorkspace.findByName(DocumentTypes.SiteArea,
                                                   "AA").next()));
         Content content = (Content) myWorkspace.getById(
               ((DocumentId) myWorkspace.findByName(DocumentTypes.Content,
                                                   "AAA").next()));
         ContentComponent component = content.getComponent("test");
         Map parametermap = new HashMap();
         RenderingContext context = myWorkspace.createRenderingContext(servletRequest,
                                                                       servletResponse,
                                                                       parametermap);
         context.setRenderedContent(content, siteArea);
         System.out.println(myWorkspace.render(context, component));
         

The rendered content is returned as a String, encoded according to the users locale.

Parameters:
p_renderingContext - the RenderingContext to use
p_component - the WCM content component to render
Returns:
the rendered component as a String
Throws:
ServiceNotAvailableException
See Also:
createRenderingContext(javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.util.Map), createRenderingContext(javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.util.Map, java.lang.String, java.lang.String)

render

public java.lang.String render(RenderingContext p_renderingContext,
                               LibraryComponent p_component)
                        throws ServiceNotAvailableException
Renders the specified WCM LibraryComponent using the specified RenderingContext.

The rendered content is returned as a String, encoded according to the users locale.

Parameters:
p_renderingContext - the RenderingContext to use
p_component - the component to render
Returns:
the rendered component as a String
Throws:
ServiceNotAvailableException
See Also:
createRenderingContext(javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.util.Map), createRenderingContext(javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.util.Map, java.lang.String, java.lang.String)

generateURL

public java.lang.String generateURL(RenderingContext p_context,
                                    ContentComponent p_component)
Generate the URL to the given component, in the context of the path in the RenderingContext. This URL is the full URL, suitable for inclusion in a link.

The RenderingContext should contain enough information to refer to the page that contains the ContentComponent. The URL will contain the path to the content, and any parameters required to render the component.

Parameters:
p_context - the RenderingContext to be used
p_component - the component
Returns:
the URL to the requested object
See Also:
createRenderingContext(javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.util.Map), createRenderingContext(javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.util.Map, java.lang.String, java.lang.String)

generateURL

public java.lang.String generateURL(RenderingContext p_context,
                                    LibraryComponent p_component)
Generate the URL to the given component, in the context of the path in the RenderingContext. This URL is the full URL, suitable for inclusion in a link. While a LibraryComponent can be rendered on its own, any information contained in the RenderingContext will be used while rendering the component.

Parameters:
p_context - the RenderingContext to be used
p_component - the component
Returns:
the URL to the requested object
See Also:
createRenderingContext(javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.util.Map), createRenderingContext(javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.util.Map, java.lang.String, java.lang.String)

createDocumentId

public DocumentId createDocumentId(java.lang.String p_stringId)
                            throws DocumentIdCreationException
Creates a new DocumentId object from a String representation of the ID. This can be used in conjunction with DocumentId.toString() as a form of serialize/deserialize pair.

One example of a use of this might be to recreate IDs that are used in list selections on an HTML form, say, to select an AuthoringTemplate. The DocumentId.toString() can be used to populate the value attribute for a field that will be sent back to the server. Once this value is received, this method can be called to reconstruct the appropriate DocumentId object from the field value.

Parameters:
p_stringId - the String representation of the required DocumentId
Returns:
a new DocumentId object
Throws:
DocumentIdCreationException - if the ID could not be created
See Also:
DocumentId.toString()

createRenderingContext

public RenderingContext createRenderingContext(javax.servlet.ServletRequest p_request,
                                               javax.servlet.ServletResponse p_response,
                                               java.util.Map p_requestParameters)
                                        throws OperationFailedException,
                                               AuthorizationException
Creates a new rendering context.

Parameters:
p_request - the ServletRequest object
p_response - the ServletResponse object
p_requestParameters - the request parameters for the request as a map of name=single-value parameters. The parameters of this Map will override the existing parameters of the request. This Map can also contain additional parameters.
Returns:
a new RenderingContext
Throws:
OperationFailedException - If the RenderingContext cannot be created
AuthorizationException - If the user does not have access to the Rendering Context.

createRenderingContext

public RenderingContext createRenderingContext(javax.servlet.ServletRequest p_request,
                                               javax.servlet.ServletResponse p_response,
                                               java.util.Map p_requestParameters,
                                               java.lang.String p_wcmWebAppPath,
                                               java.lang.String p_wcmServletPath)
                                        throws OperationFailedException,
                                               AuthorizationException
Creates a new rendering context.

Parameters:
p_request - the ServletRequest object
p_response - the ServletResponse object
p_requestParameters - the request parameters for the request as a map of name=single-value parameters. The parameters of this Map will override the existing parameters of the request. This Map can also contain additional parameters.
p_wcmWebAppPath - the URL up to the web application (ie. up to and including the context path)
p_wcmServletPath - the servlet path
Returns:
a new RenderingContext
Throws:
OperationFailedException - If the RenderingContext cannot be created
AuthorizationException - If the user does not have access to the Rendering Context.

createRenderingContext

public RenderingContext createRenderingContext(javax.portlet.PortletRequest p_request,
                                               javax.portlet.PortletResponse p_response,
                                               java.util.Map p_requestParameters)
                                        throws OperationFailedException,
                                               AuthorizationException
Creates a new rendering context.

Parameters:
p_request - the PortletRequest object
p_response - the PortletResponse object
p_requestParameters - the request parameters for the request as a map of name=single-value parameters. The parameters of this Map will override the existing parameters of the request. This Map can also contain additional parameters.
Returns:
a new RenderingContext
Throws:
OperationFailedException - If the RenderingContext cannot be created
AuthorizationException - If the user does not have access to the Rendering Context.

createRenderingContext

public RenderingContext createRenderingContext(javax.portlet.PortletRequest p_request,
                                               javax.portlet.PortletResponse p_response,
                                               java.util.Map p_requestParameters,
                                               java.lang.String p_wcmWebAppPath,
                                               java.lang.String p_wcmServletPath)
                                        throws OperationFailedException,
                                               AuthorizationException
Creates a new rendering context.

Parameters:
p_request - the PortletRequest object
p_response - the PortletResponse object
p_requestParameters - the request parameters for the request as a map of name=single-value parameters. The parameters of this Map will override the existing parameters of the request. This Map can also contain additional parameters.
p_wcmWebAppPath - the URL up to the web application (ie. up to and including the context path)
p_wcmServletPath - the servlet path
Returns:
a new RenderingContext
Throws:
OperationFailedException - If the RenderingContext cannot be created
AuthorizationException - If the user does not have access to the Rendering Context.

fromString

public DocumentType fromString(java.lang.String p_typeName)
                        throws IllegalDocumentTypeException
Returns the DocumentType for the specified API interface/class name. The interface/class name specified must be the fully qualified Java interface name as a String.

Parameters:
p_typeName - the API interface/class name
Returns:
the DocumentType for the given interface/class name
Throws:
IllegalDocumentTypeException

isMemberOfGroup

public boolean isMemberOfGroup(java.lang.String p_groupName)
Indicates if the user of this Workspace is a member of the group with the specified name. This method also checks nested groups.

Parameters:
p_groupName - the name of the group to check membership
Returns:
true if this user is a member of the group, false if not

getUserProfile

public UserProfile getUserProfile()
Returns the UserProfile for the user of this Workspace. The UserProfile allows clients to retrieve the users categories and keywords.

Returns:
the UserProfile for the user of this Workspace

useLiveAccess

public void useLiveAccess(boolean liveAccess)

Sets the Access context to use for the following methods:


The Access context is either execute or read, determined by the boolean specified.

if the value is true the system will set the access context to execute(live) access
else it will use read access.



Note: The Access context used in the API can be set at any time, after the creation of the workspace.

Parameters:
liveAccess - boolean true/false to use execute(live) access/read access respectively

useDistinguishedNames

public void useDistinguishedNames(boolean shouldUseDn)
Sets the Workspace to use full distinguished names for get/set methods that use user information. For example: Content.getCurrentApprovers() Content.getAdditionalViewers() Content.addAdditionalViewers() Content.removeAdditionalViewers() Document.getAuthors() Document.getOwners() Document.getLiveAccessMembers() Document.getReadAccessMembers() Document.getEditAccessMembers() Document.getDeleteAccessMembers() Editable.addAuthors() Editable.removeAuthors() Editable.addOwners() Editable.removeOwners() Editable.addLiveAccessMembers() Editable.addReadAccessMembers() Editable.addEditAccessMembers() Editable.removeLiveAccessMembers() Editable.removeReadAccessMembers() Editable.removeEditAccessMembers() Editable.removeDeleteAccessMembers() Editable.addDeleteAccessMembers UserProfile.getUsername()

Parameters:
shouldUseDn - represents whether to use DN for these methods

isDistinguishedNamesUsed

public boolean isDistinguishedNamesUsed()
Checks whether or not the workspace is set to use DNs for user related methods

Returns:
true if useDistinguishedNames is true, false if not