com.ibm.workplace.wcm.api
Interface WorkflowedDocument

All Known Subinterfaces:
Category, Content, ContentComponentContainer, EditableLibraryComponent, LibraryDateComponent, LibraryDocumentManagerComponent, LibraryFileComponent, LibraryHTMLComponent, LibraryImageComponent, LibraryLinkComponent, LibraryNumericComponent, LibraryRichTextComponent, LibraryShortTextComponent, LibraryStyleSheetComponent, LibraryTextComponent, LibraryUserSelectionComponent, PresentationTemplate, Site, SiteArea, SiteFrameworkContainer, Taxonomy

public interface WorkflowedDocument

WorkflowedDocument Interface Represents a WCM API object that supports workflow methods WorkflowedDocument description


Method Summary
 void addAdditionalViewers(java.lang.String[] additionalViewers)
          Adds names to the list of additional live viewers for this Content document.
 void addApprovers(java.lang.String[] approvers)
          Adds each approver specified in the string array argument to the approvers of this Content object.
 Document cancelDraftDocument()
          Cancels a draft document, if it exists.
 Document createDraftDocument()
          Create draft copy of this WorkflowedDocument object.
 void decline()
          Declines this document.
 java.lang.String[] getAdditionalViewers()
          Returns an array of names of additional live viewers for this Content document.
 java.lang.String[] getCurrentApprovers()
          Returns a string array of members who have Approver access to this Content object.
 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.
 DocumentId getWorkflowId()
          Return ID of the workflow associated with this content.
 DocumentId getWorkflowStageId()
          Returns the ID of the current WorkflowStage that this Content document is in.
 boolean hasApproverAccess()
          Checks if the user of the Workspace associated with the current Document has Approver access to this Content.
 boolean hasApproverAccess(UserProfile user)
          Checks if the UserProfile has Approver access to this Content.
 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 removeApprovers(java.lang.String[] approvers)
          Removes each approver specified in the string array argument from the approvers of this Content object.
 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 setWorkflowId(DocumentId workflowId)
          Sets the Workflow on this Content given the ID of the Workflow.
 

Method Detail

getWorkflowId

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

void setWorkflowId(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

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

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

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

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

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

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

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

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

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

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

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

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

java.lang.String[] getCurrentApprovers()
                                       throws PropertyRetrievalException
Returns a string array of members who have Approver access to this Content object. The strings are either the users' common name or distinguished name, depending on the setting on the Workspace. See Workspace.isDistinguishedNamesUsed().

The resultant array may contain the names of users and groups.

Returns an empty array if this Content object does not have Approver access specified.

Returns:
a string array of members that have Approver access to this Content object.
Throws:
PropertyRetrievalException - if this content is not workflowable, or the current stage is not accessible by this user

hasApproverAccess

boolean hasApproverAccess(UserProfile user)
                          throws OperationFailedException
Checks if the UserProfile has Approver access to this Content.

Parameters:
user - the UserProfile to perform the access check for
Returns:
true if this user has Approver access, false if not
Throws:
OperationFailedException - if error occured when accessing repository

hasApproverAccess

boolean hasApproverAccess()
                          throws OperationFailedException
Checks if the user of the Workspace associated with the current Document has Approver access to this Content.

Returns:
true if this user has Approver access, false if not
Throws:
OperationFailedException - if error occured when accessing repository

addApprovers

void addApprovers(java.lang.String[] approvers)
Adds each approver specified in the string array argument to the approvers of this Content object.

An approver is only added if the element in the string array argument can be converted to a valid member.

Note: Each approver of this Content object must be unique. I.e. Duplicates are removed.

Parameters:
approvers - the approvers to add

removeApprovers

void removeApprovers(java.lang.String[] approvers)
Removes each approver specified in the string array argument from the approvers of this Content object.

An approver is only removed if the element in the string array argument can be converted to a valid member and already an approver on this Content object.

Parameters:
approvers - the approvers names to remove

hasDraft

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

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

nextWorkflowStage

void nextWorkflowStage()
                       throws AuthorizationException,
                              OperationFailedException,
                              NoMoreWorkflowStagesException
Move this Content object into the next stage in its workflow. When an approver calls this method, the content will immediately progress to the next workflow stage regardless of whether joint approval has been configured.

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

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

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

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

decline

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

createDraftDocument

Document createDraftDocument()
                             throws AuthorizationException,
                                    OperationFailedException
Create draft copy of this WorkflowedDocument 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 WorkflowedDocuments.

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

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

cancelDraftDocument

Document cancelDraftDocument()
                             throws AuthorizationException,
                                    OperationFailedException
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