Overview Package Class Tree Deprecated Index Help PREV CLASS NEXT CLASS FRAMES NO FRAMES SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
com.ibm.workplace.wcm.api
Interface Workspace
public interface WorkspaceRepresents a view of the WCM repository for a particular user. 'Live', 'Read', 'Edit' and 'Delete' access are deprecated. The levels 'User', 'Contributor', 'Editor' and 'Manager' should be used from 6.1.
Field Summary static int ROLE_APPROVER
Constant for Content Approverstatic int ROLE_AUTHOR
Constant for Content Authorstatic int ROLE_OWNER
Constant for Content Ownerstatic int SECURITY_CONTRIBUTOR_ACCESS
security CONTRIBUTOR accessstatic int SECURITY_DELETE_ACCESS
Deprecated. Use manager accessstatic int SECURITY_EDIT_ACCESS
Deprecated. Use editor accessstatic int SECURITY_EDITOR_ACCESS
security EDITOR accessstatic int SECURITY_MANAGER_ACCESS
security MANAGER accessstatic int SECURITY_READ_ACCESS
Deprecated. Use contributor accessstatic int SECURITY_USER_ACCESS
security USER accessstatic java.lang.String SORT_KEY_CREATION_DATE
contentSearch method sort key for creation datestatic java.lang.String SORT_KEY_DESCRIPTION
contentSearch method sort key for descriptionstatic java.lang.String SORT_KEY_EXPIRY_DATE
contentSearch method sort key for expiry datestatic java.lang.String SORT_KEY_GENERAL_DATE_ONE
contentSearch method sort key for general date onestatic java.lang.String SORT_KEY_GENERAL_DATE_TWO
contentSearch method sort key for general date twostatic java.lang.String SORT_KEY_LASTMODIFIED_DATE
contentSearch method sort key for last modified datestatic java.lang.String SORT_KEY_NAME
contentSearch method sort key for namestatic java.lang.String SORT_KEY_NONE
contentSearch method sort key for no sortingstatic java.lang.String SORT_KEY_PUBLISH_DATE
contentSearch method sort key for publish datestatic java.lang.String SORT_KEY_TITLE
contentSearch method sort key for titlestatic 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 togetherstatic 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(Reference[] references)
Clears all the refences represented by the array of Reference instances.DocumentIdIterator contentSearch(DocumentId templateId, DocumentId[] siteAreaIds, DocumentId[] categoryIds, java.lang.String[] keywords)
Returns an iterator of IDs of objects that match the given search criteria.DocumentIdIterator contentSearch(DocumentId templateId, DocumentId[] siteAreaIds, DocumentId[] categoryIds, java.lang.String[] keywords, boolean matchAllKeys)
Returns an iterator of IDs of objects that match the given search criteria.DocumentIdIterator contentSearch(DocumentId templateId, DocumentId[] siteAreaIds, DocumentId[] categoryIds, java.lang.String[] keywords, boolean matchAllCategories, boolean includeAncestorSiteAreas, boolean includeDescendentSiteAreas, java.lang.String sortKey1, java.lang.String sortKey2, java.lang.String sortKey3, boolean sortAscending)
Returns an iterator of IDs of objects that match the given search criteria.Document copyCategory(DocumentId categoryId, DocumentId newParentId)
Copies a category and adds it under a new parent.Document copySiteFrameworkDocument(DocumentId docId, DocumentId newParentId, DocumentId siblingId, int position)
This method copies hierarchical items (SiteArea, Content, or ContentLink to another library.Document copyToLibrary(DocumentLibrary target, DocumentId docId)
This method copies non-hierarchical or root items to another library.Category createCategory(DocumentId parentId)
Creates a new Category under the given parent.Content createContent(DocumentId authoringTemplateId)
Deprecated. use createContent(authoringTemplateId, parentSiteAreaId, siblingId, position) instead.Content createContent(DocumentId authoringTemplateId, DocumentId parentSiteAreaId, DocumentId siblingId, int position)
Creates a new Content object, based on an AuthoringTemplate in the parent SiteArea.ContentLink createContentLink(DocumentId contentId, DocumentId parentSiteAreaId, DocumentId siblingId, int position)
Creates a new ContentLink object, linked to the given Content.LibraryDateComponent createDateComponent()
Creates a new LibraryDateComponent.DocumentId createDocumentId(java.lang.String stringId)
Creates a new DocumentId object from a String representation of the ID.DocumentIdIterator createDocumentIdIterator(DocumentId[] documentIds)
create a new DocumentIdIterator from an array of given DocumentId.LibraryDocumentManagerComponent createDocumentManagerComponent()
Creates a new LibraryDocumentManagerComponent.LibraryFileComponent createFileComponent()
Creates a new LibraryFileComponent.LibraryHTMLComponent createHTMLComponent()
Creates a new LibraryHTMLComponent.LibraryImageComponent createImageComponent()
Creates a new LibraryImageComponent.LibraryJSPComponent createJSPComponent()
Creates a new LibraryJSPComponent.LibraryLinkComponent createLinkComponent()
Creates a new LibraryLinkComponent.LibraryNumericComponent createNumericComponent()
Creates a new LibraryNumericComponent.PresentationTemplate createPresentationTemplate()
Creates a new PresentationTemplate.RenderingContext createRenderingContext(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response, java.util.Map requestParameters)
Creates a new rendering context.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.RenderingContext createRenderingContext(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, java.util.Map requestParameters)
Creates a new rendering context.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.LibraryRichTextComponent createRichTextComponent()
Creates a new LibraryRichTextComponent.LibraryShortTextComponent createShortTextComponent()
Creates a new LibraryShortTextComponent.Site createSite()
Creates a new Site.SiteArea createSiteArea()
Deprecated. use createSiteArea(parentId) insteadSiteArea createSiteArea(DocumentId parentId, DocumentId siblingId, int position)
Creates a new SiteArea under the given parent.LibraryStyleSheetComponent createStyleSheetComponent()
Creates a new LibraryStyleSheetComponent.Taxonomy createTaxonomy()
Creates a new Taxonomy.LibraryTextComponent createTextComponent()
Creates a new LibraryTextComponent.LibraryUserSelectionComponent createUserSelectionComponent()
Creates a new LibraryUserSelectionComponent.java.lang.String[] delete(DocumentId id)
Deletes an editable document from the WCM repository.boolean exists(DocumentId id)
Tests the existence of an object in the repository.DocumentIdIterator findByName(DocumentType type, java.lang.String name)
Returns an iterator of IDs of all objects of the given type with the specified name.DocumentIdIterator findByName(DocumentType type, java.lang.String name, int p_workflowStatusFilter)
Returns an iterator of IDs of all objects of the given type with the specified name that match the given workflow status filter.DocumentIdIterator findByPath(java.lang.String p_path, int p_workflowStatusFilter)
Returns an iterator of DocumentId for a given path and workflow status.DocumentIdIterator findByType(DocumentType type)
Returns an iterator of IDs of all objects of the given type.DocumentIdIterator findByType(DocumentType type, int p_workflowStatusFilter)
Returns an iterator of IDs of all objects of the given type that match the given workflow status filter.DocumentIdIterator findComponentByName(java.lang.String name)
Returns an iterator of IDs of all library components with the specified name.DocumentIdIterator findContentByAuthoringTemplate(DocumentId id)
Returns an iterator of IDs of Content which has been created using the specified authoring template.DocumentIdIterator findContentByAuthoringTemplate(DocumentId id, int p_workflowStatusFilter)
Returns an iterator of IDs of Content which has been created using the specified authoring template that match the given workflow status filter.DocumentIdIterator findContentByCategory(DocumentId id)
Returns an iterator of IDs of all Content that has the given Category in its profile.DocumentIdIterator findContentByCategory(DocumentId id, int p_workflowStatusFilter)
Returns an iterator of IDs of all Content that has the given Category in its profile that match the given workflow status filter.DocumentIdIterator findContentByPath(java.lang.String path)
Returns an iterator of IDs of Content with the given path.DocumentIdIterator findContentByWorkflowStage(DocumentId id)
Returns an iterator of IDs of Content in a specified WorkflowStage.DocumentIdIterator findContentByWorkflowStage(DocumentId[] ids)
Returns an iterator of all content in the given workflow stages.DocumentIdIterator findContentByWorkflowStage(DocumentId[] workflowStages, java.lang.String[] users, int userRoles)
Find content by workflow stage for users in particular roles.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.DocumentIdIterator findContentModifiedBetween(java.util.Date startDate, java.util.Date endDate, int p_workflowStatusFilter)
Returns an iterator of IDs of all Content that have been modified between the specified start and end dates that match the given workflow status filter.DocumentIdIterator findContentModifiedSince(java.util.Date modifiedDate)
Returns an iterator of IDs of all Content that have been modified since the specified date.DocumentIdIterator findContentModifiedSince(java.util.Date modifiedDate, int p_workflowStatusFilter)
Returns an iterator of IDs of all Content that have been modified since the specified date that match the given workflow status filter.DocumentIdIterator findDocumentsByWorkflowStage(DocumentId[] ids)
Returns an iterator of all Documents in the given workflow stages.DocumentIdIterator findDocumentsByWorkflowStage(DocumentId[] workflowStages, java.lang.String[] users, int userRoles)
Find Documents by workflow stage for users in particular roles.DocumentIdIterator findDocumentsModifiedBetween(java.util.Date startDate, java.util.Date endDate)
Returns an iterator of IDs of all Documents that have been modified between the specified start and end dates.DocumentIdIterator findDocumentsModifiedBetween(java.util.Date startDate, java.util.Date endDate, int workflowStatusFilter)
Returns an iterator of IDs of all Documents that have been modified between the specified start and end dates.DocumentIdIterator findDocumentsModifiedSince(java.util.Date modifiedDate)
Returns an iterator of IDs of all Documents that have been modified since the specified date.DocumentIdIterator findDocumentsModifiedSince(java.util.Date modifiedDate, int workflowStatusFilter)
Returns an iterator of IDs of all Documents that have been modified since the specified date.DocumentIdIterator findItemsDeletedBefore(java.util.Date deletedBeforeDate, DocumentType documentType, DocumentId workflowStage)
Returns a DocumentIdIterator of deleted documents restricted by date, document type and workflow stage.DocumentIdIterator findItemsDeletedBetween(java.util.Date deletedStartDate, java.util.Date deletedEndDate, DocumentType documentType, DocumentId workflowStage)
Returns a DocumentIdIterator of documents restricted by date, workflow stage and document typeDocumentIdIterator findItemsDeletedSince(java.util.Date deletedSinceDate, DocumentType documentType, DocumentId workflowStage)
Returns a DocumentIdIterator of documents restricted by date, workflow stage and document typeDocumentType fromString(java.lang.String typeName)
Returns the DocumentType for the specified API interface/class name.java.lang.String generateURL(RenderingContext context, ContentComponent component)
Generate the URL to the given component, in the context of the path in the RenderingContext.java.lang.String generateURL(RenderingContext context, LibraryComponent component)
Generate the URL to the given component, in the context of the path in the RenderingContext.Document getById(DocumentId id)
Return object for the given Id.Document getById(DocumentId id, boolean asReference)
Return object for the given Id.DocumentIterator getByIds(DocumentIdIterator documentIdIterator, boolean asReference)
Return the list of Document objects for the given DocumentIds as a DocumentIterator.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.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 accessDocumentId getDraftIdByPublishedId(DocumentId p_id)
Returns the DocumentId of the draft document associated with the supplied published/expired DocumentIdjava.lang.String[] getMemberNames()
Deprecated. Use the PUMA APIjava.lang.String[] getMemberNames(java.lang.String filter)
Deprecated. Use the PUMA APIjava.lang.String getPathById(DocumentId p_id, boolean p_maintainCase, boolean p_decodeURL)
Returns the path of the document with the given id.DocumentId getPublishedIdByDraftId(DocumentId p_id)
Returns the DocumentId of the published or expired document associated with the supplied draft DocumentIdReference[] getReferences(DocumentId documentId)
Returns an array of Reference instances that represent all references to the specified DocumentId.Reference[] getReferencesFrom(DocumentId documentId)
Returns an array of Reference instances that represent all references from the specified DocumentId.UserProfile getUserProfile()
Returns the UserProfile for the user of this Workspace.boolean hasAccess(DocumentId id, int securityAccessType)
Checks if the user of the Workspace has the specified access to specified document.boolean hasAccess(DocumentId id, UserProfile user, int securityAccessType)
Checks if the UserProfile has the specified access to specified document.boolean hasContributorAccess(DocumentId documentId)
Checks if user associated with the workspace has Contributor Acccess to the given DocumentIdboolean hasEditorAccess(DocumentId documentId)
Checks if user associated with the workspace has Editor Acccess to the given DocumentIdboolean hasManagerAccess(DocumentId documentId)
Checks if user associated with the workspace has Manager Acccess to the given DocumentIdboolean hasUserAccess(DocumentId documentId)
Checks if user associated with the workspace has User Acccess to the given DocumentIdboolean isDistinguishedNamesUsed()
Indicates whether this Workspace is set to use distinguished names for users Returns true if this Workspace is set to use distinguished names rather than their common names.boolean isLocked(DocumentId docId)
Indicates whether the DocumentId provided is locked or notboolean isMemberOfGroup(java.lang.String groupName)
Indicates if the user of this Workspace is a member of the group with the specified name.boolean isSystemWorkspace()
Returns true if this Workspace will act with system credentials Indicates this Workspace will perform operations with system credentials.void lock(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 levelvoid moveCategory(DocumentId categoryId, DocumentId newParentId)
Moves a category and adds it under a new parent.void moveSiteFrameworkDocument(DocumentId docId, DocumentId newParentId, DocumentId siblingId, int position)
This method moves hierarchical items (SiteArea, Content, or ContentLink to another library.void moveToLibrary(DocumentLibrary target, DocumentId docId)
This method moves non-hierarchical or root items to another library.java.lang.String[] purge(DocumentId id)
Purges an item with the given DocumentId.java.lang.String render(RenderingContext renderingContext)
Renders the content, according to the RenderingContext that is passed in.java.lang.String render(RenderingContext renderingContext, ContentComponent component)
Renders the given WCM content component using the specified rendering context.java.lang.String render(RenderingContext renderingContext, LibraryComponent component)
Renders the specified WCM LibraryComponent using the specified RenderingContext.void replaceReferences(Reference[] references, 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(Document object)
Saves an editable document to the WCM repository.void setCurrentDocumentLibrary(DocumentLibrary library)
Sets the current DocumentLibrary for this Workspace.void unlock(DocumentId docId)
Unlocks the document (draft or non-draft) provided by the DocumentId.void useDistinguishedNames(boolean distinguishedNames)
Sets the Workspace to use distinguished names users.void useLiveAccess(boolean liveAccess)
Deprecated. use useUserAccess(boolean userAccess)void useUserAccess(boolean userAccess)
Sets the Access context to use for the following methods.
Field Detail WCM_WORKSPACE_KEY
static final java.lang.String WCM_WORKSPACE_KEY
- See Also:
- Constant Field Values
WCM_RENDERINGCONTEXT_KEY
static final java.lang.String WCM_RENDERINGCONTEXT_KEY
- See Also:
- Constant Field Values
WCM_ERROR_KEY
static final java.lang.String WCM_ERROR_KEY
- See Also:
- Constant Field Values
ROLE_OWNER
static final int ROLE_OWNER
- Constant for Content Owner
- See Also:
- Constant Field Values
ROLE_AUTHOR
static final int ROLE_AUTHOR
- Constant for Content Author
- See Also:
- Constant Field Values
ROLE_APPROVER
static final int ROLE_APPROVER
- Constant for Content Approver
- See Also:
- Constant Field Values
WORKFLOWSTATUS_DRAFT
static final int WORKFLOWSTATUS_DRAFT
- workflow status for draft These constants can be bit-OR'ed together
- See Also:
- Constant Field Values
WORKFLOWSTATUS_PUBLISHED
static final int WORKFLOWSTATUS_PUBLISHED
- workflow status for published These constants can be bit-OR'ed together
- See Also:
- Constant Field Values
WORKFLOWSTATUS_EXPIRED
static final int WORKFLOWSTATUS_EXPIRED
- workflow status for expired. These constants can be bit-OR'ed together
- See Also:
- Constant Field Values
WORKFLOWSTATUS_ALL
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
static final int SECURITY_READ_ACCESS
- Deprecated. Use contributor access
- security read access
- See Also:
- Constant Field Values
SECURITY_EDIT_ACCESS
static final int SECURITY_EDIT_ACCESS
- Deprecated. Use editor access
- security edit access
- See Also:
- Constant Field Values
SECURITY_DELETE_ACCESS
static final int SECURITY_DELETE_ACCESS
- Deprecated. Use manager access
- security delete access
- See Also:
- Constant Field Values
SECURITY_USER_ACCESS
static final int SECURITY_USER_ACCESS
- security USER access
- See Also:
- Constant Field Values
SECURITY_CONTRIBUTOR_ACCESS
static final int SECURITY_CONTRIBUTOR_ACCESS
- security CONTRIBUTOR access
- See Also:
- Constant Field Values
SECURITY_EDITOR_ACCESS
static final int SECURITY_EDITOR_ACCESS
- security EDITOR access
- See Also:
- Constant Field Values
SECURITY_MANAGER_ACCESS
static final int SECURITY_MANAGER_ACCESS
- security MANAGER access
- See Also:
- Constant Field Values
SORT_KEY_CREATION_DATE
static final java.lang.String SORT_KEY_CREATION_DATE
- contentSearch method sort key for creation date
- See Also:
- Constant Field Values
SORT_KEY_PUBLISH_DATE
static final java.lang.String SORT_KEY_PUBLISH_DATE
- contentSearch method sort key for publish date
- See Also:
- Constant Field Values
SORT_KEY_EXPIRY_DATE
static final java.lang.String SORT_KEY_EXPIRY_DATE
- contentSearch method sort key for expiry date
- See Also:
- Constant Field Values
SORT_KEY_GENERAL_DATE_ONE
static final java.lang.String SORT_KEY_GENERAL_DATE_ONE
- contentSearch method sort key for general date one
- See Also:
- Constant Field Values
SORT_KEY_GENERAL_DATE_TWO
static final java.lang.String SORT_KEY_GENERAL_DATE_TWO
- contentSearch method sort key for general date two
- See Also:
- Constant Field Values
SORT_KEY_LASTMODIFIED_DATE
static final java.lang.String SORT_KEY_LASTMODIFIED_DATE
- contentSearch method sort key for last modified date
- See Also:
- Constant Field Values
SORT_KEY_NAME
static final java.lang.String SORT_KEY_NAME
- contentSearch method sort key for name
- See Also:
- Constant Field Values
SORT_KEY_TITLE
static final java.lang.String SORT_KEY_TITLE
- contentSearch method sort key for title
- See Also:
- Constant Field Values
SORT_KEY_DESCRIPTION
static final java.lang.String SORT_KEY_DESCRIPTION
- contentSearch method sort key for description
- See Also:
- Constant Field Values
SORT_KEY_NONE
static final java.lang.String SORT_KEY_NONE
- contentSearch method sort key for no sorting
- See Also:
- Constant Field Values
Method Detail createContent
Content createContent(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
Content createContent(DocumentId authoringTemplateId, DocumentId parentSiteAreaId, 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
ContentLink createContentLink(DocumentId contentId, DocumentId parentSiteAreaId, 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
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
SiteArea createSiteArea(DocumentId parentId, 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
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
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
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
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
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
createJSPComponent
LibraryJSPComponent createJSPComponent() throws DocumentCreationException, AuthorizationException
- Creates a new LibraryJSPComponent. The JSP that this library component refers to can then be set through the LibraryJSPComponent itself.
- Returns:
- the new LibraryJSPComponent object
- Throws:
- DocumentCreationException - if the object cannot be created
- AuthorizationException - if the user does not have access
createLinkComponent
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 LibraryLinkComponent object
- Throws:
- DocumentCreationException - if the object cannot be created
- AuthorizationException - if the user does not have access
createDateComponent
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
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
createRichTextComponent
LibraryRichTextComponent createRichTextComponent() throws DocumentCreationException, AuthorizationException
- Creates a new LibraryRichTextComponent. The rich text that this library component refers to can then be set through the LibraryRichTextComponent itself.
- Returns:
- the new LibraryRichTextComponent object
- Throws:
- DocumentCreationException - if the object cannot be created
- AuthorizationException - if the user does not have access
createShortTextComponent
LibraryShortTextComponent createShortTextComponent() throws DocumentCreationException, AuthorizationException
- Creates a new LibraryShortTextComponent. The Short Text that this library component refers to can then be set through the LibraryShortTextComponent itself.
- Returns:
- the new LibraryShortTextComponent object
- Throws:
- DocumentCreationException - if the object cannot be created
- AuthorizationException - if the user does not have access
createTextComponent
LibraryTextComponent createTextComponent() throws DocumentCreationException, AuthorizationException
- Creates a new LibraryTextComponent. The Text that this library component refers to can then be set through the LibraryTextComponent itself.
- Returns:
- the new LibraryTextComponent object
- Throws:
- DocumentCreationException - if the object cannot be created
- AuthorizationException - if the user does not have access
createUserSelectionComponent
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
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
java.lang.String[] save(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
java.lang.String[] delete(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
boolean exists(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
DocumentId getPublishedIdByDraftId(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
DocumentId getDraftIdByPublishedId(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
Document getById(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
Document getById(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
DocumentIterator getByIds(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
DocumentIdIterator findByType(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 visible to the current user, of the specified type
findByType
DocumentIdIterator findByType(DocumentType type, int p_workflowStatusFilter)
- Returns an iterator of IDs of all objects of the given type that match the given workflow status filter. The status workflow filter can be either publish, draft, or expired, or any combination of those. 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
- p_workflowStatusFilter - the constant to say whether to retrieve DRAFT, PUBLISHED, and/or EXPIRED
- Returns:
- an iterator of object IDs that are visible to the current user, of the specified type
findByName
DocumentIdIterator findByName(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 visible to the current user
findByName
DocumentIdIterator findByName(DocumentType type, java.lang.String name, int p_workflowStatusFilter)
- Returns an iterator of IDs of all objects of the given type with the specified name that match the given workflow status filter. The status workflow filter can be either publish, draft, or expired, or any combination of those. 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
- p_workflowStatusFilter - the constant to say whether to retrieve DRAFT, PUBLISHED, and/or EXPIRED
- Returns:
- an iterator of object IDs with the given name of the specified type that are visible to the current user
findComponentByName
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 visible to the current user
findContentModifiedSince
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 visible to the current user
findContentModifiedSince
DocumentIdIterator findContentModifiedSince(java.util.Date modifiedDate, int p_workflowStatusFilter)
- Returns an iterator of IDs of all Content that have been modified since the specified date that match the given workflow status filter. The status workflow filter can be either publish, draft, or expired, or any combination of those. 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
- p_workflowStatusFilter - the constant to say whether to retrieve DRAFT, PUBLISHED, and/or EXPIRED
- Returns:
- an iterator over objects modified since the given date that are visible to the current user
findContentModifiedBetween
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 visible to the current user
findContentModifiedBetween
DocumentIdIterator findContentModifiedBetween(java.util.Date startDate, java.util.Date endDate, int p_workflowStatusFilter)
- Returns an iterator of IDs of all Content that have been modified between the specified start and end dates that match the given workflow status filter. The status workflow filter can be either publish, draft, or expired, or any combination of those. 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
- p_workflowStatusFilter - the constant to say whether to retrieve DRAFT, PUBLISHED, and/or EXPIRED
- Returns:
- an iterator over objects modified between the given dates that are visible to the current user
findDocumentsModifiedSince
DocumentIdIterator findDocumentsModifiedSince(java.util.Date modifiedDate)
- Returns an iterator of IDs of all Documents that have been modified since the specified date. The IDs returned will include those for Documents that have been modified on the given date. If no document 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 Document last modified date
- Returns:
- an iterator over documents modified since the given date that are visible to the current user
findDocumentsModifiedBetween
DocumentIdIterator findDocumentsModifiedBetween(java.util.Date startDate, java.util.Date endDate)
- Returns an iterator of IDs of all Documents that have been modified between the specified start and end dates. The IDs returned will include those for Documents that have been modified on the specified dates. If no document 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 documents modified between the given dates that are visible to the current user
findDocumentsModifiedSince
DocumentIdIterator findDocumentsModifiedSince(java.util.Date modifiedDate, int workflowStatusFilter)
- Returns an iterator of IDs of all Documents that have been modified since the specified date. The IDs returned will include those for Documents that have been modified on the given date. If no document 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 Document last modified date
- workflowStatusFilter - the constant to say whether to retrieve DRAFT, PUBLISHED, and/or EXPIRED
- Returns:
- an iterator over documents modified since the given date that are visible to the current user
findDocumentsModifiedBetween
DocumentIdIterator findDocumentsModifiedBetween(java.util.Date startDate, java.util.Date endDate, int workflowStatusFilter)
- Returns an iterator of IDs of all Documents that have been modified between the specified start and end dates. The IDs returned will include those for Documents that have been modified on the specified dates. If no document 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
- workflowStatusFilter - the constant to say whether to retrieve DRAFT, PUBLISHED, and/or EXPIRED
- Returns:
- an iterator over documents modified between the given dates that are visible to the current user
getMemberNames
java.lang.String[] getMemberNames()
- Deprecated. Use the PUMA API
- 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
java.lang.String[] getMemberNames(java.lang.String filter)
- Deprecated. Use the PUMA API
- 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
java.lang.String getPathById(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
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
- Throws:
- java.lang.IllegalArgumentException - if p_path is null.
findContentByPath
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 visible to the current user
findContentByAuthoringTemplate
DocumentIdIterator findContentByAuthoringTemplate(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 visible to the current user
- Throws:
- IllegalDocumentTypeException - if the ID is not of type Authoring Template.
findContentByAuthoringTemplate
DocumentIdIterator findContentByAuthoringTemplate(DocumentId id, int p_workflowStatusFilter) throws IllegalDocumentTypeException
- Returns an iterator of IDs of Content which has been created using the specified authoring template that match the given workflow status filter. The status workflow filter can be either publish, draft, or expired, or any combination of those. 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
- p_workflowStatusFilter - the constant to say whether to retrieve DRAFT, PUBLISHED, and/or EXPIRED
- Returns:
- an iterator of IDs of Content based on the specified AuthoringTemplate that are visible to the current user
- Throws:
- IllegalDocumentTypeException - if the ID is not of type Authoring Template.
findContentByWorkflowStage
DocumentIdIterator findContentByWorkflowStage(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 given stage that are visible to the current user
- Throws:
- IllegalDocumentTypeException - if the ID is not of type Workflow Stage.
findDocumentsByWorkflowStage
DocumentIdIterator findDocumentsByWorkflowStage(DocumentId[] ids) throws IllegalDocumentTypeException
- Returns an iterator of all Documents in the given workflow stages.
- Parameters:
- ids - the list of IDs of the workflow stages
- Returns:
- an iterator of IDs of documents in the given stage
- Throws:
- IllegalDocumentTypeException - if incorrect document id type is passed
findDocumentsByWorkflowStage
DocumentIdIterator findDocumentsByWorkflowStage(DocumentId[] workflowStages, java.lang.String[] users, int userRoles) throws IllegalDocumentTypeException
- Find Documents 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 documents in
- users - The usernames that we want to find documents 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 Documents 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
findContentByCategory
DocumentIdIterator findContentByCategory(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 visible to the current user
- Throws:
- IllegalDocumentTypeException - if the ID is not of type Category.
findContentByCategory
DocumentIdIterator findContentByCategory(DocumentId id, int p_workflowStatusFilter) throws IllegalDocumentTypeException
- Returns an iterator of IDs of all Content that has the given Category in its profile that match the given workflow status filter. The status workflow filter can be either publish, draft, or expired, or any combination of those. 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
- p_workflowStatusFilter - the constant to say whether to retrieve DRAFT, PUBLISHED, and/or EXPIRED
- Returns:
- an iterator of IDs of Content with this category that are visible to the current user
- Throws:
- IllegalDocumentTypeException - if the ID is not of type Category.
contentSearch
DocumentIdIterator contentSearch(DocumentId templateId, DocumentId[] siteAreaIds, 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
DocumentIdIterator contentSearch(DocumentId templateId, DocumentId[] siteAreaIds, 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
contentSearch
DocumentIdIterator contentSearch(DocumentId templateId, DocumentId[] siteAreaIds, DocumentId[] categoryIds, java.lang.String[] keywords, boolean matchAllCategories, boolean includeAncestorSiteAreas, boolean includeDescendentSiteAreas, java.lang.String sortKey1, java.lang.String sortKey2, java.lang.String sortKey3, boolean sortAscending)
- Returns an iterator of IDs of objects that match the given search criteria. 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.
When searching site areas, specifying includeAncestorSiteAreas and includeDescendentSiteAreas both as false will restrict the search to only the specified site areas.
Results can be sorted by up to three keys. The fields available to sort by are:
If less than three sort keys are required, specify Workspace.SORT_KEY_NONE for those not required.
- Workspace.SORT_KEY_NAME
- Workspace.SORT_KEY_CREATION_DATE
- Workspace.SORT_KEY_PUBLISH_DATE
- Workspace.SORY_KEY_DESCRIPTION
- Workspace.SORT_KEY_EXPIRY_DATE
- Workspace.SORT_KEY_GENERAL_DATE_ONE
- Workspace.SORT_KEY_GENERAL_DATE_TWO
- Workspace.SORT_KEY_LASTMODIFIED_DATE
- Workspace.SORT_KEY_TITLE
- Workspace.SORT_KEY_NONE
The results can be sorted in ascending or descending order, according to the sortAscending parameter. The default order, as used in the other contentSearch methods, is ascending.
- 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
- matchAllCategories - indicates whether the content returned should match all categories (true) or any category (false)
- sortKey1 - Specify one of sort keys as first sort priority
- sortKey2 - Specify one of sort keys as second sort priority
- sortKey3 - Specify one of sort keys as third sort priority
- sortAscending - Specify true for ascending order and false for descending order
- Returns:
- an iterator of IDs of content that meet the search criteria
render
java.lang.String render(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
- 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
java.lang.String render(RenderingContext renderingContext, 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
- 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
java.lang.String render(RenderingContext renderingContext, 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
- 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
java.lang.String generateURL(RenderingContext context, 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
java.lang.String generateURL(RenderingContext context, 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
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
DocumentIdIterator createDocumentIdIterator(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
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
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
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
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
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
- Throws:
- IllegalDocumentTypeException
getReferences
Reference[] getReferences(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
Reference[] getReferencesFrom(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
void clearReferences(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
void replaceReferences(Reference[] references, 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
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
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
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
void setCurrentDocumentLibrary(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
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
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
void useLiveAccess(boolean liveAccess)
- Deprecated. use useUserAccess(boolean userAccess)
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
useUserAccess
void useUserAccess(boolean userAccess)
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 User or Contributor, determined by the boolean specified.
if the value is true the system will set the access context to User access
else it will use Contributor access.
Note: The Access context used in the API can be set at any time, after the creation of the workspace.
- Parameters:
- userAccess - boolean true/false to use User access/Contributor access respectively
moveToLibrary
void moveToLibrary(DocumentLibrary target, 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
void moveSiteFrameworkDocument(DocumentId docId, DocumentId newParentId, 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
void moveCategory(DocumentId categoryId, 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
Document copyToLibrary(DocumentLibrary target, 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
Document copySiteFrameworkDocument(DocumentId docId, DocumentId newParentId, 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
Document copyCategory(DocumentId categoryId, 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
void lock(DocumentId docId) throws OperationFailedException
- Locks the document (draft or non-draft) provided by the DocumentId.
- Parameters:
- docId - Document to be locked
- Throws:
- OperationFailedException
unlock
void unlock(DocumentId docId) throws OperationFailedException
- Unlocks the document (draft or non-draft) provided by the DocumentId.
- Parameters:
- docId - Document to be unlocked
- Throws:
- OperationFailedException
isLocked
boolean isLocked(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
boolean isSystemWorkspace()
- Returns true if this Workspace will act with system credentials Indicates this Workspace will perform operations with system credentials.
- Returns:
- true if this Workspace will act with system credentials, otherwise false.
createTaxonomy
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
Category createCategory(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
createPresentationTemplate
PresentationTemplate createPresentationTemplate() throws DocumentCreationException, AuthorizationException
- Creates a new PresentationTemplate.
- Returns:
- the new PresentationTemplate object
- Throws:
- DocumentCreationException - if the object cannot be created
- AuthorizationException - if the user does not have access
hasAccess
boolean hasAccess(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:
- User (Workspace.SECURITY_USER_ACCESS)
Contributor (Workspace.SECURITY_CONTRIBUTOR_ACCESS)
- Editor (Workspace.SECURITY_EDITOR_ACCESS)
- Manager (Workspace.SECURITY_MANAGER_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
boolean hasAccess(DocumentId id, UserProfile user, int securityAccessType)
- Checks if the UserProfile has the specified access to specified document.
This method supports the following access types:
- User (Workspace.SECURITY_USER_ACCESS)
Contributor (Workspace.SECURITY_CONTRIBUTOR_ACCESS)
- Editor (Workspace.SECURITY_EDITOR_ACCESS)
- Manager (Workspace.SECURITY_MANAGER_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
DocumentIdIterator findContentByWorkflowStage(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
DocumentIdIterator findContentByWorkflowStage(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 given stage
- Throws:
- IllegalDocumentTypeException
login
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.
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 appropriateNote 1: For multi-threaded applications, the login/logout will need to be done per thread.
Note 2: For long running applications, periodically re-login (before the session expires) to obtain optimum performance.
logout
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:
- login()
hasUserAccess
boolean hasUserAccess(DocumentId documentId) throws OperationFailedException
- Checks if user associated with the workspace has User Acccess to the given DocumentId
- Parameters:
- documentId - DocumentID to perform the access check for
- Returns:
- true if this user has User access, false if not
- Throws:
- OperationFailedException - if error occured when accessing repository
hasContributorAccess
boolean hasContributorAccess(DocumentId documentId) throws OperationFailedException
- Checks if user associated with the workspace has Contributor Acccess to the given DocumentId
- Parameters:
- documentId - DocumentID to perform the access check for
- Returns:
- true if this user has Contributor access, false if not
- Throws:
- OperationFailedException - if error occured when accessing repository
hasEditorAccess
boolean hasEditorAccess(DocumentId documentId) throws OperationFailedException
- Checks if user associated with the workspace has Editor Acccess to the given DocumentId
- Parameters:
- documentId - DocumentID to perform the access check for
- Returns:
- true if this user has Editor access, false if not
- Throws:
- OperationFailedException - if error occured when accessing repository
hasManagerAccess
boolean hasManagerAccess(DocumentId documentId) throws OperationFailedException
- Checks if user associated with the workspace has Manager Acccess to the given DocumentId
- Parameters:
- documentId - DocumentID to perform the access check for
- Returns:
- true if this user has Manager access, false if not
- Throws:
- OperationFailedException - if error occured when accessing repository
useDistinguishedNames
void useDistinguishedNames(boolean distinguishedNames)
- Sets the Workspace to use distinguished names users. Setting to true indicates to the Workspace that users will be passed in and returned using their distinguished names rather than their common names.
- Parameters:
- distinguishedNames - true for distinguished names, false for common names
isDistinguishedNamesUsed
boolean isDistinguishedNamesUsed()
- Indicates whether this Workspace is set to use distinguished names for users Returns true if this Workspace is set to use distinguished names rather than their common names.
- Returns:
- true if this Workspace is set to use Distinguished Names, otherwise false
findItemsDeletedBefore
DocumentIdIterator findItemsDeletedBefore(java.util.Date deletedBeforeDate, DocumentType documentType, DocumentId workflowStage)
- Returns a DocumentIdIterator of deleted documents restricted by date, document type and workflow stage.
- Parameters:
- deletedBeforeDate - limits the results to documents deleted before the given date.
A null parameter will default to the current system date and time.- workflowStage - constrains the results set to documents deleted while in the given workflow stage.
A null will default to all workflow stages.- documentType - limits the results set by document type.
A null will default to all document types.- Returns:
- DocumentIdIterator of deleted documents match specified criteria.
findItemsDeletedSince
DocumentIdIterator findItemsDeletedSince(java.util.Date deletedSinceDate, DocumentType documentType, DocumentId workflowStage)
- Returns a DocumentIdIterator of documents restricted by date, workflow stage and document type
- Parameters:
- deletedSinceDate - limits the result to documents deleted since the given date.
A null parameter will default to the current system date and time.- documentType - limits the result set by document type.
A null will default to all document types.- workflowStage - constrains the result set to documents deleted while in the given workflow stage.
A null will default to all workflow stages.- Returns:
- DocumentIdIterator of documentID matches criteria.
findItemsDeletedBetween
DocumentIdIterator findItemsDeletedBetween(java.util.Date deletedStartDate, java.util.Date deletedEndDate, DocumentType documentType, DocumentId workflowStage)
- Returns a DocumentIdIterator of documents restricted by date, workflow stage and document type
- Parameters:
- deletedStartDate - limits the result to documents deleted since the given date.
A null parameter will default to the current system date and time.- deletedEndDate - limits the result to documents deleted before the given date.
A null parameter will default to the current system date and time.- documentType - limits the result set by document type.
A null will default to all document types.- workflowStage - constrains the result set to documents deleted while in the given workflow stage.
A null will default to all workflow stages.- Returns:
- DocumentIdIterator of documentID matches criteria.
purge
java.lang.String[] purge(DocumentId id) throws DocumentPurgeException, AuthorizationException
- Purges an item with the given DocumentId.
- Parameters:
- id - document id to purge
- Returns:
- Array of error messages. If purge successful, then empty array will return.
- Throws:
- DocumentPurgeException - due to any reason item not able to deleted in repository,
such as item is referenced, item has children, item has draft copy...- AuthorizationException - in case current API user is not authorized to purge the given document
Overview Package Class Tree Deprecated Index Help PREV CLASS NEXT CLASS FRAMES NO FRAMES SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD