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

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

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

Synchronous Comm Service interface for everything regarding the system object Filecard.

Version:
$LastChangedRevision: 242 $
Author:
Enrico Homann

Nested Class Summary
static class LectureCommService.Util
          Utility class for simplifying access to the instance of async service.
 
Method Summary
 ResponseStatusEnum createNewLecture(Lecture lecture)
          Creates a new Lecture on the server.
 Paragraph createNewParagraph(long position, long parent, long lecture, java.lang.String title, java.lang.String content)
          Will create a new Paragraph object.
 ResponseStatusEnum deleteLecture(Lecture lecture)
          Hard deletes a Lecture and all its dependencies (but the user).
 boolean deleteParagraph(long paraId)
          Will soft-remove a Paragraph identified by long paraId.
 java.lang.String extractCode(long lectureId)
          Extracts source code from Lecture identified by long lectureId.
 Lecture getCompleteLecture(long lectureId)
          Will return the complete Lecture object for long lectureId.
 Paragraph getCompleteParagraph(long paraId, long lectureId)
          Will return a full Paragraph with contents and children and their contents.
 Paragraph getLatestVersionOfParagraph(long paraId)
          Will return the latest version of a Paragraph identified by long paraId.
 java.util.List<Lecture> getLectureListAll(LectureAttributeEnum sortAttribute, SQLSortDirectionEnum sortDirection)
          Will return the list with Lecture objects with all known Lecture objects.
 java.util.List<Lecture> getLectureListMostAnnotations(SQLSortDirectionEnum sortDirection)
          Will return the list with Lecture objects, sorted by the most annotations.
 java.util.List<Lecture> getLectureListOwnership(LectureAttributeEnum sortAttribute, SQLSortDirectionEnum sortDirection)
          Will return the list with Lecture objects owned by the current session User.
 java.util.List<Paragraph> getParagraphHistory(long paraId)
          Will return a List of Paragraph with all known versions to Paragraph with long paraId.
 java.lang.String renderParaAsHTML(java.lang.String para, long lectureId)
          Renders a Lecture based String para to HTML.
 ResponseStatusEnum updateLectureHeader(Lecture lecture)
          Updates the header information of a Lecture without any Paragraphs.
 boolean updateParagraph(Paragraph para)
          Will update a Paragraph object using the values provided by Paragraph para.
 

Method Detail

getCompleteLecture

Lecture getCompleteLecture(long lectureId)
                           throws InvalidPermissionException
Will return the complete Lecture object for long lectureId. Includes paragraphs and their children and Exercise objects.

Parameters:
lectureId - long
Returns:
Lecture
Throws:
InvalidPermissionException - Thrown if caller has not the correct permissions

getLatestVersionOfParagraph

Paragraph getLatestVersionOfParagraph(long paraId)
                                      throws InvalidPermissionException
Will return the latest version of a Paragraph identified by long paraId.

Parameters:
paraId - long
Returns:
Paragraph
Throws:
InvalidPermissionException - Thrown if caller has not the correct permissions

updateParagraph

boolean updateParagraph(Paragraph para)
                        throws InvalidPermissionException
Will update a Paragraph object using the values provided by Paragraph para. Always returns true.

Parameters:
para - Paragraph
Returns:
boolean
Throws:
InvalidPermissionException - Thrown if caller has not the correct permissions

createNewParagraph

Paragraph createNewParagraph(long position,
                             long parent,
                             long lecture,
                             java.lang.String title,
                             java.lang.String content)
                             throws InvalidPermissionException
Will create a new Paragraph object.

Parameters:
position - long
parent - long
lecture - lecture
title - String
content - String
Returns:
Paragraph
Throws:
InvalidPermissionException - Thrown if caller has not the correct permissions

getCompleteParagraph

Paragraph getCompleteParagraph(long paraId,
                               long lectureId)
                               throws InvalidPermissionException
Will return a full Paragraph with contents and children and their contents.

Parameters:
paraId - long
lectureId - long
Returns:
Paragraph
Throws:
InvalidPermissionException - Thrown if caller has not the correct permissions

deleteParagraph

