tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r732188 - in /tapestry/tapestry5/trunk: ./ tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ tapestry-core/src/main/java/org/apache/tapestry5/services/ tapestry-webflow/ tapestry-webflow/src/main/java/org/ tapestry-webflow...
Date Wed, 07 Jan 2009 00:44:01 GMT
Author: hlship
Date: Tue Jan  6 16:43:59 2009
New Revision: 732188

URL: http://svn.apache.org/viewvc?rev=732188&view=rev
Log:
TAP5-59: Tracking issue for Tapestry/Spring Web Flow integration

Added:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentInstanceProcessor.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/ExternalContextSource.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/ExternalContextSourceImpl.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/FlowExecutionResultProcessor.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/FlowManagerImpl.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalFlowManager.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalFlowManagerImpl.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalViewFactoryCreator.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalViewFactoryCreatorImpl.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/PageViewWrapper.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/TapestryFlowURLHandler.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/WebflowDispatcher.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/TapestryViewFactoryCreator.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/WebflowConstants.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/services/
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/services/FlowManager.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/services/WebFlowModule.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/conf/
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/conf/webdefault.xml
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/RunWebFlow.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/data/
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/data/TargetType.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/pages/
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/pages/Index.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/pages/SetLaunchCoordinates.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/services/
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/services/AppModule.java
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/resources/
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/resources/log4j.properties
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/Index.tml
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/SetLaunchCoordinates.tml
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/WEB-INF/
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/WEB-INF/applicationContext.xml
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/WEB-INF/flows/
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/WEB-INF/flows/MissileLaunch.xml
    tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/WEB-INF/web.xml
Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentEventRequestHandlerImpl.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentInstanceResultProcessor.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageRenderRequestHandlerImpl.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
    tapestry/tapestry5/trunk/tapestry-project.ipr
    tapestry/tapestry5/trunk/tapestry-webflow/pom.xml

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentEventRequestHandlerImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentEventRequestHandlerImpl.java?rev=732188&r1=732187&r2=732188&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentEventRequestHandlerImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentEventRequestHandlerImpl.java Tue Jan  6 16:43:59 2009
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2009 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
 import org.apache.tapestry5.EventConstants;
 import org.apache.tapestry5.internal.structure.ComponentPageElement;
 import org.apache.tapestry5.internal.structure.Page;
+import org.apache.tapestry5.ioc.annotations.Primary;
 import org.apache.tapestry5.ioc.internal.util.TapestryException;
 import org.apache.tapestry5.services.*;
 
@@ -34,9 +35,15 @@
 
     private final Environment environment;
 
-    public ComponentEventRequestHandlerImpl(@Traditional ComponentEventResultProcessor resultProcessor,
-                                            RequestPageCache cache, Response response,
-                                            ActionRenderResponseGenerator generator, Environment environment)
+    public ComponentEventRequestHandlerImpl(
+            @Traditional @Primary
+            ComponentEventResultProcessor resultProcessor,
+
+            RequestPageCache cache, Response response,
+
+            ActionRenderResponseGenerator generator,
+
+            Environment environment)
     {
         this.resultProcessor = resultProcessor;
         this.cache = cache;

Added: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentInstanceProcessor.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentInstanceProcessor.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentInstanceProcessor.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentInstanceProcessor.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,28 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.internal.services;
+
+import java.lang.annotation.*;
+
+/**
+ * Marker for {@link org.apache.tapestry5.services.ComponentEventResultProcessor} to identify the particular
+ * implementation used for handling {@link org.apache.tapestry5.runtime.Component} instances (i.e., pages).
+ */
+@Target({ElementType.PARAMETER, ElementType.FIELD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface ComponentInstanceProcessor
+{
+}

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentInstanceResultProcessor.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentInstanceResultProcessor.java?rev=732188&r1=732187&r2=732188&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentInstanceResultProcessor.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentInstanceResultProcessor.java Tue Jan  6 16:43:59 2009
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2009 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -16,12 +16,15 @@
 
 import org.apache.tapestry5.ComponentResources;
 import org.apache.tapestry5.internal.structure.Page;
+import org.apache.tapestry5.ioc.annotations.Marker;
 import org.apache.tapestry5.runtime.Component;
 import org.apache.tapestry5.services.ComponentEventResultProcessor;
+import org.apache.tapestry5.services.Traditional;
 import org.slf4j.Logger;
 
 import java.io.IOException;
 
+@Marker({Traditional.class, ComponentInstanceProcessor.class})
 public class ComponentInstanceResultProcessor implements ComponentEventResultProcessor<Component>
 {
     private final RequestPageCache requestPageCache;

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageRenderRequestHandlerImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageRenderRequestHandlerImpl.java?rev=732188&r1=732187&r2=732188&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageRenderRequestHandlerImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageRenderRequestHandlerImpl.java Tue Jan  6 16:43:59 2009
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2009 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
 
 import org.apache.tapestry5.EventConstants;
 import org.apache.tapestry5.internal.structure.Page;
+import org.apache.tapestry5.ioc.annotations.Primary;
 import org.apache.tapestry5.services.ComponentEventResultProcessor;
 import org.apache.tapestry5.services.PageRenderRequestHandler;
 import org.apache.tapestry5.services.PageRenderRequestParameters;
@@ -24,7 +25,9 @@
 import java.io.IOException;
 
 /**
- * Handles a PageLink as specified by a PageLinkPathSource by activating and then rendering the page.
+ * Handles a page render request by activating and then rendering the page.
+ *
+ * @see org.apache.tapestry5.internal.services.PageRenderDispatcher
  */
 public class PageRenderRequestHandlerImpl implements PageRenderRequestHandler
 {
@@ -35,7 +38,8 @@
     private final PageResponseRenderer pageResponseRenderer;
 
     public PageRenderRequestHandlerImpl(RequestPageCache cache,
-                                        @Traditional ComponentEventResultProcessor resultProcessor,
+                                        @Traditional @Primary
+                                        ComponentEventResultProcessor resultProcessor,
                                         PageResponseRenderer pageResponseRenderer)
     {
         this.cache = cache;

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java?rev=732188&r1=732187&r2=732188&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java Tue Jan  6 16:43:59 2009
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2009 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -1168,6 +1168,14 @@
     }
 
     /**
+     * @since 5.1.0.0
+     */
+    public HttpServletResponse buildHttpServletResponse()
+    {
+        return shadowBuilder.build(requestGlobals, "HTTPServletResponse", HttpServletResponse.class);
+    }
+
+    /**
      * Builds a shadow of the RequestGlobals.response property. Note again that the shadow can be an ordinary singleton,
      * even though RequestGlobals is perthread.
      */
@@ -1304,7 +1312,7 @@
      * external URL</dd> </dl>
      */
     public void contributeComponentEventResultProcessor(
-            @InjectService("ComponentInstanceResultProcessor")
+            @Traditional @ComponentInstanceProcessor
             ComponentEventResultProcessor componentInstanceProcessor,
 
             MappedConfiguration<Class, ComponentEventResultProcessor> configuration)

Modified: tapestry/tapestry5/trunk/tapestry-project.ipr
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-project.ipr?rev=732188&r1=732187&r2=732188&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-project.ipr (original)
+++ tapestry/tapestry5/trunk/tapestry-project.ipr Tue Jan  6 16:43:59 2009
@@ -146,6 +146,11 @@
           <module name="tapestry-test" />
           <module name="tapestry-upload" />
           <module name="tutorial1" />
+          <module name="tapestry-webflow">
+            <files>
+              <file url="file://$PROJECT_DIR$/tapestry-webflow/src/test/webapp/WEB-INF/web.xml" />
+            </files>
+          </module>
         </modules>
       </facet-type>
       <facet-type id="jpa" />
@@ -2013,6 +2018,28 @@
         <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-context-support/2.5.6/spring-context-support-2.5.6-sources.jar!/" />
       </SOURCES>
     </library>
+    <library name="Maven: org.jboss.el:com.springsource.org.jboss.el:2.0.0.GA">
+      <CLASSES>
+        <root url="jar://$MAVEN_REPOSITORY$/org/jboss/el/com.springsource.org.jboss.el/2.0.0.GA/com.springsource.org.jboss.el-2.0.0.GA.jar!/" />
+      </CLASSES>
+      <JAVADOC>
+        <root url="jar://$MAVEN_REPOSITORY$/org/jboss/el/com.springsource.org.jboss.el/2.0.0.GA/com.springsource.org.jboss.el-2.0.0.GA-javadoc.jar!/" />
+      </JAVADOC>
+      <SOURCES>
+        <root url="jar://$MAVEN_REPOSITORY$/org/jboss/el/com.springsource.org.jboss.el/2.0.0.GA/com.springsource.org.jboss.el-2.0.0.GA-sources.jar!/" />
+      </SOURCES>
+    </library>
+    <library name="Maven: javax.el:el-api:1.0">
+      <CLASSES>
+        <root url="jar://$MAVEN_REPOSITORY$/javax/el/el-api/1.0/el-api-1.0.jar!/" />
+      </CLASSES>
+      <JAVADOC>
+        <root url="jar://$MAVEN_REPOSITORY$/javax/el/el-api/1.0/el-api-1.0-javadoc.jar!/" />
+      </JAVADOC>
+      <SOURCES>
+        <root url="jar://$MAVEN_REPOSITORY$/javax/el/el-api/1.0/el-api-1.0-sources.jar!/" />
+      </SOURCES>
+    </library>
   </component>
   <UsedPathMacros>
     <macro name="MAVEN_REPOSITORY" />

Modified: tapestry/tapestry5/trunk/tapestry-webflow/pom.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/pom.xml?rev=732188&r1=732187&r2=732188&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/pom.xml (original)
+++ tapestry/tapestry5/trunk/tapestry-webflow/pom.xml Tue Jan  6 16:43:59 2009
@@ -55,6 +55,20 @@
             <version>${web-flow-version}</version>
         </dependency>
 
+        <dependency>
+            <groupId>javax.el</groupId>
+            <artifactId>el-api</artifactId>
+            <version>1.0</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.jboss.el</groupId>
+            <artifactId>com.springsource.org.jboss.el</artifactId>
+            <version>2.0.0.GA</version>
+            <scope>test</scope>
+        </dependency>
+
     </dependencies>
     <build>
         <plugins>
@@ -92,7 +106,7 @@
                     <archive>
                         <manifestEntries>
                             <Tapestry-Module-Classes>
-                                org.apache.tapestry5.internal.webflow.WebFlowModule
+                                org.apache.tapestry5.webflow.services.WebFlowModule
                             </Tapestry-Module-Classes>
                         </manifestEntries>
                     </archive>
@@ -122,6 +136,14 @@
         </plugins>
     </reporting>
 
+    <repositories>
+        <repository>
+            <id>com.springsource.repository.bundles.external</id>
+            <name>SpringSource Enterprise Bundle Repository - External Releases</name>
+            <url>http://repository.springsource.com/maven/bundles/external</url>
+        </repository>
+    </repositories>
+
     <properties>
         <web-flow-version>2.0.5.RELEASE</web-flow-version>
     </properties>

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/ExternalContextSource.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/ExternalContextSource.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/ExternalContextSource.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/ExternalContextSource.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,22 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.internal.webflow.services;
+
+import org.springframework.webflow.context.ExternalContext;
+
+public interface ExternalContextSource
+{
+    ExternalContext create();
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/ExternalContextSourceImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/ExternalContextSourceImpl.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/ExternalContextSourceImpl.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/ExternalContextSourceImpl.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,48 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.internal.webflow.services;
+
+import org.apache.tapestry5.services.ApplicationGlobals;
+import org.springframework.webflow.context.ExternalContext;
+import org.springframework.webflow.context.servlet.FlowUrlHandler;
+import org.springframework.webflow.context.servlet.ServletExternalContext;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class ExternalContextSourceImpl implements ExternalContextSource
+{
+    private final HttpServletRequest request;
+
+    private final HttpServletResponse response;
+
+    private final ApplicationGlobals applicationGlobals;
+
+    private final FlowUrlHandler flowUrlHandler;
+
+    public ExternalContextSourceImpl(HttpServletRequest request, HttpServletResponse response,
+                                     ApplicationGlobals applicationGlobals, FlowUrlHandler flowUrlHandler)
+    {
+        this.request = request;
+        this.response = response;
+        this.applicationGlobals = applicationGlobals;
+        this.flowUrlHandler = flowUrlHandler;
+    }
+
+    public ExternalContext create()
+    {
+        return new ServletExternalContext(applicationGlobals.getServletContext(), request, response, flowUrlHandler);
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/FlowExecutionResultProcessor.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/FlowExecutionResultProcessor.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/FlowExecutionResultProcessor.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/FlowExecutionResultProcessor.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,46 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.internal.webflow.services;
+
+import org.apache.tapestry5.services.ComponentEventResultProcessor;
+import org.apache.tapestry5.services.Response;
+import org.springframework.webflow.context.servlet.FlowUrlHandler;
+import org.springframework.webflow.executor.FlowExecutionResult;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+
+public class FlowExecutionResultProcessor implements ComponentEventResultProcessor<FlowExecutionResult>
+{
+    private final HttpServletRequest request;
+
+    private final Response response;
+
+    private final FlowUrlHandler urlHandler;
+
+    public FlowExecutionResultProcessor(HttpServletRequest request, Response response, FlowUrlHandler urlHandler)
+    {
+        this.request = request;
+        this.response = response;
+        this.urlHandler = urlHandler;
+    }
+
+    public void processResultValue(FlowExecutionResult result) throws IOException
+    {
+        String url = urlHandler.createFlowExecutionUrl(result.getFlowId(), result.getPausedKey(), request);
+
+        response.sendRedirect(response.encodeRedirectURL(url));
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/FlowManagerImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/FlowManagerImpl.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/FlowManagerImpl.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/FlowManagerImpl.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,36 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.internal.webflow.services;
+
+import org.apache.tapestry5.webflow.services.FlowManager;
+import org.springframework.webflow.executor.FlowExecutor;
+
+public class FlowManagerImpl implements FlowManager
+{
+    private final FlowExecutor flowExecutor;
+
+    private final ExternalContextSource contextSource;
+
+    public FlowManagerImpl(FlowExecutor flowExecutor, ExternalContextSource contextSource)
+    {
+        this.flowExecutor = flowExecutor;
+        this.contextSource = contextSource;
+    }
+
+    public Object initiateFlow(String flowId)
+    {
+        return flowExecutor.launchExecution(flowId, null, contextSource.create());
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalFlowManager.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalFlowManager.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalFlowManager.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalFlowManager.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,22 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.internal.webflow.services;
+
+import java.io.IOException;
+
+public interface InternalFlowManager
+{
+    void continueFlow() throws IOException;
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalFlowManagerImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalFlowManagerImpl.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalFlowManagerImpl.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalFlowManagerImpl.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,75 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.internal.webflow.services;
+
+import org.apache.tapestry5.ioc.annotations.Primary;
+import org.apache.tapestry5.services.ComponentEventResultProcessor;
+import org.apache.tapestry5.services.Response;
+import org.apache.tapestry5.services.Traditional;
+import org.springframework.webflow.context.servlet.FlowUrlHandler;
+import org.springframework.webflow.executor.FlowExecutionResult;
+import org.springframework.webflow.executor.FlowExecutor;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+
+public class InternalFlowManagerImpl implements InternalFlowManager
+{
+    private final FlowExecutor flowExecutor;
+
+    private final ExternalContextSource contextSource;
+
+    private final FlowUrlHandler urlHandler;
+
+    private final HttpServletRequest request;
+
+    private final ComponentEventResultProcessor resultProcessor;
+
+    private final Response response;
+
+    public InternalFlowManagerImpl(FlowExecutor flowExecutor,
+
+                                   ExternalContextSource contextSource,
+
+                                   FlowUrlHandler urlHandler,
+
+                                   HttpServletRequest request,
+
+                                   @Traditional @Primary
+                                   ComponentEventResultProcessor resultProcessor,
+
+                                   Response response)
+    {
+        this.flowExecutor = flowExecutor;
+        this.contextSource = contextSource;
+        this.urlHandler = urlHandler;
+        this.request = request;
+        this.resultProcessor = resultProcessor;
+        this.response = response;
+    }
+
+    public void continueFlow() throws IOException
+    {
+        String executionKey = urlHandler.getFlowExecutionKey(request);
+
+        FlowExecutionResult result = flowExecutor.resumeExecution(executionKey, contextSource.create());
+
+        // Typically, the response will be committed (a redirect to a render request) by now,
+        // but just in case.
+
+        if (!response.isCommitted())
+            resultProcessor.processResultValue(result);
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalViewFactoryCreator.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalViewFactoryCreator.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalViewFactoryCreator.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalViewFactoryCreator.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,23 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.internal.webflow.services;
+
+import org.springframework.binding.expression.Expression;
+import org.springframework.webflow.execution.ViewFactory;
+
+public interface InternalViewFactoryCreator
+{
+    ViewFactory createViewFactory(Expression viewId);
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalViewFactoryCreatorImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalViewFactoryCreatorImpl.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalViewFactoryCreatorImpl.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/InternalViewFactoryCreatorImpl.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,57 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.internal.webflow.services;
+
+import org.apache.tapestry5.internal.services.ComponentInstanceProcessor;
+import org.apache.tapestry5.runtime.Component;
+import org.apache.tapestry5.services.ComponentEventResultProcessor;
+import org.apache.tapestry5.services.ComponentSource;
+import org.apache.tapestry5.services.Traditional;
+import org.springframework.binding.expression.Expression;
+import org.springframework.webflow.execution.RequestContext;
+import org.springframework.webflow.execution.View;
+import org.springframework.webflow.execution.ViewFactory;
+
+public class InternalViewFactoryCreatorImpl implements InternalViewFactoryCreator
+{
+    private final ComponentSource componentSource;
+
+    private final ComponentEventResultProcessor<Component> resultProcessor;
+
+    public InternalViewFactoryCreatorImpl(
+            ComponentSource componentSource,
+
+            @Traditional @ComponentInstanceProcessor
+            ComponentEventResultProcessor<Component> resultProcessor)
+    {
+        this.resultProcessor = resultProcessor;
+        this.componentSource = componentSource;
+    }
+
+    public ViewFactory createViewFactory(final Expression viewId)
+    {
+        return new ViewFactory()
+        {
+            public View getView(RequestContext context)
+            {
+                String pageName = viewId.getValue(context).toString();
+
+                Component page = componentSource.getPage(pageName);
+
+                return new PageViewWrapper(pageName, page, resultProcessor);
+            }
+        };
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/PageViewWrapper.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/PageViewWrapper.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/PageViewWrapper.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/PageViewWrapper.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,63 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.internal.webflow.services;
+
+import org.apache.tapestry5.runtime.Component;
+import org.apache.tapestry5.services.ComponentEventResultProcessor;
+import org.springframework.webflow.execution.Event;
+import org.springframework.webflow.execution.View;
+
+import java.io.IOException;
+
+public class PageViewWrapper implements View
+{
+    private final String pageName;
+
+    private final Component page;
+
+    private final ComponentEventResultProcessor<Component> resultProcessor;
+
+    public PageViewWrapper(String pageName, Component page, ComponentEventResultProcessor<Component> resultProcessor)
+    {
+        this.pageName = pageName;
+        this.page = page;
+        this.resultProcessor = resultProcessor;
+    }
+
+    public void render() throws IOException
+    {
+        resultProcessor.processResultValue(page);
+    }
+
+    public void processUserEvent()
+    {
+    }
+
+    public boolean hasFlowEvent()
+    {
+        return false;
+    }
+
+    public Event getFlowEvent()
+    {
+        return null;
+    }
+
+    @Override
+    public String toString()
+    {
+        return String.format("PageViewWrapper[%s]", pageName);
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/TapestryFlowURLHandler.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/TapestryFlowURLHandler.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/TapestryFlowURLHandler.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/TapestryFlowURLHandler.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,51 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.internal.webflow.services;
+
+import org.apache.tapestry5.webflow.WebflowConstants;
+import org.springframework.webflow.context.servlet.FlowUrlHandler;
+import org.springframework.webflow.core.collection.AttributeMap;
+
+import javax.servlet.http.HttpServletRequest;
+
+public class TapestryFlowURLHandler implements FlowUrlHandler
+{
+    public String getFlowExecutionKey(HttpServletRequest request)
+    {
+        return request.getParameter(WebflowConstants.FLOW_EXECUTION_KEY_PARAMETER);
+    }
+
+    public String getFlowId(HttpServletRequest request)
+    {
+        return request.getParameter(WebflowConstants.FLOW_ID_PARAMETER);
+    }
+
+    public String createFlowDefinitionUrl(String flowId, AttributeMap input, HttpServletRequest request)
+    {
+        return String.format("%s%s?%s=%s",
+                             request.getContextPath(),
+                             WebflowConstants.WEB_FLOW_PATH,
+                             WebflowConstants.FLOW_ID_PARAMETER, flowId);
+    }
+
+    public String createFlowExecutionUrl(String flowId, String flowExecutionKey, HttpServletRequest request)
+    {
+        return String.format("%s%s?%s=%s&%s=%s",
+                             request.getContextPath(),
+                             WebflowConstants.WEB_FLOW_PATH,
+                             WebflowConstants.FLOW_ID_PARAMETER, flowId,
+                             WebflowConstants.FLOW_EXECUTION_KEY_PARAMETER, flowExecutionKey);
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/WebflowDispatcher.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/WebflowDispatcher.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/WebflowDispatcher.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/internal/webflow/services/WebflowDispatcher.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,46 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.internal.webflow.services;
+
+import org.apache.tapestry5.services.Dispatcher;
+import org.apache.tapestry5.services.Request;
+import org.apache.tapestry5.services.Response;
+import org.apache.tapestry5.webflow.WebflowConstants;
+
+import java.io.IOException;
+
+public class WebflowDispatcher implements Dispatcher
+{
+    private final InternalFlowManager flowManager;
+
+    public WebflowDispatcher(InternalFlowManager flowManager)
+    {
+        this.flowManager = flowManager;
+    }
+
+    public boolean dispatch(Request request, Response response) throws IOException
+    {
+        if (request.getPath().equalsIgnoreCase(WebflowConstants.WEB_FLOW_PATH))
+        {
+            flowManager.continueFlow();
+
+            return true;
+        }
+
+        // Continue on to other handlers.
+
+        return false;
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/TapestryViewFactoryCreator.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/TapestryViewFactoryCreator.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/TapestryViewFactoryCreator.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/TapestryViewFactoryCreator.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,51 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.webflow;
+
+import org.apache.tapestry5.internal.webflow.services.InternalViewFactoryCreator;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.binding.convert.ConversionService;
+import org.springframework.binding.expression.Expression;
+import org.springframework.binding.expression.ExpressionParser;
+import org.springframework.webflow.engine.builder.BinderConfiguration;
+import org.springframework.webflow.engine.builder.ViewFactoryCreator;
+import org.springframework.webflow.execution.ViewFactory;
+
+public class TapestryViewFactoryCreator implements ViewFactoryCreator
+{
+
+    private final InternalViewFactoryCreator internalCreator;
+
+    @Autowired
+    public TapestryViewFactoryCreator(@Inject InternalViewFactoryCreator internalCreator)
+    {
+        this.internalCreator = internalCreator;
+    }
+
+    public ViewFactory createViewFactory(Expression viewId, ExpressionParser expressionParser,
+                                         ConversionService conversionService, BinderConfiguration binderConfiguration)
+    {
+        return internalCreator.createViewFactory(viewId);
+    }
+
+    /**
+     * We map view state ids directly to page names, so this method just returns the viewStateId unchanged.
+     */
+    public String getViewIdByConvention(String viewStateId)
+    {
+        return viewStateId;
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/WebflowConstants.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/WebflowConstants.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/WebflowConstants.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/WebflowConstants.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,27 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.webflow;
+
+public class WebflowConstants
+{
+    public static final String FLOW_EXECUTION_KEY_PARAMETER = "t:flow:key";
+
+    public static final String FLOW_ID_PARAMETER = "t:flow:id";
+
+    /**
+     * URL path that indicates a webflow.
+     */
+    public static final String WEB_FLOW_PATH = "/webflow";
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/services/FlowManager.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/services/FlowManager.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/services/FlowManager.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/services/FlowManager.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,29 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.webflow.services;
+
+/**
+ * Tapestry service used to initiate a flow.  Once a flow is started, the flow will continue to operate until it is
+ * cancelled or otherwise reaches its end state. Typically, an action event will initiate a flow.
+ */
+public interface FlowManager
+{
+    /**
+     * Initiates a new web flow.
+     *
+     * @param flowId the identity of the flow to initiate
+     */
+    Object initiateFlow(String flowId);
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/services/WebFlowModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/services/WebFlowModule.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/services/WebFlowModule.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/main/java/org/apache/tapestry5/webflow/services/WebFlowModule.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,47 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.webflow.services;
+
+import org.apache.tapestry5.internal.webflow.services.*;
+import org.apache.tapestry5.ioc.MappedConfiguration;
+import org.apache.tapestry5.ioc.OrderedConfiguration;
+import org.apache.tapestry5.ioc.ServiceBinder;
+import org.apache.tapestry5.services.ComponentEventResultProcessor;
+import org.apache.tapestry5.services.Dispatcher;
+import org.springframework.webflow.context.servlet.FlowUrlHandler;
+import org.springframework.webflow.executor.FlowExecutionResult;
+
+public class WebFlowModule
+{
+    public static void bind(ServiceBinder binder)
+    {
+        binder.bind(FlowManager.class, FlowManagerImpl.class);
+        binder.bind(InternalViewFactoryCreator.class, InternalViewFactoryCreatorImpl.class);
+        binder.bind(ExternalContextSource.class, ExternalContextSourceImpl.class);
+        binder.bind(FlowUrlHandler.class, TapestryFlowURLHandler.class);
+        binder.bind(InternalFlowManager.class, InternalFlowManagerImpl.class);
+    }
+
+    public static void contributeMasterDispatcher(OrderedConfiguration<Dispatcher> configuration)
+    {
+        configuration.addInstance("WebFlow", WebflowDispatcher.class, "before:ComponentEvent,PageRender");
+    }
+
+    public static void contributeComponentEventResultProcessor(
+            MappedConfiguration<Class, ComponentEventResultProcessor> configuration)
+    {
+        configuration.addInstance(FlowExecutionResult.class, FlowExecutionResultProcessor.class);
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/test/conf/webdefault.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/test/conf/webdefault.xml?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/test/conf/webdefault.xml (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/test/conf/webdefault.xml Tue Jan  6 16:43:59 2009
@@ -0,0 +1,294 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+   Copyright 2009 The Apache Software Foundation
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<web-app
+        xmlns="http://java.sun.com/xml/ns/j2ee"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+        version="2.4">
+
+    <description>
+        Default web.xml file.
+        This file is applied to a Web application before it's own WEB_INF/web.xml file
+    </description>
+
+
+    <!-- ==================================================================== -->
+    <!-- Context params to control Session Cookies                            -->
+    <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->
+    <!-- UNCOMMENT TO ACTIVATE
+    <context-param>
+      <param-name>org.mortbay.jetty.servlet.SessionDomain</param-name>
+      <param-value>127.0.0.1</param-value>
+    </context-param>
+
+    <context-param>
+      <param-name>org.mortbay.jetty.servlet.SessionPath</param-name>
+      <param-value>/</param-value>
+    </context-param>
+
+    <context-param>
+      <param-name>org.mortbay.jetty.servlet.MaxAge</param-name>
+      <param-value>-1</param-value>
+    </context-param>
+    -->
+
+
+    <!-- ==================================================================== -->
+    <!-- The default servlet.                                                 -->
+    <!-- This servlet, normally mapped to /, provides the handling for static -->
+    <!-- content, OPTIONS and TRACE methods for the context.                  -->
+    <!-- The following initParameters are supported:                          -->
+    <!--                                                                      -->
+    <!--   acceptRanges     If true, range requests and responses are         -->
+    <!--                    supported                                         -->
+    <!--                                                                      -->
+    <!--   dirAllowed       If true, directory listings are returned if no    -->
+    <!--                    welcome file is found. Else 403 Forbidden.        -->
+    <!--                                                                      -->
+    <!--   putAllowed       If true, the PUT method is allowed                -->
+    <!--                                                                      -->
+    <!--   delAllowed       If true, the DELETE method is allowed             -->
+    <!--                                                                      -->
+    <!--   redirectWelcome  If true, redirect welcome file requests           -->
+    <!--                    else use request dispatcher forwards              -->
+    <!--                                                                      -->
+    <!--   minGzipLength    If set to a positive integer, then static content -->
+    <!--                    larger than this will be served as gzip content   -->
+    <!--                    encoded if a matching resource is found ending    -->
+    <!--                    with ".gz"                                        -->
+    <!--                                                                      -->
+    <!--   resoureBase      Can be set to replace the context resource base   -->
+    <!--                                                                      -->
+    <!--   relativeResourceBase                                               -->
+    <!--                    Set with a pathname relative to the base of the   -->
+    <!--                    servlet context root. Useful for only serving     -->
+    <!--                    static content from only specific subdirectories. -->
+    <!--                                                                      -->
+    <!-- The MOVE method is allowed if PUT and DELETE are allowed             -->
+    <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->
+    <servlet>
+        <servlet-name>default</servlet-name>
+        <servlet-class>org.mortbay.jetty.servlet.Default</servlet-class>
+        <init-param>
+            <param-name>acceptRanges</param-name>
+            <param-value>true</param-value>
+        </init-param>
+        <init-param>
+            <param-name>dirAllowed</param-name>
+            <param-value>true</param-value>
+        </init-param>
+        <init-param>
+            <param-name>putAllowed</param-name>
+            <param-value>false</param-value>
+        </init-param>
+        <init-param>
+            <param-name>delAllowed</param-name>
+            <param-value>false</param-value>
+        </init-param>
+        <init-param>
+            <param-name>redirectWelcome</param-name>
+            <param-value>false</param-value>
+        </init-param>
+        <init-param>
+            <param-name>minGzipLength</param-name>
+            <param-value>8192</param-value>
+        </init-param>
+        <load-on-startup>0</load-on-startup>
+    </servlet>
+
+
+    <servlet-mapping>
+        <servlet-name>default</servlet-name>
+        <url-pattern>/</url-pattern>
+    </servlet-mapping>
+
+    <!-- ==================================================================== -->
+    <session-config>
+        <session-timeout>30</session-timeout>
+    </session-config>
+
+
+    <!-- ==================================================================== -->
+    <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+        <welcome-file>index.htm</welcome-file>
+    </welcome-file-list>
+
+    <!-- ==================================================================== -->
+    <locale-encoding-mapping-list>
+        <locale-encoding-mapping>
+            <locale>ar</locale>
+            <encoding>ISO-8859-6</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>be</locale>
+            <encoding>ISO-8859-5</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>bg</locale>
+            <encoding>ISO-8859-5</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>ca</locale>
+            <encoding>ISO-8859-1</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>cs</locale>
+            <encoding>ISO-8859-2</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>da</locale>
+            <encoding>ISO-8859-1</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>de</locale>
+            <encoding>ISO-8859-1</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>el</locale>
+            <encoding>ISO-8859-7</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>en</locale>
+            <encoding>ISO-8859-1</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>es</locale>
+            <encoding>ISO-8859-1</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>et</locale>
+            <encoding>ISO-8859-1</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>fi</locale>
+            <encoding>ISO-8859-1</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>fr</locale>
+            <encoding>ISO-8859-1</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>hr</locale>
+            <encoding>ISO-8859-2</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>hu</locale>
+            <encoding>ISO-8859-2</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>is</locale>
+            <encoding>ISO-8859-1</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>it</locale>
+            <encoding>ISO-8859-1</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>iw</locale>
+            <encoding>ISO-8859-8</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>ja</locale>
+            <encoding>Shift_JIS</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>ko</locale>
+            <encoding>EUC-KR</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>lt</locale>
+            <encoding>ISO-8859-2</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>lv</locale>
+            <encoding>ISO-8859-2</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>mk</locale>
+            <encoding>ISO-8859-5</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>nl</locale>
+            <encoding>ISO-8859-1</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>no</locale>
+            <encoding>ISO-8859-1</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>pl</locale>
+            <encoding>ISO-8859-2</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>pt</locale>
+            <encoding>ISO-8859-1</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>ro</locale>
+            <encoding>ISO-8859-2</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>ru</locale>
+            <encoding>ISO-8859-5</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>sh</locale>
+            <encoding>ISO-8859-5</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>sk</locale>
+            <encoding>ISO-8859-2</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>sl</locale>
+            <encoding>ISO-8859-2</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>sq</locale>
+            <encoding>ISO-8859-2</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>sr</locale>
+            <encoding>ISO-8859-5</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>sv</locale>
+            <encoding>ISO-8859-1</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>tr</locale>
+            <encoding>ISO-8859-9</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>uk</locale>
+            <encoding>ISO-8859-5</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>zh</locale>
+            <encoding>GB2312</encoding>
+        </locale-encoding-mapping>
+        <locale-encoding-mapping>
+            <locale>zh_TW</locale>
+            <encoding>Big5</encoding>
+        </locale-encoding-mapping>
+    </locale-encoding-mapping-list>
+
+
+</web-app>
+

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/RunWebFlow.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/RunWebFlow.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/RunWebFlow.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/RunWebFlow.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,31 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.webflow.testapp;
+
+import org.apache.tapestry5.test.JettyRunner;
+
+import java.io.File;
+
+public class RunWebFlow
+{
+    public static void main(String[] args) throws Exception
+    {
+        File workingDir = new File(System.getProperty("user.dir"));
+
+        new File(workingDir, "target/tmp").mkdirs();
+
+        new JettyRunner(workingDir, "/", 8080, "src/test/webapp");
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/data/TargetType.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/data/TargetType.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/data/TargetType.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/data/TargetType.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,20 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.webflow.testapp.data;
+
+public enum TargetType
+{
+    CIVILIAN, MILITARY
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/pages/Index.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/pages/Index.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/pages/Index.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/pages/Index.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,29 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.webflow.testapp.pages;
+
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.apache.tapestry5.webflow.services.FlowManager;
+
+public class Index
+{
+    @Inject
+    private FlowManager flowManager;
+
+    Object onActionFromLaunch()
+    {
+        return flowManager.initiateFlow("MissileLaunch");
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/pages/SetLaunchCoordinates.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/pages/SetLaunchCoordinates.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/pages/SetLaunchCoordinates.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/pages/SetLaunchCoordinates.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,31 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.webflow.testapp.pages;
+
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.webflow.testapp.data.TargetType;
+
+public class SetLaunchCoordinates
+{
+
+    public TargetType getCivilian() { return TargetType.CIVILIAN; }
+
+    public TargetType getMilitary() { return TargetType.MILITARY; }
+
+    @Persist
+    @Property
+    private TargetType target;
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/services/AppModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/services/AppModule.java?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/services/AppModule.java (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/test/java/org/apache/tapestry5/webflow/testapp/services/AppModule.java Tue Jan  6 16:43:59 2009
@@ -0,0 +1,32 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.webflow.testapp.services;
+
+import org.apache.tapestry5.SymbolConstants;
+import org.apache.tapestry5.ioc.MappedConfiguration;
+import org.apache.tapestry5.ioc.annotations.SubModule;
+import org.apache.tapestry5.spring.SpringModule;
+import org.apache.tapestry5.webflow.services.WebFlowModule;
+
+@SubModule({WebFlowModule.class, SpringModule.class})
+public class AppModule
+{
+    public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration)
+    {
+        configuration.add(SymbolConstants.PRODUCTION_MODE, "false");
+        configuration.add(SymbolConstants.COMPRESS_WHITESPACE, "false");
+        configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en");
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/test/resources/log4j.properties?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/test/resources/log4j.properties (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/test/resources/log4j.properties Tue Jan  6 16:43:59 2009
@@ -0,0 +1,25 @@
+# Copyright 2009 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+log4j.rootCategory=INFO, A1
+
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=[%p] %c{1} %m%n
+
+log4j.category.org.springframework.webflow=debug
+

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/Index.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/Index.tml?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/Index.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/Index.tml Tue Jan  6 16:43:59 2009
@@ -0,0 +1,14 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+    <p>Welcome to NORAD-lite.</p>
+
+    <p>
+        Would you like to launch a missile?
+    </p>
+
+    <p>
+        <t:actionlink t:id="launch">YES</t:actionlink>
+    </p>
+
+
+</html>
\ No newline at end of file

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/SetLaunchCoordinates.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/SetLaunchCoordinates.tml?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/SetLaunchCoordinates.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/SetLaunchCoordinates.tml Tue Jan  6 16:43:59 2009
@@ -0,0 +1,23 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+    <h1>Set Launch Coordinates</h1>
+
+    <t:form t:id="launch">
+
+        <t:radiogroup t:id="target">
+            <ul>
+                <li>
+                    <t:radio t:id="civilian"/>
+                    <t:label for="civilian"/>
+                </li>
+                <li>
+                    <t:radio t:id="military"/>
+                    <t:label for="military"/>
+                </li>
+            </ul>
+
+            <input type="submit" value="Select"/>
+        </t:radiogroup>
+
+    </t:form>
+
+</html>
\ No newline at end of file

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/WEB-INF/applicationContext.xml?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/WEB-INF/applicationContext.xml (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/WEB-INF/applicationContext.xml Tue Jan  6 16:43:59 2009
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+   Copyright 2009 The Apache Software Foundation
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:webflow="http://www.springframework.org/schema/webflow-config"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans          http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+        http://www.springframework.org/schema/context        http://www.springframework.org/schema/context/spring-context-2.5.xsd
+        http://www.springframework.org/schema/webflow-config http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd">
+
+    <context:annotation-config/>
+
+    <!-- TODO: Find a way to make the wiring in of Tapestry more automatic. -->
+
+    <webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices">
+        <webflow:flow-location-pattern value="/WEB-INF/flows/**/*.xml"/>
+    </webflow:flow-registry>
+
+    <webflow:flow-builder-services id="flowBuilderServices" view-factory-creator="tapestryViewFactoryCreator"/>
+
+    <webflow:flow-executor id="flowExecutor"/>
+
+    <!-- It's a Spring bean; it uses @Inject to ensure connections to Tapestry services. -->
+
+    <bean name="tapestryViewFactoryCreator" class="org.apache.tapestry5.webflow.TapestryViewFactoryCreator"/>
+
+</beans>
+

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/WEB-INF/flows/MissileLaunch.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/WEB-INF/flows/MissileLaunch.xml?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/WEB-INF/flows/MissileLaunch.xml (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/WEB-INF/flows/MissileLaunch.xml Tue Jan  6 16:43:59 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<flow xmlns="http://www.springframework.org/schema/webflow"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://www.springframework.org/schema/webflow
+                          http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
+
+    <var name="targetType" class="org.apache.tapestry5.webflow.testapp.data.TargetType"/>
+
+    <!-- Each view-state should match a Tapestry page; we're also following the Tapestry naming
+    convention of using a leading capital-case character (not that Tapestry cares about case, of course). -->
+
+    <view-state id="SetLaunchCoordinates">
+        <transition on="submit" to="ConfirmLaunch"/>
+    </view-state>
+
+    <view-state id="ConfirmLaunch">
+        <transition on="submit" to="MissilesLaunched"/>
+    </view-state>
+
+    <end-state id="MissilesLaunched"/>
+
+
+</flow>
\ No newline at end of file

Added: tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/WEB-INF/web.xml?rev=732188&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/WEB-INF/web.xml (added)
+++ tapestry/tapestry5/trunk/tapestry-webflow/src/test/webapp/WEB-INF/web.xml Tue Jan  6 16:43:59 2009
@@ -0,0 +1,33 @@
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+        "http://java.sun.com/dtd/web-app_2_3.dtd">
+<!-- 
+   Copyright 2009 The Apache Software Foundation
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<web-app>
+    <display-name>Spring Web Flow Test App</display-name>
+    <context-param>
+        <param-name>tapestry.app-package</param-name>
+        <param-value>org.apache.tapestry5.webflow.testapp</param-value>
+    </context-param>
+    <filter>
+        <filter-name>app</filter-name>
+        <filter-class>org.apache.tapestry5.spring.TapestrySpringFilter</filter-class>
+    </filter>
+    <filter-mapping>
+        <filter-name>app</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+</web-app>



Mime
View raw message