# HG changeset patch
# User casties
# Date 1422873173 -3600
# Node ID e3f0613b2f2d3a8244f83d64c286a64360ec71c9
# Parent ed51eadc82c50c638f82d4947be89f450428b66e
renamed getFullname to make it configurable.
fixed Restlet at 2.2.3.
diff -r ed51eadc82c5 -r e3f0613b2f2d pom.xml
--- a/pom.xml Mon Jan 26 18:51:28 2015 +0100
+++ b/pom.xml Mon Feb 02 11:32:53 2015 +0100
@@ -9,7 +9,7 @@
2.1.6
- 2.2-SNAPSHOT
+ 2.2.3
diff -r ed51eadc82c5 -r e3f0613b2f2d src/main/java/de/mpiwg/itgroup/annotations/Person.java
--- a/src/main/java/de/mpiwg/itgroup/annotations/Person.java Mon Jan 26 18:51:28 2015 +0100
+++ b/src/main/java/de/mpiwg/itgroup/annotations/Person.java Mon Feb 02 11:32:53 2015 +0100
@@ -87,7 +87,7 @@
*/
public String updateName(BaseRestlet application) {
if (id != null) {
- name = application.getFullNameFromLdap(id);
+ name = application.getFullNameForId(id);
}
return name;
}
diff -r ed51eadc82c5 -r e3f0613b2f2d src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResourceImpl.java
--- a/src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResourceImpl.java Mon Jan 26 18:51:28 2015 +0100
+++ b/src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResourceImpl.java Mon Feb 02 11:32:53 2015 +0100
@@ -163,7 +163,7 @@
* mode.
*
* @param entity
- * @return
+ * @return user-id
*/
public String checkAuthToken(Representation entity) {
@SuppressWarnings("unchecked")
@@ -248,7 +248,7 @@
String userName = creator.getName();
if (userName == null) {
BaseRestlet restServer = (BaseRestlet) getApplication();
- userName = restServer.getFullNameFromLdap(userId);
+ userName = restServer.getFullNameForId(userId);
}
userObject.put("name", userName);
// save user object
@@ -624,7 +624,7 @@
// try to get full name
if (creator.getName() == null && username != null) {
BaseRestlet restServer = (BaseRestlet) getApplication();
- String fullName = restServer.getFullNameFromLdap(username);
+ String fullName = restServer.getFullNameForId(username);
creator.setName(fullName);
}
// userUri should be a URI, if not it will set to the MPIWG namespace
diff -r ed51eadc82c5 -r e3f0613b2f2d src/main/java/de/mpiwg/itgroup/annotations/restlet/BaseRestlet.java
--- a/src/main/java/de/mpiwg/itgroup/annotations/restlet/BaseRestlet.java Mon Jan 26 18:51:28 2015 +0100
+++ b/src/main/java/de/mpiwg/itgroup/annotations/restlet/BaseRestlet.java Mon Feb 02 11:32:53 2015 +0100
@@ -20,7 +20,8 @@
* License along with this program. If not, see
* .
* #L%
- * Author: Robert Casties (casties@mpiwg-berlin.mpg.de)
+ * Author: Robert Casties (casties@mpiwg-berlin.mpg.de),
+ * Dirk Wintergruen (dwinter@mpiwg-berlin.mpg.de)
*/
import java.io.File;
@@ -97,7 +98,13 @@
protected String ldapServerUrl;
public static final String LDAP_SERVER_KEY = "annotationmanager.ldapserver.url";
+ /**
+ * web frontend admin user name
+ */
public static final String ADMIN_USER_KEY = "annotationmanager.admin.user";
+ /**
+ * web frontend admin user password
+ */
public static final String ADMIN_PASSWORD_KEY = "annotationmanager.admin.password";
/**
@@ -276,6 +283,18 @@
}
/**
+ * Return the full name (String) of the person with the given user-id.
+ *
+ * Contacts a naming service (currently LDAP).
+ *
+ * @param userId
+ * @return full-name
+ */
+ public String getFullNameForId(String userId) {
+ return getFullNameFromLdap(userId);
+ }
+
+ /**
* Hole den vollen Benutzernamen aus dem LDAP
*
* @param creator
diff -r ed51eadc82c5 -r e3f0613b2f2d src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/PersonsResource.java
--- a/src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/PersonsResource.java Mon Jan 26 18:51:28 2015 +0100
+++ b/src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/PersonsResource.java Mon Feb 02 11:32:53 2015 +0100
@@ -125,7 +125,7 @@
}
String name = form.getFirstValue("name");
if (name == null || name.isEmpty()) {
- name = ((BaseRestlet) getApplication()).getFullNameFromLdap(id);
+ name = ((BaseRestlet) getApplication()).getFullNameForId(id);
}
String uri = form.getFirstValue("uri");
if (uri != null && uri.isEmpty()) uri = null;