boolean deleteParagraph(long paraId)
                        throws InvalidPermissionException
Will soft-remove a Paragraph identified by long paraId.

Parameters:
paraId - long
Returns:
boolean
Throws:
InvalidPermissionException - Thrown if caller has not the correct permissions

renderParaAsHTML

java.lang.String renderParaAsHTML(java.lang.String para,
                                  long lectureId)
                                  throws InvalidPermissionException
Renders a Lecture based String para to HTML. Replaces Editor Tags with valid HTML Tags.

Parameters:
para - String
lectureId - long
Returns:
String
Throws:
InvalidPermissionException - Thrown if caller has not the correct permissions

extractCode

java.lang.String extractCode(long lectureId)
                             throws InvalidPermissionException
Extracts source code from Lecture identified by long lectureId. Will return the URL of the index HTML file to show up the result or null if there was an error.

Parameters:
lectureId - long
Returns:
String
Throws:
InvalidPermissionException - Thrown if caller has not the correct permissions

getLectureListAll

java.util.List<Lecture> getLectureListAll(LectureAttributeEnum sortAttribute,
                                          SQLSortDirectionEnum sortDirection)
                                          throws InvalidPermissionException
Will return the list with Lecture objects with all known Lecture objects.

Parameters:
sortAttribute - LectureAttributeEnum attribute to sort for
sortDirection - SQLSortDirectionEnum direction of sorting
Returns:
List of Lecture
Throws:
InvalidPermissionException - Thrown if caller has insufficient permissions

getLectureListMostAnnotations

java.util.List<Lecture> getLectureListMostAnnotations(SQLSortDirectionEnum sortDirection)
                                                      throws InvalidPermissionException
Will return the list with Lecture objects, sorted by the most annotations.

Parameters:
sortDirection - SQLSortDirectionEnum direction of sorting
Returns:
List of Lecture
Throws:
InvalidPermissionException - Thrown if caller has insufficient permissions

getLectureListOwnership

java.util.List<Lecture> getLectureListOwnership(LectureAttributeEnum sortAttribute,
                                                SQLSortDirectionEnum sortDirection)
                                                throws InvalidPermissionException
Will return the list with Lecture objects owned by the current session User.

Parameters:
sortAttribute - LectureAttributeEnum attribute to sort for
sortDirection - SQLSortDirectionEnum direction of sorting
Returns:
List of Lecture
Throws:
InvalidPermissionException - Thrown if caller has insufficient permissions

createNewLecture

ResponseStatusEnum createNewLecture(Lecture lecture)
                                    throws InvalidPermissionException
Creates a new Lecture on the server. Returns SUCCESS if the lecture was created or FAILURE if there was a failure.

Parameters:
lecture - Lecture object
Returns:
ResponseStatusEnum SUCCESS at successful creation, FAILURE at failure
Throws:
InvalidPermissionException - Thrown if the caller has insufficient permissions.

updateLectureHeader

ResponseStatusEnum updateLectureHeader(Lecture lecture)
                                       throws InvalidPermissionException
Updates the header information of a Lecture without any Paragraphs. Returns SUCCESS if the operation was successful, or FAILURE otherwise

Parameters:
lecture - Lecture
Returns:
ResponseStatusEnum
Throws:
InvalidPermissionException - Thrown if the caller has insufficient permissions.

deleteLecture

ResponseStatusEnum deleteLecture(Lecture lecture)
                                 throws InvalidPermissionException
Hard deletes a Lecture and all its dependencies (but the user). Removes Lecture's Paragraphs and their attachments. Returns SUCCESS at successful operation, or FAILURE at a failure.

Parameters:
lecture - Lecture
Returns:
ResponseStatusEnum
Throws:
InvalidPermissionException - Thrown if the caller has insufficient permissions.

getParagraphHistory

java.util.List<Paragraph> getParagraphHistory(long paraId)
                                              throws InvalidPermissionException
Will return a List of Paragraph with all known versions to Paragraph with long paraId.

Parameters:
paraId - long
Returns:
List of Paragraph
Throws:
InvalidPermissionException - Thrown if the caller has insufficient permissions.