{
decorator = page.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(request, decoratorPath, fragmentType);
}
catch (TemplateLocatorException e)
{
String parent = decoConf.getString("extends");
if (parent != null)
{
template = getDecoration(request, parent + "/" + DECORATOR_TYPE + ext, fragmentType);
}
}
return template.getAppRelativePath();
}