You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by an...@apache.org on 2008/06/17 14:10:24 UTC

svn commit: r668627 - in /tapestry/tapestry4/trunk/tapestry-archetype: ./ src/main/resources/archetype-resources/ src/main/resources/archetype-resources/src/main/java/application/ src/main/resources/archetype-resources/src/main/java/application/aso/ sr...

Author: andyhot
Date: Tue Jun 17 05:10:23 2008
New Revision: 668627

URL: http://svn.apache.org/viewvc?rev=668627&view=rev
Log:
TAPESTRY-1677: update archetype for T4.1

Modified:
    tapestry/tapestry4/trunk/tapestry-archetype/pom.xml
    tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/pom.xml
    tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/Global.java
    tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/Visit.java
    tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/aso/GlobalASOFactory.java
    tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/aso/VisitASOFactory.java
    tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/components/Echo.java
    tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/components/widgets/RoundedCorner.java
    tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/pages/Home.java
    tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/services/RoundedCornerService.java
    tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/util/Utilities.java
    tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/Home.html
    tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/Echo.html
    tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/app.application
    tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml
    tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/hivemodule.xml
    tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
    tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/widgets/RoundedCorner.html
    tapestry/tapestry4/trunk/tapestry-archetype/src/site/apt/about_resultant_project.apt
    tapestry/tapestry4/trunk/tapestry-archetype/src/site/apt/index.apt
    tapestry/tapestry4/trunk/tapestry-archetype/src/site/site.xml

