changeset 60:99d9afcfd04d

configuration of uri prefixes was completely broken.
author casties
date Tue, 20 Nov 2012 19:43:12 +0100
parents e2f86ef9b871
children b8ef15c8c4a5
files src/main/java/de/mpiwg/itgroup/annotations/restlet/BaseRestlet.java
diffstat 1 files changed, 15 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/itgroup/annotations/restlet/BaseRestlet.java	Tue Nov 20 19:16:43 2012 +0100
+++ b/src/main/java/de/mpiwg/itgroup/annotations/restlet/BaseRestlet.java	Tue Nov 20 19:43:12 2012 +0100
@@ -143,6 +143,21 @@
                          */
                         graphdbPath = serverConfig.getProperty(GRAPHDB_PATH_KEY, graphdbPath);
                         ldapServerUrl = serverConfig.getProperty(LDAP_SERVER_KEY, null);
+                        /*
+                         * uri prefixes
+                         */
+                        if (serverConfig.containsKey(PERSONS_URI_KEY)) {
+                            BaseRestlet.PERSONS_URI_PREFIX = serverConfig.getProperty(PERSONS_URI_KEY);
+                        }
+                        if (serverConfig.containsKey(GROUPS_URI_KEY)) {
+                            BaseRestlet.GROUPS_URI_PREFIX = serverConfig.getProperty(GROUPS_URI_KEY);
+                        }
+                        if (serverConfig.containsKey(TAGS_URI_KEY)) {
+                            BaseRestlet.TAGS_URI_PREFIX = serverConfig.getProperty(TAGS_URI_KEY);
+                        }
+                        if (serverConfig.containsKey(ANNOTATIONS_URI_KEY)) {
+                            AnnotationStore.ANNOTATION_URI_PREFIX = serverConfig.getProperty(ANNOTATIONS_URI_KEY);
+                        }
                     } catch (IOException e) {
                         logger.warn("Error loading server config: ", e);
                     }
@@ -204,25 +219,6 @@
                 // store config
                 sc.setAttribute(CONSUMERKEYS_KEY, consumerKeys);
             }
-            /*
-             * read uri prefixes
-             */
-            String pup = (String) sc.getAttribute(PERSONS_URI_KEY);
-            if (pup != null) {
-                BaseRestlet.PERSONS_URI_PREFIX = pup;
-            }
-            String gup = (String) sc.getAttribute(GROUPS_URI_KEY);
-            if (gup != null) {
-                BaseRestlet.GROUPS_URI_PREFIX = gup;
-            }
-            String tup = (String) sc.getAttribute(TAGS_URI_KEY);
-            if (tup != null) {
-                BaseRestlet.TAGS_URI_PREFIX = tup;
-            }
-            String aup = (String) sc.getAttribute(ANNOTATIONS_URI_KEY);
-            if (aup != null) {
-                AnnotationStore.ANNOTATION_URI_PREFIX = aup;
-            }
         } else {
             logger.error("Unable to get ServletContext!");
         }