NIHVIVO-2343 Use the specialized AJAX handlers instead of the SparqlQueryAjaxController -- fixes issues with placeholder images.

This commit is contained in:
j2blake 2011-11-10 21:44:34 +00:00
parent 2704ce3c78
commit 57c28c183f
7 changed files with 49 additions and 248 deletions

View file

@ -104,7 +104,7 @@ public abstract class UserAccountsPage extends AbstractPageHandler {
map.put("firstTimeExternal",
UrlBuilder.getUrl("/accounts/firstTimeExternal"));
map.put("accountsAjax", UrlBuilder.getUrl("/accountsAjax"));
map.put("sparqlQueryAjax", UrlBuilder.getUrl("/ajax/sparqlQuery"));
map.put("proxyAjax", UrlBuilder.getUrl("/proxiesAjax"));
map.put("defaultImageUrl", DEFAULT_IMAGE_URL);
return map;

View file

@ -37,11 +37,6 @@ 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");
private final Context selectorContext;
private ProxyRelationshipSelectionCriteria criteria = ProxyRelationshipSelectionCriteria.DEFAULT_CRITERIA;
@ -80,6 +75,8 @@ public class ManageProxiesListPage extends AbstractPageHandler {
public ResponseValues showPage() {
ProxyRelationshipSelection selection = ProxyRelationshipSelector
.select(selectorContext, criteria);
log.debug("Selection: " + selection);
Map<String, Object> body = buildTemplateBodyMap(selection);
return new TemplateResponseValues(TEMPLATE_NAME, body);
}
@ -97,9 +94,6 @@ public class ManageProxiesListPage extends AbstractPageHandler {
body.put("total", selection.getTotalResultCount());
body.put("page", buildPageMap(selection));
body.put("matchingProperty", getMatchingProperty());
body.put("profileTypes", buildProfileTypesString());
body.put("formUrls", buildUrlsMap());
applyMessage(vreq, body);
@ -108,11 +102,6 @@ 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>();
@ -153,8 +142,8 @@ public class ManageProxiesListPage extends AbstractPageHandler {
private ProxyItemInfo wrapProfileItem(ProxyItemInfo item) {
String imagePath = item.getImageUrl();
if (imagePath.isEmpty()) {
imagePath = ImageUtil
.getPlaceholderImagePathForIndividual(vreq, item.getUri());
imagePath = ImageUtil.getPlaceholderImagePathForIndividual(vreq,
item.getUri());
}
return new ProfileItemWrapper(item.getUri(), item.getLabel(),
@ -191,8 +180,7 @@ public class ManageProxiesListPage extends AbstractPageHandler {
map.put("list", UrlBuilder.getUrl("/manageProxies/list"));
map.put("edit", UrlBuilder.getUrl("/manageProxies/edit"));
map.put("create", UrlBuilder.getUrl("/manageProxies/create"));
map.put("sparqlQueryAjax", UrlBuilder.getUrl("/ajax/sparqlQuery"));
map.put("defaultImageUrl", DEFAULT_IMAGE_URL);
map.put("ajax", UrlBuilder.getUrl("/proxiesAjax"));
return map;
}