Additional info/debugging statements
This commit is contained in:
parent
608ba09743
commit
2fb3cc200f
3 changed files with 14 additions and 8 deletions
|
@ -84,6 +84,7 @@ public class JsonServlet extends VitroHttpServlet {
|
|||
getVClassesForVClassGroup(req,resp);
|
||||
return;
|
||||
} else if( vreq.getParameter("getSolrIndividualsByVClasses") != null ){
|
||||
log.info("AJAX request to retrieve individuals by vclasses");
|
||||
getSolrIndividualsByVClasses(req,resp);
|
||||
return;
|
||||
} else if( vreq.getParameter("getDataForPage") != null ){
|
||||
|
@ -196,25 +197,26 @@ public class JsonServlet extends VitroHttpServlet {
|
|||
|
||||
// Accepts multiple vclasses and returns individuals which correspond to the intersection of those classes (i.e. have all those types)
|
||||
private void getSolrIndividualsByVClasses( HttpServletRequest req, HttpServletResponse resp ){
|
||||
String errorMessage = null;
|
||||
log.info("Executing retrieval of individuals by vclasses");
|
||||
String errorMessage = null;
|
||||
JSONObject rObj = null;
|
||||
try{
|
||||
VitroRequest vreq = new VitroRequest(req);
|
||||
VClass vclass=null;
|
||||
log.info("Retrieving solr individuals by vclasses");
|
||||
// Could have multiple vclass ids sent in
|
||||
String[] vitroClassIdStr = vreq.getParameterValues("vclassId");
|
||||
String[] vitroClassIdStr = vreq.getParameterValues("vclassId");
|
||||
if ( vitroClassIdStr != null && vitroClassIdStr.length > 0){
|
||||
for(String vclassId: vitroClassIdStr) {
|
||||
log.info("Using VClass " + vclassId);
|
||||
log.info("Iterating throug vclasses, using VClass " + vclassId);
|
||||
vclass = vreq.getWebappDaoFactory().getVClassDao().getVClassByURI(vclassId);
|
||||
if (vclass == null) {
|
||||
log.debug("Couldn't retrieve vclass ");
|
||||
log.error("Couldn't retrieve vclass ");
|
||||
throw new Exception (errorMessage = "Class " + vclassId + " not found");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
log.debug("parameter vclassId URI parameter expected ");
|
||||
log.error("parameter vclassId URI parameter expected but not found");
|
||||
throw new Exception("parameter vclassId URI parameter expected ");
|
||||
}
|
||||
List<String> vclassIds = Arrays.asList(vitroClassIdStr);
|
||||
|
@ -247,7 +249,8 @@ public class JsonServlet extends VitroHttpServlet {
|
|||
}
|
||||
|
||||
public static JSONObject getSolrIndividualsByVClasses(List<String> vclassURIs, HttpServletRequest req, ServletContext context) throws Exception {
|
||||
VitroRequest vreq = new VitroRequest(req);
|
||||
VitroRequest vreq = new VitroRequest(req);
|
||||
log.info("Retrieve solr results for vclasses" + vclassURIs.toString());
|
||||
Map<String, Object> map = getSolrVClassIntersectionResults(vclassURIs, vreq, context);
|
||||
log.info("Results returned from Solr for " + vclassURIs.toString() + " are of size " + map.size());
|
||||
JSONObject rObj = processVClassResults(map, vreq, context, true);
|
||||
|
@ -259,6 +262,7 @@ public class JsonServlet extends VitroHttpServlet {
|
|||
log.info("Retrieving Solr intersection results for " + vclassURIs.toString());
|
||||
String alpha = IndividualListController.getAlphaParameter(vreq);
|
||||
int page = IndividualListController.getPageParameter(vreq);
|
||||
log.info("Alpha and page parameters are " + alpha + " and " + page);
|
||||
Map<String,Object> map = null;
|
||||
try {
|
||||
map = IndividualListController.getResultsForVClassIntersections(
|
||||
|
|
|
@ -205,11 +205,11 @@ public class IndividualListController extends FreemarkerHttpServlet {
|
|||
try{
|
||||
// make query for multiple rdf types
|
||||
SolrQuery query = getQuery(vclassURIs, alpha);
|
||||
log.debug("Executed solr query for " + vclassURIs.toString());
|
||||
log.info("Executed solr query for " + vclassURIs.toString());
|
||||
rvMap = getResultsForVClassQuery(query, page, alpha, indDao, context);
|
||||
List<Individual> individuals = (List<Individual>) rvMap.get("entities");
|
||||
if (individuals == null)
|
||||
log.debug("entities list is null for vclass " + vclassURIs.toString() );
|
||||
log.info("entities list is null for vclass " + vclassURIs.toString() );
|
||||
} catch(Throwable th) {
|
||||
log.error("Error retrieving individuals corresponding to intersection multiple classes." + vclassURIs.toString(), th);
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ public class DataGetterUtils {
|
|||
for( String dataGetter : dataGetters){
|
||||
Map<String,Object> moreData = null;
|
||||
PageDataGetter getter = dataGetterMap.get(dataGetter);
|
||||
log.info("Retrieved data getter for " + dataGetter);
|
||||
try{
|
||||
moreData = getAdditionalData(pageUri, dataGetter, page, vreq, getter, context);
|
||||
if( moreData != null)
|
||||
|
@ -141,6 +142,7 @@ public class DataGetterUtils {
|
|||
|
||||
if( getter != null ){
|
||||
try{
|
||||
log.info("Retrieve data for this data getter for " + pageUri);
|
||||
return getter.getData(context, vreq, pageUri, page);
|
||||
}catch(Throwable th){
|
||||
log.error(th,th);
|
||||
|
|
Loading…
Add table
Reference in a new issue