Adding thumbnail and profileURL to data returned by JSONServlet.java NIHVIVO-1598 NIHVIVO-1606
This commit is contained in:
parent
bffdfc53ac
commit
71ed7330d5
1 changed files with 19 additions and 2 deletions
|
@ -8,6 +8,7 @@ import java.io.Writer;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Enumeration;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ListIterator;
|
import java.util.ListIterator;
|
||||||
|
@ -32,6 +33,7 @@ import com.hp.hpl.jena.ontology.OntModel;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.TabEntitiesController.PageRecord;
|
import edu.cornell.mannlib.vitro.webapp.controller.TabEntitiesController.PageRecord;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration;
|
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration;
|
||||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.SelectListGenerator;
|
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.SelectListGenerator;
|
||||||
|
@ -82,6 +84,17 @@ public class JSONServlet extends VitroHttpServlet {
|
||||||
VClass vclass=null;
|
VClass vclass=null;
|
||||||
JSONObject rObj = new JSONObject();
|
JSONObject rObj = new JSONObject();
|
||||||
|
|
||||||
|
if( log.isDebugEnabled() ){
|
||||||
|
Enumeration<String> e = vreq.getParameterNames();
|
||||||
|
while(e.hasMoreElements()){
|
||||||
|
String name = (String)e.nextElement();
|
||||||
|
log.debug("parameter: " + name);
|
||||||
|
for( String value : vreq.getParameterValues(name) ){
|
||||||
|
log.debug("value for " + name + ": '" + value + "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String vitroClassIdStr = vreq.getParameter("vclassId");
|
String vitroClassIdStr = vreq.getParameter("vclassId");
|
||||||
if ( vitroClassIdStr != null && !vitroClassIdStr.isEmpty()){
|
if ( vitroClassIdStr != null && !vitroClassIdStr.isEmpty()){
|
||||||
|
@ -122,6 +135,10 @@ public class JSONServlet extends VitroHttpServlet {
|
||||||
jo.put("URI", ind.getURI());
|
jo.put("URI", ind.getURI());
|
||||||
jo.put("label",ind.getRdfsLabel());
|
jo.put("label",ind.getRdfsLabel());
|
||||||
jo.put("name",ind.getName());
|
jo.put("name",ind.getName());
|
||||||
|
jo.put("thumbUrl", ind.getThumbUrl());
|
||||||
|
jo.put("imageUrl", ind.getImageUrl());
|
||||||
|
jo.put("profileUrl", UrlBuilder.getIndividualProfileUrl(ind, vreq.getWebappDaoFactory()));
|
||||||
|
|
||||||
jInds.put(jo);
|
jInds.put(jo);
|
||||||
}
|
}
|
||||||
rObj.put("individuals", jInds);
|
rObj.put("individuals", jInds);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue