org.kuali.student.core.comment.service
Interface CommentService

All Superinterfaces:
DictionaryService
All Known Implementing Classes:
CommentServiceImpl

public interface CommentService
extends DictionaryService


Method Summary
 CommentInfo addComment(String referenceId, String referenceTypeKey, CommentInfo commentInfo)
          Adds a comment to a reference.
 TagInfo addTag(String referenceId, String referenceTypeKey, TagInfo tagInfo)
          Adds a tag to a reference.
 CommentInfo getComment(String commentId)
          Retrieves information about a comment.
 List<CommentInfo> getComments(String referenceId, String referenceTypeKey)
          Retrieves comment information for a reference.
 List<CommentInfo> getCommentsByType(String referenceId, String referenceTypeKey, String commentTypeKey)
          Retrieves comment information for a reference of a particular type.
 List<CommentTypeInfo> getCommentTypes()
          Retrieves the list of comment types which can be linked to a referenced object.
 List<CommentTypeInfo> getCommentTypesForReferenceType(String referenceTypeKey)
          Retrieves the list of comment types which can be linked to a particular type of referenced object.
 List<ReferenceTypeInfo> getReferenceTypes()
          Retrieves the list of types which can be tagged or commented.
 TagInfo getTag(String tagId)
          Retrieves information about a tag.
 List<TagInfo> getTags(String referenceId, String referenceTypeKey)
          Retrieves tag information for a reference.
 List<TagInfo> getTagsByType(String referenceId, String referenceTypeKey, String tagTypeKey)
          Retrieves tag information for a reference of a particular type.
 List<TagTypeInfo> getTagTypes()
          Retrieves the list of tag types which can be linked to a referenced object.
 StatusInfo removeComment(String commentId, String referenceId, String referenceTypeKey)
          Removes a comment from a reference.
 StatusInfo removeComments(String referenceId)
          Removes all comments associated with a single reference
 StatusInfo removeTag(String tagId, String referenceId, String referenceTypeKey)
          Removes a tag from a reference.
 StatusInfo removeTags(String tagId)
          Removes a tag from all references to which it is linked.
 CommentInfo updateComment(String referenceId, String referenceTypeKey, CommentInfo commentInfo)
          Updates a comment for a reference.
 List<ValidationResultInfo> validateComment(String validationType, CommentInfo commentInfo)
          Validates a comment.
 
Methods inherited from interface org.kuali.student.core.dictionary.service.DictionaryService
getObjectStructure, getObjectTypes
 

Method Detail

getReferenceTypes

List<ReferenceTypeInfo> getReferenceTypes()
                                          throws OperationFailedException
Retrieves the list of types which can be tagged or commented.

Returns:
the list of types which can be tagged or commented
Throws:
OperationFailedException - unable to complete request

getCommentTypes

List<CommentTypeInfo> getCommentTypes()
                                      throws OperationFailedException
Retrieves the list of comment types which can be linked to a referenced object.

Returns:
the list of comment types which can be linked to a referenced object
Throws:
OperationFailedException - unable to complete request

getTagTypes

List<TagTypeInfo> getTagTypes()
                              throws OperationFailedException
Retrieves the list of tag types which can be linked to a referenced object.

Returns:
the list of tag types which can be linked to a referenced object
Throws:
OperationFailedException - unable to complete request

getCommentTypesForReferenceType

List<CommentTypeInfo> getCommentTypesForReferenceType(String referenceTypeKey)
                                                      throws DoesNotExistException,
                                                             InvalidParameterException,
                                                             MissingParameterException,
                                                             OperationFailedException
Retrieves the list of comment types which can be linked to a particular type of referenced object.

Parameters:
referenceTypeKey - reference type
Returns:
the list of comment types which can be linked to a referenced object type
Throws:
DoesNotExistException - specified referenceTypeKey not found
InvalidParameterException - invalid referenceTypeKey
MissingParameterException - referenceTypeKey not specified
OperationFailedException - unable to complete request

validateComment

List<ValidationResultInfo> validateComment(String validationType,
                                           CommentInfo commentInfo)
                                           throws DoesNotExistException,
                                                  InvalidParameterException,
                                                  MissingParameterException,
                                                  OperationFailedException
Validates a comment. Depending on the value of validationType, this validation could be limited to tests on just the current object and its directly contained sub-objects or expanded to perform all tests related to this object. If an identifier is present for the comment (and/or one of its contained sub-objects) and a record is found for that identifier, the validation checks if the comment can be shifted to the new values. If an identifier is not present or a record cannot be found for the identifier, it is assumed that the record does not exist and as such, the checks performed will be much shallower, typically mimicking those performed by setting the validationType to the current object.

Parameters:
validationType - identifier of the extent of validation
commentInfo - comment information to be tested.
Returns:
results from performing the validation
Throws:
DoesNotExistException - validationTypeKey not found
InvalidParameterException - invalid validationTypeKey, commentInfo
MissingParameterException - missing validationTypeKey, commentInfo
OperationFailedException - unable to complete request

getComments

