summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/App.java
diff options
context:
space:
mode:
authorJonathan Bauer2019-01-31 16:22:50 +0100
committerJonathan Bauer2019-01-31 16:22:50 +0100
commite025340c3e3056ca050b52ad05271a43846a2642 (patch)
tree733ca7ea725a84f5870827f7e89e3f9c08b59680 /dozentenmodul/src/main/java/org/openslx/dozmod/App.java
parent[*] Fix accidental use of Boolean.getBoolean. (-> .parseBoolean()) (diff)
downloadtutor-module-e025340c3e3056ca050b52ad05271a43846a2642.tar.gz
tutor-module-e025340c3e3056ca050b52ad05271a43846a2642.tar.xz
tutor-module-e025340c3e3056ca050b52ad05271a43846a2642.zip
[client] introduce branding, --dump and --pack
Application name, service name, master server endpoints, documentation websites needed to be configurable to allow for an easy rebranding of the suite. Two new options allow this: use '--dump <folder>' to dump the jar's configurable files into that folder. Aside from text templates in 'txt', logos and icons in 'img', the 'branding.properties' file contains: * masterserver.address : self-explanatory * application.name : name to be shown on graphical elements like the main window * service.name : name to be used as a prefix for formulation like 'bwLehrpool-Team' or 'bwLehrpool-System' etc * service.faq.website : link to FAQ website * service.email : support contact address Once edited, the whole folder can be integrated into the Suite with '--pack <folder> <new_jar>'. The path to the new jar is then the rebranded version of the suite.
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/App.java')
-rwxr-xr-xdozentenmodul/src/main/java/org/openslx/dozmod/App.java44
1 files changed, 27 insertions, 17 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/App.java b/dozentenmodul/src/main/java/org/openslx/dozmod/App.java
index ee3f6e7d..33b6526b 100755
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/App.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/App.java
@@ -40,8 +40,6 @@ public class App {
// Logger
private final static Logger LOGGER = Logger.getLogger(App.class);
- private static final String MASTER_SERVER_ADDRESS = "bwlp-masterserver.ruf.uni-freiburg.de";
-
public static final int THRIFT_PORT = 9090;
public static final int THRIFT_SSL_PORT = THRIFT_PORT + 1;
@@ -57,7 +55,7 @@ public class App {
private static void setupLogger() {
// path to the log file
- final String logFilePath = Config.getPath() + File.separator + "bwSuite.log";
+ final String logFilePath = Config.getPath() + File.separator + Branding.getServiceName() + ".log";
// check if we had an old log file
final File logFile = new File(logFilePath);
@@ -122,22 +120,34 @@ public class App {
};
BasicConfigurator.configure(ap);
- LOGGER.info("Starting logging to: " + logFilePath);
- LOGGER.info("bwLehrpool-Suite Version: " + ClientVersion.getLocalRevision());
- LOGGER.info(" " + FormatHelper.longDate(ClientVersion.getLocalRevTimestamp()));
- LOGGER.info("os.name: " + System.getProperty("os.name"));
- LOGGER.info("java.specification.vendor: " + System.getProperty("java.specification.vendor"));
- LOGGER.info("java.specification.name: " + System.getProperty("java.specification.name"));
- LOGGER.info("java.specification.version: " + System.getProperty("java.specification.version"));
- LOGGER.info("java.version: " + System.getProperty("java.version"));
- LOGGER.info("java.vm.version: " + System.getProperty("java.vm.version"));
- LOGGER.info("java.runtime.version: " + System.getProperty("java.runtime.version"));
+ LOGGER.info("Starting logging to: " + logFilePath);
+ LOGGER.info(Branding.getApplicationName() + " Version: " + ClientVersion.getLocalRevision());
+ LOGGER.info(" " + FormatHelper.longDate(ClientVersion.getLocalRevTimestamp()));
+ LOGGER.info("os.name: " + System.getProperty("os.name"));
+ LOGGER.info("java.specification.vendor: " + System.getProperty("java.specification.vendor"));
+ LOGGER.info("java.specification.name: " + System.getProperty("java.specification.name"));
+ LOGGER.info("java.specification.version: " + System.getProperty("java.specification.version"));
+ LOGGER.info("java.version: " + System.getProperty("java.version"));
+ LOGGER.info("java.vm.version: " + System.getProperty("java.vm.version"));
+ LOGGER.info("java.runtime.version: " + System.getProperty("java.runtime.version"));
}
public static void main(final String[] args) throws InvocationTargetException, InterruptedException {
- if (args.length >= 2 && args[0].equals("--json")) {
- writeJsonUpdateFile(args[1]);
- return;
+ if (args.length >= 2) {
+ if (args[0].equals("--json")) {
+ writeJsonUpdateFile(args[1]);
+ return;
+ }
+ if (args[0].equals("--dump")) {
+ Branding.dump(args[1]);
+ return;
+ }
+ }
+ if (args.length >= 3) {
+ if (args[0].equals("--pack")) {
+ Branding.pack(args[1], args[2]);
+ return;
+ }
}
try {
Config.init();
@@ -185,7 +195,7 @@ public class App {
port = Util.parseInt(args[1], -1);
useSsl = Boolean.parseBoolean(args[2]);
} else {
- host = MASTER_SERVER_ADDRESS;
+ host = Branding.getMasterServerAddress();
port = THRIFT_SSL_PORT;
useSsl = true;
}