NIHVIVO-2449 Send mostSpecificTypes to menu page template. Small wording tweak on add user accounts page. Correct inverse property in manageWebpagesForIndividual.jsp. Switch class dependencies from Lucene to Solr servlets.

This commit is contained in:
ryounes 2011-07-08 15:17:54 +00:00
parent 9c0cd7f639
commit d230bd73d7
6 changed files with 7 additions and 17 deletions

View file

@ -9,8 +9,6 @@ import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.search.controller.AutocompleteController;
/* This class is used to order authorships on the add author form. It should be removed in favor of using whatever
* method is used to order authorships on the publication profile page instead. I've implemented this due to
* time constraints.

View file

@ -280,16 +280,10 @@ public class SolrJsonServlet extends VitroHttpServlet {
}
public static String getMostSpecificTypeName(Individual individual, WebappDaoFactory wdf) {
public static Collection<String> getMostSpecificTypes(Individual individual, WebappDaoFactory wdf) {
ObjectPropertyStatementDao opsDao = wdf.getObjectPropertyStatementDao();
Map<String, String> types = opsDao.getMostSpecificTypesForIndividual(individual.getURI());
Collection<String> typeLabels = types.values();
Iterator<String> i = typeLabels.iterator();
// Temporarily just returning one vaue since that's what the js expects. Fix later.
if (i.hasNext()) {
return i.next();
}
return "";
Map<String, String> mostSpecificTypes = opsDao.getMostSpecificTypesForIndividual(individual.getURI());
return mostSpecificTypes.values();
}
public static String getDataPropertyValue(Individual ind, DataProperty dp, WebappDaoFactory wdf){

View file

@ -27,7 +27,6 @@ import edu.cornell.mannlib.vitro.webapp.dao.jena.VClassGroupCache;
import edu.cornell.mannlib.vitro.webapp.utils.JSONtoFmModel;
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.VClassGroupTemplateModel;
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.VClassTemplateModel;
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.BaseListedIndividual;
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.ListedIndividual;
public class BrowseDataGetter implements PageDataGetter {

View file

@ -241,7 +241,7 @@ public class DataGetterUtils {
jo.put("imageUrl", ind.getImageUrl());
jo.put("profileUrl", UrlBuilder.getIndividualProfileUrl(ind, vreq));
jo.put("vclassName", SolrJsonServlet.getMostSpecificTypeName(ind,fullWdf));
jo.put("mostSpecificTypes", SolrJsonServlet.getMostSpecificTypes(ind,fullWdf));
jo.put("preferredTitle", SolrJsonServlet.getDataPropertyValue(ind, preferredTitleDp, fullWdf));
jo.put("firstName", SolrJsonServlet.getDataPropertyValue(ind, fNameDp, fullWdf));

View file

@ -19,14 +19,13 @@ import org.json.JSONObject;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
import edu.cornell.mannlib.vitro.webapp.beans.VClassGroup;
import edu.cornell.mannlib.vitro.webapp.controller.JSONServlet;
import edu.cornell.mannlib.vitro.webapp.controller.SolrJsonServlet;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet;
import edu.cornell.mannlib.vitro.webapp.dao.jena.VClassGroupCache;
import edu.cornell.mannlib.vitro.webapp.utils.JSONtoFmModel;
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.VClassGroupTemplateModel;
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.VClassTemplateModel;
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.BaseListedIndividual;
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.ListedIndividual;
import freemarker.core.Environment;
import freemarker.template.TemplateModelException;
@ -84,7 +83,7 @@ public class BrowseWidget extends Widget {
VClass vclass = vreq.getWebappDaoFactory().getVClassDao().getVClassByURI(classUri);
map.put("class", new VClassTemplateModel(vclass));
JSONObject vclassRes = JSONServlet.getLuceneIndividualsByVClass(vclass.getURI(), request, context);
JSONObject vclassRes = SolrJsonServlet.getSolrIndividualsByVClass(vclass.getURI(), request, context);
map.put("totalCount", JSONtoFmModel.convertJSONObjectToMap( (String) vclassRes.get("totalCount") ));
map.put("alpha", JSONtoFmModel.convertJSONObjectToMap( (String) vclassRes.get("alpha") ));
map.put("individuals", JSONtoFmModel.convertJSONArrayToList( (JSONArray) vclassRes.get("individuals") ));