de.hs_rm.cs.lecturenotes.client.core.transport.service
Interface AnnotationCommService

All Superinterfaces:
com.google.gwt.user.client.rpc.RemoteService
All Known Implementing Classes:
AnnotationCommServiceImpl

@RemoteServiceRelativePath(value="AnnotationCommService")
public interface AnnotationCommService
extends com.google.gwt.user.client.rpc.RemoteService

Interface description to the (synchronous) Annotation GWT RPC Servlet.

Version:
$LastChangedRevision: 242 $
Author:
Enrico Homann

Nested Class Summary
static class AnnotationCommService.Util
          Utility class for simplifying access to the instance of async service.
 
Method Summary
 ResponseStatusEnum createAnnotation(Annotation entity)
          Creates a new annotation Annotation entity, whether a) DoecentAnnotation, or b) UserAnnotation.
 ResponseStatusEnum deleteAnnotation(long annotationId)
          Removes a Annotation and it's children from the database.
 java.util.List<Annotation> getAnnotationListByParagraphId(AnnotationDiscriminatorEnum annotationDiscr, long paragraphId, AnnotationAttributeEnum orderAttribute, SQLSortDirectionEnum sortDirection)
          Will return a List of Annotation object for the row identifier long paragraphId of Paragraph.
 java.util.List<Annotation> getAnnotationListByParaId(AnnotationDiscriminatorEnum annotationDiscr, long paraId, AnnotationAttributeEnum orderAttribute, SQLSortDirectionEnum sortDirection)
          Will return a List of Annotation object for the paragraph identifier long paraId of Paragraph.
 java.util.List<Annotation> getAnnotationListByParaId(long paraId, AnnotationAttributeEnum orderAttribute, SQLSortDirectionEnum sortDirection)
          Will return a list with all known annotations for long paraId.
 java.util.List<Annotation> getChildAnnotationByAnnotation(long parentId, AnnotationAttributeEnum orderAttribute, SQLSortDirectionEnum sortDirection)
          Will return a List of children Annotation, that are represented as "Answers/Comments" to annotations.
 java.lang.Long getNumberAnnotationsForParagraph(long paraId, boolean withResponses)
          Will return the number of annotations for Paragraph with long paraId.
 java.lang.Long getNumberResponsesForAnnotation(long annotationId)
          Will return the number of responses to Annotation with long annotationId.
 java.util.List<Annotation> getOwnershipAnnotationListByParaId(long paraId, AnnotationAttributeEnum orderAttribute, SQLSortDirectionEnum sortDirection)
          Will return a list with all known annotations for long paraId and the current session User.
 java.util.List<ParagraphStats> getTopAnnotatedParagraphs(long lectureId, long limitValue, boolean withResponses, boolean withContents, SQLSortDirectionEnum sortDirection)
          Will return a List of ParagraphStats objects that hold a Paragraph and its number of all known annotations.
 ResponseStatusEnum updateAnnotationPosition(long annotationId, AnnotationStickyPositionEnum position)
          Will update the position of the Annotation identified by long annotationId.
 

Method Detail

createAnnotation

ResponseStatusEnum createAnnotation(Annotation entity)
                                    throws InvalidPermissionException
Creates a new annotation Annotation entity, whether a) DoecentAnnotation, or b) UserAnnotation.

Parameters:
entity - Annotation
Returns:
ResponseStatusEnum
Throws:
InvalidPermissionException - Thrown if caller has insufficient permissions

getAnnotationListByParagraphId

java.util.List<Annotation> getAnnotationListByParagraphId(AnnotationDiscriminatorEnum annotationDiscr,
                                                          long paragraphId,
                                                          AnnotationAttributeEnum orderAttribute,
                                                          SQLSortDirectionEnum sortDirection)
                                                          throws InvalidPermissionException
Will return a List of Annotation object for the row identifier long paragraphId of Paragraph.

Parameters:
annotationDiscr - AnnotationDiscriminatorEnum, discriminator to separate DocentAnnotation and UserAnnotation
paragraphId - long
orderAttribute - AnnotationAttributeEnum
sortDirection - SQLSortDirection
Returns:
List of Annotation
Throws:
InvalidPermissionException - Thrown if caller has insufficient permissions

getAnnotationListByParaId

java.util.List<Annotation> getAnnotationListByParaId(AnnotationDiscriminatorEnum annotationDiscr,
                                                     long paraId,
                                                     AnnotationAttributeEnum orderAttribute,
                                                     SQLSortDirectionEnum sortDirection)
                                                     throws InvalidPermissionException
Will return a List of Annotation object for the paragraph identifier long paraId of Paragraph.

Parameters:
annotationDiscr - AnnotationDiscriminatorEnum, discriminator to separate DocentAnnotation and UserAnnotation
paraId - long
orderAttribute - AnnotationAttributeEnum
sortDirection - SQLSortDirection
Returns:
List of Annotation
Throws:
InvalidPermissionException - Thrown if caller has insufficient permissions

getAnnotationListByParaId

java.util.List<Annotation> getAnnotationListByParaId(long paraId,
                                                     AnnotationAttributeEnum orderAttribute,
                                                     SQLSortDirectionEnum sortDirection)
                                                     throws InvalidPermissionException
Will return a list with all known annotations for long paraId.

Parameters:
paraId - attribute from table annotation
orderAttribute - AnnotationAttributeEnum
sortDirection - SQLSortDirection
Returns:
list of Annotation objects
Throws:
InvalidPermissionException - Thrown if caller has insufficient permissions

getOwnershipAnnotationListByParaId

java.util.List<Annotation> getOwnershipAnnotationListByParaId(long paraId,
                                                              AnnotationAttributeEnum orderAttribute,
                                                              SQLSortDirectionEnum sortDirection)
                                                              throws InvalidPermissionException
Will return a list with all known annotations for long paraId and the current session User.

Parameters:
paraId - attribute from table annotation
orderAttribute - AnnotationAttributeEnum
sortDirection - SQLSortDirection
Returns:
list of Annotation objects
Throws:
InvalidPermissionException - Thrown if caller has insufficient permissions

getChildAnnotationByAnnotation

java.util.List<Annotation> getChildAnnotationByAnnotation(long parentId,
                                                          AnnotationAttributeEnum orderAttribute,
                                                          SQLSortDirectionEnum sortDirection)
                                                          throws InvalidPermissionException
Will return a List of children Annotation, that are represented as "Answers/Comments" to annotations.

Parameters:
parentId - long annotationId
orderAttribute - AnnotationAttributeEnum
sortDirection - SQLSortDirection
Returns:
List of Annotation
Throws:
InvalidPermissionException - Thrown if caller has insufficient permissions

deleteAnnotation

ResponseStatusEnum deleteAnnotation(long annotationId)
                                    throws InvalidPermissionException
Removes a Annotation and it's children from the database. It's a hard delete. This action cannot be undone.

Parameters:
annotationId - long
Returns:
ResponseStatusEnum with SUCCESS if the operation was successful or FAILURE otherwise
Throws:
InvalidPermissionException - Thrown if caller has insufficient permissions

getNumberResponsesForAnnotation

java.lang.Long getNumberResponsesForAnnotation(long annotationId)
                                               throws InvalidPermissionException
Will return the number of responses to Annotation with long annotationId.

Parameters:
annotationId - long
Returns:
Long
Throws:
InvalidPermissionException - Thrown if caller has insufficient permissions

getNumberAnnotationsForParagraph

java.lang.Long getNumberAnnotationsForParagraph(long paraId,
                                                boolean withResponses)
                                                throws InvalidPermissionException
Will return the number of annotations for Paragraph with long paraId. Uses paraId to get the numbers for all versions of a Paragraph. boolean withResponses indicates whether responses shall be included in the calculation.

Parameters:
paraId - long
withResponses - boolean
Returns:
Long
Throws:
InvalidPermissionException - Thrown if caller has insufficient permissions

getTopAnnotatedParagraphs

java.util.List<ParagraphStats> getTopAnnotatedParagraphs(long lectureId,
                                                         long limitValue,
                                                         boolean withResponses,
                                                         boolean withContents,
                                                         SQLSortDirectionEnum sortDirection)
                                                         throws InvalidPermissionException
Will return a List of ParagraphStats objects that hold a Paragraph and its number of all known annotations. boolean withResponses indicated whether responses to a Annotation shall be included in the calc.

Parameters:
lectureId - long
limitValue - long
withResponses - boolean
withContents - boolean
sortDirection - SQLSortDirectionEnum
Returns:
List of ParagraphStats
Throws:
InvalidPermissionException - Thrown if caller has insufficient permissions

updateAnnotationPosition

ResponseStatusEnum updateAnnotationPosition(long annotationId,
                                            AnnotationStickyPositionEnum position)
                                            throws InvalidPermissionException
Will update the position of the Annotation identified by long annotationId. Returns SUCCESS if operation was successful, or FAILURE otherwise.

Parameters:
annotationId - long
position - AnnotationStickyPositionEnum
Returns:
ResponseStatusEnum
Throws:
InvalidPermissionException - Thrown if caller has insufficient permissions