diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/widgets/BrowseWidget.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/widgets/BrowseWidget.java index 2d9153087..d7d087072 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/widgets/BrowseWidget.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/widgets/BrowseWidget.java @@ -83,8 +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); - map.put("vclass", JSONtoFmModel.convertJSONObjectToMap( (JSONObject) vclassRes.get("vclass") )); + JSONObject vclassRes = JSONServlet.getLuceneIndividualsByVClass(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") )); @@ -97,7 +96,13 @@ public class BrowseWidget extends Widget { private Map getCommonValues(Environment env, ServletContext context){ Map values = new HashMap(); values.putAll(FreemarkerHttpServlet.getDirectives()); - + try { + values.put("urls",env.getDataModel().get("urls")); + values.put("currentPage", env.getDataModel().get("currentPage")); + } catch (TemplateModelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } return values; } @@ -106,14 +111,7 @@ public class BrowseWidget extends Widget { Map body = new HashMap(); body.putAll(getCommonValues(env,context)); body.putAll(getAllClassGroupData(request, params, context)); - - try { - body.put("urls",env.getDataModel().get("urls")); - body.put("currentPage", env.getDataModel().get("currentPage")); - } catch (TemplateModelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + String macroName = Mode.ALL_CLASS_GROUPS.macroName; return new WidgetTemplateValues(macroName, body); } @@ -145,14 +143,7 @@ public class BrowseWidget extends Widget { Map body = new HashMap(); body.putAll(getCommonValues(env,context)); body.putAll(getClassData(request,params,context)); - - try { - body.put("urls",env.getDataModel().get("urls")); - body.put("currentPage", env.getDataModel().get("currentPage")); - } catch (TemplateModelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + String macroName = Mode.VCLASS.macroName; return new WidgetTemplateValues(macroName, body); } @@ -184,14 +175,7 @@ public class BrowseWidget extends Widget { Map body = new HashMap(); body.putAll(getCommonValues(env,context)); body.putAll( getClassGroupData(request,params, context)); - - try { - body.put("urls",env.getDataModel().get("urls")); - body.put("currentPage", env.getDataModel().get("currentPage")); - } catch (TemplateModelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + String macroName = Mode.CLASS_GROUP.macroName; return new WidgetTemplateValues(macroName, body); } diff --git a/webapp/web/templates/freemarker/body/partials/dump/dump.ftl b/webapp/web/templates/freemarker/body/partials/dump/dump.ftl index a65e09141..6d6a843ef 100644 --- a/webapp/web/templates/freemarker/body/partials/dump/dump.ftl +++ b/webapp/web/templates/freemarker/body/partials/dump/dump.ftl @@ -8,4 +8,6 @@ ${var} -${stylesheets.add("/css/dump.css")} +<#if stylesheets??> + ${stylesheets.add("/css/dump.css")} +