public class DefaultPrintCommentService extends Object implements PrintCommentService
PrintCommentService.CommentType| Constructor and Description |
|---|
DefaultPrintCommentService() |
| Modifier and Type | Method and Description |
|---|---|
CommentModel |
createComment(UserModel author,
String text)
|
void |
deleteComment(CommentModel comment)
This method should delete the given
CommentModel. |
Collection<CommentModel> |
filterComments(Collection<FilterCondition> filterConditions,
Collection<CommentModel> comments)
This method should filter the given collection of
CommentModel by the provided FilterConditions. |
ReplyModel |
getLastChange(CommentModel comment)
This method should return the last modified
ReplyModel if there are any. |
void |
setFilterStrategies(Map<String,FilterStrategy> filterStrategies) |
void |
setModelService(ModelService modelService) |
void |
setPrintCommentDao(PrintCommentDao printCommentDao) |
void |
setSortStrategies(Map<String,Comparator<CommentModel>> sortStrategies) |
List<CommentModel> |
sortComments(List<SortCondition> sortConditions,
List<CommentModel> comments)
This method should be used for sorting the given list of
CommentModels by the provided
SortConditions. |
public CommentModel createComment(UserModel author, String text)
PrintCommentServicecreateComment in interface PrintCommentServiceauthor - the UserModel which should be set as the author of the CommentModeltext - the String which should be set for the CommentModelCommentModelpublic void deleteComment(CommentModel comment)
PrintCommentServiceCommentModel. After deletion additionally the comment group should be
checked
for emptiness. Empty comment groups should be deleted then.deleteComment in interface PrintCommentServicecomment - the CommentModel which should be deleted.public Collection<CommentModel> filterComments(Collection<FilterCondition> filterConditions, Collection<CommentModel> comments)
PrintCommentServiceCommentModel by the provided FilterConditions.filterComments in interface PrintCommentServicefilterConditions - a collection of FilterConditions which should be used for filtering the commentscomments - a collection of CommentModels including their
WorkflowModel should be filtered by the given
FilterConditionsCommentModel or a empty collection if no CommentModel were
given or all
were filtered.public ReplyModel getLastChange(CommentModel comment)
PrintCommentServiceReplyModel if there are any.getLastChange in interface PrintCommentServicecomment - the CommentModel where the last change should be taken fromReplyModelpublic List<CommentModel> sortComments(List<SortCondition> sortConditions, List<CommentModel> comments)
PrintCommentServiceCommentModels by the provided
SortConditions.sortComments in interface PrintCommentServicesortConditions - a list of SortConditions which should be used for sorting. Higher priorised
conditions should
be set first.comments - the list of CommentModels which should be sorted with SortConditionsCommentModels list or empty list if no CommentModels were given.public void setModelService(ModelService modelService)
public void setPrintCommentDao(PrintCommentDao printCommentDao)
public void setFilterStrategies(Map<String,FilterStrategy> filterStrategies)
public void setSortStrategies(Map<String,Comparator<CommentModel>> sortStrategies)
Copyright © 2017 SAP SE. All Rights Reserved.