Some renaming in dump directives

This commit is contained in:
rjy7 2010-08-05 15:25:03 +00:00
parent 9311e83827
commit 528414e4c7
6 changed files with 14 additions and 14 deletions

View file

@ -283,7 +283,7 @@ public class FreemarkerHttpServlet extends VitroHttpServlet {
// Add any Java directives the templates should have access to
private void addDirectives(Map<String, Object> map) {
map.put("dump", new edu.cornell.mannlib.vitro.webapp.web.directives.DumpDirective());
map.put("dumpDataModel", new edu.cornell.mannlib.vitro.webapp.web.directives.DumpDataModelDirective());
map.put("dumpAll", new edu.cornell.mannlib.vitro.webapp.web.directives.DumpAllDirective());
}
// Add variables that should be available only to the page's root map, not to the body.

View file

@ -25,9 +25,9 @@ import freemarker.template.TemplateModel;
import freemarker.template.TemplateModelException;
import freemarker.template.utility.DeepUnwrap;
public class DumpDataModelDirective extends BaseTemplateDirectiveModel {
public class DumpAllDirective extends BaseTemplateDirectiveModel {
private static final Log log = LogFactory.getLog(DumpDataModelDirective.class);
private static final Log log = LogFactory.getLog(DumpAllDirective.class);
@SuppressWarnings({ "unchecked" })
@Override
@ -36,15 +36,15 @@ public class DumpDataModelDirective extends BaseTemplateDirectiveModel {
if (params.size() != 0) {
throw new TemplateModelException(
"The dumpDataModel directive doesn't allow parameters.");
"The dumpAll directive doesn't allow parameters.");
}
if (loopVars.length != 0) {
throw new TemplateModelException(
"The dumpDataModel directive doesn't allow loop variables.");
"The dumpAll directive doesn't allow loop variables.");
}
if (body != null) {
throw new TemplateModelException(
"The dumpDataModel directive doesn't allow nested content.");
"The dumpAll directive doesn't allow nested content.");
}
Configuration config = env.getConfiguration();
@ -69,7 +69,7 @@ public class DumpDataModelDirective extends BaseTemplateDirectiveModel {
}
}
String templateName = "dump-datamodel.ftl";
String templateName = "dump-all.ftl";
Map<String, Object> map = new HashMap<String, Object>();
map.put("models", models);
@ -96,7 +96,7 @@ public class DumpDataModelDirective extends BaseTemplateDirectiveModel {
String name = getDirectiveName();
map.put("name", name);
map.put("usage", "Dump the contents of the template data model.");
map.put("effect", "Dump the contents of the template data model.");
map.put("comments", "Sequences (lists and arrays) are enclosed in square brackets. Hashes are enclosed in curly braces.");

View file

@ -128,7 +128,7 @@ public class DumpDirective extends BaseTemplateDirectiveModel {
String name = getDirectiveName();
map.put("name", name);
map.put("usage", "Dump the contents of a template variable.");
map.put("effect", "Dump the contents of a template variable.");
map.put("comments", "Sequences (lists and arrays) are enclosed in square brackets. Hashes are enclosed in curly braces.");

View file

@ -5,8 +5,8 @@
<div class="dump directive">
<p><strong>Directive name:</strong> ${name}</p>
<#if usage??>
<p><strong>Usage:</strong> ${usage}</p>
<#if effect??>
<p><strong>Effect:</strong> ${effect}</p>
<#if comments??>
<p><strong>Comments:</strong> ${comments}</p>

View file

@ -52,11 +52,11 @@
<@dump var="fruit" />
<@dump var="trueStatement" />
<@dump var="falseStatement" />
<@dump var="zoo1" /> -->
<@dump var="zoo1" />
-->
${stylesheets.addFromTheme("/sstest.css", "/sstest2.css")}
${scripts.addFromTheme("/jstest.js")}
${scripts.add("/js/script1.js", "/js/script2.js", "/js/script3.js")}
<@dumpDataModel />
<@dumpAll />