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 2007/04/13 17:20:45 UTC

svn commit: r528520 - in /tiles/site: pom.xml src/site/apt/migration/ src/site/apt/migration/configuration.apt src/site/apt/migration/extension.apt src/site/apt/migration/index.apt src/site/apt/migration/tags.apt src/site/site.xml

Author: apetrelli
Date: Fri Apr 13 08:20:44 2007
New Revision: 528520

URL: http://svn.apache.org/viewvc?view=rev&rev=528520
Log:
TILESSHARED-4
Added configuration files and JSP tags migration guides.
Now the pom depends on Maven site plugin version 2.0-beta-5.

Added:
    tiles/site/src/site/apt/migration/
    tiles/site/src/site/apt/migration/configuration.apt   (with props)
    tiles/site/src/site/apt/migration/extension.apt   (with props)
    tiles/site/src/site/apt/migration/index.apt   (with props)
    tiles/site/src/site/apt/migration/tags.apt   (with props)
Modified:
    tiles/site/pom.xml
    tiles/site/src/site/site.xml

Modified: tiles/site/pom.xml
URL: http://svn.apache.org/viewvc/tiles/site/pom.xml?view=diff&rev=528520&r1=528519&r2=528520
==============================================================================
--- tiles/site/pom.xml (original)
+++ tiles/site/pom.xml Fri Apr 13 08:20:44 2007
@@ -93,7 +93,7 @@
             <plugins>
                 <plugin>
                     <artifactId>maven-site-plugin</artifactId>
-                    <version>2.0-beta-4</version>
+                    <version>2.0-beta-5</version>
                 </plugin>
             </plugins>
         </pluginManagement>

