com.arsdigita.cms.workflow
Class CMSTask

java.lang.Object
  extended bycom.arsdigita.domain.DomainObject
      extended bycom.arsdigita.domain.ObservableDomainObject
          extended bycom.arsdigita.kernel.ACSObject
              extended bycom.arsdigita.auditing.AuditedACSObject
                  extended bycom.arsdigita.workflow.simple.Task
                      extended bycom.arsdigita.workflow.simple.UserTask
                          extended bycom.arsdigita.cms.workflow.CMSTask
All Implemented Interfaces:
com.arsdigita.workflow.simple.Assignable, com.arsdigita.auditing.Audited, Cloneable

public class CMSTask
extends com.arsdigita.workflow.simple.UserTask

This class represents a task in the CMS system. This task is Assignable, and has an associated task type. The task type determines the class which performs the "action" for this page

Author:
Uday Mathur (umathu

Field Summary
static BigDecimal AUTHOR
           
static String BASE_DATA_OBJECT_TYPE
           
static BigDecimal DEPLOY
           
static BigDecimal EDIT
           
static String UNFINISHED_OP
           
static String versionId
           
 
Fields inherited from class com.arsdigita.workflow.simple.UserTask
DEFAULT_DURATION, DISABLE_OP, ENABLE_OP, FINISH_OP, ROLLBACK_OP
 
Fields inherited from class com.arsdigita.workflow.simple.Task
DELETED, DISABLED, ENABLED, FINISHED, INACTIVE
 
Fields inherited from class com.arsdigita.kernel.ACSObject
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE
 
Constructor Summary
  CMSTask()
           
  CMSTask(BigDecimal id)
          Restores a task from a BigDecimal by constructing an OID
  CMSTask(com.arsdigita.persistence.DataObject CMSTaskObject)
          Constructor for restoring user task with a data object
protected CMSTask(com.arsdigita.persistence.metadata.ObjectType type)
          Constructor for cms task used for setting object type
  CMSTask(com.arsdigita.persistence.OID oid)
          Restores a task from an OID
protected CMSTask(String typeName)
           
 
Method Summary
static void addAlert(ContentSection section, String typeLabel, String operation)
           
 Object clone()
          Creates a deep copy of this task and stores a persistent copy.
protected  void copyAttributes(CMSTask task)
          exports the attributes of this domain object.
 void enableEvt()
           
protected  void filterUsersAndSendMessage(com.arsdigita.kernel.UserCollection uc, com.arsdigita.messaging.Message msg)
          Filter the UserCollection given as the argument against PermissionService.EDIT permission on the item.
 void finish()
           
protected  com.arsdigita.messaging.Message generateMessage(String operation, com.arsdigita.kernel.Party sender)
           
protected  String getAuthoringURL(ContentItem item)
           
 ContentSection getContentSection()
          Get the ContentSection of the ContentItem that this Task is associated with.
 String getFinishURL(BigDecimal itemId)
           
 ContentItem getItem()
          Get the item associated with this Workflow.
 BigDecimal getTaskType()
           
protected  void initialize()
          Initialize setting the TaskType to Authoring by default.
protected  boolean sendAlerts(String operation)
           
protected  void sendMessageToAssignees(com.arsdigita.messaging.Message msg)
          Send a message to all assignees which are in the appropriate role(s) and have appropriate permissions on the item or have been assigned to the task directly and have appropriate permissions on the item Overrides UserTask.sendMessageToAssignees(Message)
protected  void sendUnfinishedNotification()
          Send a notification that this task has been unfinished for too long.
 void setTaskType(BigDecimal taskType)
          Sets the type of this Task to the corresponding taskType
protected static boolean shouldSendAlert(ContentSection section, String typeLabel, String operation)
           
 
Methods inherited from class com.arsdigita.workflow.simple.UserTask
assignGroup, assignUser, copyAttributes, delete, disableEvt, enable, finish, finish, finishEvt, getAlertsSender, getAssignedGroupAssociation, getAssignedGroupCollection, getAssignedGroupCount, getAssignedGroups, getAssignedUserAssociation, getAssignedUserCollection, getAssignedUserCount, getAssignedUsers, getDueDate, getDuration, getLockedUser, getNotificationSender, getStartDate, getUserTaskOID, isAssigned, isAssigned, isAssigned, isLocked, isOverdue, lock, removeAllGroupAssignees, removeGroup, removeUser, rollbackEvt, setDueDate, setDuration, setNotificationSender, setStartDate, unlock
 
Methods inherited from class com.arsdigita.workflow.simple.Task
addComment, addComment, addComment, addDependency, addFinishedListener, copyAttributes, disable, equals, getBaseDataObjectType, getComments, getCommentsSize, getDependencies, getDependencyCount, getDescription, getDisplayName, getFinishedListeners, getFinishedListenersCount, getFinishedListenersInternal, getLabel, getLastComment, getLastCommentInWorkflow, getParentID, getRequiredTasks, getState, getStateMapping, getStateString, getStateString, getWorkflow, initAttributes, isActive, isDependency, isEnabled, isFinished, notifyFinished, removeAllDependencies, removeAllFinishedListeners, removeComment, removeDependency, removeFinishedListener, setActive, setDescription, setLabel, setState, toString
 
Methods inherited from class com.arsdigita.auditing.AuditedACSObject
getCreationDate, getCreationIP, getCreationUser, getLastModifiedDate, getLastModifiedIP, getLastModifiedUser
 
Methods inherited from class com.arsdigita.kernel.ACSObject
assertPrivilege, beforeSave, checkPrivilege, doCreateCheck, doWriteCheck, getContainer, getDefaultDomainClass, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, isContainerModified, setID, setID
 
Methods inherited from class com.arsdigita.domain.ObservableDomainObject
addObserver, getObservers
 
Methods inherited from class com.arsdigita.domain.DomainObject
add, add, addToAssociation, afterDelete, afterSave, beforeDelete, clear, disconnect, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

BASE_DATA_OBJECT_TYPE

public static final String BASE_DATA_OBJECT_TYPE
See Also:
Constant Field Values

AUTHOR

public static final BigDecimal AUTHOR

EDIT

public static final BigDecimal EDIT

DEPLOY

public static final BigDecimal DEPLOY

UNFINISHED_OP

public static final String UNFINISHED_OP
See Also:
Constant Field Values
Constructor Detail

CMSTask

public CMSTask()

CMSTask

protected CMSTask(com.arsdigita.persistence.metadata.ObjectType type)
Constructor for cms task used for setting object type

Parameters:
type - the object type

CMSTask

protected CMSTask(String typeName)

CMSTask

public CMSTask(com.arsdigita.persistence.DataObject CMSTaskObject)
Constructor for restoring user task with a data object

Parameters:
CMSTaskObject - the data object

CMSTask

public CMSTask(com.arsdigita.persistence.OID oid)
        throws com.arsdigita.domain.DataObjectNotFoundException
Restores a task from an OID

Parameters:
oid - an OID

CMSTask

public CMSTask(BigDecimal id)
        throws com.arsdigita.domain.DataObjectNotFoundException
Restores a task from a BigDecimal by constructing an OID

Parameters:
id - - the BigDecimal Id of this task
Method Detail

initialize

protected void initialize()
Initialize setting the TaskType to Authoring by default.


setTaskType

public void setTaskType(BigDecimal taskType)
Sets the type of this Task to the corresponding taskType

Parameters:
taskType - BigDecimal corresponding to the id of the taskType

getTaskType

public BigDecimal getTaskType()

getFinishURL

public String getFinishURL(BigDecimal itemId)

getAuthoringURL

protected String getAuthoringURL(ContentItem item)

getItem

public ContentItem getItem()
Get the item associated with this Workflow. Assumes that we're always going to be working with ContentItems


enableEvt

public void enableEvt()

generateMessage

protected com.arsdigita.messaging.Message generateMessage(String operation,
                                                          com.arsdigita.kernel.Party sender)

clone

public Object clone()
Creates a deep copy of this task and stores a persistent copy. TODO: refactor this method in this class, and its parents


copyAttributes

protected void copyAttributes(CMSTask task)
exports the attributes of this domain object.

Parameters:
task - DomainObject to which this method copies the attributes of this object

getContentSection

public ContentSection getContentSection()
Get the ContentSection of the ContentItem that this Task is associated with. If an item is moved between ContentSections, that code must be responsible for updating all of the assigned users and groups to members of the new ContentSection.


sendUnfinishedNotification

protected void sendUnfinishedNotification()
Send a notification that this task has been unfinished for too long. Should only ever be called by the UnfinishedTaskNotifier.


addAlert

public static void addAlert(ContentSection section,
                            String typeLabel,
                            String operation)

shouldSendAlert

protected static boolean shouldSendAlert(ContentSection section,
                                         String typeLabel,
                                         String operation)

sendAlerts

protected boolean sendAlerts(String operation)

sendMessageToAssignees

protected void sendMessageToAssignees(com.arsdigita.messaging.Message msg)
Send a message to all assignees which or Overrides UserTask.sendMessageToAssignees(Message)

Parameters:
msg - the message
See Also:
Message, filterUsersAndSendMessage(com.arsdigita.kernel.UserCollection, com.arsdigita.messaging.Message)

filterUsersAndSendMessage

protected void filterUsersAndSendMessage(com.arsdigita.kernel.UserCollection uc,
                                         com.arsdigita.messaging.Message msg)
Filter the UserCollection given as the argument against PermissionService.EDIT permission on the item. Send the Message msg to the resulting set of users.

This method is used by sendMessageToAssignees(com.arsdigita.messaging.Message) to restrict the amount of users that are getting spammed by workflow associations.

Parameters:
uc - collection of users which will be filtered and used as the set of receivers for the given message msg
msg - the Message to send
See Also:
sendMessageToAssignees(com.arsdigita.messaging.Message)

finish

public void finish()
            throws com.arsdigita.workflow.simple.TaskException
Throws:
com.arsdigita.workflow.simple.TaskException


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 19 2004:2352 UTC