com.ibm.workplace.wcm.api
Interface Content

All Superinterfaces:
ContentComponentContainer, Document, Editable

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 addAdditionalViewers(java.lang.String[] additionalViewers)
          Adds names to the list of additional live viewers for this Content document.
 void addCategoryIds(com.ibm.workplace.wcm.api.DocumentId[] categoryIds)
          Add categories to this content.
 com.ibm.workplace.wcm.api.Content createDraft()
          Create draft copy of this content object.
 void decline()
          Declines this document.
 java.lang.String[] getAdditionalViewers()
          Returns an array of names of additional live viewers for this Content document.
 com.ibm.workplace.wcm.api.DocumentId getAuthoringTemplateID()
          Returns the ID of the AuthoringTemplate that was used to create this Content document.
 com.ibm.workplace.wcm.api.DocumentId[] getCategoryIds()
          Return array of IDs for the categories associated with this content.
 java.lang.String[] getCurrentApprovers()
          Returns the names of the approvers for this Content for the current workflow stage this document is in.
 com.ibm.workplace.wcm.api.DocumentId getDirectParent()
          Return the parent DocumentId of this content.
 java.util.Date getEffectiveDate()
          Returns the effective date of this Content.
 java.util.Date getExpiryDate()
          Returns the expiry date for this Content document.
 java.util.Date getGeneralDateOne()
          Return general date one for this Content document.
 java.util.Date getGeneralDateTwo()
          Return general date two for this Content document.
 java.lang.String[] getKeywords()
          Returns an array of keywords associated with this content.
 com.ibm.workplace.wcm.api.DocumentIdIterator getLinkedParents()
          Return an iterator of parent DocumentIds this content is linked to.
 com.ibm.workplace.wcm.api.DocumentIdIterator getParents()
          Returns an iterator of the parent DocumentIds of this content.
 com.ibm.workplace.wcm.api.DocumentId getWorkflowId()
          Return ID of the workflow associated with this content.
 com.ibm.workplace.wcm.api.DocumentId getWorkflowStageId()
          Returns the ID of the current WorkflowStage that this Content document is in.
 boolean hasDraft()
          Returns true if this Content has a draft document.
 boolean isDraft()
          Return true if this content object is a draft.
 boolean isExpired()
          Return true if this Content has expired.
 boolean isPublished()
          Return true if this Content document is live published content.
 void nextWorkflowStage()
          Move this Content object into the next stage in its workflow.
 void removeAdditionalViewers(java.lang.String[] additionalViewers)
          Removes names from the list of additional live viewers for this Content.
 void removeCategoryIds(com.ibm.workplace.wcm.api.DocumentId[] categoryIds)
          Remove categories from this content.
 void restartWorkflow()
          Restart the workflow on this Content object.
 void setEffectiveDate(java.util.Date effectiveDate)
          Sets the effective date of this Content document.
 void setExpiryDate(java.util.Date expiryDate)
          Sets the expiry date for this Content document.
 void setGeneralDateOne(java.util.Date generalDateOne)
          Set general date one for this Content document.
 void setGeneralDateTwo(java.util.Date generalDateTwo)
          Set general date two for this Content document.
 void setKeywords(java.lang.String[] keywords)
          Sets the keywords for this Content document.
 void setWorkflowId(com.ibm.workplace.wcm.api.DocumentId workflowId)
          Sets the Workflow on this Content given the ID of the Workflow.
 
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, addDeleteAccessMembers, addEditAccessMembers, addHistoryLogEntry, addLiveAccessMembers, addOwners, addReadAccessMembers, isChanged, removeAuthors, removeDeleteAccessMembers, removeEditAccessMembers, removeLiveAccessMembers, removeOwners, removeReadAccessMembers, setDescription, setName, setTitle
 
Methods inherited from interface com.ibm.workplace.wcm.api.Document
getAuthors, getDeleteAccessMembers, getDescription, getEditAccessMembers, getHistoryLog, getId, getLiveAccessMembers, getModifiedDate, getName, getOwnerLibrary, getOwners, getReadAccessMembers, getTitle, hasDeleteAccess, hasDeleteAccess, hasEditAccess, hasEditAccess, hasLiveAccess, hasLiveAccess, hasReadAccess, hasReadAccess
 

Method Detail

getCategoryIds

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

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

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

getWorkflowId

public com.ibm.workplace.wcm.api.DocumentId getWorkflowId()
                                                   throws AuthorizationException,
                                                          PropertyRetrievalException
Return ID of the workflow associated with this content. If the user does not have access to the Workflow, an AuthorizationException will be thrown. null will never be returned from this method.

Returns:
the ID of the Workflow for this Document
Throws:
AuthorizationException - if the user does not have the appropriate access to the workflow
PropertyRetrievalException - if this content is not workflowable or the workflow id cannot be retrieved

setWorkflowId

public void setWorkflowId(com.ibm.workplace.wcm.api.DocumentId workflowId)
                   throws OperationFailedException
Sets the Workflow on this Content given the ID of the Workflow.

Parameters:
workflowId - the ID for the required Workflow
Throws:
OperationFailedException - if this content is not workflowable or the workflow ID could not be set

getWorkflowStageId

public com.ibm.workplace.wcm.api.DocumentId getWorkflowStageId()
                                                        throws AuthorizationException,
                                                               PropertyRetrievalException
Returns the ID of the current WorkflowStage that this Content document is in. If the user does not have access to this stage, then an AuthorizationException is thrown. null is never returned.

Returns:
the ID of the current WorkflowStage of this document
Throws:
AuthorizationException - if the user does not have the appropriate access to the current workflow stage
PropertyRetrievalException - if this content is not workflowable or the workflow stage id could not be retrieved

getEffectiveDate

public java.util.Date getEffectiveDate()
                                throws PropertyRetrievalException
Returns the effective date of this Content. That is, the date this Content will become live.

Returns:
the effective date
Throws:
PropertyRetrievalException - if this content is not workflowable

setEffectiveDate

public void setEffectiveDate(java.util.Date effectiveDate)
                      throws OperationFailedException
Sets the effective date of this Content document. That is, the date the content will become live.

Parameters:
effectiveDate - the effective date
Throws:
OperationFailedException - if this content is not workflowable

getExpiryDate

public java.util.Date getExpiryDate()
                             throws PropertyRetrievalException
Returns the expiry date for this Content document. That is, the date it will expire from site.

Returns:
the expiry date
Throws:
PropertyRetrievalException - if this content is not workflowable

setExpiryDate

public void setExpiryDate(java.util.Date expiryDate)
                   throws OperationFailedException
Sets the expiry date for this Content document. That is, the date the content will expire from site.

Parameters:
expiryDate - the expiry date
Throws:
OperationFailedException - if this content is not workflowable

getGeneralDateOne

public java.util.Date getGeneralDateOne()
                                 throws PropertyRetrievalException
Return general date one for this Content document. That is, the date that the user has specified.

Returns:
General date one
Throws:
PropertyRetrievalException - if this content is not workflowable

setGeneralDateOne

public void setGeneralDateOne(java.util.Date generalDateOne)
                       throws OperationFailedException
Set general date one for this Content document. That is, the date that the user has specified.

Parameters:
generalDateOne - the general date one
Throws:
OperationFailedException - if this content is not workflowable

getGeneralDateTwo

public java.util.Date getGeneralDateTwo()
                                 throws PropertyRetrievalException
Return general date two for this Content document. That is, the date that the user has specified.

Returns:
General date Two
Throws:
PropertyRetrievalException - if this content is not workflowable

setGeneralDateTwo

public void setGeneralDateTwo(java.util.Date generalDateTwo)
                       throws OperationFailedException
Set general date two for this Content document. That is, the date that the user has specified.

Parameters:
generalDateTwo - the general date two
Throws:
OperationFailedException - if this content is not workflowable

getAdditionalViewers

public java.lang.String[] getAdditionalViewers()
                                        throws PropertyRetrievalException
Returns an array of names of additional live viewers for this Content document.

Returns:
an array of names of users or groups listed as additional viewers
Throws:
PropertyRetrievalException - if this content is not workflowable

addAdditionalViewers

public void addAdditionalViewers(java.lang.String[] additionalViewers)
                          throws OperationFailedException
Adds names to the list of additional live viewers for this Content document. Duplicate names are removed.

Parameters:
additionalViewers - the array of additional viewer names to add
Throws:
OperationFailedException - if this content is not workflowable

removeAdditionalViewers

public void removeAdditionalViewers(java.lang.String[] additionalViewers)
                             throws OperationFailedException
Removes names from the list of additional live viewers for this Content. All names in the specified array will be removed.

Parameters:
additionalViewers - the array of additional viewer names to remove
Throws:
OperationFailedException - if this content is not workflowable

getCurrentApprovers

public java.lang.String[] getCurrentApprovers()
                                       throws PropertyRetrievalException
Returns the names of the approvers for this Content for the current workflow stage this document is in.

Returns:
an array of names of users that are approvers for this Content in its current workflow stage
Throws:
PropertyRetrievalException - if this content is not workflowable, or the current stage is not accessible by this user

createDraft

public com.ibm.workplace.wcm.api.Content createDraft()
                                              throws AuthorizationException,
                                                     OperationFailedException
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 occured while creating the draft

hasDraft

public boolean hasDraft()
                 throws PropertyRetrievalException
Returns true if this Content has a draft document.

Returns:
true if this Content has a draft document, false otherwise.
Throws:
PropertyRetrievalException - if this content is not workflowable

restartWorkflow

public void restartWorkflow()
                     throws AuthorizationException,
                            OperationFailedException
Restart the workflow on this Content object. This returns the document to the first stage in its workflow.

Throws:
AuthorizationException - if the user does not have the appropriate access permission
OperationFailedException - if this content is not workflowable or an error while restarting the workflow

getAuthoringTemplateID

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

nextWorkflowStage

public void nextWorkflowStage()
                       throws AuthorizationException,
                              OperationFailedException,
                              NoMoreWorkflowStagesException
Move this Content object into the next stage in its workflow.

Throws:
AuthorizationException - if the user does not have the appropriate access permission to the workflow
OperationFailedException - if this content is not workflowable or the content could not be moved to the next workflow stage
NoMoreWorkflowStagesException - if the content is already in the last workflow stage

isDraft

public boolean isDraft()
                throws PropertyRetrievalException
Return true if this content object is a draft.

Returns:
true if it is a draft
Throws:
PropertyRetrievalException - if this content is not workflowable

isPublished

public boolean isPublished()
                    throws PropertyRetrievalException
Return true if this Content document is live published content.

Returns:
true if this content is published
Throws:
PropertyRetrievalException - if this content is not workflowable

isExpired

public boolean isExpired()
                  throws PropertyRetrievalException
Return true if this Content has expired. That is, if the expiry date has been reached.

Returns:
true if the content has expired
Throws:
PropertyRetrievalException - if this content is not workflowable

getKeywords

public 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

public 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

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

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

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

decline

public void decline()
             throws AuthorizationException,
                    OperationFailedException
Declines this document. This returns it to the first stage in the workflow.

Throws:
AuthorizationException - if the user does not have the appropriate access permission to the workflow
OperationFailedException - if this content is not workflowable or the content could not be moved to the initial workflow stage