GitLab steht Mittwoch, den 23. September, zwischen 10:00 und 12:00 Uhr aufgrund von Wartungsarbeiten nicht zur Verfügung.

Commit 2068c6f0 authored by Tom Käsler's avatar Tom Käsler

Merge branch 'fixSessionExport' into 'master'

Fix session export

fixes the import of sessionFeatures and messages of the day.

See merge request !18
parents 2d6dd0d1 e39a61d7
......@@ -2170,10 +2170,11 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware
d.put("type", "motd");
d.put("motdkey", m.getMotdkey());
d.put("title", m.getTitle());
d.put("text", m.getText());
d.put("audience", m.getAudience());
d.put("sessionkey", session.getKeyword());
d.put("startdate", String.valueOf(m.getStartdate()));
d.put("enddate", String.valueOf(m.getEnddate()));
d.put("startdate", String.valueOf(m.getStartdate().getTime()));
d.put("enddate", String.valueOf(m.getEnddate().getTime()));
motds.add(d);
}
List<Document> documents = new ArrayList<Document>(answers);
......
......@@ -23,6 +23,7 @@ import de.thm.arsnova.entities.Session;
import de.thm.arsnova.entities.User;
import de.thm.arsnova.entities.Motd;
import de.thm.arsnova.entities.SessionInfo;
import de.thm.arsnova.entities.SessionFeature;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.context.annotation.Import;
......@@ -44,6 +45,8 @@ public class ImportExportSession {
private List<Motd> motds;
private SessionFeature sessionFeature = new SessionFeature();
private SessionInfo sessionInfo;
public ImportExportSession() {
......@@ -88,6 +91,14 @@ public class ImportExportSession {
this.motds = mL;
}
public SessionFeature getSessionFeature() {
return sessionFeature;
}
public void setSessionFeature(SessionFeature sF) {
sessionFeature = sF;
}
public SessionInfo getSessionInfo() {
return sessionInfo;
}
......@@ -104,6 +115,7 @@ public class ImportExportSession {
PublicPool p = new PublicPool();
p.setPpFromSession(s);
iesession.setPublicPool(p);
sessionFeature = s.getFeatures();
session = iesession;
}
......@@ -119,6 +131,7 @@ public class ImportExportSession {
s.setActive(session.isActive());
s.setName(session.getName());
s.setShortName(session.getShortName());
s.setFeatures(session.getSessionFeature());
// public pool
if (session.getPublicPool() != null) {
// overwrite name and shortname
......@@ -223,6 +236,8 @@ public class ImportExportSession {
private PublicPool publicPool;
private SessionFeature sessionFeature;
@ApiModelProperty(required = true, value = "used to display short name")
public String getName() {
return name;
......@@ -258,6 +273,14 @@ public class ImportExportSession {
public void setPublicPool(PublicPool publicPool) {
this.publicPool = publicPool;
}
public SessionFeature getSessionFeature() {
return this.sessionFeature;
}
public void setSessionFeature(SessionFeature sF) {
this.sessionFeature = sF;
}
}
public static class PublicPool {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment