NIHVIVO-2470 Initial work on new dump template. Handle undefined variables.
This commit is contained in:
parent
4bff64ca12
commit
84f779238c
9 changed files with 96 additions and 56 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue