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/12/22 14:00:28 UTC

svn commit: r728672 - in /tiles/framework/trunk/src/site/apt: config-reference.apt tutorial/extension/points.apt tutorial/wildcard-configuration.apt whats-new.apt

Author: apetrelli
Date: Mon Dec 22 05:00:27 2008
New Revision: 728672

URL: http://svn.apache.org/viewvc?rev=728672&view=rev
Log:
TILES-343
Fixed documentation for TilesApplicationContext creation.

Modified:
    tiles/framework/trunk/src/site/apt/config-reference.apt
    tiles/framework/trunk/src/site/apt/tutorial/extension/points.apt
    tiles/framework/trunk/src/site/apt/tutorial/wildcard-configuration.apt
    tiles/framework/trunk/src/site/apt/whats-new.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=728672&r1=728671&r2=728672&view=diff
==============================================================================
--- tiles/framework/trunk/src/site/apt/config-reference.apt (original)
+++ tiles/framework/trunk/src/site/apt/config-reference.apt Mon Dec 22 05:00:27 2008
@@ -34,7 +34,7 @@
   [[1]] {{{config-reference.html#Main_configuration}Main configuration}}.
 
 *---------------------------------------------+--------------------------------------+
-| {{{config-reference.html#org.apache.tiles.context.TilesApplicationContextFactory}<<<org.apache.tiles.context.TilesApplicationContextFactory>>>}}      | Tiles application context factory class name     |
+| {{{config-reference.html#org.apache.tiles.context.AbstractTilesApplicationContextFactory}<<<org.apache.tiles.context.AbstractTilesApplicationContextFactory>>>}}      | Tiles application context factory class name     |
 *---------------------------------------------+--------------------------------------+
 | {{{config-reference.html#org.apache.tiles.context.TilesRequestContextFactory}<<<org.apache.tiles.context.TilesRequestContextFactory>>>}}      | Tiles request context factory class name     |
 *---------------------------------------------+--------------------------------------+
@@ -111,7 +111,7 @@
   {{{config-reference.html#org.apache.tiles.context.ChainedTilesRequestContextFactory.FACTORY_CLASS_NAMES}<<<org.apache.tiles.context.ChainedTilesRequestContextFactory.FACTORY_CLASS_NAMES>>>}}
 
   * <<<org.apache.tiles.context.TilesContextFactory>>>: use
-  {{{config-reference.html#org.apache.tiles.context.TilesApplicationContextFactory}<<<org.apache.tiles.context.TilesApplicationContextFactory>>>}}
+  {{{config-reference.html#org.apache.tiles.context.AbstractTilesApplicationContextFactory}<<<org.apache.tiles.context.AbstractTilesApplicationContextFactory>>>}}
   or
   {{{config-reference.html#org.apache.tiles.context.TilesRequestContextFactory}<<<org.apache.tiles.context.TilesRequestContextFactory>>>}}
 
@@ -125,17 +125,17 @@
 
 * {Main configuration}
 
-** {<<<org.apache.tiles.context.TilesApplicationContextFactory>>>}
+** {<<<org.apache.tiles.context.AbstractTilesApplicationContextFactory>>>}
 
   Specifies the application context factory class name to use.
   
   * <<Specified in>>:
-  {{{apidocs/org/apache/tiles/factory/TilesContainerFactory.html#APPLICATION_CONTEXT_FACTORY_INIT_PARAM}<<<org.apache.tiles.factory.TilesContainerFactory>>>}}.
+  {{{apidocs/org/apache/tiles/context/AbstractTilesApplicationContextFactory.html#APPLICATION_CONTEXT_FACTORY_INIT_PARAM}<<<org.apache.tiles.context.AbstractTilesApplicationContextFactory>>>}}.
     
   * <<Default>>: <<<org.apache.tiles.context.ChainedTilesApplicationContextFactory>>>.
     
   * <<Usage>>: when specified, it must contain the name of a class that
-  implements the <<<TilesApplicationContextFactory>>> interface.
+  implements the <<<AbstractTilesApplicationContextFactory>>> interface.
 
 ** {<<<org.apache.tiles.context.TilesRequestContextFactory>>>}
 
@@ -278,8 +278,8 @@
   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}<<<TilesApplicationContextFactory>>>}}.
+  names extending
+  {{{apidocs/org/apache/tiles/context/AbstractTilesApplicationContextFactory.html}<<<AbstractTilesApplicationContextFactory>>>}}.
 
 * {<<<ChainedTilesRequestContextFactory>>> configuration}
 

Modified: tiles/framework/trunk/src/site/apt/tutorial/extension/points.apt
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/src/site/apt/tutorial/extension/points.apt?rev=728672&r1=728671&r2=728672&view=diff
==============================================================================
--- tiles/framework/trunk/src/site/apt/tutorial/extension/points.apt (original)
+++ tiles/framework/trunk/src/site/apt/tutorial/extension/points.apt Mon Dec 22 05:00:27 2008
@@ -41,32 +41,50 @@
   {{{../../config-reference.html#KeyedDefinitionsFactoryTilesContainerFactory_configuration}KeyedDefinitionsFactoryTilesContainerFactory}}
   that allows to create multiple definitions factory for different "keys".
 
-* Tiles Application and Request Context Factory
+* {Tiles Application Context Factory}
+
+  The
+  {{{../../apidocs/org/apache/tiles/TilesApplicationContext.html}<<<TilesApplicationContext>>>}}
+  interface is used to abstract the Tiles context from the particular
+  technology. The same instance will be used in the whole application.
+  It is used to:
+  
+  * obtain application-scoped attributes;
+  
+  * obtain initialization parameters;
+  
+  * load resources.
+  
+  []
+  
+  The
+  {{{../../config-reference.html#org.apache.tiles.context.AbstractTilesApplicationContextFactory}<<<AbstractTilesApplicationContextFactory>>>}}
+  abstract factory is used to create instances of the class above.
+
+  The default implementation,
+  {{{../../config-reference.html#ChainedTilesApplicationContextFactory_configuration}<<<ChainedTilesApplicationContextFactory>>>}},
+  links together different implementations. The default configuration tries to
+  instantiate an implementation for Servlet and, if it fails, for Portlet
+  technology. If you need to support a new technology, we suggest to configure
+  {{{../../apidocs/org/apache/tiles/context/AbstractTilesApplicationContextFactory.html}<<<AbstractTilesApplicationContextFactory>>>}}
+  (and not using the configuration of ChainedTilesApplicationContextFactory).
+
+* Tiles Request Context Factory
 
   The
   {{{../../apidocs/org/apache/tiles/context/TilesRequestContext.html}<<<TilesRequestContext>>>}}
-  and
-  {{{../../apidocs/org/apache/tiles/context/TilesApplicationContext.html}<<<TilesApplicationContext>>>}}
-  interfaces are used to abstract the Tiles context from the particular
+  interface is used to abstract the Tiles context from the particular
   technology. The
-  {{{../../config-reference.html#org.apache.tiles.context.TilesApplicationContextFactory}<<<TilesApplicationContextFactory>>>}}
-  and the
   {{{../../config-reference.html#org.apache.tiles.context.TilesRequestContextFactory}<<<TilesRequestContextFactory>>>}}
-  interface is used to create instances of the 2 classes above.
+  interface is used to create instances of the class above.
 
-  The default implementations,
-  {{{../../config-reference.html#ChainedTilesApplicationContextFactory_configuration}<<<ChainedTilesApplicationContextFactory>>>}}
-  and 
-  {{{../../config-reference.html#ChainedTilesRequestContextFactory_configuration}<<<ChainedTilesRequestContextFactory>>>}} 
-  links together different implementation. The default configuration links
+  The default implementation,
+  {{{../../config-reference.html#ChainedTilesRequestContextFactory_configuration}<<<ChainedTilesRequestContextFactory>>>}}, 
+  links together different implementations. The default configuration links
   together the implementation for Servlet, Portlet and JSP technologies. If you
   need to support a new technology, we suggest to configure
-  {{{../../config-reference.html#ChainedTilesApplicationContextFactory_configuration}<<<ChainedTilesApplicationContextFactory>>>}}
-  and
   {{{../../config-reference.html#ChainedTilesRequestContextFactory_configuration}<<<ChainedTilesRequestContextFactory>>>}}
   and create a new instance of
-  {{{../../apidocs/org/apache/tiles/context/TilesApplicationContextFactory.html}<<<TilesApplicationContextFactory>>>}}
-  and
   {{{../../apidocs/org/apache/tiles/context/TilesRequestContextFactory.html}<<<TilesRequestContextFactory>>>}}.
 
 * Tiles Definitions Factory

Modified: tiles/framework/trunk/src/site/apt/tutorial/wildcard-configuration.apt
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/src/site/apt/tutorial/wildcard-configuration.apt?rev=728672&r1=728671&r2=728672&view=diff
==============================================================================
--- tiles/framework/trunk/src/site/apt/tutorial/wildcard-configuration.apt (original)
+++ tiles/framework/trunk/src/site/apt/tutorial/wildcard-configuration.apt Mon Dec 22 05:00:27 2008
@@ -46,37 +46,20 @@
 * Configuration
 
   To be able to specify Tiles XML definition files using wildcards, there is the
-  need for some configuration:
-
-  * If you are using parameter-based initialization, provide a new value for the
-  {{{../config-reference.html#org.apache.tiles.context.ChainedTilesApplicationContextFactory.FACTORY_CLASS_NAMES}<<<org.apache.tiles.context.ChainedTilesApplicationContextFactory.FACTORY_CLASS_NAMES>>>}}
+  need to override the Tiles application context creation. For example, if you
+  are using parameter-based initialization, provide a new value for the
+  {{{../config-reference.html#org.apache.tiles.context.AbstractTilesApplicationContextFactory}<<<org.apache.tiles.context.AbstractTilesApplicationContextFactory>>>}}
   init parameter. For example:
 
 ----------------------------------------
 <init-param>
-    <param-name>org.apache.tiles.context.ChainedTilesApplicationContextFactory.FACTORY_CLASS_NAMES</param-name>
+    <param-name>org.apache.tiles.context.AbstractTilesApplicationContextFactory</param-name>
     <param-value>
       org.apache.tiles.servlet.context.wildcard.WildcardServletTilesApplicationContextFactory
     </param-value>
 </init-param>
 ----------------------------------------
 
-  * If you are using Java-based configuration, override the 
-  {{{../apidocs/org/apache/tiles/factory/BasicTilesContainerFactory.html#registerChainedApplicationContextFactories(java.lang.Object,%20org.apache.tiles.context.ChainedTilesApplicationContextFactory)}registerChainedContextFactories}}
-  of <<<BasicTilesContainerFactory>>> this way:
-
-----------------------------------------
-/** {@inheritDoc} */
-@Override
-protected void registerChainedApplicationContextFactories(Object context,
-        ChainedTilesApplicationContextFactory contextFactory) {
-    List<TilesApplicationContextFactory> factories = new ArrayList<TilesApplicationContextFactory>(
-            CONTEXT_FACTORY_CHAIN_COUNT);
-    factories.add(new WildcardServletTilesApplicationContextFactory());
-    contextFactory.setFactories(factories);
-}
-----------------------------------------
-
 * Usage
 
   To load XML definition files using wilcards you can proceed, as usual, in two

Modified: tiles/framework/trunk/src/site/apt/whats-new.apt
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/src/site/apt/whats-new.apt?rev=728672&r1=728671&r2=728672&view=diff
==============================================================================
--- tiles/framework/trunk/src/site/apt/whats-new.apt (original)
+++ tiles/framework/trunk/src/site/apt/whats-new.apt Mon Dec 22 05:00:27 2008
@@ -68,6 +68,9 @@
 
 * Under the hood
 
+  * <<<TilesApplicationContext>>> is now created externally of the Tiles
+  container and {{{tutorial/extension/points.html#Tiles_Application_Context_Factory}must be configured externally}}.
+
   * Tiles exceptions are all unchecked now: you can now remove all your
   try-catches.