public class DefaultPrintCollaborationFacade extends Object implements PrintCollaborationFacade
| Constructor and Description |
|---|
DefaultPrintCollaborationFacade() |
| 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 commentToSave,
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 principal)
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 commentItemModel)
|
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 |
setCommentGroupService(CommentGroupService commentGroupService) |
void |
setCommentService(CommentService commentService) |
void |
setModelService(ModelService modelService) |
void |
setPrintCommentService(PrintCommentService printCommentService) |
void |
setPrintJobService(PrintJobService printJobService) |
void |
setWorkflowProcessingService(WorkflowProcessingService workflowProcessingService) |
public void assignJob(AbstractCommentModel comment, PrincipalModel principal)
PrintCollaborationFacadeWorkflowModel of the given job to the
given UserModel or UserGroupModel. This method should delegate
to PrintJobService.assignJob for
the actual
assignment.assignJob in interface PrintCollaborationFacadecomment - CommentModel where the WorkflowModel should be
takenprincipal - the UserModel or UserGroupModel which should
be assigned to the WorkflowModelpublic CommentModel createComment(PageModel page, UserModel author, String text)
PrintCollaborationFacadeCommentModel 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.createComment in interface PrintCollaborationFacadepage - 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.public void createJob(AbstractCommentModel commentToSave, ItemModel attachment, PrincipalModel assignee)
PrintCollaborationFacadeWorkflowModel, 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.createJob in interface PrintCollaborationFacadecommentToSave - 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.public void createReply(AbstractCommentModel abstractComment, UserModel author, String text, WorkflowDecisionModel selectedDecision)
PrintCollaborationFacadereply 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.createReply in interface PrintCollaborationFacadeabstractComment - comment to reply toauthor - the UserModel, who created the replytext - reply contentselectedDecision - selected decision within the workflowpublic boolean isDeleteAllowed(AbstractCommentModel comment)
PrintCollaborationFacadeAbstractCommentModel 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.isDeleteAllowed in interface PrintCollaborationFacadecomment - the AbstractCommentModel which is used for the verification.public boolean isJob(AbstractCommentModel comment)
PrintCollaborationFacadecomment is a job.isJob in interface PrintCollaborationFacadecomment - The affected commentpublic boolean isStatusChangeAllowed(UserModel currentUser, AbstractCommentModel comment)
PrintCollaborationFacadeuser is actually allowed to make a status change on the given
comment. This method checks if the given comment is a
job.isStatusChangeAllowed in interface PrintCollaborationFacadecurrentUser - The user that will be checked permission oncomment - The affected commentpublic void deleteComment(CommentModel comment) throws BusinessException
PrintCollaborationFacadeCommentModel. In case deletion is restricted a
BusinessException is
thrown.deleteComment in interface PrintCollaborationFacadecomment - the CommentModel which should be deleted.BusinessExceptionpublic Collection<CommentModel> filterAndSortComments(Collection<FilterCondition> filterConditions, List<SortCondition> sortConditions, Collection<CommentModel> comments)
PrintCollaborationFacadeCommentModels 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.filterAndSortComments in interface PrintCollaborationFacadefilterConditions - 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.public PrincipalModel getAssignee(UserModel principal)
PrintCollaborationFacadePrincipalModel (e.g. UserGroupModel) for the given UserModel which has all access rights to edit/create CommentModels
and change
the states within a WorkflowModel.getAssignee in interface PrintCollaborationFacadeprincipal - the UserModel where the PrincipalModels should be takenPrincipalModelpublic WorkflowActionModel getCurrentAction(AbstractCommentModel comment)
PrintCollaborationFacadestatus of the given AbstractCommentModel.
It should
delegate to
PrintJobService.getCurrentActionsfor the actual assignment.getCurrentAction in interface PrintCollaborationFacadecomment - the AbstractCommentModel where the current WorkflowActionModel should be taken fromWorkflowActionModel of the given AbstractCommentModel if it is a job, null
otherwisepublic List<PrintJobHistoryEntryDTO> getJobHistory(AbstractCommentModel commentItemModel)
PrintCollaborationFacadePrintJobHistoryEntryDTOs for the
WorkflowModel of the given job . It also
should delegate
PrintJobService.getJobHistory for the actual assignment.getJobHistory in interface PrintCollaborationFacadecommentItemModel - the CommentModel where the PrintJobHistoryEntryDTOs should be taken fromPrintJobHistoryEntryDTOs which were found for the given CommentModelpublic ItemModel getLastChange(CommentModel comment)
PrintCollaborationFacadeReplyModel 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.getLastChange in interface PrintCollaborationFacadecomment - the CommentModel where the last change should be taken fromItemModelpublic void setCommentService(CommentService commentService)
public void setCommentGroupService(CommentGroupService commentGroupService)
public void setModelService(ModelService modelService)
public void setPrintCommentService(PrintCommentService printCommentService)
public void setPrintJobService(PrintJobService printJobService)
public void setWorkflowProcessingService(WorkflowProcessingService workflowProcessingService)
Copyright © 2017 SAP SE. All Rights Reserved.