|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Project
This class represents Project
object
Nested Class Summary | |
---|---|
static class |
Project.ApprovalMode
The list of valid project approval modes |
static class |
Project.CommentMode
The list of valid project comment modes |
static class |
Project.PublishOptions
The list of valid project publish options |
Method Summary | |
---|---|
void |
addApprovers(java.lang.String... approverNames)
Add the given names as approvers on this object. |
void |
approve()
Approves the project. |
void |
approve(java.lang.String comment)
Approves the current project with a valid comment. |
boolean |
canPublish()
Checks if the project is in a State that allows publishing. |
void |
clearApprovers()
A convenient method to remove all approvers from the object. |
void |
clearWorkflowActionsForState(ProjectStateSelectors.State state)
A convenient method to clear all WorkflowAction s currently associated with the given State . |
void |
decline()
Declines this project. |
void |
decline(java.lang.String comment)
Declines the current project with a valid comment. |
Project.ApprovalMode |
getApprovalMode()
Get the ApprovalMode set on this object. |
Project.CommentMode |
getCommentMode()
Gets the CommentMode of this project. |
java.lang.String[] |
getCurrentApprovers()
Returns a string array of members who have Approver access to this object. |
long |
getItemCount()
Obtain the number of items on this project |
DocumentIdIterator |
getItemIds()
Get items on this project. |
DocumentIdIterator |
getItemIdsByWorkflowStatus(WorkflowSelectors.Status workflowStatus)
Obtained items with the specified workflow status on this project |
ResultIterator<Document> |
getItems()
Get items on this project. |
ResultIterator<Document> |
getItems(boolean asReference,
boolean loadElements)
Get items on this project. |
ResultIterator<Document> |
getItemsByWorkflowStatus(WorkflowSelectors.Status workflowStatus)
Obtained items with the specified workflow status on this project. |
ResultIterator<Document> |
getItemsByWorkflowStatus(WorkflowSelectors.Status workflowStatus,
boolean asReference,
boolean loadElements)
Obtained items with the specified workflow status on this project |
java.util.Locale |
getLocale()
Gets the Locale of this project. |
java.lang.String[] |
getOutstandingApprovers()
Returns a string array of members who have Approver access to this Project object but have yet to approve it. |
long |
getPublishDate()
Gets the date used by the 'Date' publish option |
Project.PublishOptions |
getPublishOption()
Gets the current project publish option |
ProjectStateSelectors.State |
getState()
Gets the State of this project. |
DocumentId[] |
getWorkflowActionsForState(ProjectStateSelectors.State state)
Get the list of WorkflowAction s associated with the given project State . |
boolean |
hasApproverAccess()
Checks if the user of the Workspace associated with the current project has
Approver access to this project. |
boolean |
hasApproverAccess(UserProfile user)
Checks if the UserProfile has Approver access to this project. |
void |
publish()
Publish this project. |
void |
publish(java.lang.String comment)
Publish this project with a valid comment. |
void |
removeApprovers(java.lang.String... approvers)
Removes the given approvers from the approver list for this object. |
void |
setApprovalMode(Project.ApprovalMode approvalMode)
Set the ApprovalMode on this object. |
void |
setCommentMode(Project.CommentMode commentMode)
Sets the CommentMode for this project. |
void |
setLocale(java.util.Locale locale)
Sets the Locale of this project object. |
void |
setPublishDate(long publishDate)
Sets the date used by the 'Date' publish option |
void |
setPublishOption(Project.PublishOptions publishOption)
Sets the publish option on this project |
void |
setWorkflowActionsForState(ProjectStateSelectors.State state,
DocumentId... workflowActionDocumentIds)
Set the given WorkflowAction s for the specified State of this Project . |
void |
submitForReview()
Submits this project for review. |
void |
submitForReview(java.lang.String comment)
Submits this project for review with a valid comment. |
void |
withdrawApproval()
Withdraws the approval of the current user from the project. |
void |
withdrawFromReview()
Withdraws this project from the ProjectStateSelectors.State.REVIEW state. |
void |
withdrawFromReview(java.lang.String comment)
Withdraws this project from the ProjectStateSelectors.State.REVIEW state with a valid comment. |
Methods inherited from interface com.ibm.workplace.wcm.api.Item |
---|
getCreationDate, getDescription, getIdentity, getModifiedDate, getName, getTitle |
Methods inherited from interface com.ibm.portal.Localized |
---|
getLocales |
Methods inherited from interface com.ibm.workplace.wcm.api.EditableItem |
---|
setDescription, setName, setTitle |
Method Detail |
---|
boolean canPublish()
true
if the project is in a valid state to publish , false
otherwise.void publish() throws com.ibm.workplace.wcm.api.exceptions.ProjectException
Document
s on this project have to be moved
into pending published status by EditableWorkflowDocument
.nextWorkflowStage().
Project is allowed to publish if:
ProjectStateSelectors.State#PENDING
or ProjectStateSelectors.State#PUBLISHED_FAILED
state ProjectStateSelectors.State#PUBLISHED_FAILED
state.
com.ibm.workplace.wcm.api.exceptions.ProjectException
- Generic issue with publishing the project
ProjectInvalidStateException
- If the project is not in a valid state to publish. Check if valid by calling canPublish()
void publish(java.lang.String comment) throws java.lang.IllegalArgumentException, com.ibm.workplace.wcm.api.exceptions.ProjectException
ProjectStateSelectors.State#PENDING
or ProjectStateSelectors.State#PUBLISHED_FAILED
state Note: if no comment is required in publishing this project
then the no-arg version publish()
should instead be used.
comment
- additional comment for project publisher.
java.lang.IllegalArgumentException
- if the comment is null or empty or consists of only whitespaces.
com.ibm.workplace.wcm.api.exceptions.ProjectException
- Generic issue with publishing the project
ProjectInvalidStateException
- If the project is not in a valid state to publish. Check if valid by calling canPublish()
ResultIterator<Document> getItems()
The returned Document
(s) are cloned and elements pre-loaded
Document
(s) on this projectResultIterator<Document> getItems(boolean asReference, boolean loadElements)
asReference
- when true this will not clone the internal Document
.loadElements
- when true any elements on the Document
will be auto-loaded.
Non-loaded elements are still accessible, but its faster to auto-load (the default) if the elements will be used.
Document(s) on this project
DocumentIdIterator getItemIds()
DocumentId(s) on this project
ResultIterator<Document> getItemsByWorkflowStatus(WorkflowSelectors.Status workflowStatus) throws com.ibm.workplace.wcm.api.exceptions.QueryServiceException
An item being marked for deletion has DRAFT
as its workflow status,
and DELETED as its pending state. Therefore it will be included as a result of this method
for only DRAFT
status.
The returned Document
(s) are cloned and elements pre-loaded
workflowStatus
- Workflow status defined by com.ibm.workplace.wcm.api.query.WorkflowSelectors.Status.
com.ibm.workplace.wcm.api.exceptions.QueryServiceException
- if exception occurs during internal querying process.ResultIterator<Document> getItemsByWorkflowStatus(WorkflowSelectors.Status workflowStatus, boolean asReference, boolean loadElements) throws com.ibm.workplace.wcm.api.exceptions.QueryServiceException
An item being marked for deletion has DRAFT
as its workflow status,
and DELETED as its pending state. Therefore it will be included as a result of this method
for only DRAFT
status.
workflowStatus
- Workflow status defined by com.ibm.workplace.wcm.api.query.WorkflowSelectors.Status.asReference
- when true this will not clone the internal Document
.loadElements
- when true any elements on the Document
will be auto-loaded. Non-loaded elements are still accessible, but its faster
to auto-load (the default) if the elements will be used.
com.ibm.workplace.wcm.api.exceptions.QueryServiceException
- if exception occurs during internal querying process.DocumentIdIterator getItemIdsByWorkflowStatus(WorkflowSelectors.Status workflowStatus) throws com.ibm.workplace.wcm.api.exceptions.QueryServiceException
An item being marked for deletion has DRAFT
as its workflow status,
and DELETED as its pending state. Therefore it will be included as a result of this method
for only DRAFT
status.
workflowStatus
- Workflow status defined by com.ibm.workplace.wcm.api.query.WorkflowSelectors.Status.
com.ibm.workplace.wcm.api.exceptions.QueryServiceException
- if exception occurs during internal querying process.long getItemCount()
Project.PublishOptions getPublishOption()
void setPublishOption(Project.PublishOptions publishOption) throws com.ibm.workplace.wcm.api.exceptions.ProjectException
publishOption
- the publish option to set
com.ibm.workplace.wcm.api.exceptions.ProjectException
- if the specified publish option can not be set.long getPublishDate()
void setPublishDate(long publishDate) throws com.ibm.workplace.wcm.api.exceptions.ProjectException
publishDate
- the date used by the 'Date' publish option
com.ibm.workplace.wcm.api.exceptions.ProjectException
- if the specified publish date can not be set.java.util.Locale getLocale()
Locale
of this project.
The meta data of this project should be populated with values in the given Locale
.
Locale
of the project.void setLocale(java.util.Locale locale)
Locale
of this project object. The Locale
specified should be representative of the meta data set on this project.
locale
- the Locale
to set on this projectProjectStateSelectors.State getState()
State
of this project.
State
of the projectvoid setWorkflowActionsForState(ProjectStateSelectors.State state, DocumentId... workflowActionDocumentIds)
WorkflowAction
s for the specified State
of this Project
.
This list will override any existing actions associated with the defined State
.
The given WorkflowAction
s will be added and executed in the defined order.
Duplicate WorkflowAction
s will be ignored.
state
- the non-null project State
to set the WorkflowAction
on.
All project State
s except ACTIVE
support WorkflowAction
.workflowActionDocumentIds
- a non-null, non-empty list of DocumentId
whose type must be assignable to that of a WorkflowAction
.
java.lang.IllegalArgumentException
- if the specified state is null or does not support WorkflowAction
.
or the DocumentId
array is null or empty,
or if no WorkflowAction
object exists for a given DocumentId
.
java.lang.IllegalStateException
- if the project's current State
is not ACTIVE
.void clearWorkflowActionsForState(ProjectStateSelectors.State state)
WorkflowAction
s currently associated with the given State
.
state
- the project State
to clear all the associated WorkflowAction
for.
java.lang.IllegalArgumentException
- if the specified state is null.
java.lang.IllegalStateException
- if the project's current State
is not ACTIVE
.DocumentId[] getWorkflowActionsForState(ProjectStateSelectors.State state)
WorkflowAction
s associated with the given project State
.
If the given project State
has no WorkflowAction
associated with it
then an empty array will be returned.
state
- the non-null project state to query associated WorkflowAction
s for.
WorkflowAction
s, defined on the given project State
,
or an empty array is there is none.void addApprovers(java.lang.String... approverNames)
approverNames
- the names of users and/or groups to be set as approvers on this object.
These names are either the common names or distinguished names,
depending on the setting on the Workspace. See Workspace.isDistinguishedNamesUsed()
.
java.lang.IllegalStateException
- if the project's current state is not ACTIVE
.void removeApprovers(java.lang.String... approvers)
An approver is only removed if it can be converted to a valid member and is already in the list of approvers for this object.
Note: Each approver is either a user's common name or distinguished name
depending on the setting on the Workspace
. See Workspace.isDistinguishedNamesUsed()
.
approvers
- the approvers names to remove from this object.
java.lang.IllegalStateException
- if the project's current state is not ACTIVE
.void clearApprovers()
removeApprovers(String...)
java.lang.IllegalStateException
- if the project's current state is not ACTIVE
.java.lang.String[] getCurrentApprovers() throws com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException
Workspace.isDistinguishedNamesUsed()
.
The resultant array may contain the names of users and groups.
Returns an empty array if this object does not have Approver access specified.
com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException
- if this document is not workflowable,
or the current stage is not accessible by this userjava.lang.String[] getOutstandingApprovers()
Project
object but have yet to approve it.
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 Project
object does
not have any outstanding approvers.
boolean hasApproverAccess(UserProfile user) throws WorkflowException
UserProfile
has Approver access to this project.
user
- the UserProfile
to perform the access check for.
WorkflowException
- if error occurs when accessing repository.boolean hasApproverAccess() throws WorkflowException
Workspace
associated with the current project has
Approver access to this project.
WorkflowException
- if error occurs when accessing repositoryvoid setCommentMode(Project.CommentMode commentMode)
CommentMode
for this project.
commentMode
- the CommentMode
to be set on this project.
java.lang.IllegalStateException
- if the project's current state is not ProjectStateSelectors.State.ACTIVE
.
java.lang.IllegalArgumentException
- if the given CommentMode
is null.Project.CommentMode getCommentMode()
CommentMode
of this project.
CommentMode
.void setApprovalMode(Project.ApprovalMode approvalMode)
ApprovalMode
on this object.
approvalMode
- the ApprovalMode
to be set.
java.lang.IllegalArgumentException
- if the argument is null.
java.lang.IllegalStateException
- if invoked on a Project
and the project's current state is not ACTIVE
.Project.ApprovalMode getApprovalMode()
ApprovalMode
set on this object.
ApprovalMode
void submitForReview() throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException, WorkflowException
Required access level: minimum Editor access to the project.
Precondition:
1. The project needs to be in ProjectStateSelectors.State.ACTIVE
.
2. The project must have at least one defined Approver.
Post-condition:
Project will be in ProjectStateSelectors.State.REVIEW
state.
com.ibm.workplace.wcm.api.exceptions.AuthorizationException
- if required access level is not met.
java.lang.IllegalStateException
- if the project's current state is not ProjectStateSelectors.State.ACTIVE
.
WorkflowException
- if the project can not be put in ProjectStateSelectors.State.REVIEW
state.void submitForReview(java.lang.String comment) throws java.lang.IllegalArgumentException, com.ibm.workplace.wcm.api.exceptions.AuthorizationException, WorkflowException
Required access level: minimum Editor access to the project.
Precondition:
1. The project needs to be in ProjectStateSelectors.State.ACTIVE
.
2. The project must have at least one defined Approver.
Post-condition:
Project will be in ProjectStateSelectors.State.REVIEW
state.
Note: if no comment is required in submitting this project for review
then the no-arg version submitForReview()
} should instead be used.
comment
- additional comment for project reviewer.
java.lang.IllegalArgumentException
- if the comment is null or empty or consists of only whitespaces.
com.ibm.workplace.wcm.api.exceptions.AuthorizationException
- if required access level is not met.
java.lang.IllegalStateException
- if the project's current state is not ProjectStateSelectors.State.ACTIVE
.
WorkflowException
- if the project can not be put in ProjectStateSelectors.State.REVIEW
state.Project#submitForReview()}
void withdrawFromReview() throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException, WorkflowException
ProjectStateSelectors.State.REVIEW
state.
This will put the project back into the ProjectStateSelectors.State.ACTIVE
state.
Required access level: minimum Editor access to the project.
Precondition:
1. The project needs to be in ProjectStateSelectors.State.REVIEW
.
Post-condition:
1. Project will be in ProjectStateSelectors.State.ACTIVE
state.
2. Existing approvals will be cleared.
com.ibm.workplace.wcm.api.exceptions.AuthorizationException
- if required access level is not met.
java.lang.IllegalStateException
- if the project's current state is not ProjectStateSelectors.State.REVIEW
.
WorkflowException
- if the project can not be put in ProjectStateSelectors.State.ACTIVE
state.void withdrawFromReview(java.lang.String comment) throws java.lang.IllegalArgumentException, com.ibm.workplace.wcm.api.exceptions.AuthorizationException, WorkflowException
ProjectStateSelectors.State.REVIEW
state with a valid comment.
This will put the project back into the ProjectStateSelectors.State.ACTIVE
state.
A valid comment in this context is any non-null, non-empty string which does not consist of only whitespaces.
Required access level: minimum Editor access to the project.
Precondition:
1. The project needs to be in ProjectStateSelectors.State.REVIEW
.
Post-condition:
1. Project will be in ProjectStateSelectors.State.ACTIVE
state.
2. Existing approvals will be cleared.
Note: if no comment is required in withdrawing this project from review
then the no-arg version withdrawFromReview()
} should instead be used.
comment
- additional comment for project reviewer.
java.lang.IllegalArgumentException
- if the comment is null or empty or consists of only whitespaces.
com.ibm.workplace.wcm.api.exceptions.AuthorizationException
- if required access level is not met.
java.lang.IllegalStateException
- if the project's current state is not ProjectStateSelectors.State.REVIEW
.
WorkflowException
- if the project can not be put in ProjectStateSelectors.State.ACTIVE
state.void approve() throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException, WorkflowException
Required access level: Approver access to the project.
Precondition:
1. The project needs to be in ProjectStateSelectors.State.REVIEW
.
Post-condition:
1. If project's ApprovalMode
is ApprovalMode.REQUIRE_SINGLE_APPROVAL
then the project will be in PENDING state.
2. Else if project's ApprovalMode
is ApprovalMode.REQUIRE_ALL_APPROVALS
AND user is the last outstanding approver then project will be in PENDING state.
3. Else, project will remain in the current REVIEWstate until the last outstanding approver approves it.
com.ibm.workplace.wcm.api.exceptions.AuthorizationException
- if required access level is not met.
java.lang.IllegalStateException
- if the project's current state is not ProjectStateSelectors.State.REVIEW
.
WorkflowException
- if the post conditions can not be achieved.void approve(java.lang.String comment) throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException, WorkflowException
CommentMode
.
Note: if no comment is required in approving this project
then the no-arg version approve()
} should instead be used.
comment
- a valid comment to be used for this approval.
java.lang.IllegalArgumentException
- if the comment is null or empty or consists of only whitespaces.
com.ibm.workplace.wcm.api.exceptions.AuthorizationException
- if user does not have Approver access to this project.
java.lang.IllegalStateException
- if the project's current state is not ProjectStateSelectors.State.REVIEW
.
WorkflowException
- if the post conditions for the approval can not be achieved.Project#approve()}}
void withdrawApproval() throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException, WorkflowException
Required access level: Approver access to the project.
Precondition:
1. The project needs to be in ProjectStateSelectors.State.REVIEW
.
Post-condition:
1. Project will stay in ProjectStateSelectors.State.REVIEW
state.
2. User's approval on the project will be removed from the list of received approvals.
com.ibm.workplace.wcm.api.exceptions.AuthorizationException
- if required access level is not met
java.lang.IllegalStateException
- if the project's current state is not ProjectStateSelectors.State.REVIEW
.
WorkflowException
- if the post conditions can not be achieved.void decline() throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException, WorkflowException
Required access level: Approver access to the project.
Precondition:
1. The project needs to be in ProjectStateSelectors.State.REVIEW
.
Post-condition:
1. Project will be in ProjectStateSelectors.State.ACTIVE
state.
2. All existing approvals on the project will be cleared.
com.ibm.workplace.wcm.api.exceptions.AuthorizationException
- if the required access level is not met.
java.lang.IllegalStateException
- if the project's current state is not ProjectStateSelectors.State.REVIEW
.
WorkflowException
- if the post conditions can not be achieved.void decline(java.lang.String comment) throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException, WorkflowException
ApprovalMode
.
Note: if no comment is required in declining this project
then the no-arg version decline()
} should instead be used.
comment
- the reason for this rejection.
java.lang.IllegalArgumentException
- if the comment is null or empty or consists of only whitespaces.
com.ibm.workplace.wcm.api.exceptions.AuthorizationException
- if user does not have Approver access to this project.
java.lang.IllegalStateException
- if the project's current state is not ProjectStateSelectors.State.REVIEW
.
WorkflowException
- if the post conditions for approval can not be achieved.Project#decline()}
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |