Author: drobiazko Date: Mon Jan 11 19:54:44 2010 New Revision: 898034 URL: http://svn.apache.org/viewvc?rev=898034&view=rev Log: TAP5-811: Layout component documentation is not very clear about directory structure
Modified: tapestry/tapestry5/trunk/src/site/apt/guide/layout.apt tapestry/tapestry5/trunk/src/site/apt/guide/project-layout.apt Modified: tapestry/tapestry5/trunk/src/site/apt/guide/layout.apt URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/src/site/apt/guide/layout.apt?rev=898034&r1=898033&r2=898034&view=diff ============================================================================== --- tapestry/tapestry5/trunk/src/site/apt/guide/layout.apt (original) +++ tapestry/tapestry5/trunk/src/site/apt/guide/layout.apt Mon Jan 11 19:54:44 2010 @@ -15,7 +15,14 @@ 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 Modified: tapestry/tapestry5/trunk/src/site/apt/guide/project-layout.apt URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/src/site/apt/guide/project-layout.apt?rev=898034&r1=898033&r2=898034&view=diff ============================================================================== --- tapestry/tapestry5/trunk/src/site/apt/guide/project-layout.apt (original) +++ tapestry/tapestry5/trunk/src/site/apt/guide/project-layout.apt Mon Jan 11 19:54:44 2010 @@ -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,7 +22,25 @@ [../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 |myapp/WEB-INF/classes | +|Java classes | | +*-----------------------+-----------------------+ +|src/main/resources |myapp/WEB-INF/classes | +|Component templates, property files | | +*-----------------------+-----------------------+ +|src/main/webapp |myapp/ | +|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 @@ -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.