com.ibm.workplace.wcm.api
Interface Workspace


public interface Workspace

Represents a view of the WCM repository for a particular user. 'Live' access has been removed from WCM. 'Live' access methods are deprecated and 'Read' access method calls should be used instead. Calling 'Live' access methods have the same effect as calling 'Read' access.


Field Summary
static int ROLE_APPROVER
          Constant for Content Approver
static int ROLE_AUTHOR
          Constant for Content Author
static int ROLE_OWNER
          Constant for Content Owner
static int SECURITY_DELETE_ACCESS
          security delete access
static int SECURITY_EDIT_ACCESS
          security edit access
static int SECURITY_READ_ACCESS
          security read access
static java.lang.String WCM_ERROR_KEY
           
static java.lang.String WCM_RENDERINGCONTEXT_KEY
           
static java.lang.String WCM_WORKSPACE_KEY
           
static int WORKFLOWSTATUS_ALL
          workflow status for draft, published or expired.
static int WORKFLOWSTATUS_DRAFT
          workflow status for draft These constants can be bit-OR'ed together
static int WORKFLOWSTATUS_EXPIRED
          workflow status for expired.
static int WORKFLOWSTATUS_PUBLISHED
          workflow status for published These constants can be bit-OR'ed together
 
Method Summary
 void clearReferences(com.ibm.workplace.wcm.api.Reference[] references)
          Clears all the refences represented by the array of Reference instances.
 com.ibm.workplace.wcm.api.DocumentIdIterator contentSearch(com.ibm.workplace.wcm.api.DocumentId templateId, com.ibm.workplace.wcm.api.DocumentId[] siteAreaIds, com.ibm.workplace.wcm.api.DocumentId[] categoryIds, java.lang.String[] keywords)
          Returns an iterator of IDs of objects that match the given search criteria.
 com.ibm.workplace.wcm.api.DocumentIdIterator contentSearch(com.ibm.workplace.wcm.api.DocumentId templateId, com.ibm.workplace.wcm.api.DocumentId[] siteAreaIds, com.ibm.workplace.wcm.api.DocumentId[] categoryIds, java.lang.String[] keywords, boolean matchAllKeys)
          Returns an iterator of IDs of objects that match the given search criteria.
 com.ibm.workplace.wcm.api.Document copyCategory(com.ibm.workplace.wcm.api.DocumentId categoryId, com.ibm.workplace.wcm.api.DocumentId newParentId)
          Copies a category and adds it under a new parent.
 com.ibm.workplace.wcm.api.Document copySiteFrameworkDocument(com.ibm.workplace.wcm.api.DocumentId docId, com.ibm.workplace.wcm.api.DocumentId newParentId, com.ibm.workplace.wcm.api.DocumentId siblingId, int position)
          This method copies hierarchical items (SiteArea, Content, or ContentLink to another library.
 com.ibm.workplace.wcm.api.Document copyToLibrary(com.ibm.workplace.wcm.api.DocumentLibrary target, com.ibm.workplace.wcm.api.DocumentId docId)
          This method copies non-hierarchical or root items to another library.
 com.ibm.workplace.wcm.api.Category createCategory(com.ibm.workplace.wcm.api.DocumentId parentId)
          Creates a new Category under the given parent.
 com.ibm.workplace.wcm.api.Content createContent(com.ibm.workplace.wcm.api.DocumentId authoringTemplateId)
          Deprecated. use createContent(authoringTemplateId, parentSiteAreaId, siblingId, position) instead.
 com.ibm.workplace.wcm.api.Content createContent(com.ibm.workplace.wcm.api.DocumentId authoringTemplateId, com.ibm.workplace.wcm.api.DocumentId parentSiteAreaId, com.ibm.workplace.wcm.api.DocumentId siblingId, int position)
          Creates a new Content object, based on an AuthoringTemplate in the parent SiteArea.
 com.ibm.workplace.wcm.api.ContentLink createContentLink(com.ibm.workplace.wcm.api.DocumentId contentId, com.ibm.workplace.wcm.api.DocumentId parentSiteAreaId, com.ibm.workplace.wcm.api.DocumentId siblingId, int position)
          Creates a new ContentLink object, linked to the given Content.
 com.ibm.workplace.wcm.api.LibraryDateComponent createDateComponent()
          Creates a new LibraryDateComponent.
 com.ibm.workplace.wcm.api.DocumentId createDocumentId(java.lang.String stringId)
          Creates a new DocumentId object from a String representation of the ID.
 com.ibm.workplace.wcm.api.DocumentIdIterator createDocumentIdIterator(com.ibm.workplace.wcm.api.DocumentId[] documentIds)
          create a new DocumentIdIterator from an array of given DocumentId.
 com.ibm.workplace.wcm.api.LibraryDocumentManagerComponent createDocumentManagerComponent()
          Creates a new LibraryDocumentManagerComponent.
 com.ibm.workplace.wcm.api.LibraryFileComponent createFileComponent()
          Creates a new LibraryFileComponent.
 com.ibm.workplace.wcm.api.LibraryHTMLComponent createHTMLComponent()
          Creates a new LibraryHTMLComponent.
 com.ibm.workplace.wcm.api.LibraryImageComponent createImageComponent()
          Creates a new LibraryImageComponent.
 com.ibm.workplace.wcm.api.LibraryLinkComponent createLinkComponent()
          Creates a new LibraryLinkComponent.
 com.ibm.workplace.wcm.api.LibraryNumericComponent createNumericComponent()
          Creates a new LibraryNumericComponent.
 com.ibm.workplace.wcm.api.RenderingContext createRenderingContext(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response, java.util.Map requestParameters)
          Creates a new rendering context.
 com.ibm.workplace.wcm.api.RenderingContext createRenderingContext(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response, java.util.Map requestParameters, java.lang.String wcmWebAppPath, java.lang.String wcmServletPath)
          Creates a new rendering context.
 com.ibm.workplace.wcm.api.RenderingContext createRenderingContext(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, java.util.Map requestParameters)
          Creates a new rendering context.
 com.ibm.workplace.wcm.api.RenderingContext createRenderingContext(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, java.util.Map requestParameters, java.lang.String wcmWebAppPath, java.lang.String wcmServletPath)
          Creates a new rendering context.
 com.ibm.workplace.wcm.api.Site createSite()
          Creates a new Site.
 com.ibm.workplace.wcm.api.SiteArea createSiteArea()
          Deprecated. use createSiteArea(parentId) instead
 com.ibm.workplace.wcm.api.SiteArea createSiteArea(com.ibm.workplace.wcm.api.DocumentId parentId, com.ibm.workplace.wcm.api.DocumentId siblingId, int position)
          Creates a new SiteArea under the given parent.
 com.ibm.workplace.wcm.api.LibraryStyleSheetComponent createStyleSheetComponent()
          Creates a new LibraryStyleSheetComponent.
 com.ibm.workplace.wcm.api.Taxonomy createTaxonomy()
          Creates a new Taxonomy.
 com.ibm.workplace.wcm.api.LibraryUserSelectionComponent createUserSelectionComponent()
          Creates a new LibraryUserSelectionComponent.
 java.lang.String[] delete(com.ibm.workplace.wcm.api.DocumentId id)
          Deletes an editable document from the WCM repository.
 boolean exists(com.ibm.workplace.wcm.api.DocumentId id)
          Tests the existence of an object in the repository.
 com.ibm.workplace.wcm.api.DocumentIdIterator findByName(com.ibm.workplace.wcm.api.DocumentType type, java.lang.String name)
          Returns an iterator of IDs of all objects of the given type with the specified name.
 com.ibm.workplace.wcm.api.DocumentIdIterator findByPath(java.lang.String p_path, int p_workflowStatusFilter)
          Returns an iterator of DocumentId for a given path and workflow status.
 com.ibm.workplace.wcm.api.DocumentIdIterator findByType(com.ibm.workplace.wcm.api.DocumentType type)
          Returns an iterator of IDs of all objects of the given type.
 com.ibm.workplace.wcm.api.DocumentIdIterator findComponentByName(java.lang.String name)
          Returns an iterator of IDs of all library components with the specified name.
 com.ibm.workplace.wcm.api.DocumentIdIterator findContentByAuthoringTemplate(com.ibm.workplace.wcm.api.DocumentId id)
          Returns an iterator of IDs of Content which has been created using the specified authoring template.
 com.ibm.workplace.wcm.api.DocumentIdIterator findContentByCategory(com.ibm.workplace.wcm.api.DocumentId id)
          Returns an iterator of IDs of all Content that has the given Category in its profile.
 com.ibm.workplace.wcm.api.DocumentIdIterator findContentByPath(java.lang.String path)
          Returns an iterator of IDs of Content with the given path.
 com.ibm.workplace.wcm.api.DocumentIdIterator findContentByWorkflowStage(com.ibm.workplace.wcm.api.DocumentId id)
          Returns an iterator of IDs of Content in a specified WorkflowStage.
 com.ibm.workplace.wcm.api.DocumentIdIterator findContentByWorkflowStage(com.ibm.workplace.wcm.api.DocumentId[] ids)
          Returns an iterator of all content in the given workflow stages.
 com.ibm.workplace.wcm.api.DocumentIdIterator findContentByWorkflowStage(com.ibm.workplace.wcm.api.DocumentId[] workflowStages, java.lang.String[] users, int userRoles)
          Find content by workflow stage for users in particular roles.
 com.ibm.workplace.wcm.api.DocumentIdIterator findContentModifiedBetween(java.util.Date startDate, java.util.Date endDate)
          Returns an iterator of IDs of all Content that have been modified between the specified start and end dates.
 com.ibm.workplace.wcm.api.DocumentIdIterator findContentModifiedSince(java.util.Date modifiedDate)
          Returns an iterator of IDs of all Content that have been modified since the specified date.
 com.ibm.workplace.wcm.api.DocumentType fromString(java.lang.String typeName)
          Returns the DocumentType for the specified API interface/class name.
 java.lang.String generateURL(com.ibm.workplace.wcm.api.RenderingContext context, com.ibm.workplace.wcm.api.ContentComponent component)
          Generate the URL to the given component, in the context of the path in the RenderingContext.
 java.lang.String generateURL(com.ibm.workplace.wcm.api.RenderingContext context, com.ibm.workplace.wcm.api.LibraryComponent component)
          Generate the URL to the given component, in the context of the path in the RenderingContext.
 com.ibm.workplace.wcm.api.Document getById(com.ibm.workplace.wcm.api.DocumentId id)
          Return object for the given Id.
 com.ibm.workplace.wcm.api.Document getById(com.ibm.workplace.wcm.api.DocumentId id, boolean asReference)
          Return object for the given Id.
 com.ibm.workplace.wcm.api.DocumentIterator getByIds(com.ibm.workplace.wcm.api.DocumentIdIterator documentIdIterator, boolean asReference)
          Return the list of Document objects for the given DocumentIds as a DocumentIterator.
 com.ibm.workplace.wcm.api.DocumentLibrary getCurrentDocumentLibrary()
          Returns the current DocumentLibrary, which is being used for all operations except rendering.
 java.util.Iterator getDocumentLibraries()
          Returns an iterator of all DocumentLibrary objects visible to the user of this Workspace.
 com.ibm.workplace.wcm.api.DocumentLibrary getDocumentLibrary(java.lang.String libraryName)
          Returns the DocumentLibrary with the specified name, or null if a DocumentLibrary with that name does not exist or the caller does not have access
 com.ibm.workplace.wcm.api.DocumentId getDraftIdByPublishedId(com.ibm.workplace.wcm.api.DocumentId p_id)
          Returns the DocumentId of the draft document associated with the supplied published/expired DocumentId
 java.lang.String[] getMemberNames()
          Returns a list of names of all users and groups available to WCM.
 java.lang.String[] getMemberNames(java.lang.String filter)
          Returns a list of names of all users and groups available to WCM.
 java.lang.String getPathById(com.ibm.workplace.wcm.api.DocumentId p_id, boolean p_maintainCase, boolean p_decodeURL)
          Returns the path of the document with the given id.
 com.ibm.workplace.wcm.api.DocumentId getPublishedIdByDraftId(com.ibm.workplace.wcm.api.DocumentId p_id)
          Returns the DocumentId of the published or expired document associated with the supplied draft DocumentId
 com.ibm.workplace.wcm.api.Reference[] getReferences(com.ibm.workplace.wcm.api.DocumentId documentId)
          Returns an array of Reference instances that represent all references to the specified DocumentId.
 com.ibm.workplace.wcm.api.Reference[] getReferencesFrom(com.ibm.workplace.wcm.api.DocumentId documentId)
          Returns an array of Reference instances that represent all references from the specified DocumentId.
 com.ibm.workplace.wcm.api.UserProfile getUserProfile()
          Returns the UserProfile for the user of this Workspace.
 boolean hasAccess(com.ibm.workplace.wcm.api.DocumentId id, int securityAccessType)
          Checks if the user of the Workspace has the specified access to specified document.
 boolean hasAccess(com.ibm.workplace.wcm.api.DocumentId id, com.ibm.workplace.wcm.api.UserProfile user, int securityAccessType)
          Checks if the UserProfile has the specified access to specified document.
 boolean isLocked(com.ibm.workplace.wcm.api.DocumentId docId)
          Indicates whether the DocumentId provided is locked or not
 boolean isMemberOfGroup(java.lang.String groupName)
          Indicates if the user of this Workspace is a member of the group with the specified name.
 boolean isSystemWorkspace()
           
 void lock(com.ibm.workplace.wcm.api.DocumentId docId)
          Locks the document (draft or non-draft) provided by the DocumentId.
 void login()
          Performs a login at the Workspace level
 void logout()
          Performs a logout at the Workspace level
 void moveCategory(com.ibm.workplace.wcm.api.DocumentId categoryId, com.ibm.workplace.wcm.api.DocumentId newParentId)
          Moves a category and adds it under a new parent.
 void moveSiteFrameworkDocument(com.ibm.workplace.wcm.api.DocumentId docId, com.ibm.workplace.wcm.api.DocumentId newParentId, com.ibm.workplace.wcm.api.DocumentId siblingId, int position)
          This method moves hierarchical items (SiteArea, Content, or ContentLink to another library.
 void moveToLibrary(com.ibm.workplace.wcm.api.DocumentLibrary target, com.ibm.workplace.wcm.api.DocumentId docId)
          This method moves non-hierarchical or root items to another library.
 java.lang.String render(com.ibm.workplace.wcm.api.RenderingContext renderingContext)
          Renders the content, according to the RenderingContext that is passed in.
 java.lang.String render(com.ibm.workplace.wcm.api.RenderingContext renderingContext, com.ibm.workplace.wcm.api.ContentComponent component)
          Renders the given WCM content component using the specified rendering context.
 java.lang.String render(com.ibm.workplace.wcm.api.RenderingContext renderingContext, com.ibm.workplace.wcm.api.LibraryComponent component)
          Renders the specified WCM LibraryComponent using the specified RenderingContext.
 void replaceReferences(com.ibm.workplace.wcm.api.Reference[] references, com.ibm.workplace.wcm.api.DocumentId newRefereeId)
          Replaces all the refences represented by the array of Reference instances with the new object represented by the specified DocumentId.
 java.lang.String[] save(com.ibm.workplace.wcm.api.Document object)
          Saves an editable document to the WCM repository.
 void setCurrentDocumentLibrary(com.ibm.workplace.wcm.api.DocumentLibrary library)
          Sets the current DocumentLibrary for this Workspace.
 void unlock(com.ibm.workplace.wcm.api.DocumentId docId)
          Unlocks the document (draft or non-draft) provided by the DocumentId.
 void useLiveAccess(boolean liveAccess)
          Deprecated. This method is deprecated from version 6.0. Calls to 'Live' access methods have the same effect as 'Read' access method calls.
 

Field Detail

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

ROLE_OWNER

public static final int ROLE_OWNER
Constant for Content Owner

See Also:
Constant Field Values

ROLE_AUTHOR

public static final int ROLE_AUTHOR
Constant for Content Author

See Also:
Constant Field Values

ROLE_APPROVER

public static final int ROLE_APPROVER
Constant for Content Approver

See Also:
Constant Field Values

WORKFLOWSTATUS_DRAFT

public static final int WORKFLOWSTATUS_DRAFT
workflow status for draft These constants can be bit-OR'ed together

See Also:
Constant Field Values

WORKFLOWSTATUS_PUBLISHED

public static final int WORKFLOWSTATUS_PUBLISHED
workflow status for published These constants can be bit-OR'ed together

See Also:
Constant Field Values

WORKFLOWSTATUS_EXPIRED

public static final int WORKFLOWSTATUS_EXPIRED
workflow status for expired. These constants can be bit-OR'ed together

See Also:
Constant Field Values

WORKFLOWSTATUS_ALL

public static final int WORKFLOWSTATUS_ALL
workflow status for draft, published or expired. These constants can be bit-OR'ed together

See Also:
Constant Field Values

SECURITY_READ_ACCESS

public static final int SECURITY_READ_ACCESS
security read access

See Also:
Constant Field Values

SECURITY_EDIT_ACCESS

public static final int SECURITY_EDIT_ACCESS
security edit access

See Also:
Constant Field Values

SECURITY_DELETE_ACCESS

public static final int SECURITY_DELETE_ACCESS
security delete access

See Also:
Constant Field Values
Method Detail

createContent

public com.ibm.workplace.wcm.api.Content createContent(com.ibm.workplace.wcm.api.DocumentId authoringTemplateId)
                                                throws DocumentCreationException,
                                                       AuthorizationException,
                                                       IllegalDocumentTypeException
Deprecated. use createContent(authoringTemplateId, parentSiteAreaId, siblingId, position) instead.

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:
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 - if the template is not an AuthoringTemplate

createContent

public com.ibm.workplace.wcm.api.Content createContent(com.ibm.workplace.wcm.api.DocumentId authoringTemplateId,
                                                       com.ibm.workplace.wcm.api.DocumentId parentSiteAreaId,
                                                       com.ibm.workplace.wcm.api.DocumentId siblingId,
                                                       int position)
                                                throws DocumentCreationException,
                                                       AuthorizationException,
                                                       IllegalDocumentTypeException
Creates a new Content object, based on an AuthoringTemplate in the parent SiteArea. The template ID that is specified must be for a template that already exists in the WCM system.

If the ChildPosition is ChildPosition.PREVIOUS or ChildPosition.NEXT, then the siblingId parameter must be specified. If it is not, then an IllegalArgumentException will be thrown. If the ChildPosition is ChildPosition.START or ChildPosition.END then the siblingId parameter, if it is not null, will be ignored.

Parameters:
authoringTemplateId - the authoring template ID
parentSiteAreaId - the parent site area ID
siblingId - the DocumentId of the sibling document, if any. May be null, according to the rules stated
position - the position of the child (docId)
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 - if specified template is not an AuthoringTemplate, the parentSiteArea is not a SiteArea, or the sibling is not a Content or ContentLink.

createContentLink

public com.ibm.workplace.wcm.api.ContentLink createContentLink(com.ibm.workplace.wcm.api.DocumentId contentId,
                                                               com.ibm.workplace.wcm.api.DocumentId parentSiteAreaId,
                                                               com.ibm.workplace.wcm.api.DocumentId siblingId,
                                                               int position)
                                                        throws DocumentCreationException,
                                                               AuthorizationException,
                                                               IllegalDocumentTypeException
Creates a new ContentLink object, linked to the given Content. The Content must be saved before creating a link to it. The ContentLink is created immediately, and should not be saved.

If the ChildPosition is ChildPosition.PREVIOUS or ChildPosition.NEXT, then the siblingId parameter must be specified. If it is not, then an IllegalArgumentException will be thrown. If the ChildPosition is ChildPosition.START or ChildPosition.END then the siblingId parameter, if it is not null, will be ignored.

Parameters:
contentId - the linked Content's ID
parentSiteAreaId - the parent site area ID
siblingId - the DocumentId of the sibling document, if any. May be null, according to the rules stated
position - the position of the child (docId)
Returns:
a new ContentLink object
Throws:
DocumentCreationException - if the ContentLink can not be created
AuthorizationException - if the user does not have access to perform this operation
IllegalDocumentTypeException - if contentId is not a Content ID, or the parentSiteAreaId is not a SiteArea ID, or the siblingId is not a Content or ContentLink.

createSiteArea

public com.ibm.workplace.wcm.api.SiteArea createSiteArea()
                                                  throws DocumentCreationException,
                                                         AuthorizationException
Deprecated. use createSiteArea(parentId) instead

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

createSiteArea

public com.ibm.workplace.wcm.api.SiteArea createSiteArea(com.ibm.workplace.wcm.api.DocumentId parentId,
                                                         com.ibm.workplace.wcm.api.DocumentId siblingId,
                                                         int position)
                                                  throws DocumentCreationException,
                                                         AuthorizationException,
                                                         IllegalDocumentTypeException
Creates a new SiteArea under the given parent. The parent can be a Site or a SiteArea.

If the ChildPosition is ChildPosition.PREVIOUS or ChildPosition.NEXT, then the siblingId parameter must be specified. If it is not, then an IllegalArgumentException will be thrown. If the ChildPosition is ChildPosition.START or ChildPosition.END then the siblingId parameter, if it is not null, will be ignored.

Parameters:
parentId - ID of the parent Site or SiteArea
siblingId - the DocumentId of the sibling document, if any. May be null, according to the rules stated
position - the position of the child (docId)
Returns:
the new SiteArea object
Throws:
DocumentCreationException - if the object cannot be created
AuthorizationException - if the user does not have access
IllegalDocumentTypeException - if the specified parent is not a Site or SiteArea

createSite

public com.ibm.workplace.wcm.api.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 com.ibm.workplace.wcm.api.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 com.ibm.workplace.wcm.api.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

createDocumentManagerComponent

public com.ibm.workplace.wcm.api.LibraryDocumentManagerComponent createDocumentManagerComponent()
                                                                                         throws DocumentCreationException,
                                                                                                AuthorizationException
Creates a new LibraryDocumentManagerComponent. The DocumentManager document that this library component refers to can then be set through the LibraryDocumentManagerComponent itself.

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

createHTMLComponent

public com.ibm.workplace.wcm.api.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

createLinkComponent

public com.ibm.workplace.wcm.api.LibraryLinkComponent createLinkComponent()
                                                                   throws DocumentCreationException,
                                                                          AuthorizationException
Creates a new LibraryLinkComponent. The Link fragment that this library component refers to can then be set through the LibraryLinkComponent itself.

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

createDateComponent

public com.ibm.workplace.wcm.api.LibraryDateComponent createDateComponent()
                                                                   throws DocumentCreationException,
                                                                          AuthorizationException
Creates a new LibraryDateComponent. The Date that this library component refers to can then be set through the LibraryDateComponent itself.

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

createNumericComponent

public com.ibm.workplace.wcm.api.LibraryNumericComponent createNumericComponent()
                                                                         throws DocumentCreationException,
                                                                                AuthorizationException
Creates a new LibraryNumericComponent. The Number that this library component refers to can then be set through the LibraryNumericComponent itself.

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

createUserSelectionComponent

public com.ibm.workplace.wcm.api.LibraryUserSelectionComponent createUserSelectionComponent()
                                                                                     throws DocumentCreationException,
                                                                                            AuthorizationException
Creates a new LibraryUserSelectionComponent. The Users that this library component refers to can then be set through the LibraryUserSelectionComponent itself.

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

createStyleSheetComponent

public com.ibm.workplace.wcm.api.LibraryStyleSheetComponent createStyleSheetComponent()
                                                                               throws DocumentCreationException,
                                                                                      AuthorizationException
Creates a new LibraryStyleSheetComponent. The Style Sheet that this library component refers to can then be set through the LibraryStyleSheetComponent itself.

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

save

public java.lang.String[] save(com.ibm.workplace.wcm.api.Document object)
                        throws DocumentSaveException,
                               AuthorizationException,
                               DuplicateChildException
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:
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
DuplicateChildException - if a document with the same name already exists at the same path

delete

public java.lang.String[] delete(com.ibm.workplace.wcm.api.DocumentId 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:
id - the ID of the object to delete
Throws:
DocumentDeleteException - if the object could not be deleted, or is not an editable object. Note: if a referential integrity exception occurs, DocumentDeleteReferentialIntegrityException is thrown which is a subclass of this exception.
AuthorizationException - if the user does not have access

exists

public boolean exists(com.ibm.workplace.wcm.api.DocumentId id)
Tests the existence of an object in the repository. Returns true if object with given ID exists, false otherwise.

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

getPublishedIdByDraftId

public com.ibm.workplace.wcm.api.DocumentId getPublishedIdByDraftId(com.ibm.workplace.wcm.api.DocumentId p_id)
                                                             throws DocumentRetrievalException,
                                                                    IllegalDocumentTypeException
Returns the DocumentId of the published or expired document associated with the supplied draft DocumentId

Parameters:
p_id - The id of the draft document whose published equilivant should be returned
Returns:
the DocumentId of the published or expired document associated with the supplied draft DocumentId
Throws:
DocumentRetrievalException - if an associated published document can't be located
IllegalDocumentTypeException - if an non-draft document id is supplied

getDraftIdByPublishedId

public com.ibm.workplace.wcm.api.DocumentId getDraftIdByPublishedId(com.ibm.workplace.wcm.api.DocumentId p_id)
                                                             throws DocumentRetrievalException,
                                                                    IllegalDocumentTypeException
Returns the DocumentId of the draft document associated with the supplied published/expired DocumentId

Parameters:
p_id - The id of the published/expired document whose draft equilivant should be returned
Returns:
the DocumentId of the draft document associated with the supplied published/expired DocumentId
Throws:
DocumentRetrievalException - if an associated draft document can't be located
IllegalDocumentTypeException - if a draft document id is supplied

getById

public com.ibm.workplace.wcm.api.Document getById(com.ibm.workplace.wcm.api.DocumentId id)
                                           throws DocumentRetrievalException,
                                                  AuthorizationException
Return object for the given Id. This method is the same as calling getById(DocumentId, boolean) with asReference equal to false. If this object is to be used for read purposes only, then getById(DocumentId, boolean) should be used with asReference equal to true.

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

getById

public com.ibm.workplace.wcm.api.Document getById(com.ibm.workplace.wcm.api.DocumentId id,
                                                  boolean asReference)
                                           throws DocumentRetrievalException,
                                                  AuthorizationException
Return object for the given Id. This method allows to optimise for performance when retrieving the item for rendering or read operations. Retrieving with asReference equal to true is faster and the object should not be modified by the client code. If client code needs to edit the Document then asReference should be false.

Parameters:
id - the ID of the object to retrieve
asReference - when true this will not clone the internal Document.
Returns:
the object
Throws:
DocumentRetrievalException - if the object cannot be retrieved
AuthorizationException - if the user does not have access

getByIds

public com.ibm.workplace.wcm.api.DocumentIterator getByIds(com.ibm.workplace.wcm.api.DocumentIdIterator documentIdIterator,
                                                           boolean asReference)
Return the list of Document objects for the given DocumentIds as a DocumentIterator. The IDs are passed in as a DocumentIdIterator. This may be the result from a call to one of the 'find' methods in Workspace or a new DocumentIdIterator may be created from an array of DocumentIds which the client of the API has collected in some manner. Any Documents whose ID is in the iterator, but the user of this Workspace does not have access to, will not be returned in the DocumentIterator. This method allows to optimise for performance when retrieving items for rendering or read operations. Retrieving with asReference equal to true is faster and the object should not be modified by the client code. If client code needs to edit the Documents then asReference should be false.

Parameters:
documentIdIterator - the iterator of IDs of the Documents to retrieve
asReference - when true this will not clone the internal Document.
Returns:
the DocumentIterator of the requested Documents
See Also:
createDocumentIdIterator(DocumentId[]), getById(DocumentId, boolean)

findByType

public com.ibm.workplace.wcm.api.DocumentIdIterator findByType(com.ibm.workplace.wcm.api.DocumentType 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:
type - the type of object
Returns:
an iterator of object IDs that are visibile to the current user, of the specified type

findByName

public com.ibm.workplace.wcm.api.DocumentIdIterator findByName(com.ibm.workplace.wcm.api.DocumentType type,
                                                               java.lang.String 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:
type - the type of object
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 com.ibm.workplace.wcm.api.DocumentIdIterator findComponentByName(java.lang.String 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:
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 com.ibm.workplace.wcm.api.DocumentIdIterator findContentModifiedSince(java.util.Date 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:
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 com.ibm.workplace.wcm.api.DocumentIdIterator findContentModifiedBetween(java.util.Date startDate,
                                                                               java.util.Date 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:
startDate - the date at the beginning of the range
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 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:
filter - the filter for searching users and groups
Returns:
a String array of names of users and groups

getPathById

public java.lang.String getPathById(com.ibm.workplace.wcm.api.DocumentId p_id,
                                    boolean p_maintainCase,
                                    boolean p_decodeURL)
                             throws DocumentRetrievalException,
                                    IllegalDocumentTypeException
Returns the path of the document with the given id. This method can return the path for either a site, a site area, a content or content link.

Parameters:
p_id - The document whose path should be returned
p_maintainCase - Specifies whether the case of the path should be maintained
p_decodeURL - Specifies whether the returned URL should be decoded

Note: Maintaining the case is slower and isn't required for use in WCM Rendering, however it is required for searching for 'Draft' items by path OR generating URLs to prerendered content on unix platforms, due to the case sensitivity of that platform

Returns:
The path to the specified document, or null if not found
Throws:
DocumentRetrievalException - if a document with the given id can't be located
IllegalDocumentTypeException - if specified id is not a Content, ContentLink, Site Area or Site.

findByPath

public com.ibm.workplace.wcm.api.DocumentIdIterator findByPath(java.lang.String p_path,
                                                               int p_workflowStatusFilter)
Returns an iterator of DocumentId for a given path and workflow status. This method can return DocumentIds for Sites, SiteAreas, Content or ContentLinks. This method supports searching for draft (Workspace.WORKFLOWSTATUS_DRAFT),published (Workspace.WORKFLOWSTATUS_PUBLISHED) or expired (Workspace.WORKFLOWSTATUS_EXPIRED) items or all items regardless of their workflow status (Workspace.WORKFLOWSTATUS_ALL). A combination of workflow status can be specified using a bitwise OR. For example Workspace.WORKFLOWSTATUS_PUBLISHED | Workspace.WORKFLOWSTATUS_EXPIRED.

Parameters:
p_path - the path to the content, site or site area. The path should not be URL encoded. The format of the path is library/site OR library/site/site area(s) OR library/site/site area(s)/content. When searching for draft items, the path is case sensitive.
p_workflowStatusFilter - this parameter must be a valid workflow status or some combination using a bitwise OR.
Returns:
an iterator of DocumentId objects with the specified workflow status for the given path

findContentByPath

public com.ibm.workplace.wcm.api.DocumentIdIterator findContentByPath(java.lang.String 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:
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 com.ibm.workplace.wcm.api.DocumentIdIterator findContentByAuthoringTemplate(com.ibm.workplace.wcm.api.DocumentId 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:
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
IllegalDocumentTypeException

findContentByWorkflowStage

public com.ibm.workplace.wcm.api.DocumentIdIterator findContentByWorkflowStage(com.ibm.workplace.wcm.api.DocumentId 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:
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
IllegalDocumentTypeException

findContentByCategory

public com.ibm.workplace.wcm.api.DocumentIdIterator findContentByCategory(com.ibm.workplace.wcm.api.DocumentId 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:
id - the ID of the Category
Returns:
an iterator of IDs of Content with this category that are visibile to the current user
IllegalDocumentTypeException

contentSearch

public com.ibm.workplace.wcm.api.DocumentIdIterator contentSearch(com.ibm.workplace.wcm.api.DocumentId templateId,
                                                                  com.ibm.workplace.wcm.api.DocumentId[] siteAreaIds,
                                                                  com.ibm.workplace.wcm.api.DocumentId[] categoryIds,
                                                                  java.lang.String[] 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:
templateId - the ID of the template to match
siteAreaIds - the IDs of the site areas to find content in
categoryIds - the IDs of categories for content to have in their profile
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 com.ibm.workplace.wcm.api.DocumentIdIterator contentSearch(com.ibm.workplace.wcm.api.DocumentId templateId,
                                                                  com.ibm.workplace.wcm.api.DocumentId[] siteAreaIds,
                                                                  com.ibm.workplace.wcm.api.DocumentId[] categoryIds,
                                                                  java.lang.String[] keywords,
                                                                  boolean 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 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:
templateId - the ID of the template to match
siteAreaIds - the IDs of the site areas to find content in
categoryIds - the IDs of categories for content to have in their profile
keywords - the IDs of keywords for content to have in its profile
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

render

public java.lang.String render(com.ibm.workplace.wcm.api.RenderingContext 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:
renderingContext - the context to render
Returns:
the rendered context as a String
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(com.ibm.workplace.wcm.api.RenderingContext renderingContext,
                               com.ibm.workplace.wcm.api.ContentComponent 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:
renderingContext - the RenderingContext to use
component - the WCM content component to render
Returns:
the rendered component as a String
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(com.ibm.workplace.wcm.api.RenderingContext renderingContext,
                               com.ibm.workplace.wcm.api.LibraryComponent 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:
renderingContext - the RenderingContext to use
component - the component to render
Returns:
the rendered component as a String
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(com.ibm.workplace.wcm.api.RenderingContext context,
                                    com.ibm.workplace.wcm.api.ContentComponent 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:
context - the RenderingContext to be used
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(com.ibm.workplace.wcm.api.RenderingContext context,
                                    com.ibm.workplace.wcm.api.LibraryComponent 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:
context - the RenderingContext to be used
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 com.ibm.workplace.wcm.api.DocumentId createDocumentId(java.lang.String 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:
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()

createDocumentIdIterator

public com.ibm.workplace.wcm.api.DocumentIdIterator createDocumentIdIterator(com.ibm.workplace.wcm.api.DocumentId[] documentIds)
create a new DocumentIdIterator from an array of given DocumentId. An example of its use is:
   // Get ID strings from request
   String[] selectedIds = request.getParameterValues("selected_ids");
   DocumentId[] ids = new DocumentId[selectedIds.length];
   for (int i = 0; i < selectedIds.length; i++)
   {
      ids[i] = workspace.createDocumentId(selectedIds[i]);
   }

   DocumentIdIterator iterator = workspace.createDocumentIdIterator(ids);
   DocumentIterator documents = workspace.getDocuments(iterator);

   // Work with returned documents
   ...

Parameters:
documentIds - an array of DocumentId.
Returns:
a new DocumentIdIterator
Throws:
java.lang.IllegalArgumentException - if the ID array contains a null.

createRenderingContext

public com.ibm.workplace.wcm.api.RenderingContext createRenderingContext(javax.servlet.ServletRequest request,
                                                                         javax.servlet.ServletResponse response,
                                                                         java.util.Map requestParameters)
                                                                  throws OperationFailedException,
                                                                         AuthorizationException
Creates a new rendering context.

Parameters:
request - the ServletRequest object
response - the ServletResponse object
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 com.ibm.workplace.wcm.api.RenderingContext createRenderingContext(javax.servlet.ServletRequest request,
                                                                         javax.servlet.ServletResponse response,
                                                                         java.util.Map requestParameters,
                                                                         java.lang.String wcmWebAppPath,
                                                                         java.lang.String wcmServletPath)
                                                                  throws OperationFailedException,
                                                                         AuthorizationException
Creates a new rendering context.

Parameters:
request - the ServletRequest object
response - the ServletResponse object
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.
wcmWebAppPath - the URL up to the web application (ie. up to and including the context path)
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 com.ibm.workplace.wcm.api.RenderingContext createRenderingContext(javax.portlet.PortletRequest request,
                                                                         javax.portlet.PortletResponse response,
                                                                         java.util.Map requestParameters)
                                                                  throws OperationFailedException,
                                                                         AuthorizationException
Creates a new rendering context.

Parameters:
request - the PortletRequest object
response - the PortletResponse object
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 com.ibm.workplace.wcm.api.RenderingContext createRenderingContext(javax.portlet.PortletRequest request,
                                                                         javax.portlet.PortletResponse response,
                                                                         java.util.Map requestParameters,
                                                                         java.lang.String wcmWebAppPath,
                                                                         java.lang.String wcmServletPath)
                                                                  throws OperationFailedException,
                                                                         AuthorizationException
Creates a new rendering context.

Parameters:
request - the PortletRequest object
response - the PortletResponse object
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.
wcmWebAppPath - the URL up to the web application (ie. up to and including the context path)
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 com.ibm.workplace.wcm.api.DocumentType fromString(java.lang.String 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:
typeName - the API interface/class name
Returns:
the DocumentType for the given interface/class name
IllegalDocumentTypeException

getReferences

public com.ibm.workplace.wcm.api.Reference[] getReferences(com.ibm.workplace.wcm.api.DocumentId documentId)
                                                    throws OperationFailedException,
                                                           AuthorizationException
Returns an array of Reference instances that represent all references to the specified DocumentId.

Parameters:
documentId -
Returns:
array of Reference instances
Throws:
OperationFailedException - if there was an error creating the array of Reference instances for the specified DocumentId.
AuthorizationException - if the user does not have access to the object specified by the DocumentId or data required to create the array of Reference instances.

getReferencesFrom

public com.ibm.workplace.wcm.api.Reference[] getReferencesFrom(com.ibm.workplace.wcm.api.DocumentId documentId)
                                                        throws OperationFailedException,
                                                               AuthorizationException
Returns an array of Reference instances that represent all references from the specified DocumentId.

Parameters:
documentId -
Returns:
array of Reference instances
Throws:
OperationFailedException - if there was an error creating the array of Reference instances for the specified DocumentId.
AuthorizationException - if the user does not have access to the object specified by the DocumentId or data required to create the array of Reference instances.

clearReferences

public void clearReferences(com.ibm.workplace.wcm.api.Reference[] references)
                     throws OperationFailedException,
                            AuthorizationException
Clears all the refences represented by the array of Reference instances.

Parameters:
references - an array of Reference instances obtained by calling getReferences(...).
Throws:
OperationFailedException - if there was an error clearing a Reference.
AuthorizationException - if the user does not have access to the referring object so the reference can be cleared.

replaceReferences

public void replaceReferences(com.ibm.workplace.wcm.api.Reference[] references,
                              com.ibm.workplace.wcm.api.DocumentId newRefereeId)
                       throws OperationFailedException,
                              AuthorizationException,
                              IllegalTypeChangeException
Replaces all the refences represented by the array of Reference instances with the new object represented by the specified DocumentId.

Parameters:
references - an array of Reference instances obtained by calling getReferences(...).
newRefereeId - the DocumentId of the object that is to be come the new referee.
Throws:
OperationFailedException - if there was an error replacing a Reference.
AuthorizationException - if the user does not have access to the referring object so the reference can be replaced.
IllegalTypeChangeException - if the type of the Document represented by the specified DocumentId is not of the appropriate type for the Reference.

isMemberOfGroup

public boolean isMemberOfGroup(java.lang.String 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:
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 com.ibm.workplace.wcm.api.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

getCurrentDocumentLibrary

public com.ibm.workplace.wcm.api.DocumentLibrary getCurrentDocumentLibrary()
Returns the current DocumentLibrary, which is being used for all operations except rendering.

Returns:
the current DocumentLibrary being used by this Workspace

setCurrentDocumentLibrary

public void setCurrentDocumentLibrary(com.ibm.workplace.wcm.api.DocumentLibrary library)
Sets the current DocumentLibrary for this Workspace. This is the Library that will be used for all operations, until it is set to a different Library.

The Library set by this method will not be used for calls to render objects. The Library specified in the path to be rendered will be used for rendering.

Parameters:
library - the DocumentLibrary to use

getDocumentLibraries

public java.util.Iterator getDocumentLibraries()
Returns an iterator of all DocumentLibrary objects visible to the user of this Workspace.

Returns:
an iterator of DocumentLibrary objects

getDocumentLibrary

public com.ibm.workplace.wcm.api.DocumentLibrary getDocumentLibrary(java.lang.String libraryName)
Returns the DocumentLibrary with the specified name, or null if a DocumentLibrary with that name does not exist or the caller does not have access

Parameters:
libraryName - the name of the DocumentLibrary to retrieve
Returns:
a DocumentLibrary object representing the library with the given name, or null if it does not exist.

useLiveAccess

public void useLiveAccess(boolean liveAccess)
Deprecated. This method is deprecated from version 6.0. Calls to 'Live' access methods have the same effect as 'Read' access method calls.

Sets the Access context to use for the following methods.

  • Category.getAllChildren (...)
  • Category.getChildren (...)
  • Category.getParent (...)
  • Content.getAuthoringTemplateID (...)
  • Content.getCategoriesIds (...)
  • Content.getParents (...)
  • Document.getOwners (...)
  • EditableLibraryComponent.getAuthors (...)
  • EditableLibraryComponent.getOwners (...)
  • FileComponentDelegate.getFile (...)
  • FileComponentDelegate.getFileName (...)
  • ImageComponent.getImageFileName (...)
  • ImageComponentDelegate.getImage (...)
  • LibraryComponent.getAuthors (...)
  • LibraryComponent.getOwners (...)
  • LibraryImageComponent.getImageFileName (...)
  • Reference.clear(...)
  • Reference.replace(...)
  • SiteArea.getDefaultContent (...)
  • SiteArea.getParent (...)
  • Site.getDefaultContent (...)
  • SiteFrameworkContainer.getAllChildren (...)
  • SiteFrameworkContainer.getChildren (...)
  • SiteFrameworkContainer.getTemplateMapping (...)
  • Taxonomy.getChildren (...)
  • UserProfile.getCategories (...)
  • Workspace.ContentSearch(...)
  • Workspace.exists(...)
  • Workspace.findByIdInIndex (...)
  • Workspace.findByName(...)
  • Workspace.findByType (...)
  • Workspace.findComponentByName (...)
  • Workspace.findContentByAuthoringTemplate (...)
  • Workspace.findContentByCategory(...)
  • Workspace.findContentByPath (...)
  • Workspace.findContentByWorkflowStage (...)
  • Workspace.findContentModifiedBetween (...)
  • Workspace.findContentModifiedSince (...)
  • Workspace.isInName2IdIndex (...)
  • Workspace.getById (...)
  • Workspace.isMemberOfgroup (...)
  • Workspace.Taxonomy.getAllChildren (...)
  • Workspace.clearReferences(...)
  • Workspace.getReferences (...)
  • Workspace.replaceReferences(...)

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

moveToLibrary

public void moveToLibrary(com.ibm.workplace.wcm.api.DocumentLibrary target,
                          com.ibm.workplace.wcm.api.DocumentId docId)
                   throws AuthorizationException,
                          DocumentRetrievalException,
                          DuplicateChildException
This method moves non-hierarchical or root items to another library. If the item is hierarchical, an IllegalDocumentTypeException will be thrown.

Parameters:
target - the DocumentLibrary that the document will be moved to
docId - the DocumentId of the document to be moved
Throws:
AuthorizationException - if the user does not have access to perform this operation
DocumentRetrievalException - if docId Document can not be retrieved
DuplicateChildException - if a document with the same name already exists at the same path

moveSiteFrameworkDocument

public void moveSiteFrameworkDocument(com.ibm.workplace.wcm.api.DocumentId docId,
                                      com.ibm.workplace.wcm.api.DocumentId newParentId,
                                      com.ibm.workplace.wcm.api.DocumentId siblingId,
                                      int position)
                               throws IllegalDocumentTypeException,
                                      AuthorizationException,
                                      DocumentRetrievalException,
                                      DuplicateChildException
This method moves hierarchical items (SiteArea, Content, or ContentLink to another library. If the item is not hierarchical, an IllegalDocumentTypeException will be thrown.

If the ChildPosition is ChildPosition.PREVIOUS or ChildPosition.NEXT, then the siblingId parameter must be specified. If it is not, then an IllegalArgumentException will be thrown. If the ChildPosition is ChildPosition.START or ChildPosition.END then the siblingId parameter, if it is not null, will be ignored.

Parameters:
docId - the DocumentId of the document to be moved
newParentId - the DocumentId of the parent for the moved document
siblingId - the DocumentId of the sibling document, if any. May be null, according to the rules stated
position - the position of the child (docId)
Throws:
IllegalDocumentTypeException - if docId is not the ID of a Content or SiteArea.
AuthorizationException - if the user does not have access to perform this operation
DocumentRetrievalException - if docId Document can not be retrieved
DuplicateChildException - if a document with the same name already exists at the same path

moveCategory

public void moveCategory(com.ibm.workplace.wcm.api.DocumentId categoryId,
                         com.ibm.workplace.wcm.api.DocumentId newParentId)
                  throws IllegalDocumentTypeException,
                         AuthorizationException,
                         DocumentRetrievalException
Moves a category and adds it under a new parent. This method can be used for moving categories within or between libraries.

Parameters:
categoryId - the DocumentId of the category to be copied
newParentId - the DocumentId of the parent for the new copy of the category
Throws:
IllegalDocumentTypeException - if categoryId is not the ID of a Category, or the newParentId is not the ID of a Category or Taxonomy
AuthorizationException - if the user does not have access to perform this operation on the category or parent.
DocumentRetrievalException - if categoryId Document can not be retrieved

copyToLibrary

public com.ibm.workplace.wcm.api.Document copyToLibrary(com.ibm.workplace.wcm.api.DocumentLibrary target,
                                                        com.ibm.workplace.wcm.api.DocumentId docId)
                                                 throws AuthorizationException,
                                                        DocumentRetrievalException,
                                                        DuplicateChildException,
                                                        DocumentCreationException,
                                                        IllegalDocumentTypeException
This method copies non-hierarchical or root items to another library. If the item is hierarchical, an IllegalDocumentTypeException will be thrown.

Parameters:
target - the DocumentLibrary that the document will be copied to
docId - the DocumentId of the document to be copied
Throws:
AuthorizationException - if the user does not have access to perform this operation
DocumentRetrievalException - if docId Document can not be retrieved
DuplicateChildException - if a document with the same name already exists at the same path
DocumentCreationException - if the new document could not be created for other reasons
IllegalDocumentTypeException

copySiteFrameworkDocument

public com.ibm.workplace.wcm.api.Document copySiteFrameworkDocument(com.ibm.workplace.wcm.api.DocumentId docId,
                                                                    com.ibm.workplace.wcm.api.DocumentId newParentId,
                                                                    com.ibm.workplace.wcm.api.DocumentId siblingId,
                                                                    int position)
                                                             throws IllegalDocumentTypeException,
                                                                    AuthorizationException,
                                                                    DocumentRetrievalException,
                                                                    DuplicateChildException,
                                                                    DocumentCreationException
This method copies hierarchical items (SiteArea, Content, or ContentLink to another library. If the item is not hierarchical, an IllegalDocumentTypeException will be thrown.

If the position is BEFORE (position = 2) or AFTER (position = 3, then the siblingId parameter must be specified. If it is not, then an IllegalArgumentException will be thrown. If the position is ChildPosition.START - (position = 0) or ChildPosition.END (position = 1) then the siblingId parameter, if it is not null, will be ignored.

Parameters:
docId - the DocumentId of the document to be copied
newParentId - the DocumentId of the parent for the new copy
siblingId - the DocumentId of the sibling document, if any. May be null, according to the rules stated
position - the position of the child (docId)
Throws:
IllegalDocumentTypeException - if docId is not the ID of a Content or SiteArea.
AuthorizationException - if the user does not have access to perform this operation
DocumentRetrievalException - if docId Document can not be retrieved
DuplicateChildException - if a document with the same name already exists at the same path
DocumentCreationException - if the new document could not be created for other reasons

copyCategory

public com.ibm.workplace.wcm.api.Document copyCategory(com.ibm.workplace.wcm.api.DocumentId categoryId,
                                                       com.ibm.workplace.wcm.api.DocumentId newParentId)
                                                throws IllegalDocumentTypeException,
                                                       AuthorizationException,
                                                       DocumentRetrievalException,
                                                       DuplicateChildException,
                                                       DocumentCreationException
Copies a category and adds it under a new parent. This method can be used for copying categories within or between libraries.

Parameters:
categoryId - the DocumentId of the category to be copied
newParentId - the DocumentId of the parent for the new copy of the category
Throws:
IllegalDocumentTypeException - if categoryId is not the ID of a Category, or the newParentId is not the ID of a Category or Taxonomy
AuthorizationException - if the user does not have access to perform this operation on the category or parent.
DocumentRetrievalException - if categoryId Document can not be retrieved
DuplicateChildException - if a document with the same name already exists at the same path
DocumentCreationException - if the new document could not be created for other reasons

lock

public void lock(com.ibm.workplace.wcm.api.DocumentId docId)
          throws OperationFailedException
Locks the document (draft or non-draft) provided by the DocumentId.

Parameters:
docId - Document to be locked
Throws:
OperationFailedException

unlock

public void unlock(com.ibm.workplace.wcm.api.DocumentId docId)
            throws OperationFailedException
Unlocks the document (draft or non-draft) provided by the DocumentId.

Parameters:
docId - Document to be unlocked
Throws:
OperationFailedException

isLocked

public boolean isLocked(com.ibm.workplace.wcm.api.DocumentId docId)
                 throws OperationFailedException
Indicates whether the DocumentId provided is locked or not

Parameters:
docId - Document to check whether it is locked
Returns:
true if locked, false otherwise
Throws:
OperationFailedException

isSystemWorkspace

public boolean isSystemWorkspace()

createTaxonomy

public com.ibm.workplace.wcm.api.Taxonomy createTaxonomy()
                                                  throws DocumentCreationException,
                                                         AuthorizationException
Creates a new Taxonomy. The new Taxonomy is returned.

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

createCategory

public com.ibm.workplace.wcm.api.Category createCategory(com.ibm.workplace.wcm.api.DocumentId parentId)
                                                  throws DocumentCreationException,
                                                         AuthorizationException,
                                                         IllegalDocumentTypeException
Creates a new Category under the given parent. The parent can be a Taxonomy or a Category.

Parameters:
parentId - ID of the parent Taxonomy or Category
Returns:
the new Category object
Throws:
DocumentCreationException - if the object cannot be created
AuthorizationException - if the user does not have access
IllegalDocumentTypeException - if the specified parent is not a Taxonomy or Category

hasAccess

public boolean hasAccess(com.ibm.workplace.wcm.api.DocumentId id,
                         int securityAccessType)
Checks if the user of the Workspace has the specified access to specified document.

This method supports the following access types:

  • Read (Workspace.SECURITY_READ_ACCESS)
  • Edit (Workspace.SECURITY_EDIT_ACCESS)
  • Delete (Workspace.SECURITY_DELETE_ACCESS)

Parameters:
id - the document to perform the access check on
securityAccessType - the access type to check
Returns:
true if the user has the specified access to the specified document, false if not

hasAccess

public boolean hasAccess(com.ibm.workplace.wcm.api.DocumentId id,
                         com.ibm.workplace.wcm.api.UserProfile user,
                         int securityAccessType)
Checks if the UserProfile has the specified access to specified document.

This method supports the following access types:

  • Read (Workspace.SECURITY_READ_ACCESS)
  • Edit (Workspace.SECURITY_EDIT_ACCESS)
  • Delete (Workspace.SECURITY_DELETE_ACCESS)

Parameters:
id - the document to perform the access check on
user - the UserProfile to perform the access check for
securityAccessType - the access type to check
Returns:
true if the user has the specified access to the specified document, false if not

findContentByWorkflowStage

public com.ibm.workplace.wcm.api.DocumentIdIterator findContentByWorkflowStage(com.ibm.workplace.wcm.api.DocumentId[] workflowStages,
                                                                               java.lang.String[] users,
                                                                               int userRoles)
                                                                        throws IllegalDocumentTypeException
Find content by workflow stage for users in particular roles. When calling this method with userRoles set to ROLE_APPROVER, only drafts are searched.

Parameters:
workflowStages - The WorkflowStages that we want to find content in
users - The usernames that we want to find content for. These are the full name of the user, as returned by methods such as UserProfile.getUsername(), and not the short name.
userRoles - The roles that the specified users are in. Valid values are ROLE_AUTHOR, ROLE_APPROVER and ROLE_OWNER. When ROLE_APPROVER is used, only drafts are searched.
Returns:
an iterator of Ids of Content items in the given workflow stage that are visible to the current user
Throws:
IllegalDocumentTypeException - if the IDs are not of type Workflow Stage
java.lang.IllegalArgumentException - if the workflow stage or user parameters are empty, if any of the workflow stage or user parameter values within the arrays are null, or if userRoles are not valid

findContentByWorkflowStage

public com.ibm.workplace.wcm.api.DocumentIdIterator findContentByWorkflowStage(com.ibm.workplace.wcm.api.DocumentId[] ids)
                                                                        throws IllegalDocumentTypeException
Returns an iterator of all content in the given workflow stages.

Parameters:
ids - the list of IDs of the workflow stages
Returns:
an iterator of IDs of content items in the gievn stage
IllegalDocumentTypeException

login

public void login()
Performs a login at the Workspace level

This method allows the caller to perform a single high-level login to the underlying WCM Repository before executing a set of WCM API method calls that form part of a request. This improves the performance of all WCM API method calls made within that request and ensures version consistency of an item's properties retrieved.

When using this method it is essential to ensure that the 'logout' method is called once the work is complete (and before the 'Repository.endWorkspace()' method is called if applicable as per the endWorkspace method's JavaDoc). The required way to use this method to ensure that this condition is met, is as follows:

try
{
   // Perform Login
   Workspace.login()

   // Call WCM API method cals for current request
   ...
}
finally
{
   // Perform logout
   Workspace.logout()
}

WCM_API.getRepository().endWorkspace(); // if appropriate

Note 1: For multi-threaded applications, the login/logout will need to be done per thread

Note 2: For long running applications, you will need to periodically re-login (before the session expires) to obtain optimum performance


logout

public void logout()
Performs a logout at the Workspace level

This method should be used in conjunction with Workspace.login, see the Workspace.login() method for usage information

See Also: