Skip to content
Snippets Groups Projects
Commit 31a99df4 authored by quark's avatar quark
Browse files

Merge remote-tracking branch 'origin/development_master' into development_master

parents 6ee0cf99 0f13ca69
No related branches found
No related tags found
No related merge requests found
Showing
with 1113 additions and 22 deletions
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<source>1.6</source> <source>1.8</source>
<target>1.6</target> <target>1.8</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
......
package unipotsdam.gf.interfaces; package unipotsdam.gf.interfaces;
import unipotsdam.gf.modules.annotation.Annotation;
import java.util.ArrayList;
/** /**
* @author Sven Kästle * @author Sven Kästle
* skaestle@uni-potsdam.de * skaestle@uni-potsdam.de
...@@ -7,42 +11,43 @@ package unipotsdam.gf.interfaces; ...@@ -7,42 +11,43 @@ package unipotsdam.gf.interfaces;
public interface Annotatable { public interface Annotatable {
/** /**
* Adds an annotation to a document and returns the new id * Adds an annotation to a target and returns the new id
* *
* @param userId The id of the author of the annotation * @param newAnnotation The new annotation as an Object
* @param annotation The annotation as an Object
* @return Returns the id of the new annotation * @return Returns the id of the new annotation
*/ */
String addAnnotation(String userId, Object annotation); int addAnnotation(Annotation newAnnotation);
/** /**
* Alters an annotation * Alters an annotation
* *
* @param id The id of the annotation * @param annotationId The id of the original annotation
* @param annotation The annotation as an Object * @param newBody The new body of the annotation
*/ */
void alterAnnotation(String id, Object annotation); void alterAnnotation(int annotationId, String newBody);
/** /**
* Deletes an annotation * Deletes an annotation
* *
* @param id The id of the annotation * @param annotationId The id of the annotation
*/ */
void deleteAnnotation(String id); void deleteAnnotation(int annotationId);
/** /**
* Returns a specific annotation from a document * Returns a specific annotation from a target
* *
* @param id The id of the annotation * @param annotationId The id of the annotation
* @param targetId The id of the target
* @return Returns a specific annotation * @return Returns a specific annotation
*/ */
Object getAnnotation(String id); Annotation getAnnotation(int annotationId, int targetId);
/** /**
* Return all annotations from a document * Returns all annotations from a target
* *
* @param targetIds An ArrayList of target ids
* @return Returns all annotations * @return Returns all annotations
*/ */
Object[] getAnnotations(); ArrayList<Annotation> getAnnotations(ArrayList<Integer> targetIds);
} }
package unipotsdam.gf.interfaces; package unipotsdam.gf.interfaces;
import unipotsdam.gf.modules.peer2peerfeedback.peer2peerfeedback;
import java.*;
/** /**
PeerFeedback Interface PeerFeedback Interface
...@@ -15,27 +18,34 @@ public interface Feedback { ...@@ -15,27 +18,34 @@ public interface Feedback {
* @return Returns the Peer2PeerFeedback Object * @return Returns the Peer2PeerFeedback Object
*/ */
Object createPeer2PeerFeedbackmask(Object FeedbackUser, Object SelectedStudent, Object Document); Peer2PeerFeedback createPeer2PeerFeedbackmask(User feedbackuser, User selectedstudent, File document);
/** /**
* give Peer2PeerFeedback * give Peer2PeerFeedback
* *
* @param Peer2PeerFeedback: The Peer2PeerFeedback as an Object * @param Peer2PeerFeedback: The Peer2PeerFeedback as an Object
* @param Document: The selected document * @param Document: The selected document
* @return Send feedback with doc * @return Send feedback with doc and return true, if the feedback is successfully sended
*/ */
Object giveFeedback(Object Peer2PeerFeedback, Object Document); Boolean giveFeedback(Peer2PeerFeedback feedback, File document);
/** /**
* show Feedbackhistory * show Feedbackhistory
* *
* @param Peer2PeerFeedback: The Peer2PeerFeedback as an Object * @param student
* @param Document: The selected document
* @return List of Feedbacks with Docs * @return List of Feedbacks with Docs
*/ */
Object showFeedback(Object Peer2PeerFeedback, Object Document); ArrayList <Peer2PeerFeedback> showFeedback(User student);
/**
* count Feedback
*
* @param student The Student, that have given Feedback
* @return Number of given Feedback
*/
int countFeedback(User student);
} }
package unipotsdam.gf.interfaces;
import unipotsdam.gf.modules.communication.model.chat.ChatMessage;
import unipotsdam.gf.modules.communication.model.chat.ChatRoom;
import unipotsdam.gf.modules.communication.model.user.User;
import unipotsdam.gf.modules.communication.model.user.UserCredentials;
import unipotsdam.gf.modules.communication.model.user.UserRegistrationInformation;
import java.util.List;
/**
* Provides connection to rocket chat
*/
public interface ICommunication {
/**
* related endpoint: https://rocket.chat/docs/developer-guides/rest-api/groups/history/
* get last 20 chat messages of specific chatroom
*
* @param roomId ID of room of user
* @return List of Chat Messages
*/
List<ChatMessage> getChatHistory(String roomId);
/**
* endpoint: https://rocket.chat/docs/developer-guides/rest-api/groups/create/
* creates chatroom
*
* @param name chat room name
* @param userIds member of chat by id; can be empty
* @return chat room id
*/
String createChatRoom(String name, List<String> userIds);
/**
* endpoint: https://rocket.chat/docs/developer-guides/rest-api/groups/invite/
*
* @param roomId chat room the user should be add to
* @param userId userID to add
* @return if user was added successfully
*/
boolean addUserToChatRoom(String roomId, String userId);
/**
* endpoint: https://rocket.chat/docs/developer-guides/rest-api/groups/settopic/
*
* @param roomId chat room where topic should be set
* @param topic topic of chat room
* @return true, if topic was set correctly
*/
boolean setChatRoomTopic(String roomId, String topic);
/**
* api: https://rocket.chat/docs/developer-guides/rest-api/groups/info/
* get information about the chat room
*
* @param roomId chat room id
* @return chat room information
*/
ChatRoom getChatRoomInfo(String roomId);
/**
* api: https://rocket.chat/docs/developer-guides/rest-api/authentication/login/
*
* @param userCredentials username and password
* @return information about user, especially authtoken for later use of endpoints
*/
User loginUser(UserCredentials userCredentials);
/**
* registers new user to rocket chat
*
* @param userRegistrationInformation registers user to rocket.chat
* @return user id
*/
String registerUser(UserRegistrationInformation userRegistrationInformation);
}
package unipotsdam.gf.interfaces;
/**
* Interface that defines a review for a students/groups contribution
*
* A review contains a feedback text and several scales which can be rated
* It can also be exported to certain formats.
*/
public interface IContributionReview {
/**
* sets the reviews feedbackText.
*
* @param feedbackText
*/
void setFeedbackText(String feedbackText);
/**
* returns the reviews feedbackText.
*
* @return feedbackText
*/
String getFeedbackText();
/**
* adds a rating scale to the review. The scales name and the maximum value
* that can be selected must be provided. The function returns an ID by
* which the scale can be accessed.
*
* TODO: maybe address scales by their name instead?
*
* @param description
* @param maxValue
* @return scaleID
*/
int addRatingScale(String description, int maxValue);
/**
* removes an existing scale from the review. The scale must be addressed by
* a scaleID that was returned when it was created.
*
* TODO: maybe not necessary anyway?
*
* @param scaleID
*/
void removeRatingScale(int scaleID);
/**
* sets the rating of an existing scale. Will throw an
* IllegalArgumentException if the rating is higher than possible.
*
* @param scaleID
* @param rating
*/
void setRatingForScale(int scaleID, int rating) throws IllegalArgumentException;
/**
* returns the rating of an existing scale, addressed by it's scaleID.
*
* @param scaleID
* @return rating
*/
int getRatingOfScale(int scaleID);
/**
* exports (or rather serializes) the review as an object so that it can be
* used by other applications.
*
* TODO: think of exportTypes
* @param exportType
* @return this object in another format
*/
String exportAs(String exportType);
/**
* override for toString. Might just call .exportAs() internally
* @return this objects String representation. Maybe not necessary, but nice
* for sure.
*/
@Override
String toString();
}
package unipotsdam.gf.interfaces;
import unipotsdam.gf.modules.journal.JournalEntry;
/**
* Interface for learning journal entry
*/
public interface IJournal {
/**
* Enum for visibility
*/
enum Visibility{ALL, STUDENT, DOZENT, NONE}
/**
* Add a new journal entry
*
* @param text text of the entry
* @param visibility visibility of the entry
*/
void addJournal(String text, Visibility visibility);
/**
* Change an existing journal entry
*
* @param newText the new text
*/
void editJournal(String newText);
/**
* Delete a journal entry
*
* @param journaId id of the entry
*/
void deleteJournal(long journaId);
/**
* change visibility of an entry
* @param journaId id of the entry
* @param visibility new visibility
*/
void setVisibility(long journaId, Visibility visibility);
/**
* Get specific journal entry
*
* @param journaId id of the entry
* @return JournalEntry from database
*/
JournalEntry getJournal(long journaId);
/**
* Get all JournalEntry for a project
*
* @param projectId id of project
* @return all JournalEnrys for that project
*/
JournalEntry getAllJournalEntrysProject(long projectId);
}
package unipotsdam.gf.interfaces;
import java.util.ArrayList;
/**
* Interface for Project Description
*/
public interface IProjectDescription {
/**
* Save description to database
* @param description
*/
void saveDescription(String description);
/**
* Add a new link to ProjectDescription
* @param link url of the link
* @param name name to shoe on website
*/
void addLink(String link, String name);
/**
* Delete link
* @param name name of the link
*/
void deleteLink(String name);
/**
* Get name of the project
* @param projectId Id of the project
* @return name of the project
*/
String getName(long projectId);
/**
* Get Description of the project
* @param projectId Id of the project
* @return Desription of the project
*/
String getDescription(long projectId);
/**
* Get Lecturer of the project
* @param projectId Id of the project
* @return Lecturer of the project
*/
long getLecturer(long projectId);
/**
* Get all Students of the project (Group)
* @param projectId Id of the Project
* @return Students of the project
*/
ArrayList<Long> getStudents(long projectId);
/**
* Get all Links of the project
* @param projectId Id of the Project
* @return all links of the project
*/
ArrayList<Long> getLinks(long projectId);
}
package unipotsdam.gf.modules.annotation;
/**
* @author Sven Kästle
* skaestle@uni-potsdam.de
*/
public class Annotation {
// variables
private int id;
private long timestamp;
private int userId;
private int targetId;
private String body;
private int startCharacter;
private int endCharacter;
// constructor
public Annotation(int id, long timestamp, int userId, int targetId, String body, int startCharacter, int endCharacter) {
this.id = id;
this.timestamp = timestamp;
this.userId = userId;
this.targetId = targetId;
this.body = body;
this.startCharacter = startCharacter;
this.endCharacter = endCharacter;
}
// methods
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public int getTargetId() {
return targetId;
}
public void setTargetId(int targetId) {
this.targetId = targetId;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public int getStartCharacter() {
return startCharacter;
}
public void setStartCharacter(int startCharacter) {
this.startCharacter = startCharacter;
}
public int getEndCharacter() {
return endCharacter;
}
public void setEndCharacter(int endCharacter) {
this.endCharacter = endCharacter;
}
@Override
public String toString() {
return "Annotation{" +
"id=" + id +
", timestamp=" + timestamp +
", userId=" + userId +
", targetId=" + targetId +
", body='" + body + '\'' +
", startCharacter=" + startCharacter +
", endCharacter=" + endCharacter +
'}';
}
}
package unipotsdam.gf.modules.communication.model.chat;
import java.time.Instant;
public class ChatMessage {
String id;
String message;
Instant timestamp;
String username;
public ChatMessage() {}
public ChatMessage(String id, String message, Instant timestamp, String username) {
this.id = id;
this.message = message;
this.timestamp = timestamp;
this.username = username;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Instant getTimestamp() {
return timestamp;
}
public void setTimestamp(Instant timestamp) {
this.timestamp = timestamp;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}
package unipotsdam.gf.modules.communication.model.chat;
public class ChatRoom {
String id;
String name;
public ChatRoom() {}
public ChatRoom(String id, String name) {
this.id = id;
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package unipotsdam.gf.modules.communication.model.user;
public class User {
String id;
String authToken;
public User() {}
public User(String id, String authToken) {
this.id = id;
this.authToken = authToken;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getAuthToken() {
return authToken;
}
public void setAuthToken(String authToken) {
this.authToken = authToken;
}
}
package unipotsdam.gf.modules.communication.model.user;
public class UserCredentials {
String username;
String password;
public UserCredentials() {}
public UserCredentials(String username, String password) {
this.username = username;
this.password = password;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
package unipotsdam.gf.modules.communication.model.user;
public class UserRegistrationInformation {
private String username;
private String email;
private String pass;
private String name;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPass() {
return pass;
}
public void setPass(String pass) {
this.pass = pass;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package unipotsdam.gf.modules.journal;
import unipotsdam.gf.interfaces.IJournal;
/**
* Prototype of JournalEntry Class
*/
public class JournalEntry {
long id;
long owner;
long project;
long timestamp;
IJournal.Visibility visibility;
String text;
public JournalEntry() {
}
public JournalEntry(long id, long owner, long project, long timestamp, IJournal.Visibility visibility, String text) {
this.id = id;
this.owner = owner;
this.project = project;
this.timestamp = timestamp;
this.visibility = visibility;
this.text = text;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getOwner() {
return owner;
}
public void setOwner(long owner) {
this.owner = owner;
}
public long getProject() {
return project;
}
public void setProject(long project) {
this.project = project;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
public IJournal.Visibility getVisibility() {
return visibility;
}
public void setVisibility(IJournal.Visibility visibility) {
this.visibility = visibility;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
@Override
public String toString() {
return "JournalEntry{" +
"id=" + id +
", owner=" + owner +
", project=" + project +
", timestamp=" + timestamp +
", visibility=" + visibility +
", text='" + text + '\'' +
'}';
}
}
package unipotsdam.gf.modules.peer2peerfeedback;
/**
Peer2PeerFeedback Object
*/
public class Peer2PeerFeedback{
String feedbacktopic;
String feedbacktype;
String feedbackreference;
File document;
String feedbacktemplate;
User feedbacksender;
User feedbackreceiver;
public Peer2PeerFeedback(String feedbacktopic, String feedbacktype, String feedbackreference, File document, String feedbacktemplate, User feedbacksender, User feedbackreceiver) {
this.feedbacktopic = feedbacktopic;
this.feedbacktype = feedbacktype;
this.feedbackreference = feedbackreference;
this.document = document;
this.feedbacktemplate = feedbacktemplate;
this.feedbacksender = feedbacksender;
this.feedbackreceiver = feedbackreceiver;
}
public String getFeedbacktopic() {
return feedbacktopic;
}
public void setFeedbacktopic(String feedbacktopic) {
this.feedbacktopic = feedbacktopic;
}
public String getFeedbacktype() {
return feedbacktype;
}
public void setFeedbacktype(String feedbacktype) {
this.feedbacktype = feedbacktype;
}
public String getFeedbackreference() {
return feedbackreference;
}
public void setFeedbackreference(String feedbackreference) {
this.feedbackreference = feedbackreference;
}
public File getDocument() {
return document;
}
public void setDocument(File document) {
this.document = document;
}
public String getFeedbacktemplate() {
return feedbacktemplate;
}
public void setFeedbacktemplate(String feedbacktemplate) {
this.feedbacktemplate = feedbacktemplate;
}
public User getFeedbacksender() {
return feedbacksender;
}
public void setFeedbacksender(User feedbacksender) {
this.feedbacksender = feedbacksender;
}
public User getFeedbackreceiver() {
return feedbackreceiver;
}
public void setFeedbackreceiver(User feedbackreceiver) {
this.feedbackreceiver = feedbackreceiver;
}
@Override
public String toString() {
return "Peer2PeerFeedback{" +
"feedbacktopic=" + feedbacktopic +
", feedbacktype=" + feedbacktype +
", feedbackreference=" + feedbackreference +
", feedbacktemplate=" + feedbacktemplate +
", feedbacksender='" + feedbacksender +
", feedbackreceiver=" + feedbackreceiver +
", document=" + document.toString() +
'}';
}
}
\ No newline at end of file
This diff is collapsed.
File added
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment