@Entity
public class Todo
extends com.whitestein.lsps.common.AbstractEntity
Modifier and Type | Field and Description |
---|---|
static String |
COUNT_PERSONAL_TODOS_WITH_NULL_PRIORITY
Query name.
|
static String |
COUNT_PERSONAL_TODOS_WITH_PRIORITY
Query name.
|
static String |
FIND_BY_TASK
Query name.
|
static String |
FIND_OPEN_ALLOCATED_TODO_IDS
Query name.
|
static String |
FIND_PERSONAL_TODOS_WITH_NULL_PRIORITY
Query name.
|
static String |
FIND_PERSONAL_TODOS_WITH_PRIORITY
Query name.
|
static String |
GET_STATUS_COUNTS
Query name.
|
Modifier | Constructor and Description |
---|---|
protected |
Todo()
Default constructor.
|
|
Todo(Long modelInstanceId,
Long elementId,
Long taskId,
String title,
String type,
Date issuedDate,
String taskNamespace,
String taskName,
byte[] content,
Date escalationDate,
String implementationType)
Creates new instance of
Todo . |
Modifier and Type | Method and Description |
---|---|
void |
accomplish(Date submittedDate)
Sets status to
TodoStatus.ACCOMPLISHED . |
void |
addPerformer(TodoPerformer performer)
Adds a todo performer.
|
void |
addPerformers(Collection<TodoPerformer> performers)
Adds a collection of todo performers.
|
void |
addRejection(TodoRejection rejection)
Adds a rejection.
|
String |
getAllocatedTo()
Returns the id of the user for which todo is allocated.
|
TodoAuthorization |
getAuthorization(Person person)
Returns the reason why the person can see the to-do in his to-do list.
|
byte[] |
getContent()
Returns the todo content.
|
int |
getCurrentDelegationLevel()
Gets current delegation level of the todo.
|
String |
getDelegatedBy()
Returns the person who delegated the todo (the current delegation) or null if the todo is not
delegated.
|
Long |
getElementId()
Returns the element id.
|
Date |
getEscalationDate()
Returns the escalation date.
|
String |
getImplementationType()
Returns implementation type.
|
String |
getInterruptionReason()
Returns reason for which the todo was interrupted.
|
Date |
getIssuedDate()
Returns the date when the todo was issued.
|
Long |
getModelInstanceId()
Returns the model instance id.
|
String |
getNotes()
Returns notes attached to the todo.
|
Collection<TodoPerformer> |
getPerformers()
Returns a collection of performers for this todo.
|
Integer |
getPriority()
Returns priority of todo in personal todo list.
|
Collection<String> |
getRejectingPersons()
Returns a collection of rejecting persons.
|
TodoRejection |
getRejectionBy(Person person)
Returns a todo rejection for the specified person.
|
Collection<TodoRejection> |
getRejections()
Returns a collection of rejections.
|
TodoStatus |
getStatus()
Returns status of the todo.
|
Date |
getSubmittedDate()
Returns the date when the todo was submitted.
|
Long |
getTaskId()
Returns the task id.
|
String |
getTaskName()
Returns the name of the task which generated the todo.
|
String |
getTaskNamespace()
Returns the name of the namespace of the context for the task which generated the todo.
|
String |
getTitle()
Returns title for todo.
|
String |
getType()
Returns type of the todo.
|
boolean |
hasInitialPerformer(Person person)
Checks if given
person is one of the todo's performers. |
void |
interrupt(Date submittedDate,
String interruptionReason)
Sets status to
TodoStatus.INTERRUPTED . |
boolean |
isAlive()
|
boolean |
isAllocated()
Returns true if the todo is allocated.
|
boolean |
isAllocatedTo(Person person)
Returns true if this todo is assigned to given person.
|
boolean |
isDelegated()
Returns true if the todo is delegated.
|
boolean |
isDelegatedTo(Person person)
Checks if the todo is delegated to
person . |
boolean |
isOrphaned()
Return true if the todo is orphaned.
|
boolean |
isPersonPermitted(Person person)
Returns true if the given person is permitted to see this todo.
|
boolean |
isPersonPermitted(Person person,
boolean checkSubstitution,
boolean checkAllocation)
Returns true if the given person is permitted to see this todo.
|
boolean |
isRejectedBy(Person person)
Checks if the todo is rejected by
person |
boolean |
isVisibleTo(Person person)
Returns true if
isPersonPermitted(person) is true and the person has not rejected the
todo. |
void |
removePerformer(TodoPerformer performer)
Removes a performer.
|
void |
removeRejection(TodoRejection rejection)
Removes a rejection.
|
void |
resume()
Sets status to
TodoStatus.SUSPENDED . |
void |
setContent(byte[] content)
Sets the todo content..
|
void |
setNotes(String notes)
Sets notes attached to the todo.
|
void |
setOrphaned(boolean orphaned)
Sets todo orphaned property.
|
void |
setPriority(Integer priority)
Sets priority of the todo in personal todo list.
|
void |
suspend()
Sets status to
TodoStatus.SUSPENDED . |
public static final String FIND_OPEN_ALLOCATED_TODO_IDS
public static final String FIND_PERSONAL_TODOS_WITH_PRIORITY
public static final String FIND_PERSONAL_TODOS_WITH_NULL_PRIORITY
public static final String COUNT_PERSONAL_TODOS_WITH_PRIORITY
public static final String COUNT_PERSONAL_TODOS_WITH_NULL_PRIORITY
public static final String GET_STATUS_COUNTS
public static final String FIND_BY_TASK
protected Todo()
public Todo(Long modelInstanceId, Long elementId, Long taskId, String title, String type, Date issuedDate, String taskNamespace, String taskName, byte[] content, Date escalationDate, String implementationType)
Todo
.modelInstanceId
- elementId
- taskId
- title
- type
- issuedDate
- taskNamespace
- taskName
- content
- escalationDate
- implementationType
- NullPointerException
- if one of title
, type
, issuedDate
, taskNamespace
,
taskName
is nullpublic Long getModelInstanceId()
public Long getElementId()
public String getTitle()
public String getType()
public TodoStatus getStatus()
public void suspend()
TodoStatus.SUSPENDED
.public void resume()
TodoStatus.SUSPENDED
.public void accomplish(Date submittedDate)
TodoStatus.ACCOMPLISHED
.submittedDate
- NullPointerException
- if submittedDate
is nullpublic void interrupt(Date submittedDate, String interruptionReason)
TodoStatus.INTERRUPTED
.submittedDate
- interruptionReason
- NullPointerException
- if submittedDate
is nullpublic boolean isAlive()
true
if the todo is alive, otherwise returns false
public Date getIssuedDate()
public Date getSubmittedDate()
public String getAllocatedTo()
public Collection<TodoPerformer> getPerformers()
public void addPerformer(TodoPerformer performer)
performer
- NullPointerException
- if performer
is nullpublic void addPerformers(Collection<TodoPerformer> performers)
performers
- NullPointerException
- if performers
is null or any element of performers
is nullpublic void removePerformer(TodoPerformer performer)
performer
- public String getTaskNamespace()
public String getTaskName()
public Long getTaskId()
public byte[] getContent()
public void setContent(byte[] content)
content
- public String getInterruptionReason()
public boolean isPersonPermitted(Person person)
person
- NullPointerException
- if person
is nullpublic boolean isVisibleTo(Person person)
isPersonPermitted(person)
is true and the person has not rejected the
todo.person
- NullPointerException
- if person
is nullpublic boolean isPersonPermitted(Person person, boolean checkSubstitution, boolean checkAllocation)
person
- checkSubstitution
- checkAllocation
- NullPointerException
- if person
is nullpublic boolean hasInitialPerformer(Person person)
person
is one of the todo's performers. That may happen if the person
is directly assigned in todo, or if the person is in role assigned in todo.person
- public boolean isAllocatedTo(Person person)
person
- NullPointerException
- if person
is nullpublic int getCurrentDelegationLevel()
public boolean isAllocated()
public boolean isDelegated()
public boolean isDelegatedTo(Person person)
person
.person
- person being checkedpublic String getDelegatedBy()
public Collection<TodoRejection> getRejections()
public Collection<String> getRejectingPersons()
public void addRejection(TodoRejection rejection)
rejection
- NullPointerException
- if rejection
is nullpublic void removeRejection(TodoRejection rejection)
rejection
- NullPointerException
- if rejection
is nullpublic boolean isRejectedBy(Person person)
person
person
- person being checkedperson
rejects the todo.public TodoRejection getRejectionBy(Person person)
person
- public Integer getPriority()
public void setPriority(Integer priority)
priority
- todo prioritypublic String getNotes()
public void setNotes(String notes)
notes
- notes for the todopublic Date getEscalationDate()
public TodoAuthorization getAuthorization(Person person)
person
- public boolean isOrphaned()
public void setOrphaned(boolean orphaned)
orphaned
- public String getImplementationType()
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.