diff options
| author | Simon Rettberg | 2016-01-20 16:45:22 +0100 |
|---|---|---|
| committer | Simon Rettberg | 2016-01-20 16:45:22 +0100 |
| commit | 7ab92261a2f55662d191165fef3ac69ed9aa6e07 (patch) | |
| tree | c215d3baf4fb0261485bfc3487ba53f5a722d255 /dozentenmodulserver/src/main/java | |
| parent | [server] Add section entry to xml (diff) | |
| download | tutor-module-7ab92261a2f55662d191165fef3ac69ed9aa6e07.tar.gz tutor-module-7ab92261a2f55662d191165fef3ac69ed9aa6e07.tar.xz tutor-module-7ab92261a2f55662d191165fef3ac69ed9aa6e07.zip | |
[server] Don't use section strings, instead use flags for isTemplate and isForLocation
Diffstat (limited to 'dozentenmodulserver/src/main/java')
| -rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java | 15 | ||||
| -rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/VmChooserEntryXml.java | 19 |
2 files changed, 18 insertions, 16 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java index cf057a39..2cc4ff48 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java @@ -485,21 +485,12 @@ public class DbLecture { boolean isForThisLocation = rs.getString("loctest") != null; if (!isForThisLocation && rs.getBoolean("islocationprivate")) continue; // Is limited to location, and we're not in one of the required locations - String prio, section; - if (isForThisLocation) { - prio = "40"; - section = "Speziell für diesen Raum"; - } else if (rs.getBoolean("istemplate")) { - section = "Vorlagen"; - prio = "60"; - } else { - section = "Veranstaltungen"; - prio = "80"; - } + boolean isTemplate = rs.getBoolean("istemplate"); + int prio = 100; list.add(new VmChooserEntryXml(rs.getString("filepath"), prio, "-", rs.getString("lecturename"), rs.getString("description"), rs.getString("lectureid"), rs.getString("virtid"), rs.getString("virtname"), rs.getString("virtoskeyword"), - rs.getString("osname"), "", section)); + rs.getString("osname"), "", isForThisLocation, isTemplate)); } return list; } catch (SQLException e) { diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/VmChooserEntryXml.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/VmChooserEntryXml.java index dcfa8a66..d383a72a 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/VmChooserEntryXml.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/VmChooserEntryXml.java @@ -30,11 +30,13 @@ public class VmChooserEntryXml { @Element private VmChooserParamXml os_name; @Element - private VmChooserParamXml section; + private VmChooserParamXml for_location; + @Element + private VmChooserParamXml is_template; - public VmChooserEntryXml(String imageFilePath, String priority, String creator, String short_description, + public VmChooserEntryXml(String imageFilePath, int priority, String creator, String short_description, String long_description, String uuid, String virtId, String virtualizerName, String osVirtName, - String osDisplayName, String icon, String section) { + String osDisplayName, String icon, boolean isForThisLocation, boolean isTemplate) { this.image_name = new VmChooserParamXml(imageFilePath); this.priority = new VmChooserParamXml(priority); this.creator = new VmChooserParamXml(creator); @@ -46,7 +48,8 @@ public class VmChooserEntryXml { this.icon = new VmChooserParamXml(icon); this.virtualizer_name = new VmChooserParamXml(virtualizerName); this.os_name = new VmChooserParamXml(osDisplayName); - this.section = new VmChooserParamXml(section); + this.for_location = new VmChooserParamXml(isForThisLocation); + this.is_template = new VmChooserParamXml(isTemplate); } private static class VmChooserParamXml { @@ -58,6 +61,14 @@ public class VmChooserEntryXml { this.param = value; } + public VmChooserParamXml(boolean bool) { + this.param = bool ? "1" : "0"; + } + + public VmChooserParamXml(int val) { + this.param = Integer.toString(val); + } + } } |
