Clearspace API (2.5.18) Core Javadocs

com.jivesoftware.community.impl.dao
Interface ApprovalDAO


public interface ApprovalDAO

Handles database interactions for relationship approval workflow related functionality.


Method Summary
 void addContainerApprover(int containerType, long containerID, long userID)
          Adds a user as a document approver for an entire container.
 void createNewWorkflow(long workflowID, long objID, long typeID, Collection<Long> users, String requestMessage, String responseMessage, JiveObjectModerator.Type queuedType)
          Creates entries in the jiveWorkflowApproval table for a new workflow.
 void deleteEmptyWorkflownBeans(long workflowID)
          Deletes all the empty workflow entries.
 void deleteUserWorkflowBean(long workflowID, long userID)
          Deletes a given workflow entry given a workflowID and userID.
 void deleteUserWorkflows(long userID)
          Deletes any workflow entry associated with the given user ID.
 void deleteWorkflow(long workflowID)
          Deletes all entries in the jiveWorkflowApproval table for a given workflow.
 List<Long> getApproverContainers(int containerType, long userID)
          Returns a list of container IDs for the given approver.
 List<Long> getContainerApprovers(int containerType, long containerID)
          Returns a list of user IDs for all the container level document approvers.
 List<ApprovalWorkflowNote> getResponseNotes(JiveObject jiveObject, JiveObjectModerator.Type queueType, JiveObjectModerator.Type... queueTypes)
          Return a list of response notes for a given object.
 List<ApprovalWorkflowBean> getUnApprovedWorkflowBeans(long userID, JiveObjectModerator.Type queueType, JiveObjectModerator.Type... queueTypes)
          Returns a list of ApprovalWorkflowBean belonging to the specified user ID and of one of the specified JiveObjectModerator.Type.
 int getUnApprovedWorkflowCount(long userID, JiveObjectModerator.Type queuType, JiveObjectModerator.Type... queueTypes)
          Returns a count of the unapproved workflow items belonging to the specified user ID and of any of the specified JiveObjectModerator.Types.
 ApprovalWorkflowBean getWorkflowBean(JiveObject jiveObject, long approverUserId, JiveObjectModerator.Type queueType, JiveObjectModerator.Type... queueTypes)
          Returns a specific workflow according to the object and the user approving the workflow's user ID.
 ApprovalWorkflowBean getWorkflowBean(long workflowID, long userID)
          Returns a ApprovalWorkflowBean by a workflowID and the userID, or null if none is found.
 List<ApprovalWorkflowBean> getWorkflowBeans(JiveObject jiveObject, JiveObjectModerator.Type queueType, JiveObjectModerator.Type... queueTypes)
          Returns a list of ApprovalWorkflowBean by typeID and objectID of a given JiveObject
 List<ApprovalWorkflowBean> getWorkflowBeans(long workflowID)
          Returns a list of ApprovalWorkflowBean objects.
 List<ApprovalWorkflowBean> getWorkflowBeans(long userID, long typeID, JiveObjectModerator.Type queueType, JiveObjectModerator.Type... queueTypes)
          Returns a list of ApprovalWorkflowBean objects that belong to the specified user and that have not been approved.
 List<ApprovalWorkflowBean> getWorkflowBeans(User user, JiveObjectModerator.Type queueType, JiveObjectModerator.Type... queueTypes)
          Returns a list of ApprovalWorkflowBean for a given user.
 int getWorkflowBeansCount(ModerationResultFilter filter)
          Returns a count of ApprovalWorkflowBeans that match the given ModerationResultFilter.
 void removeContainerApprover(int containerType, long containerID, long userID)
          Removes a user as a document approver for the specified container.
 void update(ApprovalWorkflowBean bean)
          Updates the approved and approvalTime fields in the jiveWorkflowApproval table.
 

Method Detail

createNewWorkflow

void createNewWorkflow(long workflowID,
                       long objID,
                       long typeID,
                       Collection<Long> users,
                       String requestMessage,
                       String responseMessage,
                       JiveObjectModerator.Type queuedType)
                       throws DAOException
Creates entries in the jiveWorkflowApproval table for a new workflow. This table allows you to track who has approved the relationship and who hasn't for a specified workflow.

