From 564bfd2232384b9c104f3e08302b6e321b8ee240 Mon Sep 17 00:00:00 2001 From: Daniel Gerhardt <code@dgerhardt.net> Date: Thu, 8 Jan 2015 11:35:10 +0100 Subject: [PATCH] Add configuration for tracking --- .../controller/ConfigurationController.java | 20 ++++++++++++++++++- src/main/resources/arsnova.properties.example | 13 +++++++++++- src/test/resources/arsnova.properties.example | 13 +++++++++++- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/thm/arsnova/controller/ConfigurationController.java b/src/main/java/de/thm/arsnova/controller/ConfigurationController.java index 8c002c51f..0fe5a45ce 100644 --- a/src/main/java/de/thm/arsnova/controller/ConfigurationController.java +++ b/src/main/java/de/thm/arsnova/controller/ConfigurationController.java @@ -61,7 +61,7 @@ public class ConfigurationController extends AbstractController { @Value("${links.imprint.url}") private String imprintUrl; - + @Value("${links.blog.url:}") private String blogUrl; @@ -98,6 +98,15 @@ public class ConfigurationController extends AbstractController { @Value("${question.parse-answer-option-formatting:false}") private String parseAnswerOptionFormatting; + @Value("${tracking.provider}") + private String trackingProvider; + + @Value("${tracking.tracker-url}") + private String trackingTrackerUrl; + + @Value("${tracking.site-id}") + private String trackingSiteId; + @RequestMapping(method = RequestMethod.GET) @ResponseBody public final HashMap<String, Object> getConfiguration(HttpServletRequest request) { @@ -151,6 +160,15 @@ public class ConfigurationController extends AbstractController { features.put("flashcard", "true".equals(flashcardEnabled)); features.put("gridSquare", "true".equals(gridSquareEnabled)); + if (!"".equals(trackingTrackerUrl)) { + HashMap<String, String> tracking = new HashMap<String, String>(); + config.put("tracking", tracking); + + tracking.put("provider", trackingProvider); + tracking.put("trackerUrl", trackingTrackerUrl); + tracking.put("siteId", trackingSiteId); + } + return config; } } diff --git a/src/main/resources/arsnova.properties.example b/src/main/resources/arsnova.properties.example index 5bac66381..e1cbb2293 100644 --- a/src/main/resources/arsnova.properties.example +++ b/src/main/resources/arsnova.properties.example @@ -94,7 +94,7 @@ security.user-db.reset-password-mail.body=You requested to reset your \ password.\n\nPlease follow the link below to set a new password:\n{0} # LDAP authentication -# +# # Specific parameters: # url: LDAP server URL # user-dn-pattern: Pattern used to check user credentials against the LDAP @@ -200,3 +200,14 @@ links.overlay.url=https://arsnova.eu/overlay/ links.organization.url= links.imprint.url= links.privacy-policy.url= + + +################################################################################ +# Tracking +################################################################################ +# It is possible to use an external tracking software with ARSnova. Currently +# Piwik is the only supported tracking provider. +# +tracking.provider=piwik +tracking.tracker-url= +tracking.site-id= diff --git a/src/test/resources/arsnova.properties.example b/src/test/resources/arsnova.properties.example index 0d5baa750..67d06472f 100644 --- a/src/test/resources/arsnova.properties.example +++ b/src/test/resources/arsnova.properties.example @@ -94,7 +94,7 @@ security.user-db.reset-password-mail.body=You requested to reset your \ password.\n\nPlease follow the link below to set a new password:\n{0} # LDAP authentication -# +# # Specific parameters: # url: LDAP server URL # user-dn-pattern: Pattern used to check user credentials against the LDAP @@ -199,3 +199,14 @@ links.overlay.url=https://arsnova.eu/overlay/ links.organization.url= links.imprint.url= links.privacy-policy.url= + + +################################################################################ +# Tracking +################################################################################ +# It is possible to use an external tracking software with ARSnova. Currently +# Piwik is the only supported tracking provider. +# +tracking.provider=piwik +tracking.tracker-url= +tracking.site-id= -- GitLab