NIHVIVO-2470 Initial work on new dump template. Handle undefined variables.

This commit is contained in:
ryounes 2011-04-20 21:23:38 +00:00
parent 4bff64ca12
commit 84f779238c
9 changed files with 96 additions and 56 deletions

View file

@ -41,12 +41,7 @@ public class HelpDirective extends BaseDumpDirective {
"Must specify 'for' argument.");
}
if ( !(o instanceof SimpleScalar)) {
throw new TemplateModelException(
"Value of parameter 'for' must be a string.");
}
String varName = ((SimpleScalar)o).getAsString();
String varName = params.get("var").toString();
TemplateHashModel dataModel = env.getDataModel();
Object templateModel = dataModel.get(varName);
@ -61,7 +56,7 @@ public class HelpDirective extends BaseDumpDirective {
}
Map<String, Object> map = getTemplateVariableDump(varName, env);
dump("dumpvar.ftl", map, env);
dump(TEMPLATE_DEFAULT, map, env);
}
@Override