|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the business layer component that must be used to access all Comment
functionality.
This will perform validation before it hands off to the CommentManager
.
Operations will not be performed if validation fails.
Method Summary | |
Comment |
create(User user,
Issue issue,
String body,
boolean dispatchEvent,
ErrorCollection errorCollection)
Creates and persists a Comment on the given Issue set with current date and time, visible to all
- no group level or role level restriction. |
Comment |
create(User user,
Issue issue,
String body,
String groupLevel,
Long roleLevelId,
boolean dispatchEvent,
ErrorCollection errorCollection)
Creates and persists a Comment on the given Issue set with current date and time. |
Comment |
create(User user,
Issue issue,
String body,
String groupLevel,
Long roleLevelId,
Date created,
boolean dispatchEvent,
ErrorCollection errorCollection)
Creates and persists a Comment on the given Issue . |
List |
getCommentsForUser(User currentUser,
Issue issue,
ErrorCollection errorCollection)
Will return a list of Comment s for the given user |
boolean |
hasPermissionToCreate(User currentUser,
Issue issue,
ErrorCollection errorCollection)
Has the correct permission to create a comment for the given issue. |
boolean |
isGroupVisiblityEnabled()
Returns the flag that indicates whether group visiblity is enabled |
boolean |
isProjectRoleVisiblityEnabled()
Returns the flag that indicates whether project role visibility is enabled |
boolean |
isValidAllCommentData(User currentUser,
Issue issue,
String body,
String groupLevel,
String roleLevelId,
ErrorCollection errorCollection)
Will call all other validate methods setting the appropriate errors in the errorCollection if any errors occur. |
boolean |
isValidCommentBody(String body,
ErrorCollection errorCollection)
Validates that the body is a valid string, if not the appropriate error is added to the errorCollection
This method was added so the CommentSystemField can validate the body and set the appropriate error message. |
boolean |
isValidCommentData(User currentUser,
Issue issue,
String groupLevel,
String roleLevelId,
ErrorCollection errorCollection)
This method validates if the comment has the correct role and group levels set. |
Method Detail |
public Comment create(User user, Issue issue, String body, String groupLevel, Long roleLevelId, Date created, boolean dispatchEvent, ErrorCollection errorCollection)
Comment
on the given Issue
.
user
- The User
who will be performing the operation.issue
- The Issue
you wish to associate the Comment
with. This can not be nullbody
- The body of the commentgroupLevel
- The group level visibility of the comment (null if roleLevelId specified)roleLevelId
- The role level visibility id of the comment (null if groupLevel specified)created
- The date of comment creationdispatchEvent
- whether or not you want to have an event dispatched on Comment creationerrorCollection
- holder for any errors that were thrown attempting to create a comment
public Comment create(User user, Issue issue, String body, String groupLevel, Long roleLevelId, boolean dispatchEvent, ErrorCollection errorCollection)
Comment
on the given Issue
set with current date and time.
user
- The User
who will be performing the operation.issue
- The Issue
you wish to associate the Comment
with. This can not be nullbody
- The body of the commentgroupLevel
- The group level visibility of the comment (null if roleLevelId specified)roleLevelId
- The role level visibility id of the comment (null if groupLevel specified)dispatchEvent
- whether or not you want to have an event dispatched on Comment creationerrorCollection
- holder for any errors that were thrown attempting to create a comment
public Comment create(User user, Issue issue, String body, boolean dispatchEvent, ErrorCollection errorCollection)
Comment
on the given Issue
set with current date and time, visible to all
- no group level or role level restriction.
user
- The User
who will be performing the operation.issue
- The Issue
you wish to associate the Comment
with. This can not be nullbody
- The body of the commentdispatchEvent
- whether or not you want to have an event dispatched on Comment creationerrorCollection
- holder for any errors that were thrown attempting to create a comment
public List getCommentsForUser(User currentUser, Issue issue, ErrorCollection errorCollection)
Comment
s for the given user
currentUser
- issue
- the issue with associated commentserrorCollection
-
public boolean hasPermissionToCreate(User currentUser, Issue issue, ErrorCollection errorCollection)
currentUser
- issue
-
public boolean isValidCommentBody(String body, ErrorCollection errorCollection)
errorCollection
This method was added so the CommentSystemField
can validate the body and set the appropriate error message.
body
- errorCollection
-
public boolean isValidCommentData(User currentUser, Issue issue, String groupLevel, String roleLevelId, ErrorCollection errorCollection)
errorCollection
will contain the errors.
currentUser
- issue
- groupLevel
- roleLevelId
- errorCollection
-
public boolean isValidAllCommentData(User currentUser, Issue issue, String body, String groupLevel, String roleLevelId, ErrorCollection errorCollection)
errorCollection
if any errors occur.
currentUser
- issue
- body
- groupLevel
- roleLevelId
- errorCollection
-
public boolean isGroupVisiblityEnabled()
public boolean isProjectRoleVisiblityEnabled()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |