+

Search Tips   |   Advanced Search


com.ibm.workplace.wcm.api
Interface Content

All Superinterfaces:
ContentComponentContainer, Document, Editable, WorkflowedDocument

public interface Content
extends ContentComponentContainer

A Content object represents a Content item in the WCM repository. Each Content object is based on an AuthoringTemplate, which defines its base properties and attributes (such as Workflow, security etc.)

Content objects can be created and saved through the API, and existing ones can be retrieved to be edited and saved. However, since Content objects are based on an AuthoringTemplate and these cannot be created through the API, templates must already exist in the WCM system where the Content object is to be created.

Content objects can contain components that are defined in the AuthoringTemplate which do not exist in the component library (ie. they exist only on the Content item itself). These components are referred to as 'content components'. New content components cannot be added to a Content object through the API - only ones that are defined on the template may be manipulated. The Content interface also provides methods to access the item's workflow properties. This includes moving the item to the next stage in the workflow, creating a draft, checking its published/expired status etc.


Method Summary
 void addCategoryIds(DocumentId[] categoryIds)
          Add categories to this content.
 Content cancelDraft()
          Deprecated. use cancelDraftDocument() instead.
 Content createDraft()
          Deprecated. use createDraftDocument() instead.
 DocumentId getAuthoringTemplateID()
          Returns the ID of the AuthoringTemplate that was used to create this Content document.
 DocumentId[] getCategoryIds()
          Return array of IDs for the categories associated with this content.
 DocumentId getDirectParent()
          Return the parent DocumentId of this content.
 java.lang.String[] getKeywords()
          Returns an array of keywords associated with this content.
 DocumentIdIterator getLinkedParents()
          Return an iterator of parent DocumentIds this content is linked to.
 DocumentIdIterator getParents()
          Returns an iterator of the parent DocumentIds of this content.
 void removeCategoryIds(DocumentId[] categoryIds)
          Remove categories from this content.
 void setAuthoringTemplateID(DocumentId authoringTemplateID)
          Sets the authoring template associated with this content
 void setKeywords(java.lang.String[] keywords)
          Sets the keywords for this Content document.
 
Methods inherited from interface com.ibm.workplace.wcm.api.ContentComponentContainer
addComponent, componentIterator, createComponent, getComponent, getComponentByReference, getComponentNames, hasComponent, removeComponent, setComponent
 
Methods inherited from interface com.ibm.workplace.wcm.api.Editable
addAuthors, addContributorAccessMembers, addDeleteAccessMembers, addEditAccessMembers, addEditorAccessMembers, addHistoryLogEntry, addLiveAccessMembers, addManagerAccessMembers, addOwners, addReadAccessMembers, addUserAccessMembers, isChanged, removeAuthors, removeContributorAccessMembers, removeDeleteAccessMembers, removeEditAccessMembers, removeEditorAccessMembers, removeLiveAccessMembers, removeManagerAccessMembers, removeOwners, removeReadAccessMembers, removeUserAccessMembers, setContributorAccessInheritance, setDescription, setEditorAccessInheritance, setManagerAccessInheritance, setName, setTitle, setUserAccessInheritance
 
Methods inherited from interface com.ibm.workplace.wcm.api.Document
getAuthors, getContributorAccessMembers, getCreationDate, getDeleteAccessMembers, getDescription, getEditAccessMembers, getEditorAccessMembers, getHistoryLog, getId, getInheritedContributorAccessMembers, getInheritedEditorAccessMembers, getInheritedManagerAccessMembers, getInheritedUserAccessMembers, getLiveAccessMembers, getManagerAccessMembers, getModifiedDate, getName, getOwnerLibrary, getOwners, getReadAccessMembers, getSourceWorkspace, getTitle, getUserAccessMembers, hasDeleteAccess, hasDeleteAccess, hasEditAccess, hasEditAccess, hasLiveAccess, hasLiveAccess, hasReadAccess, hasReadAccess, isContributorAccessInherited, isEditorAccessInherited, isManagerAccessInherited, isUserAccessInherited, isWorkflowed
 
Methods inherited from interface com.ibm.workplace.wcm.api.WorkflowedDocument
addAdditionalViewers, addApprovers, cancelDraftDocument, createDraftDocument, decline, getAdditionalViewers, getCurrentApprovers, getEffectiveDate, getExpiryDate, getGeneralDateOne, getGeneralDateTwo, getWorkflowId, getWorkflowStageId, hasApproverAccess, hasApproverAccess, hasDraft, isDraft, isExpired, isPublished, nextWorkflowStage, nextWorkflowStage, removeAdditionalViewers, removeApprovers, restartWorkflow, setEffectiveDate, setExpiryDate, setGeneralDateOne, setGeneralDateTwo, setWorkflowId, setWorkflowId
 

Method Detail

getCategoryIds

DocumentId[] getCategoryIds()
Return array of IDs for the categories associated with this content. Only the categories that can be seen by this user will be returned. Returns an empty array if categories have not been set.

Returns:
array of category Ids

addCategoryIds

 void addCategoryIds(DocumentId[] categoryIds)
Add categories to this content. N.B If this Content is not configured to be profiled, then no categories are added.

Parameters:
categoryIds - the array of category IDs to add

removeCategoryIds

 void removeCategoryIds(DocumentId[] categoryIds)
Remove categories from this content. No categories are removed if this content does not have a profile.

Parameters:
categoryIds - the array of category IDs to remove

getAuthoringTemplateID

DocumentId getAuthoringTemplateID()
                                  throws AuthorizationException,
                                         PropertyRetrievalException
Returns the ID of the AuthoringTemplate that was used to create this Content document.

Returns:
the ID of the AuthoringTemplate
Throws:
AuthorizationException - if the user does not have access to the template
PropertyRetrievalException - if an error occurred while retrieving the template

setAuthoringTemplateID

 void setAuthoringTemplateID(DocumentId authoringTemplateID)
                            throws IllegalDocumentTypeException
Sets the authoring template associated with this content

Note: This method updates the authoring template reference only and does not change the elements on the content to match the authoring template, this must be done manually via the add/update/remove component methods.

Parameters:
authoringTemplateID - The ID of the authoring template to associate with this content. Can not be null.
Throws:
IllegalDocumentTypeException - If the supplied ID is not to an authoring template

getKeywords

 java.lang.String[] getKeywords()
Returns an array of keywords associated with this content. Returns an empty array if no keywords have been set.

Returns:
the keywords for this content

setKeywords

 void setKeywords(java.lang.String[] keywords)
Sets the keywords for this Content document. Duplicate keywords will be removed. Keywords will not be added if this content does not have a profile.

Parameters:
keywords - the array of keywords

getParents

DocumentIdIterator getParents()
Returns an iterator of the parent DocumentIds of this content. The parent of a content is the site area it belongs to. If this content is linked to additional site areas, the links are listed after the direct parent.

This method will only return DocumentIds of parents the user has access to.

Returns:
an iterator of the parent DocumentId of this content

getDirectParent

DocumentId getDirectParent()
Return the parent DocumentId of this content. The parent of a content is the site area it belongs to.

Returns:
the ID of the parent SiteArea of this content

getLinkedParents

DocumentIdIterator getLinkedParents()
                                    throws DocumentRetrievalException
Return an iterator of parent DocumentIds this content is linked to.

Returns:
an iterator of the parent DocumentId this content is linked to.
Throws:
DocumentRetrievalException - if there was a problem retrieving the linked parents.

createDraft

Content createDraft()
                    throws AuthorizationException,
                           OperationFailedException
Deprecated. use createDraftDocument() instead.

Create draft copy of this content object.

NOTE: Creating a draft saves the original, so any changes already made to the original before a draft is created will be seen in both documents.

NOTE: You do not need to save the new draft after it is created, unless you have made changes to the draft document after creating the draft.

Returns:
the draft content copy
Throws:
AuthorizationException - if the user does not have the appropriate access permission
OperationFailedException - if this content is not workflowable or an error occurred while creating the draft

cancelDraft

Content cancelDraft()
                    throws AuthorizationException,
                           OperationFailedException
Deprecated. use cancelDraftDocument() instead.

Cancels a draft document, if it exists.

NOTE: This method may be performed on either the draft or the published content.

Returns:
The associated published document. If there is no draft to cancel, this will return null.
Throws:
AuthorizationException - if the user does not have the appropriate access permission
OperationFailedException - if this content is not workflowable or an error occurred while cancelling the draft