{
decorator = getPage().getEffectiveDefaultDecorator(fragmentType);
}
// get fragment properties for fragmentType or generic
TemplateDescriptor propsTemp = getTemplate(decorator + "/" + DECORATOR_TYPE + ".properties", fragmentType,
decorationLocator, decorationLocatorDescriptor);
if (propsTemp == null)
{
fragmentType = GENERIC_TEMPLATE_TYPE;
propsTemp = getTemplate(decorator + "/" + DECORATOR_TYPE + ".properties", fragmentType, decorationLocator,
decorationLocatorDescriptor);
}
// get decorator template
Configuration decoConf = new PropertiesConfiguration(propsTemp.getAbsolutePath());
String ext = decoConf.getString("template.extension");
String decoratorPath = decorator + "/" + DECORATOR_TYPE + ext;
TemplateDescriptor template = null;
try
{
template = getDecoration(decoratorPath, fragmentType);
}
catch (TemplateLocatorException e)
{
String parent = decoConf.getString("extends");
if (parent != null)
{
template = getDecoration(parent + "/" + DECORATOR_TYPE + ext, fragmentType);
}
}
setAttribute(DECORATOR_ID_ATTR, decoConf.getString("id"));
setAttribute(ACTION_IMAGE_EXTENSION_ATTR, decoConf.getString("action.image.extension", ".gif"));
return template.getAppRelativePath();
}