}
}
}
// load and/or verify decorator macros configuration
TemplateDescriptor macrosDescriptor = null;
// create reusable decoration base descriptor
LocatorDescriptor descriptor = null;
try
{
descriptor = decorationLocator.createLocatorDescriptor(null);
}
catch (TemplateLocatorException tle)
{
log.error("getVelocityEngine(): unable create base descriptor", tle);
}
descriptor.setMediaType(layoutMediaType);
descriptor.setCountry(layoutCountry);
descriptor.setLanguage(layoutLanguage);
descriptor.setType(layoutType);
// get decoration configuration properties descriptor
descriptor.setName(layoutDecoration + "/" + JetspeedPowerTool.DECORATOR_TYPE + ".properties");
TemplateDescriptor propertiesDescriptor = null;
try
{
propertiesDescriptor = decorationLocator.locateTemplate(descriptor);
}
catch (TemplateLocatorException tle)
{
// fallback to generic template type
try
{
descriptor.setType(JetspeedPowerTool.GENERIC_TEMPLATE_TYPE);
propertiesDescriptor = decorationLocator.locateTemplate(descriptor);
}
catch (TemplateLocatorException tleFallback)
{
}
}
// load configuration properties
Configuration configuration = null;
if (propertiesDescriptor != null)
{
try
{
configuration = new PropertiesConfiguration(propertiesDescriptor.getAbsolutePath());
}
catch (ConfigurationException ce)
{
log.warn("getVelocityEngine(): unable read decorator properties from " + propertiesDescriptor.getAbsolutePath(), ce);
}
}
if (configuration != null)
{
// get decoration template macros extension and suffix