Hello,
the documentation of the layout component has the information of the
directory structure somewhere in between the lines. For a new developer
it is very astonishing that template files are packaged in class
directories, therefore I would like to propose the following details to
the documentation.
See the patch attached.
--
Best Regards / Viele Grüße
Sebastian Hennebrueder
-----
Software Developer and Trainer for Hibernate / Java Persistence
http://www.laliluna.de
Index: src/site/apt/guide/layout.apt
===================================================================
--- src/site/apt/guide/layout.apt (Revision 800829)
+++ src/site/apt/guide/layout.apt (Arbeitskopie)
@@ -15,8 +15,15 @@
Tapestry doesn't have a mechanism for such includes, nor does it have the
need.
- Instead, you can create a component that acts like a template for your pages.
+ Instead, you can create a component that acts like a template for your
pages. It consists of a
+ template file <Layout.tml> and a Java class <Layout.java>.
+
+ In a typical maven project, the template file should be stored in the
package <src/main/resources/MY_TAPESTRY_APP_PACKAGE/components>.
+ The Java file should be stored in the package
<src/main/java/MY_TAPESTRY_APP_PACKAGE/components>.
+ See {{{project-layout.html}Project Layout}}.
+
+
* Layout.tml
----
Index: src/site/apt/guide/project-layout.apt
===================================================================
--- src/site/apt/guide/project-layout.apt (Revision 800829)
+++ src/site/apt/guide/project-layout.apt (Arbeitskopie)
@@ -8,6 +8,9 @@
created by the {{{../../quickstart/}Tapestry Quickstart Archetype}}. If you
are creating your
own build using Ant, you may use whatever conventions work for you ... as
long as everything gets
packaged up into the right place in the target WAR.
+
+ The <<most astonishing>> for a newbie might be the fact, that the template
files of components
+ (not pages) are packaged to the same directories as the Java classes.
Parts of this project layout mimics the format of an <exploded WAR> (a WAR
file unpackaged onto the
file system). This will often enable you to run your application directly
from your workspace,
@@ -19,8 +22,26 @@
[../images/projectlayout.png] Project Layout
-* Main source files
+* Packaging overview
+ The overview is based on the source structure of the maven quickstart
project.
+
+*-----------------------+-----------------------+
+|<<Source>> |<<Target in WAR>> |
+*-----------------------+-----------------------+
+|src/main/java |target/WEB-INF/classes |
+|Java classes |
|
+*-----------------------+-----------------------+
+|src/main/resources |target/WEB-INF/classes |
+|Component templates, property files | |
+*-----------------------+-----------------------+
+|src/main/webapp |target/ |
+|Page templates, images, style sheets | |
+*-----------------------+-----------------------+
+
+
+* Main source files - src/main/java
+
Main Java source files, the files that will be compiled into the WAR file,
are
in <<<src/main/java>>>. This is <only> Java source files. You can see
the <<<Index.java>>> source file inside the <<<pages>>> subpackage, and
@@ -31,7 +52,7 @@
Compiled Java classes will ultimately be packaged in the WAR inside the
<<<WEB-INF/classes>>> folder.
-* Classpath Resources
+* Classpath Resources - src/main/resources
Resource files are under <<<src/main/resources>>>. This includes the
{{{localization.html}message catalog}} for the Index page
(<<<Index.properties>>>),
@@ -41,7 +62,7 @@
Component templates will always be stored in the resources folder.
Templates for pages may be packaged in the WAR proper instead.
-* Context Resources
+* Context Resources - src/main/webapp
The WAR is built primarily from the <<<src/main/webapp>>> folder; this is
where ordinary files are stored
(such as images and stylesheets). Page templates may also be stored here
(<<<Index.tml>>>). The file <<<src/main/webapp/WEB-INF/web.xml>>>
@@ -52,7 +73,7 @@
folder of the WAR, and for putting the Tapestry library, and its
dependencies (as well as any additional libraries defined
by your application) into the <<<WEB-INF/lib>>> folder.
-* Testing
+* Testing - src/test
The folders <<<src/test/java>>> and <<<src/test/resources>>> are used when
compiling and executing tests. Files in these
folders are <not> packaged into the final WAR.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org