modelData.put("screen", data.getScreen() );
modelData.put("action", data.getAction() );
modelData.put("title", data.getTitle() );
modelData.put("message", data.getMessage() );
ParameterParser params = data.getParameters();
Enumeration e = params.keys();
while (e.hasMoreElements() )
{
String key = (String)e.nextElement();
String[] values = params.getStrings(key);
if (values.length==1)
{
modelParameters.put(key, values[0]);
}
else
{
SimpleList listModel = new SimpleList();
modelParameters.put(key, listModel);
for (int i=0; i<values.length; i++)
{
listModel.add(values[i]);
}
}
}
if (data.getACL() != null)
{
Iterator roles = data.getACL().getRoles().elements();
while (roles.hasNext() )
{
String key = ((Role)roles.next()).getName();
modelRoles.put(key, true);
}
Iterator permissions = data.getACL().getPermissions().elements();
while (permissions.hasNext() )
{
String key = ((Permission)permissions.next()).getName();
modelPermissions.put(key, true);
}
}
modelRoot.put("setTitle", new SetTitleModel(data));
modelRoot.put("addToHead", new AddToHeadModel(data));
modelRoot.put("addTemplatesToHead", new AddTemplatesToHeadModel(data));
modelRoot.put("setBodyAttributes", new SetBodyAttributesModel(data));
String templatePath = params.getString("template", null);
if (templatePath != null)
{
StringTokenizer st = new StringTokenizer(templatePath, "/");
int max = st.countTokens() - 1;
for (int i=0; i<max; i++)