Parameters:
workflowID - The ID of the workflow.
objID - The ID of the object to approve.
typeID - The object type of the aforementioned object.
users - A List of user IDs for all the people who will be approving this relationship.
requestMessage -
responseMessage -
queuedType - An integer representaion of the queued type
Throws:
com.jivesoftware.base.database.dao.DAOException - Thrown if there are any underlying database issues.
DAOException

deleteWorkflow

void deleteWorkflow(long workflowID)
                    throws DAOException
Deletes all entries in the jiveWorkflowApproval table for a given workflow.

Parameters:
workflowID - The ID of the workflow.
Throws:
com.jivesoftware.base.database.dao.DAOException - Thrown if there are any underlying database issues.
DAOException

deleteUserWorkflowBean

void deleteUserWorkflowBean(long workflowID,
                            long userID)
                            throws DAOException
Deletes a given workflow entry given a workflowID and userID.

Parameters:
workflowID - The ID of the workflow
userID - The ID of the user that you want the workflow for.
Throws:
com.jivesoftware.base.database.dao.DAOException - Thrown if there are any underlying database issues.
DAOException

deleteEmptyWorkflownBeans

void deleteEmptyWorkflownBeans(long workflowID)
                               throws DAOException
Deletes all the empty workflow entries. A workflow is "empty" if it is neither approve nor rejected and has no text in the response message.

Parameters:
workflowID - The ID of the workflow
Throws:
com.jivesoftware.base.database.dao.DAOException - Thrown if there are any underlying database issues.
DAOException

deleteUserWorkflows

void deleteUserWorkflows(long userID)
                         throws DAOException
Deletes any workflow entry associated with the given user ID.

Parameters:
userID -
Throws:
DAOException - Thrown if there aare any underlying database issues.

getWorkflowBeans

List<ApprovalWorkflowBean> getWorkflowBeans(long workflowID)
                                            throws DAOException
Returns a list of ApprovalWorkflowBean objects. ApprovalWorkflowBean objects contain information about a user's status with a given approval workflow.

Parameters:
workflowID - The ID of the workflow.
Returns:
list of work flow beans, contains user approval information.
Throws:
com.jivesoftware.base.database.dao.DAOException - Thrown if there are any underlying database issues.
DAOException

update

void update(ApprovalWorkflowBean bean)
            throws DAOException
Updates the approved and approvalTime fields in the jiveWorkflowApproval table.

Parameters:
bean - The bean to update.
Throws:
com.jivesoftware.base.database.dao.DAOException - Thrown if there are any underlying database issues.
DAOException

getUnApprovedWorkflowCount

int getUnApprovedWorkflowCount(long userID,
                               JiveObjectModerator.Type queuType,
                               JiveObjectModerator.Type... queueTypes)
                               throws DAOException
Returns a count of the unapproved workflow items belonging to the specified user ID and of any of the specified JiveObjectModerator.Types.

Parameters:
userID - the ID of the user.
queueTypes - one or more types.
Returns:
a count of the workflows.
Throws:
DAOException - Thrown if there are any underlying database issues.

getWorkflowBean

ApprovalWorkflowBean getWorkflowBean(long workflowID,
                                     long userID)
                                     throws DAOException
Returns a ApprovalWorkflowBean by a workflowID and the userID, or null if none is found.

Parameters:
workflowID - The ID of the workflow
userID - The ID of the approver user.
Returns:
A ApprovalWorkflowBean for the user on this workflow
Throws:
com.jivesoftware.base.database.dao.DAOException - Thrown if there are any underlying database issues.
DAOException

getWorkflowBean

ApprovalWorkflowBean getWorkflowBean(JiveObject jiveObject,
                                     long approverUserId,
                                     JiveObjectModerator.Type queueType,
                                     JiveObjectModerator.Type... queueTypes)
                                     throws DAOException
Returns a specific workflow according to the object and the user approving the workflow's user ID.

Parameters:
jiveObject - the object for which the workflow returned will be an approval for.
approverUserId - the user ID of the user who is to approve the specified workflow.
Returns:
the bean which contains the information related to the workflow.
Throws:
DAOException

getWorkflowBeans

List<ApprovalWorkflowBean> getWorkflowBeans(JiveObject jiveObject,
                                            JiveObjectModerator.Type queueType,
                                            JiveObjectModerator.Type... queueTypes)
                                            throws DAOException