Added: tiles/site/src/site/apt/migration/configuration.apt
URL: http://svn.apache.org/viewvc/tiles/site/src/site/apt/migration/configuration.apt?view=auto&rev=528520
==============================================================================
--- tiles/site/src/site/apt/migration/configuration.apt (added)
+++ tiles/site/src/site/apt/migration/configuration.apt Fri Apr 13 08:20:44 2007
@@ -0,0 +1,90 @@
+~~ $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.
+~~
+         -----------
+         Migrating Tiles configuration files
+         -----------
+
+Tiles configuration files translation
+
+  Most of XML elements and attributes can be translated one-to-one or
+  many-to-one without losing functionality from the 1.1-1.3 to the 2.0 DTD
+  version.
+
+* Header
+
+  The new header to be put in your Tiles definitions files is:
+
+------------------------------------------------------------
+ <!DOCTYPE tiles-definitions PUBLIC
+       "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
+       "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
+------------------------------------------------------------
+ 
+* Definitions attributes
+ 
+*---------------------------------+--------------------------------+
+| <<Struts-Tiles>>                | <<Tiles 2>>                    |
+*---------------------------------+--------------------------------+
+| <<<\<component-definitions\>>>> | <<<\<tiles-definitions\>>>>    |
+| <<<\<tiles-definitions\>>>>     |                                |
+*---------------------------------+--------------------------------+
+| <<<page>>>                      | <<<template>>>                 |
+| <<<path>>>                      |                                |
+| <<<template>>>                  |                                |
+*---------------------------------+--------------------------------+
+| <<<controllerClass>>>           | <<<preparer>>> [1]             |
+| <<<controllerUrl>>>             |                                |
+*---------------------------------+--------------------------------+
+
+  * \[1\] The default behaviour of <<<preparer>>> is to create and use a
+  single instance of the specified class. Anyway it is still possible to use a
+  URL as a preparer under a Struts 1 environment by using the
+  {{{http://svn.apache.org/repos/asf/struts/struts1/trunk/tiles2/}Struts 1 - Tiles 2}}
+  integration module, still under development.
+
+
+* Putting and adding attributes values
+
+  The <<<page>>> attribute type has been removed, use <<<template>>> instead.
+
+  The rest of the conversion is in the table below.
+
+*-----------------------+-----------------------------------------------+
+| <<Struts-Tiles>>      | <<Tiles 2>>                                   |
+*-----------------------+-----------------------------------------------+
+| <<<\<put\>>>>         | <<<\<put-attribute\>>>>                       |
+*-----------------------+-----------------------------------------------+
+| <<<\<putList\>>>>     | <<<\<put-attribute-list\>>>>                  |
+*-----------------------+-----------------------------------------------+
+| <<<\<add\>>>>         | <<<\<add-attribute\>>>>  [2]                  |
+|                       | <<<\<add-list-attribute\>>>>  [3]             |
+*-----------------------+-----------------------------------------------+
+| <<<content>>>         | <<<value>>>                                   |
+| <<<value>>>           |                                               |
+*-----------------------+-----------------------------------------------+
+| <<<direct="true">>>   | <<<type="string">>>                           |
+*-----------------------+-----------------------------------------------+
+
+  * \[2\] <<<\<add-attribute\>>>> is used when it is needed to add a single
+  attribute to a list attribute.
+
+  * \[3\] <<<\<add-list-attribute\>>>> is used when it is needed to a list
+  attribute as an element of another list attribute.
+ 
\ No newline at end of file

Propchange: tiles/site/src/site/apt/migration/configuration.apt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/site/src/site/apt/migration/configuration.apt
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: tiles/site/src/site/apt/migration/extension.apt
URL: http://svn.apache.org/viewvc/tiles/site/src/site/apt/migration/extension.apt?view=auto&rev=528520
==============================================================================
--- tiles/site/src/site/apt/migration/extension.apt (added)
+++ tiles/site/src/site/apt/migration/extension.apt Fri Apr 13 08:20:44 2007
@@ -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.
+~~
+         -----------
+         Tiles extensions migration
+         -----------
+
+Migration of Tiles extensions
+
+  TBD
\ No newline at end of file

Propchange: tiles/site/src/site/apt/migration/extension.apt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/site/src/site/apt/migration/extension.apt
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: tiles/site/src/site/apt/migration/index.apt
URL: http://svn.apache.org/viewvc/tiles/site/src/site/apt/migration/index.apt?view=auto&rev=528520
==============================================================================
--- tiles/site/src/site/apt/migration/index.apt (added)
+++ tiles/site/src/site/apt/migration/index.apt Fri Apr 13 08:20:44 2007
@@ -0,0 +1,49 @@
+~~ $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.
+~~
+         -----------
+         Migration from Struts-Tiles
+         -----------
+
+Migration from Struts-Tiles
+
+  This tutorial is intended to provide a help when migrating from the previous
+  version of Tiles, known as 
+  <<{{{http://struts.apache.org/1.3.8/struts-tiles/index.html}Struts-Tiles}}>>.
+
+  To use Tiles you need to put in your web application library directory:
+
+  * <<<tiles-api.jar>>>: it contains the API to manipulate and render Tiles.
+  
+  * <<<tiles-core.jar>>>: it contains the "engine" of Tiles, and the basic
+  implementation of the APIs.
+
+  * <<<tiles-jsp.jar>>>: it contains the JSP support to Tiles, i.e. JSP specific
+  classes and the tag library.
+
+* Further steps
+
+   * {{{configuration.html}Tiles configuration files}}: How to migrate Tiles
+   configuration files, the file usually named <<<tiles-defs.xml>>>.
+
+   * {{{tags.html}Tiles JSP tags}}: How to migrate Tiles JSP tags, the
+   <<<\<tiles:...\>>>> tags.
+   
+   * {{{extension.html}Tiles extensions}}: How to migrate Tiles
+   extensions, with explanation of main changes in the code structure.

Propchange: tiles/site/src/site/apt/migration/index.apt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/site/src/site/apt/migration/index.apt
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: tiles/site/src/site/apt/migration/tags.apt
URL: http://svn.apache.org/viewvc/tiles/site/src/site/apt/migration/tags.apt?view=auto&rev=528520
==============================================================================
--- tiles/site/src/site/apt/migration/tags.apt (added)
+++ tiles/site/src/site/apt/migration/tags.apt Fri Apr 13 08:20:44 2007
@@ -0,0 +1,120 @@
+~~ $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.
+~~
+         -----------
+         Translation of JSP tags
+         -----------
+
+Introduction
+
+  Tiles JSP tag library changed a lot, to be clearer and simpler than it was
+  before. This means that you need to change ALL of your JSP pages accordingly.
+
+Tag library inclusion
+
+  To include Tiles tag library, write this row on top of your JSP files:
+
+---------------------------------------------------------------------
+<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
+---------------------------------------------------------------------
+
+Tags differences
+
+  Here is the toughest part: Tiles 2 tags differ a lot comparing to Struts
+  Tiles. However, after the change you will notice that the JSP code will be
+  easier to understand.
+
+* The <<<\<tiles:insert\>>>> tag replacement
+
+  The <<<\<tiles:insert\>>>> of Struts-Tiles changed, in the sense that it has
+  been split in different parts and many attributes have been removed. The
+  changes are summarized in the table below.
+
+*---------------------------------+----------------------------------+
+| <<Struts-Tiles>>                | <<Tiles 2>>                      |
+*---------------------------------+----------------------------------+
+| <<<\<tiles:insert\>>>>          | <<<\<tiles:insertTemplate\>>>>   |
+|                                 | <<<\<tiles:insertAttribute\>>>>  |
+|                                 | <<<\<tiles:insertDefinition\>>>> |
+*---------------------------------+----------------------------------+
+| <<<component="definition_name">>> | Use <<<\<tiles:insertDefinition name="definition_name"\>>>> |
+*---------------------------------+----------------------------------+
+| <<<attribute="attribute_name">>>  | Use <<<\<tiles:insertAttribute name="attribute_name"\>>>>   |
+*---------------------------------+----------------------------------+
+| <<<page>>>                      | <<<template>>>                   |
+| <<<template>>>                  |                                  |
+*---------------------------------+----------------------------------+
+| <<<beanName="bean_name">>>         | <<<value="$\{bean_scopeScope.bean_name.bean_property\}">>> |
+| <<<beanProperty="bean_property">>> |                                                            |
+| <<<beanScope="bean_scope">>>       |                                                            |
+*---------------------------------+----------------------------------+
+| <<<controllerClass>>>           | <<<preparer>>> [1]               |
+| <<<controllerUrl>>>             |                                  |
+*---------------------------------+----------------------------------+
+
+
+  * \[1\] The default behaviour of <<<preparer>>> is to create and use a
+  single instance of the specified class. Anyway it is still possible to use a
+  URL as a preparer under a Struts 1 environment by using the
+  {{{http://svn.apache.org/repos/asf/struts/struts1/trunk/tiles2/}Struts 1 - Tiles 2}}
+  integration module, still under development.
+
+* Putting and adding attributes values
+
+  The <<<page>>> attribute type has been removed, use <<<template>>> instead.
+
+  The rest of the conversion is in the table below.
+
+*-------------------------+-----------------------------------------------+
+| <<Struts-Tiles>>        | <<Tiles 2>>                                   |
+*-------------------------+-----------------------------------------------+
+| <<<\<tiles:put\>>>>     | <<<\<tiles:putAttribute\>>>>                  |
+*-------------------------+-----------------------------------------------+
+| <<<\<tiles:putList\>>>> | <<<\<tiles:putAttributeList\>>>>              |
+*-------------------------+-----------------------------------------------+
+| <<<\<tiles:add\>>>>     | <<<\<tiles:addAttribute\>>>>  [2]             |
+|                         | <<<\<tiles:addListAttribute\>>>>  [3]         |
+*-------------------------+-----------------------------------------------+
+| <<<content>>>           | <<<value>>>                                   |
+| <<<value>>>             |                                               |
+*-------------------------+-----------------------------------------------+
+| <<<direct="true">>>     | <<<type="string">>>                           |
+*-------------------------+-----------------------------------------------+
+| <<<beanName="bean_name">>>         | <<<value="$\{bean_scopeScope.bean_name.bean_property\}">>> |
+| <<<beanProperty="bean_property">>> |                                                            |
+| <<<beanScope="bean_scope">>>       |                                                            |
+*---------------------------------+----------------------------------+
+
+  * \[2\] <<<\<tiles:addAttribute\>>>> is used when it is needed to add a single
+  attribute to a list attribute.
+
+  * \[3\] <<<\<tiles:addListAttribute\>>>> is used when it is needed to a list
+  attribute as an element of another list attribute.
+
+* Other changes
+
+*---------------------------------+--------------------------------------------+
+| <<Struts-Tiles>>                | <<Tiles 2>>                                |
+*---------------------------------+--------------------------------------------+
+| <<<\<tiles:get\>>>>             | <<<\<tiles:insertAttribute\>>>>            |
+*---------------------------------+--------------------------------------------+
+| <<<\<tiles:definition scope="scope"\>>>> | Removed, definitions are created in request scope. |
+*---------------------------------+--------------------------------------------+
+| <<<\<tiles:initComponentDefinitions\>>>> | <<<\<tiles:initContainer\>>>>     |
+*---------------------------------+--------------------------------------------+

Propchange: tiles/site/src/site/apt/migration/tags.apt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/site/src/site/apt/migration/tags.apt
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: tiles/site/src/site/site.xml
URL: http://svn.apache.org/viewvc/tiles/site/src/site/site.xml?view=diff&rev=528520&r1=528519&r2=528520
==============================================================================
--- tiles/site/src/site/site.xml (original)
+++ tiles/site/src/site/site.xml Fri Apr 13 08:20:44 2007
@@ -57,6 +57,9 @@
             <item   
                     name="Quickstart"
                     href="/quickstart/index.html"/>
+            <item   
+                    name="Migration from Struts Tiles"
+                    href="/migration/index.html"/>
             <item
                     name="Javadoc"
                     href="/framework/apidocs/index.html"/>