Class SCommentServiceImpl
- java.lang.Object
-
- org.bonitasoft.engine.core.process.comment.api.impl.SCommentServiceImpl
-
- All Implemented Interfaces:
SCommentService
public class SCommentServiceImpl extends java.lang.Object implements SCommentService
- Author:
- Hongwen Zang, Baptiste Mesta, Matthieu Chaffotte, Celine Souchet
-
-
Field Summary
-
Fields inherited from interface org.bonitasoft.engine.core.process.comment.api.SCommentService
COMMENT, COMMMENT_IS_DELETED
-
-
Constructor Summary
Constructors Constructor Description SCommentServiceImpl(Recorder recorder, ReadPersistenceService persistenceService, ArchiveService archiveService, SessionService sessionService, ReadSessionAccessor sessionAccessor, java.util.Map<SystemCommentType,java.lang.Boolean> systemCommentType)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SCommentaddComment(long processInstanceId, java.lang.String comment, long userId)Add a comment on process instanceSCommentaddSystemComment(long processInstanceId, java.lang.String comment)Add a system comment on process instancevoidarchive(long archiveDate, SComment sComment)voiddelete(SComment comment)Delete the commentvoiddeleteArchivedComments(java.util.List<java.lang.Long> processInstanceIds)Delete archived comments for specified process instancesvoiddeleteComments(long processInstanceId)Delete comments for a specified process instanceSACommentgetArchivedComment(long archivedCommentId)java.util.List<SComment>getComments(long processInstanceId)Deprecated.java.util.List<SComment>getComments(long processInstanceId, QueryOptions queryOptions)Get comments for the given processInstancelonggetNumberOfArchivedComments(QueryOptions searchOptions)Search number of archived CommentslonggetNumberOfComments(QueryOptions options)Number of all comments related to the specified query options.longgetNumberOfCommentsInvolvingUser(long userId, QueryOptions searchOptions)Search number of all the comments on process instants that the user can accesslonggetNumberOfCommentsManagedBy(long managerUserId, QueryOptions searchOptions)Search number of the comments visible by delegates of managerUserIdlonggetNumberOfCommentsSupervisedBy(long supervisorId, QueryOptions queryOptions)Search number of Comment for a specific supervisorbooleanisCommentEnabled(SystemCommentType sct)Returning true if the system comments are enabled for the specific SystemCommentType.java.util.List<SAComment>searchArchivedComments(QueryOptions searchOptions)Search archived Commentsjava.util.List<SComment>searchComments(QueryOptions options)List all comments related to the specified query options.java.util.List<SComment>searchCommentsInvolvingUser(long userId, QueryOptions queryOptions)List all the comments on process instants that the user can accessjava.util.List<SComment>searchCommentsManagedBy(long managerUserId, QueryOptions searchOptions)Search comments visible by delegates of managerUserIdjava.util.List<SComment>searchCommentsSupervisedBy(long supervisorId, QueryOptions queryOptions)Search an Comment for a specific supervisor
-
-
-
Constructor Detail
-
SCommentServiceImpl
public SCommentServiceImpl(Recorder recorder, ReadPersistenceService persistenceService, ArchiveService archiveService, SessionService sessionService, ReadSessionAccessor sessionAccessor, java.util.Map<SystemCommentType,java.lang.Boolean> systemCommentType)
-
-
Method Detail
-
searchComments
public java.util.List<SComment> searchComments(QueryOptions options) throws SBonitaReadException
Description copied from interface:SCommentServiceList all comments related to the specified query options.- Specified by:
searchCommentsin interfaceSCommentService- Parameters:
options- a QueryOptions object, containing some query conditions- Returns:
- a list of SComment objects corresponding to the criteria
- Throws:
SBonitaReadException
-
getNumberOfComments
public long getNumberOfComments(QueryOptions options) throws SBonitaReadException
Description copied from interface:SCommentServiceNumber of all comments related to the specified query options.- Specified by:
getNumberOfCommentsin interfaceSCommentService- Parameters:
options- a QueryOptions object, containing some query conditions- Returns:
- number of all comments corresponding to the criteria.
- Throws:
SBonitaReadException
-
getComments
@Deprecated public java.util.List<SComment> getComments(long processInstanceId) throws SBonitaReadException
Deprecated.Description copied from interface:SCommentServiceGet the first 20 comments for the given processInstance- Specified by:
getCommentsin interfaceSCommentService- Parameters:
processInstanceId- identifier of processInstance- Returns:
- a list of SComment object
- Throws:
SBonitaReadException- in case of read error
-
getComments
public java.util.List<SComment> getComments(long processInstanceId, QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:SCommentServiceGet comments for the given processInstance- Specified by:
getCommentsin interfaceSCommentService- Parameters:
processInstanceId- identifier of processInstancequeryOptions- the query options to filter the results- Returns:
- a list of SComment object
- Throws:
SBonitaReadException- in case of read error
-
addComment
public SComment addComment(long processInstanceId, java.lang.String comment, long userId) throws SCommentAddException
Description copied from interface:SCommentServiceAdd a comment on process instance- Specified by:
addCommentin interfaceSCommentService- Parameters:
processInstanceId- identifier of processInstancecomment- the comment you want to adduserId- The user that will be said to have made the comment- Throws:
SCommentAddException
-
addSystemComment
public SComment addSystemComment(long processInstanceId, java.lang.String comment) throws SCommentAddException
Description copied from interface:SCommentServiceAdd a system comment on process instance- Specified by:
addSystemCommentin interfaceSCommentService- Parameters:
processInstanceId- identifier of processInstancecomment- the comment you want to add- Throws:
SCommentAddException
-
delete
public void delete(SComment comment) throws SCommentDeletionException
Description copied from interface:SCommentServiceDelete the comment- Specified by:
deletein interfaceSCommentService- Throws:
SCommentDeletionException
-
deleteComments
public void deleteComments(long processInstanceId) throws SBonitaExceptionDescription copied from interface:SCommentServiceDelete comments for a specified process instance- Specified by:
deleteCommentsin interfaceSCommentService- Throws:
SBonitaException
-
getNumberOfCommentsSupervisedBy
public long getNumberOfCommentsSupervisedBy(long supervisorId, QueryOptions queryOptions) throws SBonitaReadExceptionDescription copied from interface:SCommentServiceSearch number of Comment for a specific supervisor- Specified by:
getNumberOfCommentsSupervisedByin interfaceSCommentService- Parameters:
supervisorId- the identifier of supervisorqueryOptions- a map of specific parameters of a query- Returns:
- number of Comment for a specific supervisor
- Throws:
SBonitaReadException- if a Read exception occurs
-
searchCommentsSupervisedBy
public java.util.List<SComment> searchCommentsSupervisedBy(long supervisorId, QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:SCommentServiceSearch an Comment for a specific supervisor- Specified by:
searchCommentsSupervisedByin interfaceSCommentService- Parameters:
supervisorId- the identifier of supervisorqueryOptions- a map of specific parameters of a query- Returns:
- an Comment for a specific supervisor
- Throws:
SBonitaReadException- if a Read exception occurs
-
getNumberOfCommentsInvolvingUser
public long getNumberOfCommentsInvolvingUser(long userId, QueryOptions searchOptions) throws SBonitaReadExceptionDescription copied from interface:SCommentServiceSearch number of all the comments on process instants that the user can access- Specified by:
getNumberOfCommentsInvolvingUserin interfaceSCommentService- Parameters:
userId- identifier of usersearchOptions- a QueryOptions object, containing some query conditions- Returns:
- number of all the comments on process instants that the user can access
- Throws:
SBonitaReadException
-
searchCommentsInvolvingUser
public java.util.List<SComment> searchCommentsInvolvingUser(long userId, QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:SCommentServiceList all the comments on process instants that the user can access- Specified by:
searchCommentsInvolvingUserin interfaceSCommentService- Parameters:
userId- identifier of userqueryOptions- a QueryOptions object, containing some query conditions- Returns:
- a list of comments on process instants that the user can access
- Throws:
SBonitaReadException
-
getNumberOfCommentsManagedBy
public long getNumberOfCommentsManagedBy(long managerUserId, QueryOptions searchOptions) throws SBonitaReadExceptionDescription copied from interface:SCommentServiceSearch number of the comments visible by delegates of managerUserId- Specified by:
getNumberOfCommentsManagedByin interfaceSCommentService- Parameters:
managerUserId- identifier of a manager usersearchOptions- a QueryOptions object, containing some query conditions- Returns:
- number of the comments visible by delegates of managerUserId
- Throws:
SBonitaReadException
-
searchCommentsManagedBy
public java.util.List<SComment> searchCommentsManagedBy(long managerUserId, QueryOptions searchOptions) throws SBonitaReadException
Description copied from interface:SCommentServiceSearch comments visible by delegates of managerUserId- Specified by:
searchCommentsManagedByin interfaceSCommentService- Parameters:
managerUserId- identifier of a manager usersearchOptions- a QueryOptions object, containing some query conditions- Returns:
- a list of comments visible by delegates of managerUserId
- Throws:
SBonitaReadException
-
getNumberOfArchivedComments
public long getNumberOfArchivedComments(QueryOptions searchOptions) throws SBonitaReadException
Description copied from interface:SCommentServiceSearch number of archived Comments- Specified by:
getNumberOfArchivedCommentsin interfaceSCommentService- Throws:
SBonitaReadException
-
searchArchivedComments
public java.util.List<SAComment> searchArchivedComments(QueryOptions searchOptions) throws SBonitaReadException
Description copied from interface:SCommentServiceSearch archived Comments- Specified by:
searchArchivedCommentsin interfaceSCommentService- Parameters:
searchOptions- a QueryOptions object, containing some query conditions- Returns:
- a list with archived Comments
- Throws:
SBonitaReadException
-
isCommentEnabled
public boolean isCommentEnabled(SystemCommentType sct)
Description copied from interface:SCommentServiceReturning true if the system comments are enabled for the specific SystemCommentType.- Specified by:
isCommentEnabledin interfaceSCommentService- Parameters:
sct- A Enum for system comments- Returns:
- Returning true if the system comments are enabled for the specific SystemCommentType.
-
getArchivedComment
public SAComment getArchivedComment(long archivedCommentId) throws SCommentNotFoundException, SBonitaReadException
- Specified by:
getArchivedCommentin interfaceSCommentService- Throws:
SCommentNotFoundExceptionSBonitaReadException
-
deleteArchivedComments
public void deleteArchivedComments(java.util.List<java.lang.Long> processInstanceIds) throws SBonitaExceptionDescription copied from interface:SCommentServiceDelete archived comments for specified process instances- Specified by:
deleteArchivedCommentsin interfaceSCommentService- Throws:
SBonitaException
-
archive
public void archive(long archiveDate, SComment sComment) throws SObjectModificationException- Specified by:
archivein interfaceSCommentService- Throws:
SObjectModificationException
-
-