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 SComment
addComment(long processInstanceId, java.lang.String comment, long userId)
Add a comment on process instanceSComment
addSystemComment(long processInstanceId, java.lang.String comment)
Add a system comment on process instancevoid
archive(long archiveDate, SComment sComment)
void
delete(SComment comment)
Delete the commentvoid
deleteArchivedComments(java.util.List<java.lang.Long> processInstanceIds)
Delete archived comments for specified process instancesvoid
deleteComments(long processInstanceId)
Delete comments for a specified process instanceSAComment
getArchivedComment(long archivedCommentId)
java.util.List<SComment>
getComments(long processInstanceId)
Deprecated.java.util.List<SComment>
getComments(long processInstanceId, QueryOptions queryOptions)
Get comments for the given processInstancelong
getNumberOfArchivedComments(QueryOptions searchOptions)
Search number of archived Commentslong
getNumberOfComments(QueryOptions options)
Number of all comments related to the specified query options.long
getNumberOfCommentsInvolvingUser(long userId, QueryOptions searchOptions)
Search number of all the comments on process instants that the user can accesslong
getNumberOfCommentsManagedBy(long managerUserId, QueryOptions searchOptions)
Search number of the comments visible by delegates of managerUserIdlong
getNumberOfCommentsSupervisedBy(long supervisorId, QueryOptions queryOptions)
Search number of Comment for a specific supervisorboolean
isCommentEnabled(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:SCommentService
List all comments related to the specified query options.- Specified by:
searchComments
in 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:SCommentService
Number of all comments related to the specified query options.- Specified by:
getNumberOfComments
in 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:SCommentService
Get the first 20 comments for the given processInstance- Specified by:
getComments
in 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:SCommentService
Get comments for the given processInstance- Specified by:
getComments
in 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:SCommentService
Add a comment on process instance- Specified by:
addComment
in 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:SCommentService
Add a system comment on process instance- Specified by:
addSystemComment
in 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:SCommentService
Delete the comment- Specified by:
delete
in interfaceSCommentService
- Throws:
SCommentDeletionException
-
deleteComments
public void deleteComments(long processInstanceId) throws SBonitaException
Description copied from interface:SCommentService
Delete comments for a specified process instance- Specified by:
deleteComments
in interfaceSCommentService
- Throws:
SBonitaException
-
getNumberOfCommentsSupervisedBy
public long getNumberOfCommentsSupervisedBy(long supervisorId, QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:SCommentService
Search number of Comment for a specific supervisor- Specified by:
getNumberOfCommentsSupervisedBy
in 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:SCommentService
Search an Comment for a specific supervisor- Specified by:
searchCommentsSupervisedBy
in 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 SBonitaReadException
Description copied from interface:SCommentService
Search number of all the comments on process instants that the user can access- Specified by:
getNumberOfCommentsInvolvingUser
in 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:SCommentService
List all the comments on process instants that the user can access- Specified by:
searchCommentsInvolvingUser
in 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 SBonitaReadException
Description copied from interface:SCommentService
Search number of the comments visible by delegates of managerUserId- Specified by:
getNumberOfCommentsManagedBy
in 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:SCommentService
Search comments visible by delegates of managerUserId- Specified by:
searchCommentsManagedBy
in 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:SCommentService
Search number of archived Comments- Specified by:
getNumberOfArchivedComments
in interfaceSCommentService
- Throws:
SBonitaReadException
-
searchArchivedComments
public java.util.List<SAComment> searchArchivedComments(QueryOptions searchOptions) throws SBonitaReadException
Description copied from interface:SCommentService
Search archived Comments- Specified by:
searchArchivedComments
in 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:SCommentService
Returning true if the system comments are enabled for the specific SystemCommentType.- Specified by:
isCommentEnabled
in 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:
getArchivedComment
in interfaceSCommentService
- Throws:
SCommentNotFoundException
SBonitaReadException
-
deleteArchivedComments
public void deleteArchivedComments(java.util.List<java.lang.Long> processInstanceIds) throws SBonitaException
Description copied from interface:SCommentService
Delete archived comments for specified process instances- Specified by:
deleteArchivedComments
in interfaceSCommentService
- Throws:
SBonitaException
-
archive
public void archive(long archiveDate, SComment sComment) throws SObjectModificationException
- Specified by:
archive
in interfaceSCommentService
- Throws:
SObjectModificationException
-
-