|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@PublicApi public interface CommentManager
The CommentManager is used to retrieve and create comments in JIRA. Comments are always associated with an issue.
Field Summary | |
---|---|
static String |
EVENT_ORIGINAL_COMMENT_PARAMETER
Retrieves all Comment s on the
given Issue that the given ApplicationUser has permission to see. |
Method Summary | |
---|---|
Comment |
convertToComment(org.ofbiz.core.entity.GenericValue commentGV)
This is a convenience method that can be used to convert a GenericValue representation of a comment to a comment object. |
Comment |
create(Issue issue,
ApplicationUser author,
ApplicationUser updateAuthor,
String body,
String groupLevel,
Long roleLevelId,
Date created,
Date updated,
boolean dispatchEvent)
|
Comment |
create(Issue issue,
ApplicationUser author,
ApplicationUser updateAuthor,
String body,
String groupLevel,
Long roleLevelId,
Date created,
Date updated,
boolean dispatchEvent,
boolean tweakIssueUpdateDate)
Creates a comment and associates it with the given issue. |
Comment |
create(Issue issue,
ApplicationUser author,
String body,
boolean dispatchEvent)
Creates a comment and associates it with the given issue. |
Comment |
create(Issue issue,
ApplicationUser author,
String body,
String groupLevel,
Long roleLevelId,
boolean dispatchEvent)
Creates a comment and associates it with the given issue. |
Comment |
create(Issue issue,
ApplicationUser author,
String body,
String groupLevel,
Long roleLevelId,
Date created,
boolean dispatchEvent)
Creates a comment and associates it with the given issue. |
Comment |
create(Issue issue,
String author,
String body,
boolean dispatchEvent)
Deprecated. Use create(Issue issue, ApplicationUser author, String body, boolean dispatchEvent) instead. Since v6.0.
Creates a comment and associates it with the given issue. Using this method the comment will be created
with a createdDate of the current date/time and with no visibility restrictions. |
Comment |
create(Issue issue,
String author,
String body,
String groupLevel,
Long roleLevelId,
boolean dispatchEvent)
Deprecated. Use create(Issue issue, ApplicationUser author, String body, String groupLevel, Long roleLevelId, boolean dispatchEvent) instead. Since v6.0.
Creates a comment and associates it with the given issue. Using this method the comment will be created
with a createdDate of the current time. If you have provided a groupLevel then the comment visibility will be restricted
to the provided group, it is assumed that validation to ensure that the group actually exists has been performed
outside of this method. If you have provided a roleLevelId then the comment visibility will be restricted to the
provided role, it is assumed that validation to ensure that the role actually exists has been performed outside
of this method.
NOTE: A comment should not have both a group level and role level visibility restriction. This
method will not stop this, but it does not semantically make sense. |
Comment |
create(Issue issue,
String author,
String body,
String groupLevel,
Long roleLevelId,
Date created,
boolean dispatchEvent)
Deprecated. Use create(Issue issue, ApplicationUser author, String body, String groupLevel, Long roleLevelId, Date created, boolean dispatchEvent) instead. Since v6.0.
Creates a comment and associates it with the given issue. Using this method the comment will be created
with a createdDate of the specified date. This method should be used if you are trying to preserve existing
information and it is important to retain the original created date. If you have provided a groupLevel then the
comment visibility will be restricted to the provided group, it is assumed that validation to ensure that the
group actually exists has been performed outside of this method. If you have provided a roleLevelId then the
comment visibility will be restricted to the provided role, it is assumed that validation to ensure that the
role actually exists has been performed outside of this method.
NOTE: A comment should not have both a group level and role level visibility restriction. This
method will not stop this, but it does not semantically make sense. |
Comment |
create(Issue issue,
String author,
String updateAuthor,
String body,
String groupLevel,
Long roleLevelId,
Date created,
Date updated,
boolean dispatchEvent)
Deprecated. Use create(Issue issue, ApplicationUser author, ApplicationUser updateAuthor, String body, String groupLevel, Long roleLevelId, Date created, Date updated, boolean dispatchEvent) instead. Since v6.0.
Creates a comment and associates it with the given issue. Using this method the comment will be created
with a createdDate of the specified date. This method should be used if you are trying to preserve existing
information and it is important to retain the original created date. If you have provided a groupLevel then the
comment visibility will be restricted to the provided group, it is assumed that validation to ensure that the
group actually exists has been performed outside of this method. If you have provided a roleLevelId then the
comment visibility will be restricted to the provided role, it is assumed that validation to ensure that the
role actually exists has been performed outside of this method.
NOTE: A comment should not have both a group level and role level visibility restriction. This
method will not stop this, but it does not semantically make sense. |
Comment |
create(Issue issue,
String author,
String updateAuthor,
String body,
String groupLevel,
Long roleLevelId,
Date created,
Date updated,
boolean dispatchEvent,
boolean tweakIssueUpdateDate)
Deprecated. Use create(com.atlassian.jira.issue.Issue, com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.user.ApplicationUser, String, String, Long, java.util.Date, java.util.Date, boolean, boolean) instead. Since v6.0.
Creates a comment and associates it with the given issue. Using this method the comment will be created
with a createdDate of the specified date. This method should be used if you are trying to preserve existing
information and it is important to retain the original created date. If you have provided a groupLevel then the
comment visibility will be restricted to the provided group, it is assumed that validation to ensure that the
group actually exists has been performed outside of this method. If you have provided a roleLevelId then the
comment visibility will be restricted to the provided role, it is assumed that validation to ensure that the
role actually exists has been performed outside of this method.
NOTE: A comment should not have both a group level and role level visibility restriction. This
method will not stop this, but it does not semantically make sense. |
ChangeItemBean |
delete(Comment comment)
Deletes the specified comment. |
Comment |
getCommentById(Long commentId)
Will return a comment for the passed in commentId. |
List<Comment> |
getComments(Issue issue)
This will return all comments for a given issue. |
List<Comment> |
getCommentsForUser(Issue issue,
ApplicationUser user)
Retrieves all Comment s on the
given Issue that the given ApplicationUser has permission to see. |
List<Comment> |
getCommentsForUser(Issue issue,
com.atlassian.crowd.embedded.api.User user)
Deprecated. Use getCommentsForUser(Issue issue, ApplicationUser user) instead. Since v6.0.
Retrieves all Comment s on the
given Issue that the given User has permission to see.
If the passed in user is null, only comments with no permission level set will be returned.
NOTE: keep in mind null user represents an anonymous i.e. non-logged in user. |
long |
getCountForCommentsRestrictedByGroup(String groupName)
Returns the count of all Comment 's that have their visibility restricted by the named group. |
MutableComment |
getMutableComment(Long commentId)
Retrieves comment by given id and returns it as mutable object. |
ProjectRole |
getProjectRole(Long projectRoleId)
This is a convenience method to allow us to easily get a ProjectRole. |
boolean |
isUserCommentAuthor(ApplicationUser user,
Comment comment)
Returns true if the given user is the author of the given comment. |
boolean |
isUserCommentAuthor(com.atlassian.crowd.embedded.api.User user,
Comment comment)
Deprecated. Use isUserCommentAuthor(ApplicationUser user, Comment comment) instead. Since v6.0.
Returns true if the given user is the author of the given comment.
If the given Comment has a null author, this represents that it was created anonymously, and no-one is the author (returns false). If the given User is null, then this represents that the current user is anonymous, and the method will always return false. |
int |
swapCommentGroupRestriction(String groupName,
String swapGroup)
Updates Comment 's such that comments that have a visibility
restriction of the provided groupName will be changed to have a visibility restriction of the
provided swapGroup. |
void |
update(Comment comment,
boolean dispatchEvent)
Persists the updated comment. |
Field Detail |
---|
static final String EVENT_ORIGINAL_COMMENT_PARAMETER
Comment
s on the
given Issue that the given ApplicationUser
has permission to see.
If the passed in user is null, only comments with no permission level set will be returned.
NOTE: keep in mind null user represents an anonymous i.e. non-logged in user.
Method Detail |
---|
List<Comment> getCommentsForUser(Issue issue, ApplicationUser user)
Comment
s on the
given Issue that the given ApplicationUser
has permission to see.
If the passed in user is null, only comments with no permission level set will be returned.
NOTE: keep in mind null user represents an anonymous i.e. non-logged in user.
issue
- the comments are associated with.user
- the user whose permission level will be used to limit the comments returned.
Comment
sList<Comment> getCommentsForUser(Issue issue, com.atlassian.crowd.embedded.api.User user)
getCommentsForUser(Issue issue, ApplicationUser user)
instead. Since v6.0.
Retrieves all Comment
s on the
given Issue that the given User
has permission to see.
If the passed in user is null, only comments with no permission level set will be returned.
NOTE: keep in mind null user represents an anonymous i.e. non-logged in user.
issue
- the comments are associated with.user
- the user whose permission level will be used to limit the comments returned.
Comment
sList<Comment> getComments(Issue issue)
User
please use
getCommentsForUser(com.atlassian.jira.issue.Issue, com.atlassian.jira.user.ApplicationUser)
)}
issue
- the comments are associated with.
Comment create(Issue issue, ApplicationUser author, String body, boolean dispatchEvent)
issue
- the issue to associate the comment with.author
- the key of the user who has created this comment.body
- the text of the comment.dispatchEvent
- if true then an event of type EventType.ISSUE_COMMENTED_ID
will be dispatched and any notifications listening for that event will be triggered.
If false no event will be dispatched.
Comment create(Issue issue, String author, String body, boolean dispatchEvent)
create(Issue issue, ApplicationUser author, String body, boolean dispatchEvent)
instead. Since v6.0.
Creates a comment and associates it with the given issue. Using this method the comment will be created
with a createdDate of the current date/time and with no visibility restrictions.
issue
- the issue to associate the comment with.author
- the key of the user who has created this comment.body
- the text of the comment.dispatchEvent
- if true then an event of type EventType.ISSUE_COMMENTED_ID
will be dispatched and any notifications listening for that event will be triggered.
If false no event will be dispatched.
Comment create(Issue issue, ApplicationUser author, String body, String groupLevel, Long roleLevelId, boolean dispatchEvent)
issue
- the issue to associate the comment with.author
- the key of the user who has created this comment.body
- the text of the comment.groupLevel
- is the group name to limit comment visibility to, this must be a valid group name.roleLevelId
- is the id of the the ProjectRole
to limit comment visibility to, this must reference a
valid project role.dispatchEvent
- if true then an event of type EventType.ISSUE_COMMENTED_ID
will be dispatched and any notifications listening for that event will be triggered.
If false no event will be dispatched.
Comment create(Issue issue, String author, String body, String groupLevel, Long roleLevelId, boolean dispatchEvent)
create(Issue issue, ApplicationUser author, String body, String groupLevel, Long roleLevelId, boolean dispatchEvent)
instead. Since v6.0.
Creates a comment and associates it with the given issue. Using this method the comment will be created
with a createdDate of the current time. If you have provided a groupLevel then the comment visibility will be restricted
to the provided group, it is assumed that validation to ensure that the group actually exists has been performed
outside of this method. If you have provided a roleLevelId then the comment visibility will be restricted to the
provided role, it is assumed that validation to ensure that the role actually exists has been performed outside
of this method.
NOTE: A comment should not have both a group level and role level visibility restriction. This
method will not stop this, but it does not semantically make sense.
issue
- the issue to associate the comment with.author
- the key of the user who has created this comment.body
- the text of the comment.groupLevel
- is the group name to limit comment visibility to, this must be a valid group name.roleLevelId
- is the id of the the ProjectRole
to limit comment visibility to, this must reference a
valid project role.dispatchEvent
- if true then an event of type EventType.ISSUE_COMMENTED_ID
will be dispatched and any notifications listening for that event will be triggered.
If false no event will be dispatched.
Comment create(Issue issue, ApplicationUser author, String body, String groupLevel, Long roleLevelId, Date created, boolean dispatchEvent)
issue
- the issue to associate the comment with.author
- the key of the user who has created this comment.body
- the text of the comment.groupLevel
- is the group name to limit comment visibility to, this must be a valid group name.roleLevelId
- is the id of the the ProjectRole
to limit comment visibility to, this must reference a
valid project role.created
- is the date that will be used as the comments creation date.dispatchEvent
- if true then an event of type EventType.ISSUE_COMMENTED_ID
will be dispatched and any notifications listening for that event will be triggered.
If false no event will be dispatched.
Comment create(Issue issue, String author, String body, String groupLevel, Long roleLevelId, Date created, boolean dispatchEvent)
create(Issue issue, ApplicationUser author, String body, String groupLevel, Long roleLevelId, Date created, boolean dispatchEvent)
instead. Since v6.0.
Creates a comment and associates it with the given issue. Using this method the comment will be created
with a createdDate of the specified date. This method should be used if you are trying to preserve existing
information and it is important to retain the original created date. If you have provided a groupLevel then the
comment visibility will be restricted to the provided group, it is assumed that validation to ensure that the
group actually exists has been performed outside of this method. If you have provided a roleLevelId then the
comment visibility will be restricted to the provided role, it is assumed that validation to ensure that the
role actually exists has been performed outside of this method.
NOTE: A comment should not have both a group level and role level visibility restriction. This
method will not stop this, but it does not semantically make sense.
issue
- the issue to associate the comment with.author
- the key of the user who has created this comment.body
- the text of the comment.groupLevel
- is the group name to limit comment visibility to, this must be a valid group name.roleLevelId
- is the id of the the ProjectRole
to limit comment visibility to, this must reference a
valid project role.created
- is the date that will be used as the comments creation date.dispatchEvent
- if true then an event of type EventType.ISSUE_COMMENTED_ID
will be dispatched and any notifications listening for that event will be triggered.
If false no event will be dispatched.
Comment create(Issue issue, ApplicationUser author, ApplicationUser updateAuthor, String body, String groupLevel, Long roleLevelId, Date created, Date updated, boolean dispatchEvent)
Comment create(Issue issue, String author, String updateAuthor, String body, String groupLevel, Long roleLevelId, Date created, Date updated, boolean dispatchEvent)
create(Issue issue, ApplicationUser author, ApplicationUser updateAuthor, String body, String groupLevel, Long roleLevelId, Date created, Date updated, boolean dispatchEvent)
instead. Since v6.0.
Creates a comment and associates it with the given issue. Using this method the comment will be created
with a createdDate of the specified date. This method should be used if you are trying to preserve existing
information and it is important to retain the original created date. If you have provided a groupLevel then the
comment visibility will be restricted to the provided group, it is assumed that validation to ensure that the
group actually exists has been performed outside of this method. If you have provided a roleLevelId then the
comment visibility will be restricted to the provided role, it is assumed that validation to ensure that the
role actually exists has been performed outside of this method.
NOTE: A comment should not have both a group level and role level visibility restriction. This
method will not stop this, but it does not semantically make sense.
issue
- the issue to associate the comment with.author
- the key of the user who has created this comment.updateAuthor
- the key of the user who has updated this comment lastbody
- the text of the comment.groupLevel
- is the group name to limit comment visibility to, this must be a valid group name.roleLevelId
- is the id of the the ProjectRole
to limit comment visibility to, this must reference a
valid project role.created
- is the date that will be used as the comments creation date.updated
- is the date that will be used as the comments updated date.dispatchEvent
- if true then an event of type EventType.ISSUE_COMMENTED_ID
will be dispatched and any notifications listening for that event will be triggered.
If false no event will be dispatched.
Comment create(Issue issue, ApplicationUser author, ApplicationUser updateAuthor, String body, String groupLevel, Long roleLevelId, Date created, Date updated, boolean dispatchEvent, boolean tweakIssueUpdateDate)
issue
- the issue to associate the comment with.author
- the key of the user who has created this comment.updateAuthor
- the key of the user who has updated this comment lastbody
- the text of the comment.groupLevel
- is the group name to limit comment visibility to, this must be a valid group name.roleLevelId
- is the id of the the ProjectRole
to limit comment visibility to, this must reference a
valid project role.created
- is the date that will be used as the comments creation date.updated
- is the date that will be used as the comments updated date.dispatchEvent
- if true then an event of type EventType.ISSUE_COMMENTED_ID
will be dispatched and any notifications listening for that event will be triggered.
If false no event will be dispatched.tweakIssueUpdateDate
- if true the issues 'updated' date will be set to now.
Comment create(Issue issue, String author, String updateAuthor, String body, String groupLevel, Long roleLevelId, Date created, Date updated, boolean dispatchEvent, boolean tweakIssueUpdateDate)
create(com.atlassian.jira.issue.Issue, com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.user.ApplicationUser, String, String, Long, java.util.Date, java.util.Date, boolean, boolean)
instead. Since v6.0.
Creates a comment and associates it with the given issue. Using this method the comment will be created
with a createdDate of the specified date. This method should be used if you are trying to preserve existing
information and it is important to retain the original created date. If you have provided a groupLevel then the
comment visibility will be restricted to the provided group, it is assumed that validation to ensure that the
group actually exists has been performed outside of this method. If you have provided a roleLevelId then the
comment visibility will be restricted to the provided role, it is assumed that validation to ensure that the
role actually exists has been performed outside of this method.
NOTE: A comment should not have both a group level and role level visibility restriction. This
method will not stop this, but it does not semantically make sense.
issue
- the issue to associate the comment with.author
- the key of the user who has created this comment.updateAuthor
- the key of the user who has updated this comment lastbody
- the text of the comment.groupLevel
- is the group name to limit comment visibility to, this must be a valid group name.roleLevelId
- is the id of the the ProjectRole
to limit comment visibility to, this must reference a
valid project role.created
- is the date that will be used as the comments creation date.updated
- is the date that will be used as the comments updated date.dispatchEvent
- if true then an event of type EventType.ISSUE_COMMENTED_ID
will be dispatched and any notifications listening for that event will be triggered.
If false no event will be dispatched.tweakIssueUpdateDate
- if true the issues 'updated' date will be set to now.
ProjectRole getProjectRole(Long projectRoleId)
ProjectRole
.
NOTE: If you are trying to retrieve a ProjectRole
then you should be using the
ProjectRoleManager
.
projectRoleId
- the id to the ProjectRole
object you would like returned.
Comment convertToComment(org.ofbiz.core.entity.GenericValue commentGV)
commentGV
- is the GenericValue representation of a comment.
Comment getCommentById(Long commentId)
commentId
- the id representing the Comment
you would like to retrieve.
Comment
or null (if the user cannot browse the comment).
IllegalArgumentException
- if its id is nullMutableComment getMutableComment(Long commentId)
commentId
- comment id
IllegalArgumentException
- if its id is nullvoid update(Comment comment, boolean dispatchEvent)
comment
- to updatedispatchEvent
- if true then an event of type EventType.ISSUE_COMMENT_EDITED_ID
will be dispatched and any notifications listening for that event will be triggered.
If false no event will be dispatched.
IllegalArgumentException
- if comment passed in is null or its id is nullint swapCommentGroupRestriction(String groupName, String swapGroup)
Comment
's such that comments that have a visibility
restriction of the provided groupName will be changed to have a visibility restriction of the
provided swapGroup.
Note: There is no validation performed by this method to determine if the provided swapGroup is a valid
group with JIRA. This validation must be done by the caller.
groupName
- identifies the group the comments are restricted by, this must not be null.swapGroup
- identifies the group the comments will be changed to be restricted by, this must not be null.
long getCountForCommentsRestrictedByGroup(String groupName)
Comment
's that have their visibility restricted by the named group.
groupName
- identifies the group the comments are restricted by, this must not be null.
Comment
's who's visibility are restricted by the passed in group name.ChangeItemBean delete(Comment comment)
comment
- to delete
IllegalArgumentException
- if comment passed in is null or its id is nullboolean isUserCommentAuthor(ApplicationUser user, Comment comment)
If the given Comment has a null author, this represents that it was created anonymously, and no-one is the author (returns false). If the given User is null, then this represents that the current user is anonymous, and the method will always return false.
user
- The User. Can be null to represent current user is not logged in (anonymous).comment
- The Comment. Cannot be null.
boolean isUserCommentAuthor(com.atlassian.crowd.embedded.api.User user, Comment comment)
isUserCommentAuthor(ApplicationUser user, Comment comment)
instead. Since v6.0.
Returns true if the given user is the author of the given comment.
If the given Comment has a null author, this represents that it was created anonymously, and no-one is the author (returns false). If the given User is null, then this represents that the current user is anonymous, and the method will always return false.
user
- The User. Can be null to represent current user is not logged in (anonymous).comment
- The Comment. Cannot be null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |