NIHVIVO-2343 Allow configuration of what types of Individual are eligible to have proxies.

This commit is contained in:
j2blake 2011-11-06 17:13:02 +00:00
parent 89ea62af47
commit 2203b09fed
6 changed files with 49 additions and 4 deletions

View file

@ -35,6 +35,8 @@ public class ManageProxiesListPage extends AbstractPageHandler {
private static final String TEMPLATE_NAME = "manageProxies-list.ftl";
private static final String PROPERTY_PROFILE_TYPES = "proxy.eligibleTypeList";
private static final String DEFAULT_IMAGE_URL = UrlBuilder
.getUrl("/images/placeholders/person.thumbnail.jpg");
@ -94,6 +96,7 @@ public class ManageProxiesListPage extends AbstractPageHandler {
body.put("page", buildPageMap(selection));
body.put("matchingProperty", getMatchingProperty());
body.put("profileTypes", buildProfileTypesString());
body.put("formUrls", buildUrlsMap());
@ -103,6 +106,11 @@ public class ManageProxiesListPage extends AbstractPageHandler {
return body;
}
private String buildProfileTypesString() {
return ConfigurationProperties.getBean(vreq).getProperty(
PROPERTY_PROFILE_TYPES, "http://www.w3.org/2002/07/owl#Thing");
}
private List<ProxyRelationship> wrapProxyRelationships(
ProxyRelationshipSelection selection) {
List<ProxyRelationship> wrapped = new ArrayList<ProxyRelationship>();

View file

@ -18,6 +18,7 @@ import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.usepages.ManageOwnP
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.beans.SelfEditingConfiguration;
import edu.cornell.mannlib.vitro.webapp.beans.UserAccount;
import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.controller.accounts.UserAccountsPage;
import edu.cornell.mannlib.vitro.webapp.controller.accounts.admin.UserAccountsEditPage;
@ -47,6 +48,8 @@ public class UserAccountsMyAccountPage extends UserAccountsPage {
private static final String TEMPLATE_NAME = "userAccounts-myAccount.ftl";
private static final String PROPERTY_PROFILE_TYPES = "proxy.eligibleTypeList";
private final UserAccountsMyAccountPageStrategy strategy;
private final UserAccount userAccount;
@ -148,6 +151,7 @@ public class UserAccountsMyAccountPage extends UserAccountsPage {
}
body.put("formUrls", buildUrlsMap());
body.put("myAccountUri", userAccount.getUri());
body.put("profileTypes", buildProfileTypesString());
// Could I do this without exposing this mechanism? But how to search
// for an associated profile in AJAX?
@ -172,6 +176,11 @@ public class UserAccountsMyAccountPage extends UserAccountsPage {
return new TemplateResponseValues(TEMPLATE_NAME, body);
}
private String buildProfileTypesString() {
return ConfigurationProperties.getBean(vreq).getProperty(
PROPERTY_PROFILE_TYPES, "http://www.w3.org/2002/07/owl#Thing");
}
public void updateAccount() {
userAccount.setEmailAddress(emailAddress);
userAccount.setFirstName(firstName);