public class ActivitiesServiceImpl extends AbstractAppService implements ActivitiesService, ActivitiesNames
ActivitiesServiceACTIVITIES_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, saveEntityclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateDraftEntity, getBaseRelPath, getDisplayName, getDraftParent, getEntityByUid, getLabel, publishEntity, publishEntity, saveEntitypublic java.lang.String getAppBaseName()
AppServicegetAppBaseName in interface AppServicepublic java.lang.String getDefaultRelPath(Node entity) throws RepositoryException
AppServicegetDefaultRelPath in interface AppServiceRepositoryExceptionpublic java.lang.String getDefaultRelPath(Session session, java.lang.String nodeType, java.lang.String id)
AppServicegetDefaultRelPath in interface AppServicesession - TODOpublic Node configureActivity(Node activity, java.lang.String type, java.lang.String title, java.lang.String desc, java.util.List<Node> relatedTo) throws RepositoryException
ActivitiesServiceconfigureActivity in interface ActivitiesServiceRepositoryExceptionpublic 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
ActivitiesServiceconfigureActivity in interface ActivitiesServiceRepositoryExceptionpublic boolean isKnownType(Node entity)
AppServiceisKnownType in interface AppServicepublic java.lang.String getMainNodeType(Node entity)
AppServicegetMainNodeType in interface AppServicepublic boolean isKnownType(java.lang.String nodeType)
AppServiceisKnownType in interface AppServicepublic java.util.Calendar getActivityRelevantDate(Node activityNode)
ActivitiesServicegetActivityRelevantDate in interface ActivitiesServiceactivityNode - an activity or a taskpublic java.lang.String getActivityLabel(Node activity)
ActivitiesServiceAppService.getMainNodeType(Node) methods will be used.getActivityLabel in interface ActivitiesServicepublic NodeIterator getMyTasks(Session session, boolean onlyOpenTasks)
ActivitiesServicegetMyTasks in interface ActivitiesServicepublic NodeIterator getTasksForUser(Session session, java.lang.String username, boolean onlyOpenTasks)
ActivitiesServicegetTasksForUser in interface ActivitiesServicesession - 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
RepositoryExceptionpublic boolean updateStatus(java.lang.String templateId,
Node taskNode,
java.lang.String newStatus,
java.util.List<java.lang.String> modifiedPaths)
throws RepositoryException
ActivitiesServiceupdateStatus in interface ActivitiesServiceRepositoryExceptionpublic boolean isTaskDone(Node taskNode)
ActivitiesServiceisTaskDone in interface ActivitiesServicepublic boolean isTaskSleeping(Node taskNode)
ActivitiesServiceisTaskSleeping in interface ActivitiesServicepublic java.lang.String getAssignedToDisplayName(Node taskNode)
getAssignedToDisplayName in interface ActivitiesServicepublic Node configureTask(Node task, java.lang.String taskNodeType, java.lang.String title, java.lang.String description, java.lang.String assignedTo) throws RepositoryException
ActivitiesServiceconfigureTask in interface ActivitiesServiceRepositoryExceptionpublic 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
ActivitiesServiceconfigureTask in interface ActivitiesServiceRepositoryExceptionpublic void setTaskDefaultStatus(Node taskNode, java.lang.String taskNodeType) throws RepositoryException
setTaskDefaultStatus in interface ActivitiesServiceRepositoryExceptionpublic void setUserAdminService(UserAdminService userAdminService)
public void setResourcesService(ResourcesService resourcesService)
Copyright © 2007–2020. All rights reserved.