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 2010/12/11 15:16:04 UTC

svn commit: r1044659 - in /tiles/sandbox/trunk/tiles3/tiles-api/src: main/java/org/apache/tiles/ main/java/org/apache/tiles/access/ main/java/org/apache/tiles/mgmt/ test/java/org/apache/tiles/ test/java/org/apache/tiles/access/

Author: apetrelli
Date: Sat Dec 11 14:16:04 2010
New Revision: 1044659

URL: http://svn.apache.org/viewvc?rev=1044659&view=rev
Log:
TILESSB-38
Fixed tiles-api checkstyle.

Added:
    tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/access/package-info.java   (with props)
    tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/mgmt/package-info.java   (with props)
    tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/package-info.java   (with props)
Removed:
    tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/access/package.html
    tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/mgmt/package.html
    tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/package.html
Modified:
    tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/TilesContainer.java
    tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/TilesContainerWrapper.java
    tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/access/TilesAccess.java
    tiles/sandbox/trunk/tiles3/tiles-api/src/test/java/org/apache/tiles/TilesContainerWrapperTest.java
    tiles/sandbox/trunk/tiles3/tiles-api/src/test/java/org/apache/tiles/access/TilesAccessTest.java

Modified: tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/TilesContainer.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/TilesContainer.java?rev=1044659&r1=1044658&r2=1044659&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/TilesContainer.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/TilesContainer.java Sat Dec 11 14:16:04 2010
@@ -45,7 +45,7 @@ public interface TilesContainer {
 
     /**
      * Retrive the attribute context of the current request.
-     * @param request TODO
+     * @param request The request.
      * @return map of the attributes in the current attribute context.
      */
     AttributeContext getAttributeContext(Request request);
@@ -55,7 +55,7 @@ public interface TilesContainer {
      * from others.<br>
      * When the use of the contexts is finished, call
      * {@link TilesContainer#endContext(Request)}
-     * @param request TODO
+     * @param request The request.
      *
      * @return The newly created context.
      */
@@ -66,13 +66,13 @@ public interface TilesContainer {
      * from others.<br>
      * It must be called after a
      * {@link TilesContainer#startContext(Request)} call.
-     * @param request TODO
+     * @param request The request.
      */
     void endContext(Request request);
 
     /**
      * Renders the current context, as it is.
-     * @param request TODO
+     * @param request The request.
      *
      * @since 2.1.0
      */
@@ -82,7 +82,7 @@ public interface TilesContainer {
      * Executes a preparer.
      *
      * @param preparer The name of the preparer to execute.
-     * @param request TODO
+     * @param request The request.
      */
     void prepare(String preparer, Request request);
 
@@ -90,7 +90,7 @@ public interface TilesContainer {
      * Render the given tiles request.
      *
      * @param definition the current definition.
-     * @param request TODO
+     * @param request The request.
      */
     void render(String definition, Request request);
 
@@ -99,13 +99,13 @@ public interface TilesContainer {
      * @param definition The definition to render.
      * @param request The request context.
      */
-    public void render(Definition definition, Request request);
+    void render(Definition definition, Request request);
 
     /**
      * Render the given Attribute.
      *
      * @param attribute The attribute to render.
-     * @param request TODO
+     * @param request The request.
      * @throws IOException If something goes wrong during writing to the output.
      * @since 2.1.2
      */
@@ -116,7 +116,7 @@ public interface TilesContainer {
      * Evaluates the given attribute.
      *
      * @param attribute The attribute to evaluate.
-     * @param request TODO
+     * @param request The request.
      * @return The evaluated object.
      * @since 2.1.0
      */
@@ -128,17 +128,15 @@ public interface TilesContainer {
      * @param definitionName The name of the definition to find.
      * @param request The request context.
      * @return The definition, if found.
-     * @throws DefinitionsFactoryException If the definitions factory throws an
-     * exception.
      */
-    public Definition getDefinition(String definitionName,
+    Definition getDefinition(String definitionName,
             Request request);
 
     /**
      * Determine whether or not the definition exists.
      *
      * @param definition the name of the definition.
-     * @param request TODO
+     * @param request The request.
      * @return true if the definition is found.
      */
     boolean isValidDefinition(String definition, Request request);

Modified: tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/TilesContainerWrapper.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/TilesContainerWrapper.java?rev=1044659&r1=1044658&r2=1044659&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/TilesContainerWrapper.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/TilesContainerWrapper.java Sat Dec 11 14:16:04 2010
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.tiles;
 
 import java.io.IOException;
@@ -5,10 +25,23 @@ import java.io.IOException;
 import org.apache.tiles.request.ApplicationContext;
 import org.apache.tiles.request.Request;
 
+/**
+ * Wraps a Tiles container to allow easy decoration.
+ *
+ * @version $Rev$ $Date$
+ */
 public class TilesContainerWrapper implements TilesContainer {
 
+    /**
+     * The container to wrap.
+     */
     protected TilesContainer container;
 
+    /**
+     * Constructor.
+     *
+     * @param container The container to wrap.
+     */
     public TilesContainerWrapper(TilesContainer container) {
         this.container = container;
         if (container == null) {
@@ -16,6 +49,11 @@ public class TilesContainerWrapper imple
         }
     }
 
+    /**
+     * Returns the wrapped container.
+     *
+     * @return The wrapped container.
+     */
     public TilesContainer getWrappedContainer() {
         return container;
     }

Modified: tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/access/TilesAccess.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/access/TilesAccess.java?rev=1044659&r1=1044658&r2=1044659&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/access/TilesAccess.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/access/TilesAccess.java Sat Dec 11 14:16:04 2010
@@ -129,7 +129,6 @@ public final class TilesAccess {
      *
      * @param request The request to use.
      * @param key The key under which the container is stored.
-     * @param context The servlet context to use.
      * @since 2.1.0
      */
     public static void setCurrentContainer(Request request,
@@ -164,7 +163,6 @@ public final class TilesAccess {
      * Returns the current container that has been set, or the default one.
      *
      * @param request The request to use.
-     * @param context The servlet context to use.
      * @return The current Tiles container to use in web pages.
      * @since 2.1.0
      */

Added: tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/access/package-info.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/access/package-info.java?rev=1044659&view=auto
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/access/package-info.java (added)
+++ tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/access/package-info.java Sat Dec 11 14:16:04 2010
@@ -0,0 +1,25 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/**
+ * Tiles access package. Utility classes to access Tiles funcionality from an application.
+ */
+package org.apache.tiles.access;
+

Propchange: tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/access/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/access/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/mgmt/package-info.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/mgmt/package-info.java?rev=1044659&view=auto
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/mgmt/package-info.java (added)
+++ tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/mgmt/package-info.java Sat Dec 11 14:16:04 2010
@@ -0,0 +1,26 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/**
+ * Classes and interfaces to be used when it is needed to create Tiles definitions
+ * during the execution of the application.
+ */
+package org.apache.tiles.mgmt;
+

Propchange: tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/mgmt/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/mgmt/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/package-info.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/package-info.java?rev=1044659&view=auto
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/package-info.java (added)
+++ tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/package-info.java Sat Dec 11 14:16:04 2010
@@ -0,0 +1,387 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/**
+ * The Tiles taglib and framework allows building web pages by assembling reusable
+ pieces of pages, called Tiles. A Tiles is usually a simple JSP page.
+
+ <div class="section">
+ <h2>Introduction</h2>
+
+ <p>The Tiles framework allows building pages by assembling reusable Tiles.
+ As an example, the page in the next figure can be build by assembling a
+ header, a footer, a menu and a body.</p>
+
+ <p><img src="doc-files/image001.gif" height="169" width="145" alt="doc-files/image001"></p>
+
+ <p>Each Tiles (header, menu, body, ...) is a JSP page and can itself be build
+ by assembling other Tiles.</p>
+
+ <p>Using Tiles can be compared as using Java methods: You need to define the Tiles (the method body), and then you
+ can &quot;call&quot; this body anywhere you want, passing it some parameters. In Tiles, parameters are called
+ &quot;attributes&quot; in order to avoid confusion with the request parameters.</p>
+
+ <p>The Tiles body can be a simple JSP page, a Struts action or any URI pointing
+ to a resource inside the current web site.</p>
+
+ <p>Inserting the body, or calling it, is done with the tag &lt;tiles:insert
+ ...&gt; anywhere in a JSP page. Insertion can also be done by specifying
+ a <em>definition name </em>as the path of a Struts forward or as input,
+ forward or include attributes of a Struts action.</p>
+
+ <p>Tiles bodies are used to create layouts, reusable parts, ... Tiles insertions
+ are used to insert Tiles. The same Tiles can be reused several times in
+ the same site, or even in the same page.</p>
+
+ <p>Insertion of a Tiles body can be associated to a logical name in what Tiles calls a &quot;definition&quot;. A
+ definition contains a logical name, a page used as body and some attribute values. The definition declaration
+ doesn't insert the associated Tiles body. It just associates it with the name. A definition name can be used
+ anywhere insertion of a Tiles body can occur. The associated Tiles body is then inserted with associated
+ attributes.</p>
+
+ <p>The definition declarations can be done in JSP pages or in one or more
+ centralized files. A definition can extend another one, overload some attributes,
+ add new attributes ... This allows the declaration of a &quot;master&quot; definition
+ declaring the common layout, header, menu and footer. All other definitions
+ extend this master layout thereby making it possible to change the entire
+ site look &amp; feel simply by changing the master definition. </p>
+ </div>
+ <div class="section">
+ <h2>Simple Examples</h2>
+
+ <div class="subsection1">
+ <h3>Insert a JSP page</h3>
+ <pre>&lt;tiles:insert <strong>page</strong>=&quot;/layouts/commonLayout.jsp&quot; flush=&quot;true&quot; /&gt;
+ </pre>
+ <p>This example inserts the specified page in place of the tag. The page attribute is any valid URL pointing to
+ a resource inside the current site.</p>
+ </div>
+ <div class="subsection1">
+ <a name="doc.InsertPageWithAttributes"></a>
+
+ <h3>Insert a Tiles passing some attributes</h3>
+ <pre>
+ &lt;tiles:insert page=&quot;/layouts/classicLayout.jsp&quot; flush=&amp;quot;true&quot;&gt;
+ &lt;tiles:put name=&quot;title&quot;  value=&quot;Page Title&quot; /&gt;
+ &lt;tiles:put name=&quot;header&quot; value=&quot;/common/header.jsp&quot; /&gt;
+ &lt;tiles:put name=&quot;footer&quot; value=&quot;/common/footer.jsp&quot; /&gt;
+ &lt;tiles:put name=&quot;menu&quot;   value=&quot;/common/menu.jsp&quot; /&gt;
+ &lt;tiles:put name=&quot;body&quot;   value=&quot;/tiles/mainBody.jsp&quot; /&gt;
+ &lt;/tiles:insert&gt;
+ </pre>
+ <p>This example inserts the specified page, passing it the attributes. Attributes
+ are stored in a Tiles context which is passed to the inserted pag and
+ can then be accesssed by their names.</p>
+ </div>
+ <div class="subsection1">
+ <h3>Retrieve an attribute value as String</h3>
+ <pre>
+ &lt;tiles:getAsString name=&quot;title&quot; /&gt;
+ </pre>
+ <p>This example retrieves the value of the attribute &quot;title&quot; and prints it as a String in the current
+ output stream. The method toString() is applied on the attribute value, allowing to pass any kind of object
+ as value.</p>
+ </div>
+ <div class="subsection1">
+ <h3>Insert Tiles referenced by an attribute</h3>
+ <pre>
+ &lt;tiles:insert attribute='menu' /&gt;
+ </pre>
+ <p>This inserts the Tiles referenced by the attribute &quot;menu&quot; value. The
+ specified attribute value is first retrieved from current Tiles's context,
+ and then the value is used as a page target to insert.</p>
+ </div>
+ <div class="subsection1">
+ <h3>Classic Layout </h3>
+
+ <p>This example is a layout assembling a page in the classic header-footer-menu-body
+ fashion.</p>
+ <pre>
+ &lt;%@ taglib uri=&quot;http://tiles.apache.org/tags-tiles&quot; prefix=&quot;tiles&quot; %&gt;
+ &lt;HTML&gt;
+ &lt;HEAD&gt;
+ &lt;link rel=&quot;stylesheet&quot; href=&quot;&lt;%=request.getContextPath()%&gt;/layouts/stylesheet.css&quot;
+ type=&quot;text/css&quot;/&gt;
+ &lt;title&gt;&lt;tiles:getAsString name=&quot;title&quot;/&gt;&lt;/title&gt;
+ &lt;/HEAD&gt;
+ &lt;body&gt;
+ &lt;table border=&quot;0&quot; width=&quot;100%&quot; cellspacing=&quot;5&quot;&gt;
+ &lt;tr&gt;
+ &lt;td colspan=&quot;2&quot;&gt;&lt;tiles:insert attribute=&quot;header&quot; /&gt;&lt;/td&gt;
+ &lt;/tr&gt;
+ &lt;tr&gt;
+ &lt;td width=&quot;140&quot; valign=&quot;top&quot;&gt;
+ &lt;tiles:insert attribute='menu' /&gt;
+ &lt;/td&gt;
+ &lt;td valign=&quot;top&quot;  align=&quot;left&quot;&gt;
+ &lt;tiles:insert attribute='body' /&gt;
+ &lt;/td&gt;
+ &lt;/tr&gt;
+ &lt;tr&gt;
+ &lt;td colspan=&quot;2&quot;&gt;
+ &lt;tiles:insert attribute=&quot;footer&quot; /&gt;
+ &lt;/td&gt;
+ &lt;/tr&gt;
+ &lt;/table&gt;
+ &lt;/body&gt;
+ &lt;/html&gt;
+ </pre>
+ <p>The layout is declared in a JSP page (ex: /layouts/classicLayout.jsp).
+ It can be used in conjunction with the tag described in &quot;<a href="#doc.InsertPageWithAttributes">Insert
+ a page passing some attributes</a>&quot;. </p>
+ </div>
+ </div>
+ <div class="section">
+ <h2>Definitions</h2>
+
+ <p>A definition associates a logical name with the URL of a Tiles to be inserted
+ and some attribute values. A definition doesn't insert the Tiles. This is
+ done later using the definition name. A definition name can be inserted
+ as often as you want in your site, making it easy to reuse a Tiles. </p>
+
+ <p>A definition can extend another definition and overload some attributes
+ or add new ones. This makes easy factorization of definitions differing
+ by some attributes. For example, you can define a master definition declaring
+ the main header, menu, footer, and a default title. Then let each of your
+ page definitions extend this master definition and overload the title and
+ the body.</p>
+
+ <p>Definitions can be declared in a JSP page, or in one or more centralized
+ files. To enable the definitions from centralized files, you need to initialize
+ the &quot;definitions factory&amp;&amp;quot; which will parse the definitions from the files
+ and provide them to the Tiles framework.</p>
+
+ <div class="subsection1">
+ <h3>Enabling Definition Factory</h3>
+
+ <p>To enable Tiles definitions described in one or more files, you need to write these files and to initialize the
+ definition factory. </p>
+
+ <p>Initialization is different depending on the Struts version you use,
+ or if you do not use Struts at all.</p>
+
+ <div class="subsection2">
+ <h4>Struts1.1</h4>
+
+ <p>Use the Tiles plug-in to enable Tiles definitions. This plug-in creates
+ the definition factory and passese it a configuration object populated
+ with parameters. Parameters can be specified in the web.xml file or
+ as plug-in parameters. The plug-in first reads parameters from web.xml,
+ and then overloads them with the ones found in the plug-in. All parameters
+ are optional and can be omitted. The plug-in should be declared in each
+ struts-config file:</p>
+ <pre>
+ &lt;plug-in className=&amp;&amp;quot;org.apache.struts.tiles.TilesPlugin&amp;&amp;quot; &gt;
+ &lt;set-property property=&amp;&amp;quot;definitions-config&amp;&amp;quot;
+ value=&amp;&amp;quot;/WEB-INF/tiles-defs.xml,
+ /WEB-INF/tiles-tests-defs.xml,/WEB-INF/tiles-tutorial-defs.xml,
+ /WEB-INF/tiles-examples-defs.xml&amp;&amp;quot; /&gt;
+ &lt;set-property property=&amp;&amp;quot;moduleAware&amp;&amp;quot; value=&amp;&amp;quot;true&amp;&amp;quot; /&gt;
+ &lt;set-property
+ property=&amp;&amp;quot;org.apache.tiles.definition.digester.DigesterDefinitionsReader.PARSER_VALIDATE&amp;&amp;quot;
+ value=&amp;&amp;quot;true&amp;&amp;quot; /&gt;
+ &lt;/plug-in&gt;
+ </pre>
+ <ul>
+ <li>definitions-config: (optional)
+ <ul>
+ <li>Specify configuration file names. There can be several comma separated file names (default: ?? )
+ </li>
+ </ul>
+ </li>
+ <li>org.apache.tiles.definition.digester.DigesterDefinitionsReader.PARSER_VALIDATE: (optional)
+ <ul>
+ <li>Specify if XML parser should validate the Tiles configuration
+ file
+ <ul>
+ <li>true : validate. DTD should be specified in file header (default)</li>
+ <li>false : no validation</li>
+
+ </ul>
+ </li>
+ </ul>
+ </li>
+
+ <li>moduleAware: (optional)
+ <ul>
+ <li>Specify if the Tiles definition factory is module aware. If true (default),
+ there will be one factory for each Struts module.
+ If false, there will be one common factory for all module. In this later case,
+ it is still needed to declare one plugin per module. The factory will be
+ initialized with parameters found in the first initialized plugin (generally the
+ one associated with the default module).
+ <ul>
+ <li>true : Tiles framework is module aware</li>
+ <li>false :Tiles framework has one single factoy shared among modules (default)</li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+
+ <li>tilesUtilImplClassname: (optional - for advanced user)
+ <ul>
+ <li>Specify The classname of the TilesUtil implementation to use. The specified class should
+ be a subclass of TilesUtilStrutsImpl. This option disable the moduleAware option.
+ <br>Specifying &amp;&amp;&quot;TilesUtilStrutsImpl&amp;&amp;&quot; is equivalent to moduleAware =
+ false.
+ <br>Specifying &amp;&amp;&quot;TilesUtilStrutsModuleImpl&amp;&amp;&quot; is equivalent to moduleAware
+ = true.
+ This option is taken into account only once, when it is first encountered. To avoid problems,
+ it is advice to specify the same values in all TilesPlugin declaration.
+ </li>
+ </ul>
+ </li>
+
+ </ul>
+ <p>The TilesPlugin class creates one definition factory for each struts module.
+ </p>
+
+ <p>
+ If the flag moduleAware is false, only one shared factory is created for all modules.
+ In this later case, the factory is initialized with parameters found in the first plugin.
+ The plugins should be declared in all modules, and the moduleAware flag should be
+ the same for the entire application.</p>
+
+ <p>
+ Paths found in Tiles definitions are relative to the main context.</p>
+
+ <p>You don't need to specify a TilesRequestProcessor, this is automatically
+ done by the plug-in. If, however, you want to specify your own RequestProcessor,
+ it should extend the TilesRequestProcessor. The plug-in checks this
+ constraint.</p>
+ </div>
+ <div class="subsection2">
+ <h4>Struts1.0.x</h4>
+
+ <p>You need to use a special servlet extending the Struts servlet. This is specified in the web.xml file of your
+ application:</p>
+ <pre>
+ &lt;servlet&gt;
+ &lt;servlet-name&gt;action&lt;/servlet-name&gt;
+ &lt;servlet-class&gt;org.apache.tiles.web.startup.TilesServlet&lt;/servlet-class&gt;
+ &lt;!-- Tiles Servlet parameter
+ Specify configuration file names. There can be several comma
+ separated file names
+ --&gt;
+ &lt;init-param&gt;
+ &lt;param-name&gt;definitions-config&lt;/param-name&gt;
+ &lt;param-value&gt;/WEB-INF/tiles-defs.xml&lt;/param-value&gt;
+ &lt;/init-param&gt;
+ &lt;!-- Tiles Servlet parameter
+ Specify if XML parser should validate the Tiles configuration file(s).
+ true : validate. DTD should be specified in file header.
+ false : no validation
+ --&gt;
+ &lt;init-param&gt;
+ &lt;param-name&gt;org.apache.tiles.definition.digester.DigesterDefinitionsReader.PARSER_VALIDATE&lt;/param-name&gt;
+ &lt;param-value&gt;true&lt;/param-value&gt;
+ &lt;/init-param&gt;
+ ...
+ &lt;/servlet&gt;
+ </pre>
+ </div>
+ <div class="subsection2">
+ <h4>Without Struts</h4>
+
+ <p>Tiles can be used without Struts. To initialize the definition factory, you can use the provided servlet. Declare
+ it in the web.xml file of your application:</p>
+ <pre>
+ &lt;servlet&gt;
+ &lt;servlet-name&gt;action&lt;/servlet-name&gt;
+ &lt;servlet-class&gt;org.apache.struts.tiles.TilesServlet&lt;/servlet-class&gt;
+
+
+ &lt;init-param&gt;
+ &lt;param-name&gt;definitions-config&lt;/param-name&gt;
+ &lt;param-value&gt;/WEB-INF/tiles-defs.xml&lt;/param-value&gt;
+ &lt;/init-param&gt;
+ &lt;init-param&gt;
+ &lt;param-name&gt;org.apache.tiles.definition.digester.DigesterDefinitionsReader.PARSER_VALIDATE&lt;/param-name&gt;
+ &lt;param-value&gt;true&lt;/param-value&gt;
+ &lt;/init-param&gt;
+ ...
+ </pre>
+ <p>The parameters are the same as for Struts1.1 or 1.0.</p>
+ </div>
+ </div>
+ <div class="subsection1">
+ <h3>Definition File Syntax</h3>
+
+ <p>The definition file syntax can be found in the
+ <a href="http://tiles.apache.org/dtds/tiles-config_2_0.dtd">tiles-config_2_0.dtd file</a>.
+ </p>
+
+ <p>Following is a simple example:</p>
+ <pre>
+ &lt;!DOCTYPE tiles-definitions PUBLIC
+ &amp;&amp;quot;-//Apache Software Foundation//DTD Tiles Configuration//EN&amp;&amp;quot;
+ &amp;&amp;quot;http://tiles.apache.org/dtds/tiles-config_2_0.dtd&amp;&amp;quot;&gt;
+
+ &lt;!-- Definitions for Tiles documentation   --&gt;
+ &lt;tiles-definitions&gt;
+
+ &lt;!-- ========================================================== --&gt;
+ &lt;!-- Master definition                                          --&gt;
+ &lt;!-- ========================================================== --&gt;
+ &lt;!-- Main page layout used as a root for other page definitions --&gt;
+
+ &lt;definition name=&amp;&amp;quot;site.mainLayout&amp;&amp;quot;
+   template=&amp;&amp;quot;/layouts/classicLayout.jsp&amp;&amp;quot;&gt;
+ &lt;put name=&amp;&amp;quot;title&amp;&amp;quot;  value=&amp;&amp;quot;Tiles Blank Site&amp;&amp;quot; /&gt;
+ &lt;put name=&amp;&amp;quot;header&amp;&amp;quot; value=&amp;&amp;quot;/tiles/common/header.jsp&amp;&amp;quot; /&gt;
+ &lt;put name=&amp;&amp;quot;menu&amp;&amp;quot;   value=&amp;&amp;quot;site.menu.bar&amp;&amp;quot; /&gt;
+ &lt;put name=&amp;&amp;quot;footer&amp;&amp;quot; value=&amp;&amp;quot;/tiles/common/footer.jsp&amp;&amp;quot; /&gt;
+ &lt;put name=&amp;&amp;quot;body&amp;&amp;quot;   value=&amp;&amp;quot;/tiles/body.jsp&amp;&amp;quot; /&gt;
+ &lt;/definition&gt;
+
+ &lt;!-- ========================================================== --&gt;
+ &lt;!-- Index page definition                                      --&gt;
+ &lt;!-- ========================================================== --&gt;
+ &lt;!-- This definition inherits from the main definition.
+ It overloads the page title and the body used.
+ Use the same mechanism to define new pages sharing common
+ properties (here header, menu, footer, layout)
+ --&gt;
+
+ &lt;definition name=&amp;&amp;quot;site.index.page&amp;&amp;quot;
+   extends=&amp;&amp;quot;site.mainLayout&amp;&amp;quot; &gt;
+ &lt;put name=&amp;&amp;quot;title&amp;&amp;quot;  value=&amp;&amp;quot;Tiles Blank Site Index&amp;&amp;quot; /&gt;
+ &lt;put name=&amp;&amp;quot;body&amp;&amp;quot;   value=&amp;&amp;quot;/tiles/body.jsp&amp;&amp;quot; /&gt;
+ &lt;/definition&gt;
+
+ &lt;/tiles-definition&gt;
+ </pre>
+ </div>
+ <div class="subsection1">
+ <h3>Debugging</h3>
+
+ <p>To debug a page made of Tiles, you can use following advices:</p>
+ <ul>
+ <li>Check each Tiles separatly. Try to access nested Tiles directly to test
+ if thes work properly.
+ </li>
+ <li>Enable Tiles logging. See the commons-logging package help.</li>
+ </ul>
+ </div>
+ </div>
+
+ */
+package org.apache.tiles;
+

Propchange: tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/sandbox/trunk/tiles3/tiles-api/src/main/java/org/apache/tiles/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: tiles/sandbox/trunk/tiles3/tiles-api/src/test/java/org/apache/tiles/TilesContainerWrapperTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-api/src/test/java/org/apache/tiles/TilesContainerWrapperTest.java?rev=1044659&r1=1044658&r2=1044659&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-api/src/test/java/org/apache/tiles/TilesContainerWrapperTest.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-api/src/test/java/org/apache/tiles/TilesContainerWrapperTest.java Sat Dec 11 14:16:04 2010
@@ -1,5 +1,22 @@
-/**
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package org.apache.tiles;
 
@@ -20,8 +37,14 @@ import org.junit.Test;
  */
 public class TilesContainerWrapperTest {
 
+    /**
+     * The container.
+     */
     private TilesContainer container;
 
+    /**
+     * The wrapper to test.
+     */
     private TilesContainerWrapper wrapper;
 
     /**
@@ -36,7 +59,7 @@ public class TilesContainerWrapperTest {
     /**
      * Tests {@link TilesContainerWrapper#TilesContainerWrapper(TilesContainer)}.
      */
-    @Test(expected=NullPointerException.class)
+    @Test(expected = NullPointerException.class)
     public void testTilesContainerWrapperNPE() {
         new TilesContainerWrapper(null);
     }
@@ -66,7 +89,7 @@ public class TilesContainerWrapperTest {
     }
 
     /**
-     * Test method for {@link org.apache.tiles.TilesContainerWrapper#evaluate(org.apache.tiles.Attribute, org.apache.tiles.request.Request)}.
+     * Test method for {@link TilesContainerWrapper#evaluate(Attribute, Request)}.
      */
     @Test
     public void testEvaluate() {
@@ -95,7 +118,7 @@ public class TilesContainerWrapperTest {
     }
 
     /**
-     * Test method for {@link org.apache.tiles.TilesContainerWrapper#getAttributeContext(org.apache.tiles.request.Request)}.
+     * Test method for {@link TilesContainerWrapper#getAttributeContext(Request)}.
      */
     @Test
     public void testGetAttributeContext() {
@@ -110,7 +133,7 @@ public class TilesContainerWrapperTest {
     }
 
     /**
-     * Test method for {@link org.apache.tiles.TilesContainerWrapper#getDefinition(java.lang.String, org.apache.tiles.request.Request)}.
+     * Test method for {@link TilesContainerWrapper#getDefinition(String, Request)}.
      */
     @Test
     public void testGetDefinition() {
@@ -125,7 +148,7 @@ public class TilesContainerWrapperTest {
     }
 
     /**
-     * Test method for {@link org.apache.tiles.TilesContainerWrapper#isValidDefinition(java.lang.String, org.apache.tiles.request.Request)}.
+     * Test method for {@link TilesContainerWrapper#isValidDefinition(String, Request)}.
      */
     @Test
     public void testIsValidDefinition() {
@@ -139,7 +162,7 @@ public class TilesContainerWrapperTest {
     }
 
     /**
-     * Test method for {@link org.apache.tiles.TilesContainerWrapper#prepare(java.lang.String, org.apache.tiles.request.Request)}.
+     * Test method for {@link TilesContainerWrapper#prepare(String, Request)}.
      */
     @Test
     public void testPrepare() {
@@ -153,7 +176,7 @@ public class TilesContainerWrapperTest {
     }
 
     /**
-     * Test method for {@link org.apache.tiles.TilesContainerWrapper#render(java.lang.String, org.apache.tiles.request.Request)}.
+     * Test method for {@link TilesContainerWrapper#render(String, Request)}.
      */
     @Test
     public void testRenderStringRequest() {
@@ -167,7 +190,7 @@ public class TilesContainerWrapperTest {
     }
 
     /**
-     * Test method for {@link org.apache.tiles.TilesContainerWrapper#render(org.apache.tiles.Definition, org.apache.tiles.request.Request)}.
+     * Test method for {@link TilesContainerWrapper#render(Definition, Request)}.
      */
     @Test
     public void testRenderDefinitionRequest() {
@@ -182,7 +205,7 @@ public class TilesContainerWrapperTest {
     }
 
     /**
-     * Test method for {@link org.apache.tiles.TilesContainerWrapper#render(org.apache.tiles.Attribute, org.apache.tiles.request.Request)}.
+     * Test method for {@link TilesContainerWrapper#render(Attribute, Request)}.
      * @throws IOException If something goes wrong.
      */
     @Test

Modified: tiles/sandbox/trunk/tiles3/tiles-api/src/test/java/org/apache/tiles/access/TilesAccessTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-api/src/test/java/org/apache/tiles/access/TilesAccessTest.java?rev=1044659&r1=1044658&r2=1044659&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-api/src/test/java/org/apache/tiles/access/TilesAccessTest.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-api/src/test/java/org/apache/tiles/access/TilesAccessTest.java Sat Dec 11 14:16:04 2010
@@ -138,7 +138,7 @@ public class TilesAccessTest {
      * Tests
      * {@link ServletUtil#setCurrentContainer(ServletRequest, String)}.
      */
-    @Test(expected=NoSuchContainerException.class)
+    @Test(expected = NoSuchContainerException.class)
     public void testSetCurrentContainerException() {
         Request request = createMock(Request.class);
         ApplicationContext context = createMock(ApplicationContext.class);
@@ -180,7 +180,7 @@ public class TilesAccessTest {
      * Tests
      * {@link ServletUtil#setCurrentContainer(ServletRequest, TilesContainer)}.
      */
-    @Test(expected=NullPointerException.class)
+    @Test(expected = NullPointerException.class)
     public void testSetCurrentContainerWithContainerException() {
         Request request = createMock(Request.class);
         ApplicationContext context = createMock(ApplicationContext.class);