Mercurial > hg > AnnotationManager
comparison src/main/java/de/mpiwg/itgroup/annotationManager/restlet/SearchAnnotations.java @ 26:235b91ba8dff
on the way to new annotations...
author | casties |
---|---|
date | Thu, 26 Apr 2012 11:44:57 +0200 |
parents | a3e324009990 |
children | e5f5848892a2 |
comparison
equal
deleted
inserted
replaced
25:52dff477e45f | 26:235b91ba8dff |
---|---|
148 userObject.put("id",annot.creator); | 148 userObject.put("id",annot.creator); |
149 | 149 |
150 RestServer restServer = (RestServer) getApplication(); | 150 RestServer restServer = (RestServer) getApplication(); |
151 | 151 |
152 String userID= annot.creator; | 152 String userID= annot.creator; |
153 if (userID.startsWith(NS.MPIWG_PERSONS)){ | 153 if (userID.startsWith(NS.MPIWG_PERSONS_URL)){ |
154 userID=userID.replace(NS.MPIWG_PERSONS, ""); //entferne NAMESPACE | 154 userID=userID.replace(NS.MPIWG_PERSONS_URL, ""); //entferne NAMESPACE |
155 } | 155 } |
156 String userName=restServer.getUserNameFromLdap(userID); | 156 String userName=restServer.getUserNameFromLdap(userID); |
157 userObject.put("name",userName); | 157 userObject.put("name",userName); |
158 | 158 |
159 jo.put("user",userObject); | 159 jo.put("user",userObject); |
363 } | 363 } |
364 | 364 |
365 //username should be a URI, if not it will set to the MPIWG namespace defined in de.mpiwg.itgroup.annotationManager.Constants.NS | 365 //username should be a URI, if not it will set to the MPIWG namespace defined in de.mpiwg.itgroup.annotationManager.Constants.NS |
366 String usernameOrig=username; | 366 String usernameOrig=username; |
367 if (!username.startsWith("http")) | 367 if (!username.startsWith("http")) |
368 username=NS.MPIWG_PERSONS+username; | 368 username=NS.MPIWG_PERSONS_URL+username; |
369 | 369 |
370 if (mode.equals("complexAnnotation")){// Annotation mit text in externer ressource | 370 if (mode.equals("complexAnnotation")){// Annotation mit text in externer ressource |
371 | 371 |
372 Context context = getContext(); | 372 Context context = getContext(); |
373 String drupalPath = context.getParameters().getFirstValue("de.mpiwg.itgroup.annotationManager.drupalServer"); | 373 String drupalPath = context.getParameters().getFirstValue("de.mpiwg.itgroup.annotationManager.drupalServer"); |
446 if (username == null) | 446 if (username == null) |
447 username = authUser.getIdentifier(); | 447 username = authUser.getIdentifier(); |
448 | 448 |
449 //username should be a URI, if not it will set to the MPIWG namespace defined in de.mpiwg.itgroup.annotationManager.Constants.NS | 449 //username should be a URI, if not it will set to the MPIWG namespace defined in de.mpiwg.itgroup.annotationManager.Constants.NS |
450 if (!username.startsWith("http")) | 450 if (!username.startsWith("http")) |
451 username=NS.MPIWG_PERSONS+username; | 451 username=NS.MPIWG_PERSONS_URL+username; |
452 | 452 |
453 return new Annotation(xpointer, username, null, text, type, url); | 453 return new Annotation(xpointer, username, null, text, type, url); |
454 } | 454 } |
455 | 455 |
456 /** | 456 /** |
531 xpointer = url; | 531 xpointer = url; |
532 } | 532 } |
533 | 533 |
534 //username should be a URI, if not it will set to the MPIWG namespace defined in de.mpiwg.itgroup.annotationManager.Constants.NS | 534 //username should be a URI, if not it will set to the MPIWG namespace defined in de.mpiwg.itgroup.annotationManager.Constants.NS |
535 if (!username.startsWith("http")) | 535 if (!username.startsWith("http")) |
536 username=NS.MPIWG_PERSONS+username; | 536 username=NS.MPIWG_PERSONS_URL+username; |
537 | 537 |
538 return new Annotation(xpointer, username, null, text, null); | 538 return new Annotation(xpointer, username, null, text, null); |
539 } | 539 } |
540 | 540 |
541 } | 541 } |