You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tiles.apache.org by ap...@apache.org on 2008/11/07 15:15:39 UTC
svn commit: r712128 - in /tiles/framework/trunk/src/site/apt:
config-reference.apt migration/configuration.apt
Author: apetrelli
Date: Fri Nov 7 06:15:30 2008
New Revision: 712128
URL: http://svn.apache.org/viewvc?rev=712128&view=rev
Log:
TILES-333
Added documentation to show how to add a renderer for "page" type.
Fixed configuration reference.
Modified:
tiles/framework/trunk/src/site/apt/config-reference.apt
tiles/framework/trunk/src/site/apt/migration/configuration.apt
Modified: tiles/framework/trunk/src/site/apt/config-reference.apt
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/src/site/apt/config-reference.apt?rev=712128&r1=712127&r2=712128&view=diff
==============================================================================
--- tiles/framework/trunk/src/site/apt/config-reference.apt (original)
+++ tiles/framework/trunk/src/site/apt/config-reference.apt Fri Nov 7 06:15:30 2008
@@ -147,7 +147,7 @@
* <<Default>>: <<<org.apache.tiles.context.ChainedTilesRequestContextFactory>>>.
* <<Usage>>: when specified, it must contain the name of a class that
- implements the <<<TilesContextFactory>>> interface.
+ implements the <<<TilesRequestContextFactory>>> interface.
** {<<<org.apache.tiles.factory.AbstractTilesContainerFactory>>>}
@@ -228,7 +228,7 @@
* <<Specified in>>:
{{{apidocs/org/apache/tiles/renderer/impl/BasicRendererFactory.html#TYPE_RENDERERS_INIT_PARAM}<<<org.apache.tiles.renderer.impl.BasicRendererFactory>>>}}.
- * <<Default>>: <<<string,org.apache.tiles.renderer.impl;
+ * <<Default>>: <<<string,org.apache.tiles.renderer.impl.StringAttributeRenderer;
definition,org.apache.tiles.renderer.impl.DefinitionAttributeRenderer;
template,org.apache.tiles.renderer.impl.TemplateAttributeRenderer>>>.
@@ -275,11 +275,11 @@
{{{apidocs/org/apache/tiles/context/ChainedTilesApplicationContextFactory.html#FACTORY_CLASS_NAMES}<<<org.apache.tiles.context.ChainedTilesApplicationContextFactory>>>}}.
* <<Default>>: <<<org.apache.tiles.servlet.context.ServletTilesApplicationContextFactory,
- org.apache.tiles.portlet.context.PortletApplicationTilesContextFactory>>>
+ org.apache.tiles.portlet.context.PortletApplicationTilesApplicationContextFactory>>>
* <<Usage>>: when specified, it must contain a comma-separated list of class
names implementing
- {{{apidocs/org/apache/tiles/context/TilesApplicationContextFactory.html}<<<TilesContextFactory>>>}}.
+ {{{apidocs/org/apache/tiles/context/TilesApplicationContextFactory.html}<<<TilesApplicationContextFactory>>>}}.
* {<<<ChainedTilesRequestContextFactory>>> configuration}
Modified: tiles/framework/trunk/src/site/apt/migration/configuration.apt
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/src/site/apt/migration/configuration.apt?rev=712128&r1=712127&r2=712128&view=diff
==============================================================================
--- tiles/framework/trunk/src/site/apt/migration/configuration.apt (original)
+++ tiles/framework/trunk/src/site/apt/migration/configuration.apt Fri Nov 7 06:15:30 2008
@@ -36,18 +36,41 @@
* Configuration using Java
If you are using Java-based configuration, override the
- {{{../apidocs/org/apache/tiles/factory/BasicTilesContainerFactory.html#createDefinitionsReader(java.lang.Object,%20org.apache.tiles.TilesApplicationContext,%20org.apache.tiles.context.TilesContextFactory)}createDefinitionsReader}}
+ {{{../apidocs/org/apache/tiles/factory/BasicTilesContainerFactory.html#createDefinitionsReader(java.lang.Object,%20org.apache.tiles.TilesApplicationContext,%20org.apache.tiles.context.TilesRequestContextFactory)}createDefinitionsReader}}
method this way:
---------------------------------------
@Override
protected DefinitionsReader createDefinitionsReader(Object context,
TilesApplicationContext applicationContext,
- TilesContextFactory contextFactory) {
+ TilesRequestContextFactory contextFactory) {
return new CompatibilityDigesterDefinitionsReader();
}
---------------------------------------
+ You need to add a renderer for the "page" attribute type, that is in fact the "template" type.
+ So override the
+ {{{../apidocs/org/apache/tiles/factory/BasicTilesContainerFactory.html#registerAttributeRenderers(org.apache.tiles.renderer.impl.BasicRendererFactory,%20java.lang.Object,%20org.apache.tiles.TilesApplicationContext,%20org.apache.tiles.context.TilesRequestContextFactory,%20org.apache.tiles.TilesContainer,%20org.apache.tiles.evaluator.AttributeEvaluator)}registerAttributeRenderers}}
+ method.
+
+---------------------------------------
+@Override
+protected void registerAttributeRenderers(
+ BasicRendererFactory rendererFactory, Object context,
+ TilesApplicationContext applicationContext,
+ TilesRequestContextFactory contextFactory, TilesContainer container,
+ AttributeEvaluator evaluator) {
+ super.registerAttributeRenderers(rendererFactory, context,
+ applicationContext, contextFactory, container, evaluator);
+ TemplateAttributeRenderer templateRenderer = new TemplateAttributeRenderer();
+ templateRenderer.setApplicationContext(applicationContext);
+ templateRenderer.setRequestContextFactory(contextFactory);
+ templateRenderer.setEvaluator(evaluator);
+ rendererFactory.registerRenderer("page", templateRenderer);
+}
+---------------------------------------
+
+
* Configuration using initialization parameters
If you are using configuration using initialization parameters in
@@ -62,6 +85,23 @@
</init-param>
---------------------------------------
+ You need to add a renderer for the "page" attribute type, that is in fact the "template" type.
+ So set the
+ {{{../config-reference.html#org.apache.tiles.renderer.impl.BasicRendererFactory.TYPE_RENDERERS}<<<org.apache.tiles.renderer.impl.BasicRendererFactory.TYPE_RENDERERS>>>}}
+ this way:
+
+---------------------------------------
+<init-param>
+ <param-name>org.apache.tiles.renderer.impl.BasicRendererFactory.TYPE_RENDERERS</param-name>
+ <param-value>
+ string,org.apache.tiles.renderer.impl.StringAttributeRenderer;
+ definition,org.apache.tiles.renderer.impl.DefinitionAttributeRenderer;
+ template,org.apache.tiles.renderer.impl.TemplateAttributeRenderer;
+ page,org.apache.tiles.renderer.impl.TemplateAttributeRenderer
+ </param-value>
+</init-param>
+---------------------------------------
+
Tiles configuration files translation
A better, and more powerful, choice is to rewrite the definition files, to use