public class ActivitiesServiceImpl extends AbstractAppService implements ActivitiesService, ActivitiesNames
ActivitiesService
ACTIVITIES_ACTIVITIES, ACTIVITIES_ACTIVITY_DATE, ACTIVITIES_APP_BASE_NAME, ACTIVITIES_ASSIGNED_TO, ACTIVITIES_ATTACHEMENTS, ACTIVITIES_CACHE_AVG_RATE, ACTIVITIES_CLOSE_DATE, ACTIVITIES_CLOSED_BY, ACTIVITIES_DEPENDS_ON, ACTIVITIES_DUE_DATE, ACTIVITIES_FROM_IP, ACTIVITIES_MANAGER, ACTIVITIES_PARENT_UID, ACTIVITIES_POLL_NAME, ACTIVITIES_RATE, ACTIVITIES_RATES, ACTIVITIES_RELATED_TO, ACTIVITIES_REPORTED_BY, ACTIVITIES_TASK_CLOSING_STATUSES, ACTIVITIES_TASK_DEFAULT_STATUS, ACTIVITIES_TASK_STATUS, ACTIVITIES_TASKS, ACTIVITIES_WAKE_UP_DATE
Constructor and Description |
---|
ActivitiesServiceImpl() |
Modifier and Type | Method and Description |
---|---|
Node |
configureActivity(Node activity,
java.lang.String type,
java.lang.String title,
java.lang.String desc,
java.util.List<Node> relatedTo)
Simply configures a simple activity using default manager (the current
logged in user) and default date (now)
|
Node |
configureActivity(Node activity,
java.lang.String reporterId,
java.lang.String type,
java.lang.String title,
java.lang.String desc,
java.util.List<Node> relatedTo,
java.util.Calendar date)
Creates a new simple activity using the default path
We use a distinct manager and activity date rather than JCR_CREATED and
JCR_CREATED_BY fields because we cannot force these fields and this is
problematic for instance when importing old activities
|
Node |
configureTask(Node task,
java.lang.String taskNodeType,
java.lang.String title,
java.lang.String description,
java.lang.String assignedTo)
Creates a new draft task with the minimum information
|
Node |
configureTask(Node draftTask,
java.lang.String taskNodeType,
java.lang.String reporterId,
java.lang.String title,
java.lang.String description,
java.lang.String assignedTo,
java.util.List<Node> relatedTo,
java.util.Calendar creationDate,
java.util.Calendar dueDate,
java.util.Calendar wakeUpDate)
Creates a new draft task with the given information.
|
java.lang.String |
getActivityLabel(Node activity)
Returns the default activity English Label if defined.
|
java.util.Calendar |
getActivityRelevantDate(Node activityNode)
Retrieves a date to display depending on the node type.
|
java.lang.String |
getAppBaseName()
Returns the current App name
|
java.lang.String |
getAssignedToDisplayName(Node taskNode)
Get the display name of the assigned to group for this task
|
java.lang.String |
getDefaultRelPath(Node entity)
Computes the App specific relative path for a known type based on properties
of the passed node
|
java.lang.String |
getDefaultRelPath(Session session,
java.lang.String nodeType,
java.lang.String id)
Computes the App specific relative path for this known node type based on the
passed id
|
java.lang.String |
getMainNodeType(Node entity)
Returns the App specific main type of a node, that can be its primary type or
one of its mixin, typically for the People App.
|
NodeIterator |
getMyTasks(Session session,
boolean onlyOpenTasks)
Retrieves tasks assigned to one of the group that contain the username
retrieved from the current session
|
NodeIterator |
getTasksForGroup(Session session,
java.lang.String[] roles,
boolean onlyOpenTasks) |
NodeIterator |
getTasksForUser(Session session,
java.lang.String username,
boolean onlyOpenTasks)
Retrieves tasks assigned to one of the group that contain this username
|
boolean |
isKnownType(Node entity)
Simply checks if the passed entity has a primary or mixin type that is known
and thus can be managed by the this App
|
boolean |
isKnownType(java.lang.String nodeType)
Simply checks if the passed type is known and thus can be managed by the this
App.
|
boolean |
isTaskDone(Node taskNode)
Determines whether a task has been done.
|
boolean |
isTaskSleeping(Node taskNode)
Determines whether is sleeping.
|
protected boolean |
manageClosedState(java.lang.String templateId,
Node taskNode,
java.lang.String oldStatus,
java.lang.String newStatus,
java.util.List<java.lang.String> modifiedPaths) |
void |
setResourcesService(ResourcesService resourcesService) |
void |
setTaskDefaultStatus(Node taskNode,
java.lang.String taskNodeType) |
void |
setUserAdminService(UserAdminService userAdminService) |
boolean |
updateStatus(java.lang.String templateId,
Node taskNode,
java.lang.String newStatus,
java.util.List<java.lang.String> modifiedPaths)
Updates the status of this task to the new passed status.
|
createDraftEntity, getDisplayName, getDraftParent, getEntityByUid, publishEntity, saveEntity
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createDraftEntity, getBaseRelPath, getDisplayName, getDraftParent, getEntityByUid, getLabel, publishEntity, publishEntity, saveEntity
public java.lang.String getAppBaseName()
AppService
getAppBaseName
in interface AppService
public java.lang.String getDefaultRelPath(Node entity) throws RepositoryException
AppService
getDefaultRelPath
in interface AppService
RepositoryException
public java.lang.String getDefaultRelPath(Session session, java.lang.String nodeType, java.lang.String id)
AppService
getDefaultRelPath
in interface AppService
session
- TODOpublic Node configureActivity(Node activity, java.lang.String type, java.lang.String title, java.lang.String desc, java.util.List<Node> relatedTo) throws RepositoryException
ActivitiesService
configureActivity
in interface ActivitiesService
RepositoryException
public Node configureActivity(Node activity, java.lang.String reporterId, java.lang.String type, java.lang.String title, java.lang.String desc, java.util.List<Node> relatedTo, java.util.Calendar date) throws RepositoryException
ActivitiesService
configureActivity
in interface ActivitiesService
RepositoryException
public boolean isKnownType(Node entity)
AppService
isKnownType
in interface AppService
public java.lang.String getMainNodeType(Node entity)
AppService
getMainNodeType
in interface AppService
public boolean isKnownType(java.lang.String nodeType)
AppService
isKnownType
in interface AppService
public java.util.Calendar getActivityRelevantDate(Node activityNode)
ActivitiesService
getActivityRelevantDate
in interface ActivitiesService
activityNode
- an activity or a taskpublic java.lang.String getActivityLabel(Node activity)
ActivitiesService
AppService.getMainNodeType(Node)
methods will be used.getActivityLabel
in interface ActivitiesService
public NodeIterator getMyTasks(Session session, boolean onlyOpenTasks)
ActivitiesService
getMyTasks
in interface ActivitiesService
public NodeIterator getTasksForUser(Session session, java.lang.String username, boolean onlyOpenTasks)
ActivitiesService
getTasksForUser
in interface ActivitiesService
session
- username
- onlyOpenTasks
- public NodeIterator getTasksForGroup(Session session, java.lang.String[] roles, boolean onlyOpenTasks)
protected boolean manageClosedState(java.lang.String templateId, Node taskNode, java.lang.String oldStatus, java.lang.String newStatus, java.util.List<java.lang.String> modifiedPaths) throws RepositoryException
RepositoryException
public boolean updateStatus(java.lang.String templateId, Node taskNode, java.lang.String newStatus, java.util.List<java.lang.String> modifiedPaths) throws RepositoryException
ActivitiesService
updateStatus
in interface ActivitiesService
RepositoryException
public boolean isTaskDone(Node taskNode)
ActivitiesService
isTaskDone
in interface ActivitiesService
public boolean isTaskSleeping(Node taskNode)
ActivitiesService
isTaskSleeping
in interface ActivitiesService
public java.lang.String getAssignedToDisplayName(Node taskNode)
getAssignedToDisplayName
in interface ActivitiesService
public Node configureTask(Node task, java.lang.String taskNodeType, java.lang.String title, java.lang.String description, java.lang.String assignedTo) throws RepositoryException
ActivitiesService
configureTask
in interface ActivitiesService
RepositoryException
public Node configureTask(Node draftTask, java.lang.String taskNodeType, java.lang.String reporterId, java.lang.String title, java.lang.String description, java.lang.String assignedTo, java.util.List<Node> relatedTo, java.util.Calendar creationDate, java.util.Calendar dueDate, java.util.Calendar wakeUpDate) throws RepositoryException
ActivitiesService
configureTask
in interface ActivitiesService
RepositoryException
public void setTaskDefaultStatus(Node taskNode, java.lang.String taskNodeType) throws RepositoryException
setTaskDefaultStatus
in interface ActivitiesService
RepositoryException
public void setUserAdminService(UserAdminService userAdminService)
public void setResourcesService(ResourcesService resourcesService)
Copyright © 2007–2020. All rights reserved.