Modified: tapestry/tapestry4/trunk/tapestry-archetype/pom.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/pom.xml?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/pom.xml (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/pom.xml Tue Jun 17 05:10:23 2008
@@ -1,17 +1,19 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
     <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.tapestry</groupId>
     <artifactId>tapestry-archetype</artifactId>
-    <packaging>maven-plugin</packaging>
-    <version>4.1.2</version>
+    <packaging>jar</packaging>
+    <version>4.1.6-SNAPSHOT</version>
 
     <parent>
         <groupId>org.apache.tapestry</groupId>
         <artifactId>tapestry-project</artifactId>
-        <version>4.1.2</version>
+        <version>4.1.6-SNAPSHOT</version>
     </parent>
-    
+
     <name>Simple Tapestry Archetype</name>
     <inceptionYear>2007</inceptionYear>
 
@@ -21,13 +23,18 @@
             <url>http://www.joshlong.com</url>
             <email>josh@joshlong.com</email>
         </contributor>
+        <contributor>
+            <name>Ulrich Staerk</name>
+            <email>uli@spielviel.de</email>
+        </contributor>
     </contributors>
 
-    <build>
-    </build>
+    <build></build>
 
     <reporting>
-        <outputDirectory>../target/site/tapestry-archetype</outputDirectory>
+        <outputDirectory>
+            ../target/site/tapestry-archetype
+        </outputDirectory>
         <excludeDefaults>true</excludeDefaults>
     </reporting>
 </project>
\ No newline at end of file

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/pom.xml?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/pom.xml (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/pom.xml Tue Jun 17 05:10:23 2008
@@ -1,16 +1,16 @@
-<project  xmlns="http://maven.apache.org/POM/4.0.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <groupId>${groupId}</groupId>
     <artifactId>${artifactId}</artifactId>
     <version>${version}</version>
     <packaging>war</packaging>
     <name>${artifactId} Tapestry Application</name>
-    
+
     <dependencies>
         <!--
-        These are some useful dependencies, you may remove them at any time.
+            These are some useful dependencies, you may remove them at any time.
         -->
         <dependency>
             <groupId>commons-lang</groupId>
@@ -37,109 +37,61 @@
         </dependency>
 
         <!--
-        ===============================================
-        Spring Framework
-        ===============================================
-        You should probably change this to something more relevant to your systems
+            ===============================================
+            Spring Framework
+            ===============================================
+            You should probably change this to something more relevant to your systems
         -->
         <dependency>
             <groupId>org.springframework</groupId>
-            <artifactId>spring-core</artifactId>
-            <version>1.2.7</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
             <artifactId>spring</artifactId>
-            <version>1.2.7</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-dao</artifactId>
-            <version>1.2.7</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.maven.wagon</groupId>
-            <artifactId>wagon-ftp</artifactId>
-            <version>1.0-alpha-5</version>
+            <version>2.0.6</version>
         </dependency>
 
         <!--
-        ===============================================
-        The following are required (for this archetype to be any fun!)
-        ===============================================
+            ===============================================
+            The following are required (for this archetype to be any fun!)
+            ===============================================
         -->
         <!--
-         NB: Spring integration is first-class, even if it's
-         not "directly" integrated into the framework!
+            NB: Spring integration is first-class, even if it's
+            not "directly" integrated into the framework!
         -->
         <dependency>
             <groupId>com.javaforge.tapestry</groupId>
             <artifactId>tapestry-spring</artifactId>
-            <version>0.1.2</version>
+            <version>1.0.0</version>
             <exclusions>
                 <exclusion>
-                    <artifactId>tapestry</artifactId>
-                    <groupId>tapestry</groupId>
-                </exclusion>
-                <exclusion>
-                    <artifactId>tapestry-annotations</artifactId>
                     <groupId>tapestry</groupId>
-                </exclusion>
-                <exclusion>
-                    <artifactId>tapestry-contrib</artifactId>
-                    <groupId>tapestry</groupId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <!--
-           NB:  You don't really need this, but if you did, this is how you'd configure it.
-                This is useful when you're using the BeanForm component.
-                todo
-                Btw, the BeanForm should be installed as follows
-        -->
-        <dependency>
-            <groupId>com.javaforge.tapestry</groupId>
-            <artifactId>tapestry-prop</artifactId>
-            <version>0.1.1</version>
-            <exclusions>
-                <exclusion>
                     <artifactId>tapestry</artifactId>
-                    <groupId>tapestry</groupId>
                 </exclusion>
-
                 <exclusion>
-                    <artifactId>tapestry-annotations</artifactId>
-                    <groupId>tapestry</groupId>
-                </exclusion>
-
-                <exclusion>
-                    <artifactId>tapestry-contrib</artifactId>
                     <groupId>tapestry</groupId>
+                    <artifactId>tapestry-annotations</artifactId>
                 </exclusion>
-
             </exclusions>
         </dependency>
 
-
         <dependency>
             <groupId>org.apache.tapestry</groupId>
             <artifactId>tapestry-annotations</artifactId>
-            <version>4.1.2-SNAPSHOT</version>
+            <version>4.1.6-SNAPSHOT</version>
         </dependency>
-
         <dependency>
             <groupId>org.apache.tapestry</groupId>
             <artifactId>tapestry-framework</artifactId>
-            <version>4.1.2-SNAPSHOT</version>
+            <version>4.1.6-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.tapestry</groupId>
             <artifactId>tapestry-contrib</artifactId>
-            <version>4.1.2-SNAPSHOT</version>
+            <version>4.1.6-SNAPSHOT</version>
         </dependency>
+
         <!-- A dependency on either JUnit or TestNG is required, or the surefire plugin (which runs the tests)
-             will fail, preventing Maven from packaging the WAR. Tapestry includes a large number
-             of testing facilities designed for use with TestNG (http://testng.org/), so it's recommended. -->
+            will fail, preventing Maven from packaging the WAR. Tapestry includes a large number
+            of testing facilities designed for use with TestNG (http://testng.org/), so it's recommended. -->
         <dependency>
             <groupId>org.testng</groupId>
             <artifactId>testng</artifactId>
@@ -150,8 +102,8 @@
     </dependencies>
     <build>
         <!--
-        Un comment the following so that the produced deliverable matches
-        your artifact, instead of artifact + version.
+            Un comment the following so that the produced deliverable matches
+            your artifact, instead of artifact + version.
         -->
         <!--<finalName>${artifactId}</finalName>-->
         <resources>
@@ -176,18 +128,14 @@
                     <dependentWarExcludes>WEB-INF/web.xml</dependentWarExcludes>
                 </configuration>
             </plugin>
-
-
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
-
                 <configuration>
                     <source>1.5</source>
                     <target>1.5</target>
                     <optimize>true</optimize>
                 </configuration>
-
             </plugin>
 
             <!-- Run the application using "mvn jetty:run" -->
@@ -195,14 +143,12 @@
             <plugin>
                 <groupId>org.mortbay.jetty</groupId>
                 <artifactId>maven-jetty-plugin</artifactId>
-                <version>6.1.5</version>
                 <configuration>
-
                     <scanTargets>
                         <scanTarget>src/main/resources/</scanTarget>
                     </scanTargets>
                     <!--
-                                        <webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml>
+                        <webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml>
                     -->
                     <systemProperties>
                         <systemProperty>
@@ -217,7 +163,6 @@
                     <scanIntervalSeconds>10</scanIntervalSeconds>
                 </configuration>
             </plugin>
-
         </plugins>
     </build>
 
@@ -226,13 +171,19 @@
             <name>codehaus.org</name>
             <id>Maven Snapshots 2</id>
             <url>http://snapshots.repository.codehaus.org/</url>
-            <snapshots> <enabled>true</enabled></snapshots>
-            <releases>  <enabled>true</enabled></releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
         </repository>
 
         <repository>
             <id>apache.snapshots</id>
-            <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+            <url>
+                http://people.apache.org/repo/m2-snapshot-repository
+            </url>
             <snapshots>
                 <enabled>true</enabled>
             </snapshots>
@@ -249,16 +200,20 @@
             </snapshots>
             <releases>
                 <enabled>true</enabled>
-            </releases> </repository>
+            </releases>
+        </repository>
         <repository>
             <id>dev.java.net</id>
-            <url>https://maven-repository.dev.java.net/nonav/repository/</url>
+            <url>
+                https://maven-repository.dev.java.net/nonav/repository/
+            </url>
             <snapshots>
                 <enabled>true</enabled>
             </snapshots>
             <releases>
                 <enabled>true</enabled>
-            </releases>  </repository>
+            </releases>
+        </repository>
         <repository>
             <id>Maven Snapshots</id>
             <url>http://snapshots.maven.codehaus.org/maven2/</url>

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/Global.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/Global.java?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/Global.java (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/Global.java Tue Jun 17 05:10:23 2008
@@ -1,46 +1,36 @@
 package ${packageName}.application;
-import java.io.Serializable;
 
 import java.io.Serializable;
-import org.springframework.beans.factory.InitializingBean;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
+
 import ${packageName}.util.Utilities;
 
-  /**
-     * You can "store" anything here you would
-     * store in the session, and
-     * only for things you'd persist
-     * for the whole application, per user.
-     *
-     * A good example: the working credentials of one user logged into a system.
-     *
-     * To Store something, simply add an accessor/mutator.
-     *
-     * <code>
-     *
-     * private User user;
-     * public User getUser(){ return this.user; }
-     * public void setUser (User usr ){ this.user=usr;}
-     *
-     * </code>
-     *
-    */
+/**
+ * <p>
+ * This ASO will have application scope (see <a
+ * href="http://tapestry.apache.org/tapestry4.1/usersguide/state.html">http://tapestry.apache.org/tapestry4.1/usersguide/state.html</a>)
+ * and will be created upon first access. Information stored here will be available to all users.
+ * </p>
+ * <p>
+ * You should not store user-specific information here because it will be available to all users.
+ * You could however store some utilities object here. To store something, simply add an
+ * accessor/mutator.
+ * </p>
+ */
 public class Global implements Serializable
 {
-     private Utilities utilities ;
 
-    public Utilities getUtilities() {
+    private static final long serialVersionUID = 4566826739855338869L;
+
+    private Utilities utilities;
+
+    public Utilities getUtilities()
+    {
         return utilities;
     }
 
-    public void setUtilities(Utilities utilities) {
+    public void setUtilities(Utilities utilities)
+    {
         this.utilities = utilities;
     }
 
-
-
-
 }

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/Visit.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/Visit.java?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/Visit.java (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/Visit.java Tue Jun 17 05:10:23 2008
@@ -1,45 +1,43 @@
 package ${packageName}.application;
 
 import java.io.Serializable;
-import org.springframework.beans.factory.InitializingBean;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
+
 import ${packageName}.util.Utilities;
 
-  /**
-     * You can "store" anything here you would
-     * store in the session, and
-     * only for things you'd persist
-     * for the whole application, per user.
-     *
-     * A good example: the working credentials of one user logged into a system.
-     *
-     * To Store something, simply add an accessor/mutator.
-     *
-     * <code>
-     *
-     * private User user;
-     * public User getUser(){ return this.user; }
-     * public void setUser (User usr ){ this.user=usr;}
-     *
-     * </code>
-     *
-    */
+/**
+ * <p>
+ * This ASO will have session scope (see <a
+ * href="http://tapestry.apache.org/tapestry4.1/usersguide/state.html">http://tapestry.apache.org/tapestry4.1/usersguide/state.html</a>)
+ * and will be created upon first access (thus creating a new session if one does not already
+ * exist).
+ * </p>
+ * <p>
+ * For example one could store a user's credentials here. To store something, simply add an
+ * accessor/mutator.
+ * </p>
+ * <code>
+ *
+ * private User user;
+ * public User getUser(){ return this.user; }
+ * public void setUser (User usr ){ this.user=usr;}
+ *
+ * </code>
+ */
 public class Visit implements Serializable
 {
-     private Utilities utilities ;
 
-    public Utilities getUtilities() {
+    private static final long serialVersionUID = 5024704945209999149L;
+
+    private Utilities utilities;
+
+    public Utilities getUtilities()
+    {
         return utilities;
     }
 
-    public void setUtilities(Utilities utilities) {
+    public void setUtilities(Utilities utilities)
+    {
         this.utilities = utilities;
     }
 
-
-
-
 }

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/aso/GlobalASOFactory.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/aso/GlobalASOFactory.java?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/aso/GlobalASOFactory.java (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/aso/GlobalASOFactory.java Tue Jun 17 05:10:23 2008
@@ -1,25 +1,34 @@
 package ${packageName}.application.aso;
-import ${packageName}.util.* ;
-import ${packageName}.application.* ;
+
 import org.apache.tapestry.engine.state.StateObjectFactory;
 
+import ${packageName}.application.Global;
+import ${packageName}.util.Utilities;
 
+/**
+ * This is a factory for creating application-scoped ASOs and is configured in hivemodule.xml. This is
+ * needed if your ASO can't be instantiated using a simple constructor. In this case we want to
+ * inject a Spring managed bean into the ASO.
+ */
 public class GlobalASOFactory implements StateObjectFactory
 {
-     private Utilities utilities ;
 
-    public Utilities getUtilities() {
+    private Utilities utilities;
+
+    public Utilities getUtilities()
+    {
         return utilities;
     }
 
-    public void setUtilities(Utilities utilities) {
+    public void setUtilities(Utilities utilities)
+    {
         this.utilities = utilities;
     }
 
     public Object createStateObject()
     {
-       Global v = new Global() ;
+        Global v = new Global();
         v.setUtilities(getUtilities());
         return v;
     }
-}
\ No newline at end of file
+}

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/aso/VisitASOFactory.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/aso/VisitASOFactory.java?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/aso/VisitASOFactory.java (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/application/aso/VisitASOFactory.java Tue Jun 17 05:10:23 2008
@@ -1,25 +1,34 @@
 package ${packageName}.application.aso;
-import ${packageName}.util.* ;
-import ${packageName}.application.* ;
+
 import org.apache.tapestry.engine.state.StateObjectFactory;
 
+import ${packageName}.application.Visit;
+import ${packageName}.util.Utilities;
 
+/**
+ * This is a factory for creating session-scoped ASOs and is configured in hivemodule.xml. This is
+ * needed if your ASO can't be instantiated using a simple constructor. In this case we want to
+ * inject a Spring managed bean into the ASO.
+ */
 public class VisitASOFactory implements StateObjectFactory
 {
-     private Utilities utilities ;
 
-    public Utilities getUtilities() {
+    private Utilities utilities;
+
+    public Utilities getUtilities()
+    {
         return utilities;
     }
 
-    public void setUtilities(Utilities utilities) {
+    public void setUtilities(Utilities utilities)
+    {
         this.utilities = utilities;
     }
 
     public Object createStateObject()
     {
-       Visit v = new Visit() ;
+        Visit v = new Visit();
         v.setUtilities(getUtilities());
         return v;
     }
-}
\ No newline at end of file
+}

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/components/Echo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/components/Echo.java?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/components/Echo.java (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/components/Echo.java Tue Jun 17 05:10:23 2008
@@ -1,18 +1,15 @@
 package ${packageName}.components;
 
 import org.apache.tapestry.BaseComponent;
-import org.apache.tapestry.annotations.InjectObject;
 import org.apache.tapestry.annotations.Parameter;
 
 /**
  * @author Joshua Long
- *
  */
 abstract public class Echo extends BaseComponent
 {
-    
 
-    @Parameter abstract public String getValue() ;
-    
+    @Parameter
+    public abstract String getValue();
 
-}
\ No newline at end of file
+}

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/components/widgets/RoundedCorner.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/components/widgets/RoundedCorner.java?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/components/widgets/RoundedCorner.java (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/components/widgets/RoundedCorner.java Tue Jun 17 05:10:23 2008
@@ -1,42 +1,43 @@
 package ${packageName}.components.widgets;
 
-import org.apache.tapestry.engine.ILink;
-import org.apache.tapestry.annotations.Parameter;
-import org.apache.tapestry.BaseComponent;
+import java.util.HashMap;
+import java.util.Map;
 
+import org.apache.tapestry.BaseComponent;
 import org.apache.tapestry.annotations.InjectObject;
 import org.apache.tapestry.annotations.Parameter;
 import org.apache.tapestry.engine.IEngineService;
 import org.apache.tapestry.engine.ILink;
 
-import java.util.HashMap;
-import java.util.Map;
-
-
 /**
- * The rounded corner component provides a corner image, rendered with Java2D. Naturally, the inspiration was
- * the much vaunted google groups image generator URL. That URL is exemplary of the value of an engine service in Tapestry:
- * you parameterize it, and it generates useful output, even if the output itself is never going to be a destination for some user.
- * <p/>
- * It takes as it's parameters the background color, the foreground color, the desired
- * height and width, and the desired corner.
- * <p/>
- * Note that the component itself is really very simple. It just marshals the parameters
- * and converts them into useful input for our engine-service. The engine service does the
- * hard work of rendering the image using Java2D. All values have useful defaults, so getting it working can be as simple as
- * <p/>
+ * <p>
+ * The rounded corner component provides a corner image, rendered with Java2D. Naturally, the
+ * inspiration was the much vaunted google groups image generator URL. That URL is exemplary of the
+ * value of an engine service in Tapestry: you parameterize it, and it generates useful output, even
+ * if the output itself is never going to be a destination for some user.
+ * </p>
+ * <p>
+ * It takes as it's parameters the background color, the foreground color, the desired height and
+ * width, and the desired corner.
+ * </p>
+ * <p>
+ * Note that the component itself is really very simple. It just marshals the parameters and
+ * converts them into useful input for our engine-service. The engine service does the hard work of
+ * rendering the image using Java2D. All values have useful defaults, so getting it working can be
+ * as simple as
+ * </p>
  * <code>
  * <img src ="#" jwcid = "@widgets/RoundedCorner" corner = "SE"/>
  * </code>
  */
-abstract public class RoundedCorner extends BaseComponent {
-
+abstract public class RoundedCorner extends BaseComponent
+{
 
     @InjectObject("engine-service:RoundedCornerService")
     abstract public IEngineService getRoundedCornersService();
 
-
-    public String getCornerImageURL() {
+    public String getCornerImageURL()
+    {
         IEngineService service = getRoundedCornersService();
 
         ILink link = service.getLink(false, getServiceParameters());
@@ -44,7 +45,8 @@
         return link.getURL();
     }
 
-    public Map<String, String> getServiceParameters() {
+    public Map<String, String> getServiceParameters()
+    {
         Map<String, String> ps = new HashMap<String, String>();
         ps.put("h", getHeight());
         ps.put("w", getWidth());

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/pages/Home.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/pages/Home.java?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/pages/Home.java (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/pages/Home.java Tue Jun 17 05:10:23 2008
@@ -1,7 +1,8 @@
 package ${packageName}.pages;
+
 import org.apache.tapestry.html.BasePage;
 import org.apache.tapestry.services.ResponseBuilder;
-import java.util.Date ;
+import java.util.Date;
 
 /**
  * Start page of "${artifactId}".
@@ -9,24 +10,23 @@
 abstract public class Home extends BasePage
 {
 
-    abstract public ResponseBuilder getResponseBuilder()  ;
+    abstract public ResponseBuilder getResponseBuilder();
 
     /**
      * Re-renders (via ajax) the Tapestry node containing the date and time.
      */
-    public void refresh ()
+    public void refresh()
     {
         getResponseBuilder().updateComponent("time");
     }
 
-
     /**
-     * a synthesized property returning the current time.
-     *
-     * @return the current data and time
+     * A synthesized property returning the current time.
+     * 
+     * @return the current date and time
      */
     public Date getCurrentTime()
-	{
-		return new Date();
-	}
-}
\ No newline at end of file
+    {
+        return new Date();
+    }
+}

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/services/RoundedCornerService.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/services/RoundedCornerService.java?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/services/RoundedCornerService.java (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/services/RoundedCornerService.java Tue Jun 17 05:10:23 2008
@@ -1,7 +1,17 @@
 package ${packageName}.services;
 
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.geom.RoundRectangle2D;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
 
-import ${packageName}.util.Utilities;
+import javax.imageio.ImageIO;
 
 import org.apache.tapestry.IRequestCycle;
 import org.apache.tapestry.engine.IEngineService;
@@ -10,26 +20,19 @@
 import org.apache.tapestry.util.ContentType;
 import org.apache.tapestry.web.WebResponse;
 
-import javax.imageio.ImageIO;
-import java.awt.*;
-import java.awt.geom.RoundRectangle2D;
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
+import ${packageName}.util.Utilities;
 
-public class RoundedCornerService implements IEngineService {
+public class RoundedCornerService implements IEngineService
+{
 
-    enum RoundedCorner {
+    enum RoundedCorner
+    {
         NW, NE, SW, SE
     }
 
-
     /**
      * This renders a rounded corner that has the specified size, dimensions, etc.
-     *
+     * 
      * @param bg
      * @param fg
      * @param width
@@ -39,10 +42,9 @@
      * @throws Throwable
      */
 
-    private BufferedImage renderRoundedCorner(
-            String bg, String fg,
-            int width, int height, RoundedCorner corner
-    ) throws Throwable {
+    private BufferedImage renderRoundedCorner(String bg, String fg, int width, int height, RoundedCorner corner)
+        throws Throwable
+    {
 
         width = width * 2;
         height = height * 2;
@@ -51,36 +53,32 @@
 
         BufferedImage img = new BufferedImage(visibleW, visibleH, BufferedImage.TYPE_INT_RGB);
 
-
         Graphics2D g2d = img.createGraphics();
 
-
         int x = 0, y = 0;
-        switch (corner) {
-            case NW:
-                // everythings rendered this wa bey default
-                break;
-            case SW:
-                x = 0;
-                y = (visibleH * 3) * -1;
-                ;
-                break;
-
-
-            case NE:
-                x = (visibleW * 3) * -1;
-                y = 0;//visibleH * -1 ;
-
-                break;
-
-            case SE:
-                x = (visibleW * 3) * -1;
-                y = (visibleH * 3) * -1;
+        switch(corner) {
+        case NW:
+            // everythings rendered this way by default
+            break;
+        case SW:
+            x = 0;
+            y = (visibleH * 3) * -1;
+            ;
+            break;
+
+        case NE:
+            x = (visibleW * 3) * -1;
+            y = 0;// visibleH * -1 ;
+
+            break;
+
+        case SE:
+            x = (visibleW * 3) * -1;
+            y = (visibleH * 3) * -1;
 
-                break;
+            break;
         }
 
-
         RoundRectangle2D rect = new RoundRectangle2D.Float(x, y, width * 2, height * 2, width, height);
 
         Color bgColor = Color.decode(bg);
@@ -94,38 +92,33 @@
         g2d.setColor(fgColor);
         g2d.fill(rect);
 
-
         g2d.dispose();
 
-
         return img;
     }
 
-
     public static String SERVICE_NAME = "RoundedCornerService";
 
-    public void service(IRequestCycle cycle) throws IOException {
+    public void service(IRequestCycle cycle)
+        throws IOException
+    {
 
         // so you hit the service
         // by the time were actually rendering stuff, we will always
         // have a map of <String,String > that translates well.
 
         String corner = cycle.getParameter("corner");
-        String wS = cycle.getParameter("w"),
-                hS = cycle.getParameter("h"),
-                fg = cycle.getParameter("fg"),
-                bg = cycle.getParameter("bg");
+        String wS = cycle.getParameter("w"), hS = cycle.getParameter("h"), fg = cycle.getParameter("fg"), bg = cycle
+                .getParameter("bg");
 
         RoundedCorner crnr = RoundedCorner.valueOf(corner);
 
         int h = Integer.parseInt(hS);
         int w = Integer.parseInt(wS);
 
-
         try {
             OutputStream output = response.getOutputStream(new ContentType("image/jpeg"));
 
-
             BufferedImage rc = renderRoundedCorner(bg, fg, w, h, crnr);
 
             ImageIO.write(rc, "jpeg", output);
@@ -134,21 +127,22 @@
             getUtilities().log(th);
         }
 
-
     }
 
-
-    public Utilities getUtilities() {
+    public Utilities getUtilities()
+    {
         return utilities;
     }
 
-    public void setUtilities(Utilities utilities) {
+    public void setUtilities(Utilities utilities)
+    {
         this.utilities = utilities;
     }
 
     private Utilities utilities;
 
-    public ILink getLink(boolean isPost, Object parameter) {
+    public ILink getLink(boolean isPost, Object parameter)
+    {
         Map<String, Object> params = new HashMap<String, Object>();
         params.put("corner", RoundedCorner.NE.toString());
         params.put("bg", "#FFFFFF");
@@ -162,13 +156,12 @@
 
             Set<String> keys = params.keySet();
 
-            for (String key : keys) {
+            for(String key : keys) {
                 if (p.containsKey(key)) {
 
                     Object value = p.get(key);
 
-                    if (value != null)
-                        params.put(key, value);
+                    if (value != null) params.put(key, value);
 
                 }
             }
@@ -178,27 +171,31 @@
         return linkFactory.constructLink(this, false, params, true);
     }
 
-
     private LinkFactory linkFactory;
     private WebResponse response;
 
-    public LinkFactory getLinkFactory() {
+    public LinkFactory getLinkFactory()
+    {
         return linkFactory;
     }
 
-    public void setLinkFactory(LinkFactory linkFactory) {
+    public void setLinkFactory(LinkFactory linkFactory)
+    {
         this.linkFactory = linkFactory;
     }
 
-    public WebResponse getResponse() {
+    public WebResponse getResponse()
+    {
         return response;
     }
 
-    public void setResponse(WebResponse response) {
+    public void setResponse(WebResponse response)
+    {
         this.response = response;
     }
 
-    public String getName() {
+    public String getName()
+    {
         return SERVICE_NAME;
     }
 

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/util/Utilities.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/util/Utilities.java?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/util/Utilities.java (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/java/util/Utilities.java Tue Jun 17 05:10:23 2008
@@ -3,24 +3,29 @@
 import java.io.Serializable;
 import java.text.MessageFormat;
 
-
 import org.apache.commons.lang.exception.ExceptionUtils;
 
-import java.io.Serializable;
-import java.text.MessageFormat;
-
 /**
+ * <p>
  * Useful object designed to help do things common to application development that might be useful.
- * <p/>
- * In this case: a standard mechanism to log. You might insert other helper methods here. If you can't reuse someone else's code,
- * it's at least worth factoring it out, right?
+ * </p>
+ * <p>
+ * In this case: a standard mechanism to log. You might insert other helper methods here. If you
+ * can't reuse someone else's code, it's at least worth factoring it out, right?
+ * </p>
  */
-public class Utilities implements Serializable {
-    public void log(Throwable th) {
+public class Utilities implements Serializable
+{
+
+    private static final long serialVersionUID = -5064936490372587675L;
+
+    public void log(Throwable th)
+    {
         log(ExceptionUtils.getFullStackTrace(th));
     }
 
-    public void log(String msg, Object... params) {
+    public void log(String msg, Object... params)
+    {
         System.out.println(MessageFormat.format(msg, params));
     }
-}
\ No newline at end of file
+}

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/Home.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/Home.html?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/Home.html (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/Home.html Tue Jun 17 05:10:23 2008
@@ -1,37 +1,25 @@
 <!--
 A simple welcome page.
 -->
-<html jwcid="$content$">
-<body jwcid="@Shell" title="literal:'${artifactId}' Start Page">
+<html jwcid="@Shell" title="literal:'${artifactId}' Start Page">
+<body jwcid="@Body">
 <h1>view Start Page</h1>
 
-<p> This is the start page for this application, a good place to start your modifications.
-    Just to prove this is live: </p>
+<p>This is the start page for this application, a good place to
+start your modifications. Just to prove this is live:</p>
 
-<p>
-    <span jwcid="time@Any">
-        The current time is: <span jwcid="@Insert" value="ognl:currentTime"> 12/22/2002 blah </span>
-    </span>
-</p>
+<p><span jwcid="time@Any"> The current time is: <span
+  jwcid="@Insert" value="ognl:currentTime"> 12/22/2002 blah </span> </span></p>
 
-<p>
-    Here's the Echo component working:
-    <span jwcid="@Echo" value="literal:Hello, world!">  bon-jovi</span>
-</p>
+<p>Here's the Echo component working: <span jwcid="@Echo"
+  value="literal:Hello, world!"> bon-jovi</span></p>
 
-<p>
-    <a jwcid="@PageLink" page="Home">refresh</a> |
+<p><a jwcid="@PageLink" page="Home">refresh</a> | <a
+  jwcid="@DirectLink" async="true" listener="listener:refresh">
+refresh via ajax </a></p>
 
-    <a  jwcid = "@DirectLink" async = "true" listener = "listener:refresh">
-    refresh via ajax
-    </a>
-
-
-</p>
-
-<p> Here's another example of a component which in turn leverages an engine-service:
-    <img src="#" alt="" jwcid="@widgets/RoundedCorner"/>
-</p>
+<p>Here's another example of a component which in turn leverages an
+engine-service: <img src="#" alt="" jwcid="@widgets/RoundedCorner" /></p>
 
 </body>
 </html>

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/Echo.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/Echo.html?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/Echo.html (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/Echo.html Tue Jun 17 05:10:23 2008
@@ -3,8 +3,7 @@
  This is perhaps the most useless component.
 
 -->
-<span jwcid = "$content$">
-
-    <span  style = "font-size:smaller">this message brought to you by @Echo</span> <b> <span jwcid ="@Insert" value  = "ognl:value"> the message </span>  </b>
-
+<span jwcid="$content$">
+  <span style="font-size: smaller">this message is brought to you by @Echo: </span>
+  <b><span jwcid="@Insert" value="ognl:value">the message</span></b>
 </span>
\ No newline at end of file

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/app.application
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/app.application?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/app.application (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/app.application Tue Jun 17 05:10:23 2008
@@ -1,11 +1,11 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE application PUBLIC
-        "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
-        "http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
-
-<application name="app">
-    <meta key="org.apache.tapestry.page-class-packages" value="${packageName}.pages"/>
-    <meta key="org.apache.tapestry.component-class-packages" value="${packageName}.components"/>
-    <library id="contrib" specification-path="classpath:/org/apache/tapestry/contrib/Contrib.library"/>
+<?xml version="1.0"?>
+
+<!DOCTYPE application PUBLIC
+  "-//Apache Software Foundation//Tapestry Specification 4.0//EN" 
+  "http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
+
+<application name="app">
+  <meta key="org.apache.tapestry.page-class-packages" value="${packageName}.pages" />
+  <meta key="org.apache.tapestry.component-class-packages" value="${packageName}.components" />
+  <library id="contrib" specification-path="classpath:/org/apache/tapestry/contrib/Contrib.library" />
 </application>
\ No newline at end of file

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml Tue Jun 17 05:10:23 2008
@@ -3,14 +3,15 @@
 
 <beans>
 
-    <!--
-     this object is a convenience object.
-     You could administer any kind of spring object here and know that it would
-     be properly introduced into your component classes with a simple
-     <code>
-        @InjectObject( "spring:beanName") public abstract BeanClass getBeanName();
-     </code>
-    -->
-    <bean lazy-init="true" id="utilities" class="${packageName}.util.Utilities">
-    </bean>
+  <!--
+    this object is a convenience object.
+    You could administer any kind of spring object here and know that it would
+    be properly introduced into your component classes with a simple
+    <code>
+    @InjectObject("spring:beanName") public abstract BeanClass getBeanName();
+    </code>
+  -->
+  <bean lazy-init="true" id="utilities"
+    class="${packageName}.util.Utilities">
+  </bean>
 </beans>
\ No newline at end of file

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/hivemodule.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/hivemodule.xml?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/hivemodule.xml (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/hivemodule.xml Tue Jun 17 05:10:23 2008
@@ -1,77 +1,86 @@
 <module id="app" version="4.0.0" package="${packageName}">
 
-    <service-point id="globalFactory" interface="${packageName}.application.aso.GlobalFactory">
-        <invoke-factory>
-            <construct class="${packageName}.application.aso.GlobalFactory">
-                <set-object property="utilities" value="spring:utilities"/>
-            </construct>
-        </invoke-factory>
-    </service-point>
-    <!--
+  <!--
     this creates the factory object that in turn creates the Application State Object
-    -->
-    <service-point id="visitFactory" interface="${packageName}.application.aso.VisitFactory">
-        <invoke-factory>
-            <construct class="${packageName}.application.aso.VisitFactory">
-                <set-object property="utilities" value="spring:utilities"/>
-            </construct>
-        </invoke-factory>
-    </service-point>
-
-    <contribution configuration-id="tapestry.asset.UnprotectedAssets">
-        <unprotected-resource contains=".*js"/>
-    </contribution>
-
-    <contribution configuration-id="tapestry.state.ApplicationObjects">
-        <state-object name="global" scope="application">
-            <invoke-factory object="service:globalFactory"/>
-        </state-object>
-        <state-object name="visit" scope="session">
-            <invoke-factory object="service:visitFactory"/>
-        </state-object>
-
-        <!--
-
-        This form works equally well if you don't need to do anything besides
-        run the constructor to get your application state object working. 
+  -->
+  <service-point id="globalFactory"
+    interface="${packageName}.application.aso.GlobalFactory">
+    <invoke-factory>
+      <construct class="${packageName}.application.aso.GlobalFactory">
+        <set-object property="utilities" value="spring:utilities" />
+      </construct>
+    </invoke-factory>
+  </service-point>
+  
+  <!--
+    this creates the factory object that in turn creates the Application State Object
+  -->
+  <service-point id="visitFactory"
+    interface="${packageName}.application.aso.VisitFactory">
+    <invoke-factory>
+      <construct class="${packageName}.application.aso.VisitFactory">
+        <set-object property="utilities" value="spring:utilities" />
+      </construct>
+    </invoke-factory>
+  </service-point>
+
+  <contribution configuration-id="tapestry.asset.UnprotectedAssets">
+    <unprotected-resource contains=".*js" />
+  </contribution>
+
+  <contribution configuration-id="tapestry.state.ApplicationObjects">
+    <state-object name="global" scope="application">
+      <invoke-factory object="service:globalFactory" />
+    </state-object>
+    <state-object name="visit" scope="session">
+      <invoke-factory object="service:visitFactory" />
+    </state-object>
 
-     <contribution configuration-id="tapestry.state.ApplicationObjects">
+    <!--
+      
+      This form works equally well if you don't need to do anything besides
+      run the constructor to get your application state object working. 
+      
+      <contribution configuration-id="tapestry.state.ApplicationObjects">
       <state-object name="visit" scope="session">
-        <create-instance class="org.example.myapp.application.aso.VisitFactory"/>
+      <create-instance class="org.example.myapp.application.aso.VisitFactory"/>
       </state-object>
-    </contribution>
-        -->
-
-
-    </contribution>
+      </contribution>
+    -->
 
-    <contribution configuration-id="tapestry.url.ServiceEncoders">
-        <asset-encoder id="asset" path="/assets"/>
-    </contribution>
 
-    <!--
-      =======================================================
-      SERVICES
-      =======================================================
-      -->
-    <!-- this is a listing to tell tapestry which objects are services
-    -->
-    <contribution configuration-id="tapestry.services.ApplicationServices">
-        <service name="RoundedCornerService" object="service:RoundedCornerService"/>
-    </contribution>
+  </contribution>
 
-    <!-- This configures each one of those services in their own special ways.
-    -->
-    <service-point id="RoundedCornerService" interface="org.apache.tapestry.engine.IEngineService">
-        <invoke-factory>
-            <construct class="${packageName}.services.RoundedCornerService">
-                <set-object property="response" value="infrastructure:response"/>
-                <set-object property="linkFactory" value="infrastructure:linkFactory"/>
-                <set-object property="utilities" value="spring:utilities"/>
-
-            </construct>
-        </invoke-factory>
-    </service-point>
+  <contribution configuration-id="tapestry.url.ServiceEncoders">
+    <asset-encoder id="asset" path="/assets" />
+  </contribution>
+
+  <!--
+    =======================================================
+    SERVICES
+    =======================================================
+  -->
+  <!-- this is a listing to tell tapestry which objects are services
+  -->
+  <contribution
+    configuration-id="tapestry.services.ApplicationServices">
+    <service name="RoundedCornerService"
+      object="service:RoundedCornerService" />
+  </contribution>
+
+  <!-- This configures each one of those services in their own special ways.
+  -->
+  <service-point id="RoundedCornerService"
+    interface="org.apache.tapestry.engine.IEngineService">
+    <invoke-factory>
+      <construct class="${packageName}.services.RoundedCornerService">
+        <set-object property="response" value="infrastructure:response" />
+        <set-object property="linkFactory"
+          value="infrastructure:linkFactory" />
+        <set-object property="utilities" value="spring:utilities" />
+      </construct>
+    </invoke-factory>
+  </service-point>
 
 
 </module>

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml Tue Jun 17 05:10:23 2008
@@ -4,64 +4,66 @@
         "http://java.sun.com/dtd/web-app_2_3.dtd">
 
 <web-app>
-    <display-name>${artifactId} view</display-name>
+  <display-name>${artifactId} view</display-name>
 
-    <context-param>
-        <param-name>contextConfigLocation</param-name>
-        <param-value>
-            /WEB-INF/applicationContext.xml
-        </param-value>
-    </context-param>
-    <filter>
-        <filter-name>redirect</filter-name>
-        <filter-class>org.apache.tapestry.RedirectFilter</filter-class>
-    </filter>
-    <filter-mapping>
-        <filter-name>redirect</filter-name>
-        <url-pattern>/</url-pattern>
-    </filter-mapping>
-    <listener>
-        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
-    </listener>
-    <servlet>
-        <servlet-name>app</servlet-name>
-        <servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
-        <load-on-startup>1</load-on-startup>
-    </servlet>
-    <servlet-mapping>
-        <servlet-name>app</servlet-name>
-        <url-pattern>/app</url-pattern>
-    </servlet-mapping>
-    <servlet-mapping>
-        <servlet-name>app</servlet-name>
-        <url-pattern>*.html</url-pattern>
-    </servlet-mapping>
-    <servlet-mapping>
-        <servlet-name>app</servlet-name>
-        <url-pattern>*.external</url-pattern>
-    </servlet-mapping>
-    <servlet-mapping>
-        <servlet-name>app</servlet-name>
-        <url-pattern>*.direct</url-pattern>
-    </servlet-mapping>
-    <servlet-mapping>
-        <servlet-name>app</servlet-name>
-        <url-pattern>*.sdirect</url-pattern>
-    </servlet-mapping>
-    <servlet-mapping>
-        <servlet-name>app</servlet-name>
-        <url-pattern>/assets/*</url-pattern>
-    </servlet-mapping>
-    <servlet-mapping>
-        <servlet-name>app</servlet-name>
-        <url-pattern>/users/*</url-pattern>
-    </servlet-mapping>
-    <servlet-mapping>
-        <servlet-name>app</servlet-name>
-        <url-pattern>*.svc</url-pattern>
-    </servlet-mapping>
-    <welcome-file-list>
-        <welcome-file>Home.html</welcome-file>
-        <welcome-file>app</welcome-file>
-    </welcome-file-list>
+  <context-param>
+    <param-name>contextConfigLocation</param-name>
+    <param-value>/WEB-INF/applicationContext.xml</param-value>
+  </context-param>
+  <filter>
+    <filter-name>redirect</filter-name>
+    <filter-class>org.apache.tapestry.RedirectFilter</filter-class>
+  </filter>
+  <filter-mapping>
+    <filter-name>redirect</filter-name>
+    <url-pattern>/</url-pattern>
+  </filter-mapping>
+  <listener>
+    <listener-class>
+      org.springframework.web.context.ContextLoaderListener
+    </listener-class>
+  </listener>
+  <servlet>
+    <servlet-name>app</servlet-name>
+    <servlet-class>
+      org.apache.tapestry.ApplicationServlet
+    </servlet-class>
+    <load-on-startup>1</load-on-startup>
+  </servlet>
+  <servlet-mapping>
+    <servlet-name>app</servlet-name>
+    <url-pattern>/app</url-pattern>
+  </servlet-mapping>
+  <servlet-mapping>
+    <servlet-name>app</servlet-name>
+    <url-pattern>*.html</url-pattern>
+  </servlet-mapping>
+  <servlet-mapping>
+    <servlet-name>app</servlet-name>
+    <url-pattern>*.external</url-pattern>
+  </servlet-mapping>
+  <servlet-mapping>
+    <servlet-name>app</servlet-name>
+    <url-pattern>*.direct</url-pattern>
+  </servlet-mapping>
+  <servlet-mapping>
+    <servlet-name>app</servlet-name>
+    <url-pattern>*.sdirect</url-pattern>
+  </servlet-mapping>
+  <servlet-mapping>
+    <servlet-name>app</servlet-name>
+    <url-pattern>/assets/*</url-pattern>
+  </servlet-mapping>
+  <servlet-mapping>
+    <servlet-name>app</servlet-name>
+    <url-pattern>/users/*</url-pattern>
+  </servlet-mapping>
+  <servlet-mapping>
+    <servlet-name>app</servlet-name>
+    <url-pattern>*.svc</url-pattern>
+  </servlet-mapping>
+  <welcome-file-list>
+    <welcome-file>Home.html</welcome-file>
+    <welcome-file>app</welcome-file>
+  </welcome-file-list>
 </web-app>
\ No newline at end of file

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/widgets/RoundedCorner.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/widgets/RoundedCorner.html?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/widgets/RoundedCorner.html (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/widgets/RoundedCorner.html Tue Jun 17 05:10:23 2008
@@ -1,4 +1,3 @@
 <div jwcid="$content$">
-    <img src="ognl:cornerImageURL" jwcid="@Any"/>
-
+  <img jwcid="@Any" src="ognl:cornerImageURL"/>
 </div>  
\ No newline at end of file

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/site/apt/about_resultant_project.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/site/apt/about_resultant_project.apt?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/site/apt/about_resultant_project.apt (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/site/apt/about_resultant_project.apt Tue Jun 17 05:10:23 2008
@@ -1,175 +1,175 @@
- ----
- Using the Tapestry 4.1.2 Archetype
- ----
-
-About the Resultant Project
-
-
-  What you have in front of you is a simple Tapestry application with some simple examples of all the major players in a typical Tapestry application.
-
-* Pages
-
-  A page is the basic unit of work for a tapestry application. Its a screen, not an action. When you design your page, you think in the scope of a screen. Typically a page will encompass just an action, but it doesn't need to. An example: a user login sequence. You hit the page, it shows a login and a password field and a submit button. You hit submit, it performs validation, and returns with a congratulating message and your login information (perhaps it sends an email). Or, it may explain whats wrong with the input. Below the form are links to register or have an email sent to you. Clicking on them merely refreshes the page with a new form in place allowing you to register. Ditto with the forget password form. Naturally, you might do well to factor each one of these scenarios out into a different page, but you dont have to. They can all be in the scope of one page.
-
-  In a working Tapestry application, the main page is the page named <<<Home.html>>>. In the project, all pages are looked for in <<<${groupId}/${artifactId}/pages>>>, so in the project it will be <<<org.example.myapp.pages.Home>>>.
-  All pages have a corresponding html file. The html file is located at the root of the web context. In the project, this corresponds to the webapp folder. Thus, <<<webapp/Home.html>>> corresponds to <<<org.example.mapp.pages.Home>>>. You can correctly infer that a sub-package would be nested one directory in the webapp folder. Thus, <<<org.example.myapp.pages.users.UserHome>>> corresponds to <<<webapp/users/UserHome.html>>>.
-
-  At this point, you've gained over a Struts action or a CGI if only because it's simpler working with objects and listeners than URLs, but there's more.
-
- 
-** For More
-
-  * {{{http://tapestry.apache.org/tapestry4.1/quickstart/helloworld.html}Quick Start (good grounding on the basics) }}
-
-  * {{{http://tapestry.apache.org/tapestry4.1/usersguide/template.html} Information on Tapestry page templates }}
-
-  * {{{http://tapestry.apache.org/tapestry4.1/usersguide/events.html} Tapestry page classes and the events of the lifecycle }}
-  
-
-
-
-* Components
-
-  The real gains come from components. Components are the most fun. Even if you never leverage the framework's infrastructure to build your own components, you can leverage the components that already exist.
-  In the markup of your page, <<<<span jwcid="@Insert" value= "literal:Hello, world!">>>> creates an instance of the Insert component, for example. In our example project, we have a simple component, <<<Echo>>>, defined. The java class for these components is going to be under the ${groupId}/${artifactId}/components folder, or, in this case
-  <<<org.example.mapp.components.Echo>>>. The html for a component is found in the WEB-INF folder. Thus, <<<WEB-INF/Echo.html>>> corresponds to <<<org.example.mapp.components.Echo>>>. 
-
-  Using the resultant component is as simple as inserting the following in the markup of another component or page. The Echo component has one parameter (it's the only accessor on the object, and it's annotated with the <<<...@Parameter>>> annotation. It has an accessor for <<<getValue()>>>, thus, the parameter is simply <<<value>>> in HTML. 
-
-+-----+
-<span jwcid = "@Echo" value= "This is to be echoed!"/>
-+-----+
-
-  Note: were the component defined in a subfolder (<<<webapp/subfolder/Echo.html>>>) and package (<<<org.example.myapp.components.subfolder.Echo>>>), then using it would change slightly to include the subfolder:
-
-+-----+
-<span jwcid = "@subfolder/Echo" value= "This is to be echoed!"/>
-+-----+
- 
-** For More
-
-  * {{{http://tapestry.apache.org/tapestry4.1/usersguide/components.html}The 360 on creating components}}. This is an invaluable resource, however you will want to <<also>> take away that, for a component class extending <<<BaseComponent>>>, you may have a corresponding .html file and that will be rendered instead. You don't  have  to use renderComponent for everything.
-
-
-
-
-* Engine Services
-
-  An engine service is Tapestry's window on a lower level http request/response cycle. You are a few steps above raw Servlets, in that you're working with Tapestry and Tapestry knows how to plug engine services in, whereas it doesn't have any particular connectin with a servlet. An engine service, put another way, is where you'd handle things that are either systemic to a lot of pages/components/the application, or you need to produce something Tapestry itself doesn't produce: a graph, or an image, for example. They are often created in conjunction with a component. For example, in the resultant project there is a component called widgets/RoundedCorner. Using it, you can specify 
-
-+-----+
-  <img src="#" corner = "SE" alt="" jwcid="@widgets/RoundedCorner" width = "12" />
-+-----+
-
-  and it'll in turn produce an image of a rounded corner to your specifications, using Java2D to draw the images dynamically. The component included is lacking  the polish of a feature-complete component (caching of images, for example.), but it demonstrates the fundamentals. The component takes parameters, the parameters are tunneled the to the engine service, and the engine service draws  the response using Java2D and gives the component a URL that it may use to render the resultant image (whcih it in turn uses as the src parameter of an img tag. This cooperation makes engine services your freind.
-
-** For More
-
-  * {{{http://opencomponentry.com:8080/workbench/app}The Tapestry Workbench Application}}:The tapestry workbench features a "Chart" example. The chart example uses jCharts, and is rendered as an image. This is a fine example of the cooperation between Tapestry and the component used for charting, and an engine service. The Tapestry source code (available from SVN, or download) typically has these "examples" included, and you may find the source for the workbench there.
-
-  * It can not be overstated: the Tapestry framework itself relies on engine services for the core components! The DirectLink uses an engine service to coordinate it's magic and invoke listeners and the @Image component uses the asset service to furnish context assets, for example.  
-
-
-
-* Application State Objects (ASO)
-
-  An application state object is useful for storing objects at different scopes broader than a single page or a request of a single page. They correspond to traditional session objects, and servlet context objects. You can get access to an application state object at any time by "injecting" it into your client code (your pages or components). If there already isn't an ASO of the type and scope you want, Tapestry creates it for you. For example, say that you want to log a person in, and then store that authenticated User object in session, in an object designed for keeping track of the currently logged in user. You would access an ASO, set the User object on it, and move on
-
-  In the example project, we have two application state objects, one called <<<Global>>>, and another called <<<Visit>>>. In our application, we've created these two application scope objects, but we also wanted them to have access to beans defined in our Spring context. We plugged in a custom application state factory. Everything is pretty usefully setup, but overridable. Our custom factory is responsible for dressing up the ASO before any client code gets to use it, which is perfect for passing Spring context objects. In this case, we configure the factory to have the beans provided, and we transfer these beans to the ASO inside the factory. The configuration between the two collaborating objects can be seen in <<<src/webapp/WEB-INF/hivemodule.xml>>>:
-
-+-------+
- ...
-<!--
- This creates the factory object that in turn
- creates the Application State Object
--->
-<service-point id="visitFactory" interface="org.example.myapp.application.aso.VisitFactory">
- <invoke-factory>
-  <construct class="org.example.myapp.application.aso.VisitFactory">
-   <set-object property="utilities" value="spring:utilities"/>
-  </construct>
- </invoke-factory>
-</service-point>
- ...
-+-------+
-
-  The element below is the registry of applicaton state objects. You may have as many application state objects as you'd like  defined. If you don't want to have Spring beans injected into the Application State object, then the configuration shown in comments in the configuration file apply.
-
-+-------+
-<contribution configuration-id="tapestry.state.ApplicationObjects">
- ...
- <state-object name="visit"  scope="session">
-  <invoke-factory object = "service:visitFactory"/>
- </state-object>
- ...
-</contribution>
-+-------+
-
-  From there, you  may use the ASO's any time you want in a component or page by telling Tapestry you want a reference to one.  Tapestry takes care of the rest. 
-
-+-------+
-      @InjectState("visit")  
-      public abstract Visit getVisit() ;
-
-      public void authenticate (IRequestCycle cycle )
-      { 
-	User usr=getVisit().getUser();
-	if( usr!=null  && usr.isAdministrator())
-	{ 
-	 // then do something meaningful  
-	}
-      }
-   
-+-------+
-
-  It's important to remember that Tapestry will create the object if it doesn't already exist, which sometimes means that a session will be created, even if you didn't intend for it be. Tapestry provides a meaningful way of determining whether the object exists without actually accessing (and thus triggering its creation) the ASO: the @InjectStateFlag annotation. The above may be rewritten more efficiently as:
-     
-+-------+
-      @InjectStateFlag( "visit") 
-      abstract public boolean isVisitCreated() ;
-
-      @InjectState( "visit")  
-      public abstract Visit getVisit() ;
-      
-      
-      public void authenticate (IRequestCycle cycle )
-      { 
-           if(isVisitCreated() )// that is to say, theres already an 
-				// object in place, so you don't have to worry 
-	   {	
-		User usr=getVisit().getUser();
-		if( usr!=null  && usr.isAdministrator())
-		{ 
-			// then do something meaningful  
-		}
-           }
-            
-      }
-+-------+
-
- 
-** For More
-
-  * {{{http://tapestry.apache.org/tapestry4.1/usersguide/state.html}The Tapestry User Guide regarding application state}}: all sorts of information is presented here. Skip to the  section discussing "Application State Objects"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ ----
+ Using the Tapestry 4.1.6 Archetype
+ ----
+
+About the Resultant Project
+
+
+  What you have in front of you is a simple Tapestry application with some simple examples of all the major players in a typical Tapestry application.
+
+* Pages
+
+  A page is the basic unit of work for a tapestry application. Its a screen, not an action. When you design your page, you think in the scope of a screen. Typically a page will encompass just an action, but it doesn't need to. An example: a user login sequence. You hit the page, it shows a login and a password field and a submit button. You hit submit, it performs validation, and returns with a congratulating message and your login information (perhaps it sends an email). Or, it may explain whats wrong with the input. Below the form are links to register or have an email sent to you. Clicking on them merely refreshes the page with a new form in place allowing you to register. Ditto with the forget password form. Naturally, you might do well to factor each one of these scenarios out into a different page, but you dont have to. They can all be in the scope of one page.
+
+  In a working Tapestry application, the main page is the page named <<<Home.html>>>. In the project, all pages are looked for in <<<${groupId}/${artifactId}/pages>>>, so in the project it will be <<<org.example.myapp.pages.Home>>>.
+  All pages have a corresponding html file. The html file is located at the root of the web context. In the project, this corresponds to the webapp folder. Thus, <<<webapp/Home.html>>> corresponds to <<<org.example.mapp.pages.Home>>>. You can correctly infer that a sub-package would be nested one directory in the webapp folder. Thus, <<<org.example.myapp.pages.users.UserHome>>> corresponds to <<<webapp/users/UserHome.html>>>.
+
+  At this point, you've gained over a Struts action or a CGI if only because it's simpler working with objects and listeners than URLs, but there's more.
+
+ 
+** For More
+
+  * {{{http://tapestry.apache.org/tapestry4.1/quickstart/helloworld.html}Quick Start (good grounding on the basics) }}
+
+  * {{{http://tapestry.apache.org/tapestry4.1/usersguide/template.html} Information on Tapestry page templates }}
+
+  * {{{http://tapestry.apache.org/tapestry4.1/usersguide/events.html} Tapestry page classes and the events of the lifecycle }}
+  
+
+
+
+* Components
+
+  The real gains come from components. Components are the most fun. Even if you never leverage the framework's infrastructure to build your own components, you can leverage the components that already exist.
+  In the markup of your page, <<<<span jwcid="@Insert" value= "literal:Hello, world!">>>> creates an instance of the Insert component, for example. In our example project, we have a simple component, <<<Echo>>>, defined. The java class for these components is going to be under the ${groupId}/${artifactId}/components folder, or, in this case
+  <<<org.example.mapp.components.Echo>>>. The html for a component is found in the WEB-INF folder. Thus, <<<WEB-INF/Echo.html>>> corresponds to <<<org.example.mapp.components.Echo>>>. 
+
+  Using the resultant component is as simple as inserting the following in the markup of another component or page. The Echo component has one parameter (it's the only accessor on the object, and it's annotated with the <<<...@Parameter>>> annotation. It has an accessor for <<<getValue()>>>, thus, the parameter is simply <<<value>>> in HTML. 
+
++-----+
+<span jwcid = "@Echo" value= "This is to be echoed!"/>
++-----+
+
+  Note: were the component defined in a subfolder (<<<webapp/subfolder/Echo.html>>>) and package (<<<org.example.myapp.components.subfolder.Echo>>>), then using it would change slightly to include the subfolder:
+
++-----+
+<span jwcid = "@subfolder/Echo" value= "This is to be echoed!"/>
++-----+
+ 
+** For More
+
+  * {{{http://tapestry.apache.org/tapestry4.1/usersguide/components.html}The 360 on creating components}}. This is an invaluable resource, however you will want to <<also>> take away that, for a component class extending <<<BaseComponent>>>, you may have a corresponding .html file and that will be rendered instead. You don't  have  to use renderComponent for everything.
+
+
+
+
+* Engine Services
+
+  An engine service is Tapestry's window on a lower level http request/response cycle. You are a few steps above raw Servlets, in that you're working with Tapestry and Tapestry knows how to plug engine services in, whereas it doesn't have any particular connectin with a servlet. An engine service, put another way, is where you'd handle things that are either systemic to a lot of pages/components/the application, or you need to produce something Tapestry itself doesn't produce: a graph, or an image, for example. They are often created in conjunction with a component. For example, in the resultant project there is a component called widgets/RoundedCorner. Using it, you can specify 
+
++-----+
+  <img src="#" corner = "SE" alt="" jwcid="@widgets/RoundedCorner" width = "12" />
++-----+
+
+  and it'll in turn produce an image of a rounded corner to your specifications, using Java2D to draw the images dynamically. The component included is lacking  the polish of a feature-complete component (caching of images, for example.), but it demonstrates the fundamentals. The component takes parameters, the parameters are tunneled the to the engine service, and the engine service draws  the response using Java2D and gives the component a URL that it may use to render the resultant image (whcih it in turn uses as the src parameter of an img tag. This cooperation makes engine services your freind.
+
+** For More
+
+  * {{{http://opencomponentry.com:8080/workbench/app}The Tapestry Workbench Application}}:The tapestry workbench features a "Chart" example. The chart example uses jCharts, and is rendered as an image. This is a fine example of the cooperation between Tapestry and the component used for charting, and an engine service. The Tapestry source code (available from SVN, or download) typically has these "examples" included, and you may find the source for the workbench there.
+
+  * It can not be overstated: the Tapestry framework itself relies on engine services for the core components! The DirectLink uses an engine service to coordinate it's magic and invoke listeners and the @Image component uses the asset service to furnish context assets, for example.  
+
+
+
+* Application State Objects (ASO)
+
+  An application state object is useful for storing objects at different scopes broader than a single page or a request of a single page. They correspond to traditional session objects, and servlet context objects. You can get access to an application state object at any time by "injecting" it into your client code (your pages or components). If there already isn't an ASO of the type and scope you want, Tapestry creates it for you. For example, say that you want to log a person in, and then store that authenticated User object in session, in an object designed for keeping track of the currently logged in user. You would access an ASO, set the User object on it, and move on
+
+  In the example project, we have two application state objects, one called <<<Global>>>, and another called <<<Visit>>>. In our application, we've created these two application scope objects, but we also wanted them to have access to beans defined in our Spring context. We plugged in a custom application state factory. Everything is pretty usefully setup, but overridable. Our custom factory is responsible for dressing up the ASO before any client code gets to use it, which is perfect for passing Spring context objects. In this case, we configure the factory to have the beans provided, and we transfer these beans to the ASO inside the factory. The configuration between the two collaborating objects can be seen in <<<src/webapp/WEB-INF/hivemodule.xml>>>:
+
++-------+
+ ...
+<!--
+ This creates the factory object that in turn
+ creates the Application State Object
+-->
+<service-point id="visitFactory" interface="org.example.myapp.application.aso.VisitFactory">
+ <invoke-factory>
+  <construct class="org.example.myapp.application.aso.VisitFactory">
+   <set-object property="utilities" value="spring:utilities"/>
+  </construct>
+ </invoke-factory>
+</service-point>
+ ...
++-------+
+
+  The element below is the registry of applicaton state objects. You may have as many application state objects as you'd like  defined. If you don't want to have Spring beans injected into the Application State object, then the configuration shown in comments in the configuration file apply.
+
++-------+
+<contribution configuration-id="tapestry.state.ApplicationObjects">
+ ...
+ <state-object name="visit"  scope="session">
+  <invoke-factory object = "service:visitFactory"/>
+ </state-object>
+ ...
+</contribution>
++-------+
+
+  From there, you  may use the ASO's any time you want in a component or page by telling Tapestry you want a reference to one.  Tapestry takes care of the rest. 
+
++-------+
+      @InjectState("visit")  
+      public abstract Visit getVisit() ;
+
+      public void authenticate (IRequestCycle cycle )
+      { 
+	User usr=getVisit().getUser();
+	if( usr!=null  && usr.isAdministrator())
+	{ 
+	 // then do something meaningful  
+	}
+      }
+   
++-------+
+
+  It's important to remember that Tapestry will create the object if it doesn't already exist, which sometimes means that a session will be created, even if you didn't intend for it be. Tapestry provides a meaningful way of determining whether the object exists without actually accessing (and thus triggering its creation) the ASO: the @InjectStateFlag annotation. The above may be rewritten more efficiently as:
+     
++-------+
+      @InjectStateFlag( "visit") 
+      abstract public boolean isVisitCreated() ;
+
+      @InjectState( "visit")  
+      public abstract Visit getVisit() ;
+      
+      
+      public void authenticate (IRequestCycle cycle )
+      { 
+           if(isVisitCreated() )// that is to say, theres already an 
+				// object in place, so you don't have to worry 
+	   {	
+		User usr=getVisit().getUser();
+		if( usr!=null  && usr.isAdministrator())
+		{ 
+			// then do something meaningful  
+		}
+           }
+            
+      }
++-------+
+
+ 
+** For More
+
+  * {{{http://tapestry.apache.org/tapestry4.1/usersguide/state.html}The Tapestry User Guide regarding application state}}: all sorts of information is presented here. Skip to the  section discussing "Application State Objects"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/site/apt/index.apt?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/site/apt/index.apt (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/site/apt/index.apt Tue Jun 17 05:10:23 2008
@@ -1,40 +1,40 @@
- ----
- Using the Tapestry 4.x Archetype
- ----
-
-Tapestry Archetype (For Tapestry 4)
-
-  An {{{http://maven.apache.org/plugins/maven-archetype-plugin/index.html}archetype}} is a Maven 2 form of a project template. You can create an empty shell of your project quickly.
-
-  What you should know: the latest and greatest Tapestry 5 is just around the corner. There's an excellent archetype for getting up and running with it
-  {{{http://tapestry.apache.org/tapestry5/tapestry-simple/}here}}. This archetype is inspired by that one.
-
-  This archetype creates a very simple application using Tapestry (the Dojo-enabled Tapestry versions.)
-
-  If you don't have Maven, you can get it {{{http://maven.apache.org}here}}. Install it and then invoke:
-  
-+---+
-mvn archetype:create -DarchetypeGroupId=org.apache.tapestry \
--DarchetypeArtifactId=tapestry-archetype \
--DarchetypeVersion=4.1.2-SNAPSHOT -DgroupId=org.example -DartifactId=myapp
-+---+
-
-  First, you must decide on your group id, artifact id, and version number. For example, let's choose <<org.example>> for our group id,
-  <<myapp>> for the artifactId, and <<1.0.0-SNAPSHOT>> for the version number.  We also need a root package name, which we'll create by combining the group id
-  and the artifact id.
-
-  <Again, the first time you do this, you'll see a large number of download messages.>
-
-  This should yeild a project in the directory in which you invoked the command that has all the fixings for experimenting with Tapestry. 
-
-  You may run the application by issuing <<<mvn jetty6:run>>>. Jetty will monitor your project directory and periodically reload the files (every 10 seconds, in this case).
-  We've also configured Tapestry to automatically reload the templates (typically, it caches the files. This setting won't affect the final .war you build, but is great for
-  development). Thus, you can modify any .script/.page/.jwc/.html file and expect an instantaneous result. If you modify and recompile a java class file, Jetty will reload
-  the context for you and you'll be up and running within 10 seconds.
-
-  You can now see your running application as {{{http://localhost:8080/myapp}http://localhost:8080/myapp}}.
-
-  You can hit Control-C to stop Jetty.
-
-  Maven also comes pre-packaged with plugins for getting up and running with your favorite IDE. Off the top of my head, I know that <<<mvn idea:idea>>> and
-  <<<mvn eclipse:eclipse>>> will do the <right thing> for you. You can open the project with your favorite editor, make your change and then reload!
+ ----
+ Using the Tapestry 4.1 Archetype
+ ----
+
+Tapestry Archetype (For Tapestry 4.1)
+
+  An {{{http://maven.apache.org/plugins/maven-archetype-plugin/index.html}archetype}} is a Maven 2 form of a project template. You can create an empty shell of your project quickly.
+
+  What you should know: the latest and greatest Tapestry 5 is just around the corner. There's an excellent archetype for getting up and running with it
+  {{{http://tapestry.apache.org/tapestry5/tapestry-simple/}here}}. This archetype is inspired by that one.
+
+  This archetype creates a very simple application using Tapestry 4.1 (the Dojo-enabled Tapestry versions.)
+
+  If you don't have Maven, you can get it {{{http://maven.apache.org}here}}. Install it and then invoke:
+  
++---+
+mvn archetype:create -DarchetypeGroupId=org.apache.tapestry \
+-DarchetypeArtifactId=tapestry-archetype \
+-DarchetypeVersion=4.1.6-SNAPSHOT -DgroupId=org.example -DartifactId=myapp
++---+
+
+  First, you must decide on your group id, artifact id, and version number. For example, let's choose <<org.example>> for our group id,
+  <<myapp>> for the artifactId, and <<1.0.0-SNAPSHOT>> for the version number.  We also need a root package name, which we'll create by combining the group id
+  and the artifact id.
+
+  <Again, the first time you do this, you'll see a large number of download messages.>
+
+  This should yeild a project in the directory in which you invoked the command that has all the fixings for experimenting with Tapestry. 
+
+  You may run the application by issuing <<<mvn jetty:run>>>. Jetty will monitor your project directory and periodically reload the files (every 10 seconds, in this case).
+  We've also configured Tapestry to automatically reload the templates (typically, it caches the files. This setting won't affect the final .war you build, but is great for
+  development). Thus, you can modify any .script/.page/.jwc/.html file and expect an instantaneous result. If you modify and recompile a java class file, Jetty will reload
+  the context for you and you'll be up and running within 10 seconds.
+
+  You can now see your running application at {{{http://localhost:8080/myapp}http://localhost:8080/myapp}}.
+
+  You can hit Control-C to stop Jetty.
+
+  Maven also comes pre-packaged with plugins for getting up and running with your favorite IDE. Off the top of my head, I know that <<<mvn idea:idea>>> and
+  <<<mvn eclipse:eclipse>>> will do the <right thing> for you. You can open the project with your favorite editor, make your change and then reload!

Modified: tapestry/tapestry4/trunk/tapestry-archetype/src/site/site.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-archetype/src/site/site.xml?rev=668627&r1=668626&r2=668627&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-archetype/src/site/site.xml (original)
+++ tapestry/tapestry4/trunk/tapestry-archetype/src/site/site.xml Tue Jun 17 05:10:23 2008
@@ -14,24 +14,21 @@
         <groupId>org.apache.tapestry</groupId>
         <artifactId>maven-skin</artifactId>
         <version>1.0-SNAPSHOT</version>
-    </skin>-->
+        </skin>-->
 
-    <publishDate format="dd MMM yyyy"/>
+    <publishDate format="dd MMM yyyy" />
 
     <body>
         <links>
-            <item name="Tapestry" href="http://tapestry.apache.org"/>
-            <item name="Apache" href="http://www.apache.org/"/>
+            <item name="Tapestry" href="http://tapestry.apache.org" />
+            <item name="Apache" href="http://www.apache.org/" />
         </links>
-
         <menu name="Usage">
-            
-            <item name="Introduction" href="index.html"/>
-            <item name="Why Use This Archetype" href="why.html"/>
-           <item name="About The Resultant Project" href="about_resultant_project.html"/>
-
+            <item name="Introduction" href="index.html" />
+            <item name="Why Use This Archetype" href="why.html" />
+            <item name="About The Resultant Project"
+                href="about_resultant_project.html" />
         </menu>
-        
         ${reports}
     </body>
 </project>