}
try {
loadTemplate(config);
} catch (Exception e) {
throw new SmooksConfigurationException("Error loading Templating resource: " + config, e);
}
} else if(smooksConfig != null) {
if(smooksConfig.getResource() == null) {
throw new SmooksConfigurationException("Templating resource undefined in resource configuration: " + smooksConfig);
}
try {
loadTemplate(smooksConfig);
} catch (Exception e) {
throw new SmooksConfigurationException("Error loading Templating resource: " + smooksConfig, e);
}
String visitBefore = smooksConfig.getStringParameter("visitBefore");
if(visitBefore != null) {
if(!legactVisitBeforeParamWarn) {
logger.warn("Templating <param> 'visitBefore' deprecated. Use 'applyTemplateBefore'.");
legactVisitBeforeParamWarn = true;
}
this.applyTemplateBefore = visitBefore.equalsIgnoreCase("true");
}
if(action == Action.BIND_TO) {
if(bindId == null) {
throw new SmooksConfigurationException("'bindto' templating action configurations must also specify a 'bindId' configuration for the Id under which the result is bound to the ExecutionContext");
} else {
bindBeanId = applicationContext.getBeanIdStore().register(bindId);
}
}
} else {
throw new SmooksConfigurationException(getClass().getSimpleName() + " not configured.");
}
}