NIHVIVO-2449 In search results, display preferredTitle with fallback to mostSpecificTypes

This commit is contained in:
ryounes 2011-07-06 19:02:49 +00:00
parent cb5f5ed18c
commit 9ee6a96c55
4 changed files with 53 additions and 1 deletions

View file

@ -1,12 +1,14 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual;
package edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.BaseListedIndividual;
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.ListedIndividual;
public class ListedIndividual extends BaseListedIndividual {

View file

@ -0,0 +1,27 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.web.templatemodels.searchresult;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
public class IndividualSearchResult extends BaseIndividualSearchResult {
private static final Log log = LogFactory.getLog(IndividualSearchResult.class);
private static final String CORE = "http://vivoweb.org/ontology/core#";
public IndividualSearchResult(Individual individual, VitroRequest vreq) {
super(individual, vreq);
}
/* Access methods for templates */
public String getPreferredTitle() {
return individual.getDataValue(CORE + "preferredTitle");
}
}