comparison src/main/java/de/mpiwg/itgroup/annotations/restlet/RestServer.java @ 6:6dfbe2400f64

delete annotation should work now.
author casties
date Wed, 11 Jul 2012 17:08:40 +0200
parents bbf0cc5bee29
children 58357a4b86de
comparison
equal deleted inserted replaced
5:bbf0cc5bee29 6:6dfbe2400f64
51 private WrappingNeoServerBootstrapper srv; 51 private WrappingNeoServerBootstrapper srv;
52 public static final String GRAPHDBSRV_KEY = "annotationmanager.graphdb.srv"; 52 public static final String GRAPHDBSRV_KEY = "annotationmanager.graphdb.srv";
53 53
54 private AnnotationStore store; 54 private AnnotationStore store;
55 public static final String ANNSTORE_KEY = "annotationmanager.store"; 55 public static final String ANNSTORE_KEY = "annotationmanager.store";
56
57 private String ldapServerUrl;
58 public static final String LDAP_SERVER_KEY = "annotationmanager.ldapserver.url";
56 59
57 /** 60 /**
58 * constructor 61 * constructor
59 * 62 *
60 * @param parentContext 63 * @param parentContext
78 serverConfig.load(ps1); 81 serverConfig.load(ps1);
79 /* 82 /*
80 * read serverconfig options 83 * read serverconfig options
81 */ 84 */
82 graphdbPath = serverConfig.getProperty(GRAPHDB_PATH_KEY, graphdbPath); 85 graphdbPath = serverConfig.getProperty(GRAPHDB_PATH_KEY, graphdbPath);
86 ldapServerUrl = serverConfig.getProperty(LDAP_SERVER_KEY, null);
83 } catch (IOException e) { 87 } catch (IOException e) {
84 logger.warn("Error loading server config: ", e); 88 logger.warn("Error loading server config: ", e);
85 } 89 }
86 logger.debug("config: " + serverConfig); 90 logger.debug("config: " + serverConfig);
87 } else { 91 } else {
179 * @return 183 * @return
180 */ 184 */
181 public String getFullNameFromLdap(String creator) { 185 public String getFullNameFromLdap(String creator) {
182 String retString = creator; // falls nichts gefunden wird einfach den 186 String retString = creator; // falls nichts gefunden wird einfach den
183 // creator zurueckgeben 187 // creator zurueckgeben
188 if (ldapServerUrl == null) {
189 return retString;
190 }
184 Hashtable<String, String> env = new Hashtable<String, String>(); 191 Hashtable<String, String> env = new Hashtable<String, String>();
185 String sp = "com.sun.jndi.ldap.LdapCtxFactory"; 192 String sp = "com.sun.jndi.ldap.LdapCtxFactory";
186 env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, sp); 193 env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, sp);
187 194
188 // TODO: should go into config file 195 env.put(javax.naming.Context.PROVIDER_URL, ldapServerUrl);
189 String ldapUrl = "ldap://ldap.mpiwg-berlin.mpg.de/dc=mpiwg-berlin,dc=mpg,dc=de";
190 env.put(javax.naming.Context.PROVIDER_URL, ldapUrl);
191 196
192 DirContext dctx; 197 DirContext dctx;
193 try { 198 try {
194 dctx = new InitialDirContext(env); 199 dctx = new InitialDirContext(env);
195 } catch (NamingException e1) { 200 } catch (NamingException e1) {