Commit 2c822151 authored by Daniel Gerhardt's avatar Daniel Gerhardt

Annotate getters of non-persistant entities with 'Public' view

parent 47056813
......@@ -17,10 +17,14 @@
*/
package de.thm.arsnova.entities;
import com.fasterxml.jackson.annotation.JsonView;
import de.thm.arsnova.entities.serialization.View;
public class Authorize {
private String user;
private String socketid;
@JsonView(View.Public.class)
public final String getUser() {
return user;
}
......@@ -29,6 +33,7 @@ public class Authorize {
this.user = user;
}
@JsonView(View.Public.class)
public final String getSocketid() {
return socketid;
}
......
......@@ -17,6 +17,9 @@
*/
package de.thm.arsnova.entities;
import com.fasterxml.jackson.annotation.JsonView;
import de.thm.arsnova.entities.serialization.View;
import java.util.ArrayList;
import java.util.List;
......@@ -42,6 +45,7 @@ public class Feedback {
values.add(d);
}
@JsonView(View.Public.class)
public final List<Integer> getValues() {
return values;
}
......
......@@ -17,6 +17,8 @@
*/
package de.thm.arsnova.entities;
import com.fasterxml.jackson.annotation.JsonView;
import de.thm.arsnova.entities.serialization.View;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -40,6 +42,7 @@ public class InterposedReadingCount {
}
@ApiModelProperty(required = true, value = "the number of read interposed questions")
@JsonView(View.Public.class)
public int getRead() {
return read;
}
......@@ -49,6 +52,7 @@ public class InterposedReadingCount {
}
@ApiModelProperty(required = true, value = "the number of unread interposed questions")
@JsonView(View.Public.class)
public int getUnread() {
return unread;
}
......@@ -58,6 +62,7 @@ public class InterposedReadingCount {
}
@ApiModelProperty(required = true, value = "the number of total interposed questions")
@JsonView(View.Public.class)
public int getTotal() {
return getRead() + getUnread();
}
......
......@@ -17,6 +17,9 @@
*/
package de.thm.arsnova.entities;
import com.fasterxml.jackson.annotation.JsonView;
import de.thm.arsnova.entities.serialization.View;
/**
* A login service description. For example, this class is used to display the login buttons in ARSnova mobile.
*/
......@@ -51,6 +54,7 @@ public class ServiceDescription {
}
}
@JsonView(View.Public.class)
public String getId() {
return id;
}
......@@ -59,6 +63,7 @@ public class ServiceDescription {
this.id = id;
}
@JsonView(View.Public.class)
public String getName() {
return name;
}
......@@ -67,6 +72,7 @@ public class ServiceDescription {
this.name = name;
}
@JsonView(View.Public.class)
public String getDialogUrl() {
return dialogUrl;
}
......@@ -75,6 +81,7 @@ public class ServiceDescription {
this.dialogUrl = dialogUrl;
}
@JsonView(View.Public.class)
public String getImage() {
return image;
}
......@@ -83,6 +90,7 @@ public class ServiceDescription {
this.image = image;
}
@JsonView(View.Public.class)
public int getOrder() {
return order;
}
......@@ -91,6 +99,7 @@ public class ServiceDescription {
this.order = order;
}
@JsonView(View.Public.class)
public String[] getAllowedRoles() {
return allowedRoles;
}
......
......@@ -17,6 +17,8 @@
*/
package de.thm.arsnova.entities;
import com.fasterxml.jackson.annotation.JsonView;
import de.thm.arsnova.entities.serialization.View;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -69,6 +71,7 @@ public class SessionInfo {
}
@ApiModelProperty(required = true, value = "the name")
@JsonView(View.Public.class)
public String getName() {
return name;
}
......@@ -78,6 +81,7 @@ public class SessionInfo {
}
@ApiModelProperty(required = true, value = "the short name")
@JsonView(View.Public.class)
public String getShortName() {
return shortName;
}
......@@ -87,6 +91,7 @@ public class SessionInfo {
}
@ApiModelProperty(required = true, value = "the keyword")
@JsonView(View.Public.class)
public String getKeyword() {
return keyword;
}
......@@ -96,6 +101,7 @@ public class SessionInfo {
}
@ApiModelProperty(required = true, value = "true for active")
@JsonView(View.Public.class)
public boolean isActive() {
return active;
}
......@@ -105,6 +111,7 @@ public class SessionInfo {
}
@ApiModelProperty(required = true, value = "the source the course comes from (example: moodle)")
@JsonView(View.Public.class)
public String getCourseType() {
return courseType;
}
......@@ -114,6 +121,7 @@ public class SessionInfo {
}
@ApiModelProperty(required = true, value = "the session type")
@JsonView(View.Public.class)
public String getSessionType() {
return sessionType;
}
......@@ -123,6 +131,7 @@ public class SessionInfo {
}
@ApiModelProperty(required = true, value = "used to display level")
@JsonView(View.Public.class)
public String getPpLevel() {
return ppLevel;
}
......@@ -132,6 +141,7 @@ public class SessionInfo {
}
@ApiModelProperty(required = true, value = "the public pool subject")
@JsonView(View.Public.class)
public String getPpSubject() {
return ppSubject;
}
......@@ -141,6 +151,7 @@ public class SessionInfo {
}
@ApiModelProperty(required = true, value = "the number of questions")
@JsonView(View.Public.class)
public int getNumQuestions() {
return numQuestions;
}
......@@ -150,6 +161,7 @@ public class SessionInfo {
}
@ApiModelProperty(required = true, value = "the number of answers")
@JsonView(View.Public.class)
public int getNumAnswers() {
return numAnswers;
}
......@@ -159,6 +171,7 @@ public class SessionInfo {
}
@ApiModelProperty(required = true, value = "used to display interposed number")
@JsonView(View.Public.class)
public int getNumInterposed() {
return numInterposed;
}
......@@ -168,6 +181,7 @@ public class SessionInfo {
}
@ApiModelProperty(required = true, value = "the number of unanswered questions")
@JsonView(View.Public.class)
public int getNumUnanswered() {
return numUnanswered;
}
......@@ -177,6 +191,7 @@ public class SessionInfo {
}
@ApiModelProperty(required = true, value = "the creation timestamp")
@JsonView(View.Public.class)
public long getCreationTime() {
return creationTime;
}
......@@ -186,6 +201,7 @@ public class SessionInfo {
}
@ApiModelProperty(required = true, value = "the number of unread interposed questions")
@JsonView(View.Public.class)
public int getNumUnredInterposed() {
return numUnredInterposed;
}
......
......@@ -17,6 +17,8 @@
*/
package de.thm.arsnova.entities;
import com.fasterxml.jackson.annotation.JsonView;
import de.thm.arsnova.entities.serialization.View;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -40,6 +42,7 @@ public class Statistics {
private int flashcards;
@ApiModelProperty(required = true, value = "the number of answers")
@JsonView(View.Public.class)
public int getAnswers() {
return answers;
}
......@@ -49,6 +52,7 @@ public class Statistics {
}
@ApiModelProperty(required = true, value = "the number of lecture questions")
@JsonView(View.Public.class)
public int getLectureQuestions() {
return lectureQuestions;
}
......@@ -58,6 +62,7 @@ public class Statistics {
}
@ApiModelProperty(required = true, value = "the number of prepartion uestions")
@JsonView(View.Public.class)
public int getPreparationQuestions() {
return preparationQuestions;
}
......@@ -67,11 +72,13 @@ public class Statistics {
}
@ApiModelProperty(required = true, value = "the total number of questions")
@JsonView(View.Public.class)
public int getQuestions() {
return getLectureQuestions() + getPreparationQuestions();
}
@ApiModelProperty(required = true, value = "the number of open sessions")
@JsonView(View.Public.class)
public int getOpenSessions() {
return openSessions;
}
......@@ -81,6 +88,7 @@ public class Statistics {
}
@ApiModelProperty(required = true, value = "the number of closed Sessions")
@JsonView(View.Public.class)
public int getClosedSessions() {
return closedSessions;
}
......@@ -90,11 +98,13 @@ public class Statistics {
}
@ApiModelProperty(required = true, value = "the total number of Sessions")
@JsonView(View.Public.class)
public int getSessions() {
return getOpenSessions() + getClosedSessions();
}
@ApiModelProperty(required = true, value = "used to display Active Users")
@JsonView(View.Public.class)
public int getActiveUsers() {
return activeUsers;
}
......@@ -104,6 +114,7 @@ public class Statistics {
}
@ApiModelProperty(required = true, value = "the number of users that are logged")
@JsonView(View.Public.class)
public int getLoggedinUsers() {
return loggedinUsers;
}
......@@ -113,6 +124,7 @@ public class Statistics {
}
@ApiModelProperty(required = true, value = "the number of interposed Questions")
@JsonView(View.Public.class)
public int getInterposedQuestions() {
return interposedQuestions;
}
......@@ -122,6 +134,7 @@ public class Statistics {
}
@ApiModelProperty(required = true, value = "the number of flashcards")
@JsonView(View.Public.class)
public int getFlashcards() {
return flashcards;
}
......@@ -131,6 +144,7 @@ public class Statistics {
}
@ApiModelProperty(required = true, value = "the number of creators")
@JsonView(View.Public.class)
public int getCreators() {
return creators;
}
......@@ -140,6 +154,7 @@ public class Statistics {
}
@ApiModelProperty(required = true, value = "the number of concept Questions")
@JsonView(View.Public.class)
public int getConceptQuestions() {
return conceptQuestions;
}
......@@ -149,6 +164,7 @@ public class Statistics {
}
@ApiModelProperty(required = true, value = "the number of active Students")
@JsonView(View.Public.class)
public int getActiveStudents() {
return activeStudents;
}
......
......@@ -17,6 +17,8 @@
*/
package de.thm.arsnova.entities;
import com.fasterxml.jackson.annotation.JsonView;
import de.thm.arsnova.entities.serialization.View;
import de.thm.arsnova.services.UserSessionService;
import org.jasig.cas.client.authentication.AttributePrincipal;
import org.pac4j.oauth.profile.facebook.FacebookProfile;
......@@ -76,6 +78,7 @@ public class User implements Serializable {
setType(LDAP);
}
@JsonView(View.Public.class)
public String getUsername() {
return username;
}
......@@ -84,6 +87,7 @@ public class User implements Serializable {
this.username = username;
}
@JsonView(View.Public.class)
public String getType() {
return type;
}
......@@ -108,6 +112,7 @@ public class User implements Serializable {
this.isAdmin = a;
}
@JsonView(View.Public.class)
public boolean isAdmin() {
return this.isAdmin;
}
......
......@@ -18,8 +18,10 @@
package de.thm.arsnova.entities.transport;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonView;
import de.thm.arsnova.entities.Question;
import de.thm.arsnova.entities.User;
import de.thm.arsnova.entities.serialization.View;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -59,6 +61,7 @@ public class Answer implements Serializable {
}
@ApiModelProperty(required = true, value = "used to display text answer")
@JsonView(View.Public.class)
public String getAnswerText() {
return answerText;
}
......@@ -68,6 +71,7 @@ public class Answer implements Serializable {
}
@ApiModelProperty(required = true, value = "used to display subject answer")
@JsonView(View.Public.class)
public String getAnswerSubject() {
return answerSubject;
}
......@@ -76,6 +80,7 @@ public class Answer implements Serializable {
this.answerSubject = answerSubject;
}
@JsonView(View.Public.class)
public final String getAnswerTextRaw() {
return this.answerTextRaw;
}
......@@ -84,6 +89,7 @@ public class Answer implements Serializable {
this.answerTextRaw = answerTextRaw;
}
@JsonView(View.Public.class)
public final String getAnswerSubjectRaw() {
return this.answerSubjectRaw;
}
......@@ -92,6 +98,7 @@ public class Answer implements Serializable {
this.answerSubjectRaw = answerSubjectRaw;
}
@JsonView(View.Public.class)
public final double getFreeTextScore() {
return this.freeTextScore;
}
......@@ -110,6 +117,7 @@ public class Answer implements Serializable {
}
@ApiModelProperty(required = true, value = "abstention")
@JsonView(View.Public.class)
public boolean isAbstention() {
return abstention;
}
......@@ -146,6 +154,7 @@ public class Answer implements Serializable {
}
@ApiModelProperty(required = true, value = "used to display image answer")
@JsonView(View.Public.class)
public String getAnswerImage() {
return answerImage;
}
......
......@@ -17,12 +17,14 @@
*/
package de.thm.arsnova.entities.transport;
import com.fasterxml.jackson.annotation.JsonView;
import de.thm.arsnova.entities.Motd;
import de.thm.arsnova.entities.Question;
import de.thm.arsnova.entities.Session;
import de.thm.arsnova.entities.SessionFeature;
import de.thm.arsnova.entities.SessionInfo;
import de.thm.arsnova.entities.User;
import de.thm.arsnova.entities.serialization.View;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -56,6 +58,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = "used to display session")
@JsonView(View.Public.class)
public ImportExportSesssion getSession() {
return session;
}
......@@ -65,6 +68,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = "used to display questions")
@JsonView(View.Public.class)
public List<ImportExportQuestion> getQuestions() {
return questions;
}
......@@ -74,6 +78,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = "used to display questions feedback")
@JsonView(View.Public.class)
public List<InterposedQuestion> getFeedbackQuestions() {
return feedbackQuestions;
}
......@@ -82,6 +87,7 @@ public class ImportExportSession {
this.feedbackQuestions = feedbackQuestions;
}
@JsonView(View.Public.class)
public List<Motd> getMotds() {
return motds;
}
......@@ -90,6 +96,7 @@ public class ImportExportSession {
this.motds = mL;
}
@JsonView(View.Public.class)
public SessionFeature getSessionFeature() {
return sessionFeature;
}
......@@ -98,6 +105,7 @@ public class ImportExportSession {
sessionFeature = sF;
}
@JsonView(View.Public.class)
public SessionInfo getSessionInfo() {
return sessionInfo;
}
......@@ -217,6 +225,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = " used to display answers")
@JsonView(View.Public.class)
public List<Answer> getAnswers() {
return answers;
}
......@@ -241,6 +250,7 @@ public class ImportExportSession {
private SessionFeature sessionFeature;
@ApiModelProperty(required = true, value = "used to display short name")
@JsonView(View.Public.class)
public String getName() {
return name;
}
......@@ -250,6 +260,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = false, value = "used to identify public pool sessions")
@JsonView(View.Public.class)
public String getSessionType() {
return sessionType;
}
......@@ -259,6 +270,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = "used to display short name")
@JsonView(View.Public.class)
public String getShortName() {
return shortName;
}
......@@ -268,6 +280,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = "active")
@JsonView(View.Public.class)
public boolean isActive() {
return active;
}
......@@ -277,6 +290,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = "used to display public pool")
@JsonView(View.Public.class)
public PublicPool getPublicPool() {
return publicPool;
}
......@@ -285,6 +299,7 @@ public class ImportExportSession {
this.publicPool = publicPool;
}
@JsonView(View.Public.class)
public SessionFeature getSessionFeature() {
return this.sessionFeature;
}
......@@ -333,6 +348,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = "used to display author name")
@JsonView(View.Public.class)
public String getPpAuthorName() {
return ppAuthorName;
}
......@@ -342,6 +358,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = "used to display author mail")
@JsonView(View.Public.class)
public String getPpAuthorMail() {
return ppAuthorMail;
}
......@@ -351,6 +368,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = "used to display university")
@JsonView(View.Public.class)
public String getPpUniversity() {
return ppUniversity;
}
......@@ -360,6 +378,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = "used to display logo")
@JsonView(View.Public.class)
public String getPpLogo() {
return ppLogo;
}
......@@ -369,6 +388,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = "used to display subject")
@JsonView(View.Public.class)
public String getPpSubject() {
return ppSubject;
}
......@@ -378,6 +398,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = "used to display license")
@JsonView(View.Public.class)
public String getPpLicense() {
return ppLicense;
}
......@@ -387,6 +408,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = "used to display level")
@JsonView(View.Public.class)
public String getPpLevel() {
return ppLevel;
}
......@@ -396,6 +418,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = "used to display description")
@JsonView(View.Public.class)
public String getPpDescription() {
return ppDescription;
}
......@@ -405,6 +428,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = "used to display faculty")
@JsonView(View.Public.class)
public String getPpFaculty() {
return ppFaculty;
}
......@@ -414,6 +438,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = "used to display name")
@JsonView(View.Public.class)
public String getName() {
return name;
}
......@@ -423,6 +448,7 @@ public class ImportExportSession {
}
@ApiModelProperty(required = true, value = "used to display short name")
@JsonView(View.Public.class)
public String getShortName() {
return shortName;
}
......
......@@ -17,6 +17,8 @@
*/
package de.thm.arsnova.entities.transport;
import com.fasterxml.jackson.annotation.JsonView;
import de.thm.arsnova.entities.serialization.View;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -54,6 +56,7 @@ public class InterposedQuestion {
public InterposedQuestion() { }
@ApiModelProperty(required = true, value = "used to display Id")
@JsonView(View.Public.class)
public String getId() {
return id;
}
......@@ -63,6 +66,7 @@ public class InterposedQuestion {
}
@ApiModelProperty(required = true, value = "used to display Subject")
@JsonView(View.Public.class)
public String getSubject() {
return subject;
}
......@@ -72,6 +76,7 @@ public class InterposedQuestion {
}
@ApiModelProperty(required = true, value = "used to display Text")
@JsonView(View.Public.class)
public String getText() {
return text;
}
......@@ -81,6 +86,7 @@ public class InterposedQuestion {
}
@ApiModelProperty(required = true, value = "used to display Timetamp")
@JsonView(View.Public.class)
public long getTimestamp() {
return timestamp;
}
......@@ -90,6 +96,7 @@ public class InterposedQuestion {
}
@ApiModelProperty(required = true, value = "is read")
@JsonView(View.Public.class)
public boolean isRead() {
return read;
}
......
......@@ -17,6 +17,8 @@
*/
package de.thm.arsnova.entities.transport;
import com.fasterxml.jackson.annotation.JsonView;
import de.thm.arsnova.entities.serialization.View;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -39,6 +41,7 @@ public class LearningProgressValues {
private int numUsers;
@ApiModelProperty(required = true, value = "used to display course progress")
@JsonView(View.Public.class)
public int getCourseProgress() {
return courseProgress;
}
......@@ -48,6 +51,7 @@ public class LearningProgressValues {
}
@ApiModelProperty(required = true, value = "used to display my progress")
@JsonView(View.Public.class)
public int getMyProgress() {
return myProgress;
}
......@@ -57,6 +61,7 @@ public class LearningProgressValues {
}
@ApiModelProperty(required = true, value = "used to display questions number")
@JsonView(View.Public.class)
public int getNumQuestions() {
return numQuestions;
}
......@@ -65,6 +70,7 @@ public class LearningProgressValues {
this.numQuestions = numQuestions;
}
@JsonView(View.Public.class)
public int getNumerator() {
return numerator;
}
......@@ -73,6 +79,7 @@ public class LearningProgressValues {
this.numerator = numerator;
}
@JsonView(View.