public interface PrintCollaborationFacade
CommentService, CommentGroupService,
PrintCommentService and
PrintJobService . It helps you to create /
delete jobs,
comments and replies, checks if comments and replies may be deleted, assign comments and jobs to Users or UserGroups,
filter
and sort these, get the current action and all history information from a job and to get the
UserGroupModel of a user a
job can be assigned to. Jobs are a combination of a CommentModel with an attached
WorkflowModel. All CommentModels with an attached
WorkflowModel are assumed to be jobs by definition.| Modifier and Type | Method and Description |
|---|---|
void |
assignJob(AbstractCommentModel comment,
PrincipalModel principal)
This method should assign the
WorkflowModel of the given job to the
given UserModel or UserGroupModel. |
CommentModel |
createComment(PageModel page,
UserModel author,
String text)
|
void |
createJob(AbstractCommentModel comment,
ItemModel attachment,
PrincipalModel assignee)
This method should create a
WorkflowModel, it should attach it to the
given CommentModel and assign it to
the given UserModel or UserGroupModel. |
void |
createReply(AbstractCommentModel abstractComment,
UserModel author,
String text,
WorkflowDecisionModel selectedDecision)
|
void |
deleteComment(CommentModel comment)
This method should delete the given
CommentModel. |
Collection<CommentModel> |
filterAndSortComments(Collection<FilterCondition> filterConditions,
List<SortCondition> sortConditions,
Collection<CommentModel> comments)
This method should filter the given collection of
CommentModels by the given FilterConditions and
sorts it
by the given SortConditions afterwards. |
PrincipalModel |
getAssignee(UserModel user)
This method should find a
PrincipalModel (e.g. |
WorkflowActionModel |
getCurrentAction(AbstractCommentModel comment)
This method should find the current
status of the given AbstractCommentModel. |
List<PrintJobHistoryEntryDTO> |
getJobHistory(AbstractCommentModel comment)
|
ItemModel |
getLastChange(CommentModel comment)
This method returns either a
ReplyModel or a WorkflowActionModel
depending on which has been last modified
or created. |
boolean |
isDeleteAllowed(AbstractCommentModel comment)
This method verifies if a
AbstractCommentModel may be removed. |
boolean |
isJob(AbstractCommentModel comment)
This method checks if the given
comment is a job. |
boolean |
isStatusChangeAllowed(UserModel currentUser,
AbstractCommentModel comment)
|
void assignJob(AbstractCommentModel comment, PrincipalModel principal)
WorkflowModel of the given job to the
given UserModel or UserGroupModel. This method should delegate
to PrintJobService.assignJob for
the actual
assignment.comment - CommentModel where the WorkflowModel should be
takenprincipal - the UserModel or UserGroupModel which should
be assigned to the WorkflowModelCommentModel createComment(PageModel page, UserModel author, String text)
CommentModel for the given PageModel, UserModel and
text.
Should return the CommentModel without persisting it using the
ModelService. The caller of this method needs to take
care about
saving the CommentModel. This method should delegate
PrintCommentService.createComment for the actual assignment.page - the PageModel the CommentModel should be attached toauthor - the UserModel should be set as assignee for the created CommentModeltext - the String which should be set for the CommentModelCommentModel which is not persisted.void createJob(AbstractCommentModel comment, ItemModel attachment, PrincipalModel assignee)
WorkflowModel, it should attach it to the
given CommentModel and assign it to
the given UserModel or UserGroupModel. The caller of this
method needs to take care about saving all created
models by calling modelService.saveAll(). This method should delegate to
PrintJobService.createJob for the actual assignment.comment - the CommentModel to which the WorkflowModel
should be created forattachment - the ItemModel which should be attached to the
WorkflowModelassignee - the UserModel or UserGroupModel which should be
set as the assigned principle of the created WorkflowModel.void createReply(AbstractCommentModel abstractComment, UserModel author, String text, WorkflowDecisionModel selectedDecision)
reply for the selected
decision and the given comment or reply. This ensures
that a reply is connected to a state change
in the print workflow process and will then no longer be deletable if the selected decision is not null.void deleteComment(CommentModel comment) throws BusinessException
CommentModel. In case deletion is restricted a
BusinessException is
thrown.comment - the CommentModel which should be deleted.BusinessExceptionCollection<CommentModel> filterAndSortComments(Collection<FilterCondition> filterConditions, List<SortCondition> sortConditions, Collection<CommentModel> comments)
CommentModels by the given FilterConditions and
sorts it
by the given SortConditions afterwards. This method should delegate
PrintCommentService.filterComments and
PrintCommentService.sortComments for the actual assignment.filterConditions - a collection of FilterConditions which should be used for filtering the commentssortConditions - a list of SortConditions which should be used for sorting the commentscomments - a collection of CommentModel which should be filtered by the given FilterCondition
and SortConditionsCommentModels or empty collection if the list is empty after
filtering.PrincipalModel getAssignee(UserModel user)
PrincipalModel (e.g. UserGroupModel) for the given UserModel which has all access rights to edit/create CommentModels
and change
the states within a WorkflowModel.user - the UserModel where the PrincipalModels should be takenPrincipalModelWorkflowActionModel getCurrentAction(AbstractCommentModel comment)
status of the given AbstractCommentModel.
It should
delegate to
PrintJobService.getCurrentActionsfor the actual assignment.comment - the AbstractCommentModel where the current WorkflowActionModel should be taken fromWorkflowActionModel of the given AbstractCommentModel if it is a job, null
otherwiseList<PrintJobHistoryEntryDTO> getJobHistory(AbstractCommentModel comment)
PrintJobHistoryEntryDTOs for the
WorkflowModel of the given job . It also
should delegate
PrintJobService.getJobHistory for the actual assignment.comment - the CommentModel where the PrintJobHistoryEntryDTOs should be taken fromPrintJobHistoryEntryDTOs which were found for the given CommentModelItemModel getLastChange(CommentModel comment)
ReplyModel or a WorkflowActionModel
depending on which has been last modified
or created. This method delegates to
PrintCommentService.getLastChange for fetching the latest ReplyModel
and
PrintJobService.getCurrentActions(de.hybris.platform.workflow.model.WorkflowModel)
getLastChange(de.hybris.platform.workflow.model.WorkflowModel)
PrintJobService.getLastChange} for fetching the latest WorkflowActionModel.comment - the CommentModel where the last change should be taken fromItemModelboolean isDeleteAllowed(AbstractCommentModel comment)
AbstractCommentModel may be removed. By default a comment
may not be
deleted if it is already synchronized to InDesign once and a reply may not be deleted if it belongs to a
state change.comment - the AbstractCommentModel which is used for the verification.boolean isJob(AbstractCommentModel comment)
comment is a job.comment - The affected commentboolean isStatusChangeAllowed(UserModel currentUser, AbstractCommentModel comment)
user is actually allowed to make a status change on the given
comment. This method checks if the given comment is a
job.currentUser - The user that will be checked permission oncomment - The affected commentCopyright © 2017 SAP SE. All Rights Reserved.