|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.issue.comments.DefaultCommentManager
public class DefaultCommentManager
| Field Summary | |
|---|---|
static String |
COMMENT_ENTITY
|
| Fields inherited from interface com.atlassian.jira.issue.comments.CommentManager |
|---|
EVENT_ORIGINAL_COMMENT_PARAMETER |
| Constructor Summary | |
|---|---|
DefaultCommentManager(IssueManager issueManager,
TextAnalyzer textAnalyzer,
CacheManager cacheManager,
ProjectRoleManager projectRoleManager,
CommentPermissionManager commentPermissionManager,
OfBizDelegator delegator,
JiraAuthenticationContext jiraAuthenticationContext)
|
|
| Method Summary | |
|---|---|
Comment |
convertToComment(org.ofbiz.core.entity.GenericValue gv)
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,
String author,
String body,
boolean dispatchEvent)
Creates a comment and associates it with the given issue. |
Comment |
create(Issue issue,
String author,
String body,
String groupLevel,
Long roleLevelId,
boolean dispatchEvent)
Creates a comment and associates it with the given issue. |
Comment |
create(Issue issue,
String 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 updateAuthor,
String body,
String groupLevel,
Long roleLevelId,
Date created,
Date updated,
boolean dispatchEvent)
Creates a comment and associates it with the given issue. |
Comment |
create(Issue issue,
String author,
String 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. |
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,
User user)
Retrieves all Comments on the
given Issue that the given User has permission to see. |
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(User user,
Comment comment)
Returns true if the given user is the author of the given comment. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String COMMENT_ENTITY
| Constructor Detail |
|---|
public DefaultCommentManager(IssueManager issueManager,
TextAnalyzer textAnalyzer,
CacheManager cacheManager,
ProjectRoleManager projectRoleManager,
CommentPermissionManager commentPermissionManager,
OfBizDelegator delegator,
JiraAuthenticationContext jiraAuthenticationContext)
| Method Detail |
|---|
public ProjectRole getProjectRole(Long projectRoleId)
CommentManagerCommentImpl
to get a ProjectRole.
NOTE: If you are trying to retrieve a ProjectRole then you should be using the
ProjectRoleManager.
getProjectRole in interface CommentManagerprojectRoleId - the id to the ProjectRole object you would like returned.
public Comment convertToComment(org.ofbiz.core.entity.GenericValue gv)
CommentManager
convertToComment in interface CommentManagergv - is the GenericValue representation of a comment.
public Comment getCommentById(Long commentId)
CommentManager
getCommentById in interface CommentManagercommentId - the id representing the Comment you would like to retrieve.
Comment or null (if the user cannot browse the comment).public MutableComment getMutableComment(Long commentId)
CommentManager
getMutableComment in interface CommentManagercommentId - comment id
public List<Comment> getCommentsForUser(Issue issue,
User user)
CommentManagerComments 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.
getCommentsForUser in interface CommentManagerissue - the comments are associated with.user - the user whose permission level will be used to limit the comments returned.
Commentspublic List<Comment> getComments(Issue issue)
CommentManagerUser please use
getCommentsForUser(Issueissue,Useruser)
getComments in interface CommentManagerissue - the comments are associated with.
public Comment create(Issue issue,
String author,
String body,
boolean dispatchEvent)
CommentManager
create in interface CommentManagerissue - the issue to associate the comment with.author - 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.
public Comment create(Issue issue,
String author,
String body,
String groupLevel,
Long roleLevelId,
boolean dispatchEvent)
throws DataAccessException
CommentManager
create in interface CommentManagerissue - the issue to associate the comment with.author - 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.
DataAccessException
public Comment create(Issue issue,
String author,
String body,
String groupLevel,
Long roleLevelId,
Date created,
boolean dispatchEvent)
throws DataAccessException
CommentManager
create in interface CommentManagerissue - the issue to associate the comment with.author - 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.
DataAccessException
public Comment create(Issue issue,
String author,
String updateAuthor,
String body,
String groupLevel,
Long roleLevelId,
Date created,
Date updated,
boolean dispatchEvent)
throws DataAccessException
CommentManager
create in interface CommentManagerissue - the issue to associate the comment with.author - the user who has created this comment.updateAuthor - 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.
DataAccessException
public Comment create(Issue issue,
String author,
String updateAuthor,
String body,
String groupLevel,
Long roleLevelId,
Date created,
Date updated,
boolean dispatchEvent,
boolean tweakIssueUpdateDate)
throws DataAccessException
CommentManager
create in interface CommentManagerissue - the issue to associate the comment with.author - the user who has created this comment.updateAuthor - 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.
DataAccessExceptionCommentManager.create(com.atlassian.jira.issue.Issue,String,String,String,String,Long,java.util.Date,java.util.Date,boolean,boolean)
public void update(Comment comment,
boolean dispatchEvent)
CommentManager
update in interface CommentManagercomment - 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.public ChangeItemBean delete(Comment comment)
CommentManager
delete in interface CommentManagercomment - to delete
public boolean isUserCommentAuthor(User user,
Comment comment)
CommentManagerIf 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.
isUserCommentAuthor in interface CommentManageruser - The User. Can be null to represent current user is not logged in (anonymous).comment - The Comment. Cannot be null.
public int swapCommentGroupRestriction(String groupName,
String swapGroup)
CommentManagerComment'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.
swapCommentGroupRestriction in interface CommentManagergroupName - 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.
public long getCountForCommentsRestrictedByGroup(String groupName)
CommentManagerComment's that have their visibility restricted by the named group.
getCountForCommentsRestrictedByGroup in interface CommentManagergroupName - 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||