List<CommentInfo> getComments(String referenceId,
                              String referenceTypeKey)
                              throws DoesNotExistException,
                                     InvalidParameterException,
                                     MissingParameterException,
                                     OperationFailedException,
                                     PermissionDeniedException
Retrieves comment information for a reference. The expected behavior is that if the caller is not authorized to invoke the getComments operation, a PERMISSION_DENIED error is returned. Assuming that the caller is authorized to invoke getComments, only comments that the caller is authorized to view are included in the returned commentInfoList; comments that the caller is unauthorized to view are filtered out of the return parameter.

Parameters:
referenceId - reference identifier
referenceTypeKey - reference type
Returns:
list of comment information
Throws:
DoesNotExistException - specified referenceId, referenceTypeKey not found
InvalidParameterException - invalid referenceId, referenceTypeKey
MissingParameterException - referenceId, referenceTypeKey not specified
OperationFailedException - unable to complete request
PermissionDeniedException - authorization failure

getTags

List<TagInfo> getTags(String referenceId,
                      String referenceTypeKey)
                      throws DoesNotExistException,
                             InvalidParameterException,
                             MissingParameterException,
                             OperationFailedException,
                             PermissionDeniedException
Retrieves tag information for a reference. The expected behavior is that if the caller is not authorized to invoke the getTags operation, a PERMISSION_DENIED error is returned. Assuming that the caller is authorized to invoke getTags, only tags that the caller is authorized to view are included in the returned tagInfoList; tags that the caller is unauthorized to view are filtered out of the return parameter.

Parameters:
referenceId - reference identifier
referenceTypeKey - reference type
Returns:
list of tag information
Throws:
DoesNotExistException - specified referenceId, referenceTypeKey not found
InvalidParameterException - invalid referenceId, referenceTypeKey
MissingParameterException - referenceId, referenceTypeKey not specified
OperationFailedException - unable to complete request
PermissionDeniedException - authorization failure

getCommentsByType

List<CommentInfo> getCommentsByType(String referenceId,
                                    String referenceTypeKey,
                                    String commentTypeKey)
                                    throws DoesNotExistException,
                                           InvalidParameterException,
                                           MissingParameterException,
                                           OperationFailedException,
                                           PermissionDeniedException
Retrieves comment information for a reference of a particular type. The expected behavior is that if the caller is not authorized to invoke the getCommentsByType operation, a PERMISSION_DENIED error is returned. Assuming that the caller is authorized to invoke getCommentsByType, only comments that the caller is authorized to view are included in the returned commentInfoList; comments that the caller is unauthorized to view are filtered out of the return parameter.

Parameters:
referenceId - reference identifier
referenceTypeKey - reference type
commentTypeKey - comment type
Returns:
list of comment information
Throws:
DoesNotExistException - specified referenceId, referenceTypeKey, commentTypeKey not found
InvalidParameterException - invalid referenceId, referenceTypeKey,commentTypeKey
MissingParameterException - referenceId, referenceTypeKey, commentTypeKey not specified
OperationFailedException - unable to complete request
PermissionDeniedException - authorization failure

getTagsByType

List<TagInfo> getTagsByType(String referenceId,
                            String referenceTypeKey,
                            String tagTypeKey)
                            throws DoesNotExistException,
                                   InvalidParameterException,
                                   MissingParameterException,
                                   OperationFailedException,
                                   PermissionDeniedException
Retrieves tag information for a reference of a particular type. The expected behavior is that if the caller is not authorized to invoke the getTagsByType operation, a PERMISSION_DENIED error is returned. Assuming that the caller is authorized to invoke getTagsByType, only tags that the caller is authorized to view are included in the returned tagInfoList; tags that the caller is unauthorized to view are filtered out of the return parameter.

Parameters:
referenceId - reference identifier
referenceTypeKey - reference type
tagTypeKey - tag type
Returns:
list of tag information
Throws:
DoesNotExistException - specified referenceId, referenceTypeKey, tagTypeKey not found
InvalidParameterException - invalid referenceId, referenceTypeKey,tagTypeKey
MissingParameterException - referenceId, referenceTypeKey, tagTypeKey not specified
OperationFailedException - unable to complete request
PermissionDeniedException - authorization failure

getComment

CommentInfo getComment(String commentId)
                       throws DoesNotExistException,
                              InvalidParameterException,
                              MissingParameterException,
                              OperationFailedException,
                              PermissionDeniedException
Retrieves information about a comment.

Parameters:
commentId - comment identifier
Returns:
information about a comment
Throws:
DoesNotExistException - specified commentId not found
InvalidParameterException - invalid commentId
MissingParameterException - commentId not specified
OperationFailedException - unable to complete request
PermissionDeniedException - authorization failure

getTag

TagInfo getTag(String tagId)
               throws DoesNotExistException,
                      InvalidParameterException,
                      MissingParameterException,
                      OperationFailedException,
                      PermissionDeniedException
Retrieves information about a tag.

Parameters:
tagId - tag identifier
Returns:
information about a tag
Throws:
DoesNotExistException - specified tagId not found
InvalidParameterException - invalid tagId
MissingParameterException - tagId not specified
OperationFailedException - unable to complete request
PermissionDeniedException - authorization failure

addComment

CommentInfo addComment(String referenceId,
                       String referenceTypeKey,
                       CommentInfo commentInfo)
                       throws DataValidationErrorException,
                              InvalidParameterException,
                              MissingParameterException,
                              OperationFailedException,
                              PermissionDeniedException
Adds a comment to a reference.

Parameters:
referenceId - identifier of reference
referenceTypeKey - reference type
commentInfo - detailed information about the comment
Returns:
detailed information about the comment
Throws:
DataValidationErrorException - One or more values invalid for this operation
InvalidParameterException - One or more parameters invalid
MissingParameterException - One or more parameters missing
OperationFailedException - unable to complete request
PermissionDeniedException - authorization failure

addTag

TagInfo addTag(String referenceId,
               String referenceTypeKey,
               TagInfo tagInfo)
               throws DataValidationErrorException,
                      AlreadyExistsException,
                      InvalidParameterException,
                      MissingParameterException,
                      OperationFailedException,
                      PermissionDeniedException
Adds a tag to a reference.

Parameters:
referenceId - identifier of reference
referenceTypeKey - reference type
tagInfo - detailed information about the tag
Returns:
detailed information about the tag
Throws:
DataValidationErrorException - One or more values invalid for this operation
AlreadyExistsException - tag of that namespace, predicate and value already exists for that reference id
InvalidParameterException - One or more parameters invalid
MissingParameterException - One or more parameters missing
OperationFailedException - unable to complete request
PermissionDeniedException - authorization failure

updateComment

CommentInfo updateComment(String referenceId,
                          String referenceTypeKey,
                          CommentInfo commentInfo)
                          throws DataValidationErrorException,
                                 InvalidParameterException,
                                 MissingParameterException,
                                 OperationFailedException,
                                 PermissionDeniedException,
                                 DoesNotExistException,
                                 VersionMismatchException
Updates a comment for a reference.

Parameters:
referenceId - identifier of reference
referenceTypeKey - reference type
commentInfo - detailed information about the comment
Returns:
detailed information about the comment
Throws:
DataValidationErrorException - One or more values invalid for this operation
InvalidParameterException - One or more parameters invalid
MissingParameterException - One or more parameters missing
OperationFailedException - unable to complete request
PermissionDeniedException - authorization failure
DoesNotExistException - comment does not exist
VersionMismatchException - The action was attempted on an out of date version. *

removeComment

StatusInfo removeComment(String commentId,
                         String referenceId,
                         String referenceTypeKey)
                         throws DoesNotExistException,
                                InvalidParameterException,
                                MissingParameterException,
                                OperationFailedException,
                                PermissionDeniedException
Removes a comment from a reference.

Parameters:
commentId - identifier of the comment
referenceId - identifier of the reference
referenceTypeKey - reference type
Returns:
status of the operation (success, failed)
Throws:
DoesNotExistException - commentId, referenceId does not exist
InvalidParameterException - One or more parameters invalid
MissingParameterException - One or more parameters missing
OperationFailedException - unable to complete request
PermissionDeniedException - authorization failure

removeTag

StatusInfo removeTag(String tagId,
                     String referenceId,
                     String referenceTypeKey)
                     throws DoesNotExistException,
                            InvalidParameterException,
                            MissingParameterException,
                            OperationFailedException,
                            PermissionDeniedException
Removes a tag from a reference.

Parameters:
tagId - identifier of the tag
referenceId - identifier of the reference
referenceTypeKey - reference type
Returns:
status of the operation (success, failed)
Throws:
DoesNotExistException - tagId, referenceId does not exist
InvalidParameterException - One or more parameters invalid
MissingParameterException - One or more parameters missing
OperationFailedException - unable to complete request
PermissionDeniedException - authorization failure

removeComments

StatusInfo removeComments(String referenceId)
                          throws DoesNotExistException,
                                 InvalidParameterException,
                                 MissingParameterException,
                                 OperationFailedException,
                                 PermissionDeniedException
Removes all comments associated with a single reference

Parameters:
referenceId - identifier of the reference
Returns:
status of the operation (success, failed)
Throws:
DoesNotExistException - referenceId does not exist
InvalidParameterException - One or more parameters invalid
MissingParameterException - One or more parameters missing
OperationFailedException - unable to complete request
PermissionDeniedException - authorization failure

removeTags

StatusInfo removeTags(String tagId)
                      throws DoesNotExistException,
                             InvalidParameterException,
                             MissingParameterException,
                             OperationFailedException,
                             PermissionDeniedException
Removes a tag from all references to which it is linked.

Parameters:
tagId - identifier of the tag
Returns:
status of the operation (success, failed)
Throws:
DoesNotExistException - tagId does not exist
InvalidParameterException - One or more parameters invalid
MissingParameterException - One or more parameters missing
OperationFailedException - unable to complete request
PermissionDeniedException - authorization failure


Copyright © 2010 The Kuali Foundation. All rights reserved.