Returns a list of ApprovalWorkflowBean by typeID and objectID of a given JiveObject

Parameters:
jiveObject - The jiveObject to get workflow beans for.
Returns:
list of work flow beans
Throws:
com.jivesoftware.base.database.dao.DAOException - Thrown if there are any underlying database issues.
DAOException

getWorkflowBeans

List<ApprovalWorkflowBean> getWorkflowBeans(User user,
                                            JiveObjectModerator.Type queueType,
                                            JiveObjectModerator.Type... queueTypes)
                                            throws DAOException
Returns a list of ApprovalWorkflowBean for a given user.

Parameters:
user - The user
Returns:
a list of ApprovalWorkflowBean for a given user.
Throws:
com.jivesoftware.base.database.dao.DAOException - Thrown if there are any underlying database issues.
DAOException

getWorkflowBeans

List<ApprovalWorkflowBean> getWorkflowBeans(long userID,
                                            long typeID,
                                            JiveObjectModerator.Type queueType,
                                            JiveObjectModerator.Type... queueTypes)
                                            throws DAOException
Returns a list of ApprovalWorkflowBean objects that belong to the specified user and that have not been approved.

Parameters:
userID - The ID of the user to acquire the ApprovalWorkflowBean for.
typeID - The Jive Object type to restrict the retrieval to.
Returns:
a list of ApprovalWorkflowBean
Throws:
com.jivesoftware.base.database.dao.DAOException - Thrown if there are any underlying database issues.
DAOException

addContainerApprover

void addContainerApprover(int containerType,
                          long containerID,
                          long userID)
                          throws DAOException
Adds a user as a document approver for an entire container.

Parameters:
containerType - The object type of the container to add the user as an document approver for.
containerID - The ID of the container to add the user as an document approver for.
userID - The ID of the user to add as a container level document approver.
Throws:
DAOException - Thrown if there are any underlying database issues.

removeContainerApprover

void removeContainerApprover(int containerType,
                             long containerID,
                             long userID)
                             throws DAOException
Removes a user as a document approver for the specified container.

Parameters:
containerType - The object type of the container the user is a document approver for.
containerID - The ID of the container the user is a document approver for.
userID - The ID of the user who is a document approver.
Throws:
DAOException - Thrown if there are any underlying database issues.

getContainerApprovers

List<Long> getContainerApprovers(int containerType,
                                 long containerID)
                                 throws DAOException
Returns a list of user IDs for all the container level document approvers.

Parameters:
containerType - The object type of the container
containerID - The ID of the container to get a list of user IDs of the document approvers.
Returns:
A list of user IDs.
Throws:
DAOException - Thrown if there are any underlying database issues.

getApproverContainers

List<Long> getApproverContainers(int containerType,
                                 long userID)
                                 throws DAOException
Returns a list of container IDs for the given approver.

Parameters:
containerType - The object type of the container
userID - The ID of the user assigned as container approver for 1 or more containers
Returns:
A list of container IDs.
Throws:
DAOException - Thrown if there are any underlying database issues.

getResponseNotes

List<ApprovalWorkflowNote> getResponseNotes(JiveObject jiveObject,
                                            JiveObjectModerator.Type queueType,
                                            JiveObjectModerator.Type... queueTypes)
                                            throws DAOException
Return a list of response notes for a given object.

Parameters:
jiveObject -
Returns:
a list of ApprovalWorkflowNote
Throws:
DAOException - Thrown if there are any underlying database issues.

getUnApprovedWorkflowBeans

List<ApprovalWorkflowBean> getUnApprovedWorkflowBeans(long userID,
                                                      JiveObjectModerator.Type queueType,
                                                      JiveObjectModerator.Type... queueTypes)
Returns a list of ApprovalWorkflowBean belonging to the specified user ID and of one of the specified JiveObjectModerator.Type.

Parameters:
userID - the ID of the user.
queueTypes - one or more queueTypes.
Returns:
a list of work flow beans.

getWorkflowBeansCount

int getWorkflowBeansCount(ModerationResultFilter filter)
                          throws DAOException
Returns a count of ApprovalWorkflowBeans that match the given ModerationResultFilter.

Parameters:
filter - the filter.
Returns:
a count of approval workflow beans.
Throws:
DAOException - Thrown if there are any underlying database issues.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.