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);
|
getVClassesForVClassGroup(req,resp);
|
||||||
return;
|
return;
|
||||||
} else if( vreq.getParameter("getSolrIndividualsByVClasses") != null ){
|
} else if( vreq.getParameter("getSolrIndividualsByVClasses") != null ){
|
||||||
|
log.info("AJAX request to retrieve individuals by vclasses");
|
||||||
getSolrIndividualsByVClasses(req,resp);
|
getSolrIndividualsByVClasses(req,resp);
|
||||||
return;
|
return;
|
||||||
} else if( vreq.getParameter("getDataForPage") != null ){
|
} else if( vreq.getParameter("getDataForPage") != null ){
|
||||||
|
@ -196,7 +197,8 @@ 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)
|
// 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 ){
|
private void getSolrIndividualsByVClasses( HttpServletRequest req, HttpServletResponse resp ){
|
||||||
String errorMessage = null;
|
log.info("Executing retrieval of individuals by vclasses");
|
||||||
|
String errorMessage = null;
|
||||||
JSONObject rObj = null;
|
JSONObject rObj = null;
|
||||||
try{
|
try{
|
||||||
VitroRequest vreq = new VitroRequest(req);
|
VitroRequest vreq = new VitroRequest(req);
|
||||||
|
@ -206,15 +208,15 @@ public class JsonServlet extends VitroHttpServlet {
|
||||||
String[] vitroClassIdStr = vreq.getParameterValues("vclassId");
|
String[] vitroClassIdStr = vreq.getParameterValues("vclassId");
|
||||||
if ( vitroClassIdStr != null && vitroClassIdStr.length > 0){
|
if ( vitroClassIdStr != null && vitroClassIdStr.length > 0){
|
||||||
for(String vclassId: vitroClassIdStr) {
|
for(String vclassId: vitroClassIdStr) {
|
||||||
log.info("Using VClass " + vclassId);
|
log.info("Iterating throug vclasses, using VClass " + vclassId);
|
||||||
vclass = vreq.getWebappDaoFactory().getVClassDao().getVClassByURI(vclassId);
|
vclass = vreq.getWebappDaoFactory().getVClassDao().getVClassByURI(vclassId);
|
||||||
if (vclass == null) {
|
if (vclass == null) {
|
||||||
log.debug("Couldn't retrieve vclass ");
|
log.error("Couldn't retrieve vclass ");
|
||||||
throw new Exception (errorMessage = "Class " + vclassId + " not found");
|
throw new Exception (errorMessage = "Class " + vclassId + " not found");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}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 ");
|
throw new Exception("parameter vclassId URI parameter expected ");
|
||||||
}
|
}
|
||||||
List<String> vclassIds = Arrays.asList(vitroClassIdStr);
|
List<String> vclassIds = Arrays.asList(vitroClassIdStr);
|
||||||
|
@ -248,6 +250,7 @@ public class JsonServlet extends VitroHttpServlet {
|
||||||
|
|
||||||
public static JSONObject getSolrIndividualsByVClasses(List<String> vclassURIs, HttpServletRequest req, ServletContext context) throws Exception {
|
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);
|
Map<String, Object> map = getSolrVClassIntersectionResults(vclassURIs, vreq, context);
|
||||||
log.info("Results returned from Solr for " + vclassURIs.toString() + " are of size " + map.size());
|
log.info("Results returned from Solr for " + vclassURIs.toString() + " are of size " + map.size());
|
||||||
JSONObject rObj = processVClassResults(map, vreq, context, true);
|
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());
|
log.info("Retrieving Solr intersection results for " + vclassURIs.toString());
|
||||||
String alpha = IndividualListController.getAlphaParameter(vreq);
|
String alpha = IndividualListController.getAlphaParameter(vreq);
|
||||||
int page = IndividualListController.getPageParameter(vreq);
|
int page = IndividualListController.getPageParameter(vreq);
|
||||||
|
log.info("Alpha and page parameters are " + alpha + " and " + page);
|
||||||
Map<String,Object> map = null;
|
Map<String,Object> map = null;
|
||||||
try {
|
try {
|
||||||
map = IndividualListController.getResultsForVClassIntersections(
|
map = IndividualListController.getResultsForVClassIntersections(
|
||||||
|
|
|
@ -205,11 +205,11 @@ public class IndividualListController extends FreemarkerHttpServlet {
|
||||||
try{
|
try{
|
||||||
// make query for multiple rdf types
|
// make query for multiple rdf types
|
||||||
SolrQuery query = getQuery(vclassURIs, alpha);
|
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);
|
rvMap = getResultsForVClassQuery(query, page, alpha, indDao, context);
|
||||||
List<Individual> individuals = (List<Individual>) rvMap.get("entities");
|
List<Individual> individuals = (List<Individual>) rvMap.get("entities");
|
||||||
if (individuals == null)
|
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) {
|
} catch(Throwable th) {
|
||||||
log.error("Error retrieving individuals corresponding to intersection multiple classes." + vclassURIs.toString(), 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){
|
for( String dataGetter : dataGetters){
|
||||||
Map<String,Object> moreData = null;
|
Map<String,Object> moreData = null;
|
||||||
PageDataGetter getter = dataGetterMap.get(dataGetter);
|
PageDataGetter getter = dataGetterMap.get(dataGetter);
|
||||||
|
log.info("Retrieved data getter for " + dataGetter);
|
||||||
try{
|
try{
|
||||||
moreData = getAdditionalData(pageUri, dataGetter, page, vreq, getter, context);
|
moreData = getAdditionalData(pageUri, dataGetter, page, vreq, getter, context);
|
||||||
if( moreData != null)
|
if( moreData != null)
|
||||||
|
@ -141,6 +142,7 @@ public class DataGetterUtils {
|
||||||
|
|
||||||
if( getter != null ){
|
if( getter != null ){
|
||||||
try{
|
try{
|
||||||
|
log.info("Retrieve data for this data getter for " + pageUri);
|
||||||
return getter.getData(context, vreq, pageUri, page);
|
return getter.getData(context, vreq, pageUri, page);
|
||||||
}catch(Throwable th){
|
}catch(Throwable th){
|
||||||
log.error(th,th);
|
log.error(th,th);
|
||||||
|
|
Loading…
Add table
Reference in a new issue