Method from org.apache.tiles.extras.complete.CompleteAutoloadTilesContainerFactory Detail: |
protected AttributeEvaluatorFactory createAttributeEvaluatorFactory(TilesApplicationContext applicationContext,
TilesRequestContextFactory contextFactory,
LocaleResolver resolver) {
BasicAttributeEvaluatorFactory attributeEvaluatorFactory = new BasicAttributeEvaluatorFactory(
createELEvaluator(applicationContext));
attributeEvaluatorFactory.registerAttributeEvaluator("MVEL",
createMVELEvaluator());
attributeEvaluatorFactory.registerAttributeEvaluator("OGNL",
createOGNLEvaluator());
return attributeEvaluatorFactory;
}
|
protected AttributeRenderer createDefaultAttributeRenderer(BasicRendererFactory rendererFactory,
TilesApplicationContext applicationContext,
TilesRequestContextFactory contextFactory,
TilesContainer container,
AttributeEvaluatorFactory attributeEvaluatorFactory) {
ChainedDelegateAttributeRenderer retValue = new ChainedDelegateAttributeRenderer();
retValue.addAttributeRenderer((TypeDetectingAttributeRenderer) rendererFactory
.getRenderer(DEFINITION_RENDERER_NAME));
retValue.addAttributeRenderer((TypeDetectingAttributeRenderer) rendererFactory
.getRenderer(VELOCITY_RENDERER_NAME));
retValue.addAttributeRenderer((TypeDetectingAttributeRenderer) rendererFactory
.getRenderer(FREEMARKER_RENDERER_NAME));
retValue.addAttributeRenderer((TypeDetectingAttributeRenderer) rendererFactory
.getRenderer(TEMPLATE_RENDERER_NAME));
retValue.addAttributeRenderer((TypeDetectingAttributeRenderer) rendererFactory
.getRenderer(STRING_RENDERER_NAME));
retValue.setApplicationContext(applicationContext);
retValue.setRequestContextFactory(contextFactory);
retValue.setAttributeEvaluatorFactory(attributeEvaluatorFactory);
return retValue;
}
|
protected DefinitionsReader createDefinitionsReader(TilesApplicationContext applicationContext,
TilesRequestContextFactory contextFactory) {
return new CompatibilityDigesterDefinitionsReader();
}
|
protected PatternDefinitionResolver<T> createPatternDefinitionResolver(Class<T> customizationKeyClass) {
DefinitionPatternMatcherFactory wildcardFactory = new WildcardDefinitionPatternMatcherFactory();
DefinitionPatternMatcherFactory regexpFactory = new RegexpDefinitionPatternMatcherFactory();
PrefixedPatternDefinitionResolver< T > resolver = new PrefixedPatternDefinitionResolver< T >();
resolver.registerDefinitionPatternMatcherFactory("WILDCARD", wildcardFactory);
resolver.registerDefinitionPatternMatcherFactory("REGEXP", regexpFactory);
return resolver;
}
|
protected List<URL> getSourceURLs(TilesApplicationContext applicationContext,
TilesRequestContextFactory contextFactory) {
try {
Set< URL > urlSet = applicationContext
.getResources("/WEB-INF/**/tiles*.xml");
urlSet.addAll(applicationContext
.getResources("classpath*:META-INF/**/tiles*.xml"));
return URLUtil.getBaseTilesDefinitionURLs(urlSet);
} catch (IOException e) {
throw new DefinitionsFactoryException(
"Cannot load definition URLs", e);
}
}
|
protected List<TilesRequestContextFactory> getTilesRequestContextFactoriesToBeChained(ChainedTilesRequestContextFactory parent) {
List< TilesRequestContextFactory > factories = super.getTilesRequestContextFactoriesToBeChained(parent);
registerRequestContextFactory(
FreeMarkerTilesRequestContextFactory.class.getName(),
factories, parent);
registerRequestContextFactory(
VelocityTilesRequestContextFactory.class.getName(),
factories, parent);
return factories;
}
|
protected BasicTilesContainer instantiateContainer(TilesApplicationContext applicationContext) {
return new CachingTilesContainer();
}
|
protected void registerAttributeRenderers(BasicRendererFactory rendererFactory,
TilesApplicationContext applicationContext,
TilesRequestContextFactory contextFactory,
TilesContainer container,
AttributeEvaluatorFactory attributeEvaluatorFactory) {
super.registerAttributeRenderers(rendererFactory, applicationContext, contextFactory,
container, attributeEvaluatorFactory);
FreeMarkerAttributeRenderer freemarkerRenderer = new FreeMarkerAttributeRenderer();
freemarkerRenderer.setApplicationContext(applicationContext);
freemarkerRenderer.setAttributeEvaluatorFactory(attributeEvaluatorFactory);
freemarkerRenderer.setRequestContextFactory(contextFactory);
freemarkerRenderer.setParameter("TemplatePath", "/");
freemarkerRenderer.setParameter("NoCache", "true");
freemarkerRenderer.setParameter("ContentType", "text/html");
freemarkerRenderer.setParameter("template_update_delay", "0");
freemarkerRenderer.setParameter("default_encoding", "ISO-8859-1");
freemarkerRenderer.setParameter("number_format", "0.##########");
freemarkerRenderer.commit();
rendererFactory.registerRenderer(FREEMARKER_RENDERER_NAME, freemarkerRenderer);
VelocityAttributeRenderer velocityRenderer = new VelocityAttributeRenderer();
velocityRenderer.setApplicationContext(applicationContext);
velocityRenderer.setAttributeEvaluatorFactory(attributeEvaluatorFactory);
velocityRenderer.setRequestContextFactory(contextFactory);
velocityRenderer.commit();
rendererFactory.registerRenderer(VELOCITY_RENDERER_NAME, velocityRenderer);
}
|