cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gkossakow...@apache.org
Subject svn commit: r562102 - in /cocoon/trunk: blocks/cocoon-ajax/cocoon-ajax-impl/ blocks/cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/ blocks/cocoon-flowscript/cocoon-flowscript-impl/ blocks/cocoon-flowscript/cocoon-flowscript-impl/src/...
Date Thu, 02 Aug 2007 13:10:07 GMT
Author: gkossakowski
Date: Thu Aug  2 06:10:05 2007
New Revision: 562102

URL: http://svn.apache.org/viewvc?view=rev&rev=562102
Log:
COCOON-2103: Changed helper methods (setContextObject and setWebContinuation) in FlowHelper
so it's now possible to push context object and continuation on new object model.
Adapted test cases and all the code that used this methods.

Modified:
    cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/pom.xml
    cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/GetContinuationAction.java
    cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/pom.xml
    cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/util/PipelineUtil.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/pom.xml
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/Form.js
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/test/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/pom.xml
    cocoon/trunk/blocks/cocoon-javaflow/cocoon-javaflow-impl/src/main/java/org/apache/cocoon/components/flow/java/AbstractContinuable.java
    cocoon/trunk/blocks/cocoon-javaflow/cocoon-javaflow-impl/src/main/java/org/apache/cocoon/components/flow/java/JavaInterpreter.java
    cocoon/trunk/blocks/cocoon-javaflow/cocoon-javaflow-impl/src/main/java/org/apache/cocoon/forms/flow/java/FormInstance.java
    cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/test/java/org/apache/cocoon/template/jxtg/JXTemplateGeneratorTestCase.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/pom.xml
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/flow/AbstractInterpreter.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/flow/FlowHelper.java

Modified: cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/pom.xml?view=diff&rev=562102&r1=562101&r2=562102
==============================================================================
--- cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/pom.xml (original)
+++ cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/pom.xml Thu Aug  2 06:10:05 2007
@@ -44,6 +44,10 @@
       <groupId>org.apache.cocoon</groupId>
       <artifactId>cocoon-servlet-service-components</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-expression-language-api</artifactId>
+    </dependency>
   </dependencies>
   
   <distributionManagement>

Modified: cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/GetContinuationAction.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/GetContinuationAction.java?view=diff&rev=562102&r1=562101&r2=562102
==============================================================================
--- cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/GetContinuationAction.java
(original)
+++ cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/GetContinuationAction.java
Thu Aug  2 06:10:05 2007
@@ -31,6 +31,7 @@
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Redirector;
 import org.apache.cocoon.environment.SourceResolver;
+import org.apache.cocoon.objectmodel.ObjectModel;
 import org.apache.cocoon.sitemap.SitemapParameters;
 
 /**
@@ -49,10 +50,12 @@
  */
 public class GetContinuationAction extends ServiceableAction implements ThreadSafe, Disposable
{
     ContinuationsManager contManager;
+    ObjectModel newObjectModel;
 
     public void service(ServiceManager manager) throws ServiceException {
         super.service(manager);
         this.contManager = (ContinuationsManager)manager.lookup(ContinuationsManager.ROLE);
+        this.newObjectModel = (ObjectModel)manager.lookup(ObjectModel.ROLE);
     }
 
     public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String
source, Parameters parameters) throws Exception {
@@ -71,7 +74,7 @@
         } else {
             // Getting the continuation updates the last access time
             wk.getContinuation();
-            FlowHelper.setWebContinuation(objectModel, wk);
+            FlowHelper.setWebContinuation(objectModel, newObjectModel, wk);
             return Collections.EMPTY_MAP;
         }
     }

Modified: cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/pom.xml?view=diff&rev=562102&r1=562101&r2=562102
==============================================================================
--- cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/pom.xml (original)
+++ cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/pom.xml Thu Aug  2 06:10:05
2007
@@ -62,6 +62,10 @@
       <artifactId>servlet-api</artifactId>
       <scope>provided</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-expression-language-api</artifactId>
+    </dependency>
   </dependencies>
   
   <profiles>

Modified: cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/util/PipelineUtil.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/util/PipelineUtil.java?view=diff&rev=562102&r1=562101&r2=562102
==============================================================================
--- cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/util/PipelineUtil.java
(original)
+++ cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/util/PipelineUtil.java
Thu Aug  2 06:10:05 2007
@@ -25,6 +25,7 @@
 import org.apache.cocoon.components.flow.FlowHelper;
 import org.apache.cocoon.components.flow.javascript.JavaScriptFlowHelper;
 import org.apache.cocoon.components.source.SourceUtil;
+import org.apache.cocoon.objectmodel.ObjectModel;
 import org.apache.cocoon.processing.ProcessInfoProvider;
 import org.apache.cocoon.spring.configurator.WebAppContextUtils;
 import org.apache.commons.io.IOUtils;
@@ -55,11 +56,12 @@
     public void processToStream(String uri, Object viewData, OutputStream output)
     throws IOException {
         final Map objectModel = getObjectModel();
+        final ObjectModel newObjectModel = getNewObjectModel();
         final SourceResolver resolver = getSourceResolver();
 
         // Keep the previous view data, if any (is it really necessary?), and set the new
one
         Object oldViewData = FlowHelper.getContextObject(objectModel);
-        FlowHelper.setContextObject(objectModel, JavaScriptFlowHelper.unwrap(viewData));
+        FlowHelper.setContextObject(objectModel, JavaScriptFlowHelper.unwrap(viewData), newObjectModel);
 
         Source src = null;
         InputStream input = null;
@@ -75,7 +77,7 @@
             }
 
             // Restore the previous view data
-            FlowHelper.setContextObject(objectModel, oldViewData);
+            FlowHelper.setContextObject(objectModel, oldViewData, newObjectModel);
             resolver.release(src);
         }
     }
@@ -90,17 +92,18 @@
     public void processToSAX(String uri, Object viewData, ContentHandler handler)
     throws SAXException, IOException, ProcessingException {
         final Map objectModel = getObjectModel();
+        final ObjectModel newObjectModel = getNewObjectModel();
         final SourceResolver resolver = getSourceResolver();
 
         Object oldViewData = FlowHelper.getContextObject(objectModel);
-        FlowHelper.setContextObject(objectModel, JavaScriptFlowHelper.unwrap(viewData));
+        FlowHelper.setContextObject(objectModel, JavaScriptFlowHelper.unwrap(viewData), newObjectModel);
 
         Source src = null;
         try {
             src = resolver.resolveURI("cocoon:/" + uri);
             SourceUtil.toSAX(src, handler);
         } finally {
-            FlowHelper.setContextObject(objectModel, oldViewData);
+            FlowHelper.setContextObject(objectModel, oldViewData, newObjectModel);
             resolver.release(src);
         }
     }
@@ -114,9 +117,10 @@
      */
     public Document processToDOM(String uri, Object viewData) throws ProcessingException,
SAXException, IOException  {
         final Map objectModel = getObjectModel();
+        final ObjectModel newObjectModel = getNewObjectModel();
         final SourceResolver resolver = getSourceResolver();
         Object oldViewData = FlowHelper.getContextObject(objectModel);
-        FlowHelper.setContextObject(objectModel, JavaScriptFlowHelper.unwrap(viewData));
+        FlowHelper.setContextObject(objectModel, JavaScriptFlowHelper.unwrap(viewData), newObjectModel);
 
         Source src = null;
 
@@ -124,7 +128,7 @@
             src = resolver.resolveURI("cocoon:/" + uri);
             return SourceUtil.toDOM(src);
         } finally {
-            FlowHelper.setContextObject(objectModel, oldViewData);
+            FlowHelper.setContextObject(objectModel, oldViewData, newObjectModel);
             resolver.release(src);
         }
     }
@@ -145,5 +149,10 @@
         final ProcessInfoProvider infoProvider =
             (ProcessInfoProvider)webAppContext.getBean(ProcessInfoProvider.ROLE);
         return infoProvider.getObjectModel();
+    }
+    
+    protected static ObjectModel getNewObjectModel() {
+        final WebApplicationContext webAppContext = WebAppContextUtils.getCurrentWebApplicationContext();
+        return (ObjectModel)webAppContext.getBean(ObjectModel.ROLE);
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/pom.xml?view=diff&rev=562102&r1=562101&r2=562102
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/pom.xml (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/pom.xml Thu Aug  2 06:10:05 2007
@@ -71,6 +71,15 @@
       <groupId>org.apache.cocoon</groupId>
       <artifactId>cocoon-flowscript-impl</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-expression-language-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-expression-language-impl</artifactId>
+      <scope>test</scope>
+    </dependency>
     <!-- other dependencies -->
     <dependency>
       <groupId>commons-collections</groupId>

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/Form.js
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/Form.js?view=diff&rev=562102&r1=562101&r2=562102
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/Form.js
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/Form.js
Thu Aug  2 06:10:05 2007
@@ -130,7 +130,8 @@
     // (the same is done by cocoon.sendPage())
     // FIXME : hack needed because FOM doesn't provide access to the object model
     var objectModel = org.apache.cocoon.components.ContextHelper.getObjectModel(this.avalonContext);
-    org.apache.cocoon.components.flow.FlowHelper.setContextObject(objectModel, viewdata);
+    var newObjectModel = cocoon.getComponent(org.apache.cocoon.objectmodel.ObjectModel.ROLE);
+    org.apache.cocoon.components.flow.FlowHelper.setContextObject(objectModel, viewdata,
newObjectModel);
 
     if (this.restoreHook) {
         this.restoreHook(this);
@@ -197,7 +198,8 @@
         // (the same is done by cocoon.sendPage())
         // FIXME : hack needed because FOM doesn't provide access to the object model
         var objectModel = org.apache.cocoon.components.ContextHelper.getObjectModel(this.avalonContext);
-        org.apache.cocoon.components.flow.FlowHelper.setContextObject(objectModel, viewdata);
+        var newObjectModel = cocoon.getComponent(org.apache.cocoon.objectmodel.ObjectModel.ROLE);
+        org.apache.cocoon.components.flow.FlowHelper.setContextObject(objectModel, viewdata,
newObjectModel);
 
         finished = this.form.process(formContext);
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/test/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/test/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.java?view=diff&rev=562102&r1=562101&r2=562102
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/test/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.java
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/test/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListTestCase.java
Thu Aug  2 06:10:05 2007
@@ -25,18 +25,17 @@
 
 import org.apache.avalon.framework.context.Context;
 import org.apache.avalon.framework.context.DefaultContext;
-
 import org.apache.cocoon.components.ContextHelper;
 import org.apache.cocoon.components.flow.FlowHelper;
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.environment.mock.MockRequest;
 import org.apache.cocoon.forms.FormsConstants;
+import org.apache.cocoon.objectmodel.ObjectModel;
+import org.apache.cocoon.objectmodel.ObjectModelImpl;
 import org.apache.cocoon.xml.dom.DOMBuilder;
-
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.impl.ResourceSource;
-
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
@@ -57,7 +56,8 @@
         flowContextObject.put("beans", beans);
         Request request = new MockRequest();
         Map objectModel = new HashMap();
-        FlowHelper.setContextObject(objectModel, flowContextObject);
+        ObjectModel newObjectModel = new ObjectModelImpl();
+        FlowHelper.setContextObject(objectModel, flowContextObject, newObjectModel);
         objectModel.put(ObjectModelHelper.REQUEST_OBJECT, request);
         Map contextObjectModel = new HashMap();
         contextObjectModel.put(ContextHelper.CONTEXT_OBJECT_MODEL, objectModel);
@@ -89,7 +89,8 @@
         flowContextObject.put("beans", beans);
         Request request = new MockRequest();
         Map objectModel = new HashMap();
-        FlowHelper.setContextObject(objectModel, flowContextObject);
+        ObjectModel newObjectModel = new ObjectModelImpl();
+        FlowHelper.setContextObject(objectModel, flowContextObject, newObjectModel);
         objectModel.put(ObjectModelHelper.REQUEST_OBJECT, request);
         Map contextObjectModel = new HashMap();
         contextObjectModel.put(ContextHelper.CONTEXT_OBJECT_MODEL, objectModel);

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/pom.xml?view=diff&rev=562102&r1=562101&r2=562102
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/pom.xml (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/pom.xml Thu Aug  2 06:10:05 2007
@@ -57,6 +57,21 @@
       <groupId>org.apache.cocoon</groupId>
       <artifactId>cocoon-samples-style-default</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-databases-impl</artifactId>
+      <version>1.0.0-RC2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-databases-hsqldb-server</artifactId>
+      <version>1.0.0-RC2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-databases-hsqldb-client</artifactId>
+      <version>1.0.0-RC2-SNAPSHOT</version>
+    </dependency>
   </dependencies>
 
 </project>

Modified: cocoon/trunk/blocks/cocoon-javaflow/cocoon-javaflow-impl/src/main/java/org/apache/cocoon/components/flow/java/AbstractContinuable.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-javaflow/cocoon-javaflow-impl/src/main/java/org/apache/cocoon/components/flow/java/AbstractContinuable.java?view=diff&rev=562102&r1=562101&r2=562102
==============================================================================
--- cocoon/trunk/blocks/cocoon-javaflow/cocoon-javaflow-impl/src/main/java/org/apache/cocoon/components/flow/java/AbstractContinuable.java
(original)
+++ cocoon/trunk/blocks/cocoon-javaflow/cocoon-javaflow-impl/src/main/java/org/apache/cocoon/components/flow/java/AbstractContinuable.java
Thu Aug  2 06:10:05 2007
@@ -18,6 +18,7 @@
 
 import java.io.OutputStream;
 import java.util.Map;
+
 import org.apache.avalon.framework.CascadingRuntimeException;
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.parameters.Parameters;
@@ -25,6 +26,7 @@
 import org.apache.cocoon.components.flow.FlowHelper;
 import org.apache.cocoon.components.flow.util.PipelineUtil;
 import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.objectmodel.ObjectModel;
 import org.apache.commons.javaflow.Continuation;
 import org.apache.excalibur.source.SourceUtil;
 
@@ -59,8 +61,10 @@
         CocoonContinuationContext context = getContext();
         if (context.getLogger() != null)
             context.getLogger().debug("send page and wait '" + uri + "'");
+        ObjectModel newObjectModel = (ObjectModel)getComponent(ObjectModel.ROLE);
         FlowHelper.setContextObject(ContextHelper.getObjectModel(context.getAvalonContext()),
-                bizdata);
+                bizdata, newObjectModel);
+        releaseComponent(newObjectModel);
         if (SourceUtil.indexOfSchemeColon(uri) == -1) {
             uri = "cocoon:/" + uri;
             if (getContext().getRedirector().hasRedirected()) {
@@ -92,10 +96,12 @@
             context.getLogger().debug("send page '" + uri + "'");
         }
         
+        ObjectModel newObjectModel = (ObjectModel)getComponent(ObjectModel.ROLE);
         FlowHelper.setContextObject(
                 ContextHelper.getObjectModel(context.getAvalonContext()),
-                bizdata
+                bizdata, newObjectModel
                 );
+        releaseComponent(newObjectModel);
 
         if (SourceUtil.indexOfSchemeColon(uri) == -1) {
             uri = "cocoon:/" + uri;

Modified: cocoon/trunk/blocks/cocoon-javaflow/cocoon-javaflow-impl/src/main/java/org/apache/cocoon/components/flow/java/JavaInterpreter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-javaflow/cocoon-javaflow-impl/src/main/java/org/apache/cocoon/components/flow/java/JavaInterpreter.java?view=diff&rev=562102&r1=562101&r2=562102
==============================================================================
--- cocoon/trunk/blocks/cocoon-javaflow/cocoon-javaflow-impl/src/main/java/org/apache/cocoon/components/flow/java/JavaInterpreter.java
(original)
+++ cocoon/trunk/blocks/cocoon-javaflow/cocoon-javaflow-impl/src/main/java/org/apache/cocoon/components/flow/java/JavaInterpreter.java
Thu Aug  2 06:10:05 2007
@@ -147,7 +147,7 @@
                 handler, null, timeToLive, getInterpreterID(), null);
 
         FlowHelper.setWebContinuation(
-                ContextHelper.getObjectModel(avalonContext), wk);
+                ContextHelper.getObjectModel(avalonContext), newObjectModel, wk);
 
         final Continuation newContinuation = Continuation.startWith(new Invoker(method),
context);
 
@@ -174,7 +174,7 @@
                 newHandler, oldWebContinuation, timeToLive, getInterpreterID(), null);
 
         FlowHelper.setWebContinuation(
-                ContextHelper.getObjectModel(avalonContext), newWebContinuation);
+                ContextHelper.getObjectModel(avalonContext), newObjectModel, newWebContinuation);
 
         final Continuation oldContinuation = oldHandler.getContinuation();
 

Modified: cocoon/trunk/blocks/cocoon-javaflow/cocoon-javaflow-impl/src/main/java/org/apache/cocoon/forms/flow/java/FormInstance.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-javaflow/cocoon-javaflow-impl/src/main/java/org/apache/cocoon/forms/flow/java/FormInstance.java?view=diff&rev=562102&r1=562101&r2=562102
==============================================================================
--- cocoon/trunk/blocks/cocoon-javaflow/cocoon-javaflow-impl/src/main/java/org/apache/cocoon/forms/flow/java/FormInstance.java
(original)
+++ cocoon/trunk/blocks/cocoon-javaflow/cocoon-javaflow-impl/src/main/java/org/apache/cocoon/forms/flow/java/FormInstance.java
Thu Aug  2 06:10:05 2007
@@ -17,6 +17,7 @@
 package org.apache.cocoon.forms.flow.java;
 
 import java.util.Locale;
+
 import org.apache.avalon.framework.CascadingRuntimeException;
 import org.apache.cocoon.components.flow.FlowHelper;
 import org.apache.cocoon.components.flow.java.AbstractContinuable;
@@ -28,6 +29,7 @@
 import org.apache.cocoon.forms.formmodel.Form;
 import org.apache.cocoon.forms.formmodel.Widget;
 import org.apache.cocoon.forms.transformation.FormsPipelineConfig;
+import org.apache.cocoon.objectmodel.ObjectModel;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 import org.w3c.dom.Element;
@@ -192,7 +194,10 @@
             FormContext formContext = new FormContext(getRequest(), locale);
             // Prematurely add the bizData as a request attribute so that event listeners
can use it
             // (the same is done by cocoon.sendPage())
-            FlowHelper.setContextObject(this.getObjectModel(), bizData);
+            //FIXME: I'm not sure if ObjectModel shouldn't be part of CocoonContinuationContext
+            ObjectModel newObjectModel = (ObjectModel)getComponent(ObjectModel.ROLE);
+            FlowHelper.setContextObject(this.getObjectModel(), bizData, newObjectModel);
+            releaseComponent(newObjectModel);
             finished = this.form.process(formContext);
         } while (!finished);
     }

Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/test/java/org/apache/cocoon/template/jxtg/JXTemplateGeneratorTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/test/java/org/apache/cocoon/template/jxtg/JXTemplateGeneratorTestCase.java?view=diff&rev=562102&r1=562101&r2=562102
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/test/java/org/apache/cocoon/template/jxtg/JXTemplateGeneratorTestCase.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/test/java/org/apache/cocoon/template/jxtg/JXTemplateGeneratorTestCase.java
Thu Aug  2 06:10:05 2007
@@ -24,6 +24,7 @@
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.cocoon.SitemapComponentTestCase;
 import org.apache.cocoon.components.flow.FlowHelper;
+import org.apache.cocoon.objectmodel.ObjectModel;
 
 /**
  * @version SVN $Id: JXTemplateGeneratorTestCase.java 358974 2005-12-25
@@ -54,7 +55,8 @@
         super.setUp();
 
         // Make the FOM objects available to the view layer
-        FlowHelper.setContextObject(getObjectModel(), flowContext);
+        ObjectModel newObjectModel = (ObjectModel)getBeanFactory().getBean(ObjectModel.ROLE);
+        FlowHelper.setContextObject(getObjectModel(), flowContext, newObjectModel);
     }
 
     public Map getFlowContext() {

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/pom.xml?view=diff&rev=562102&r1=562101&r2=562102
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/pom.xml (original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/pom.xml Thu Aug  2 06:10:05 2007
@@ -74,6 +74,10 @@
       <groupId>org.apache.cocoon</groupId>
       <artifactId>cocoon-xml-api</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-expression-language-api</artifactId>
+    </dependency>
     <!-- Excalibur -->
     <dependency>
       <groupId>org.apache.avalon.framework</groupId>

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/flow/AbstractInterpreter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/flow/AbstractInterpreter.java?view=diff&rev=562102&r1=562101&r2=562102
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/flow/AbstractInterpreter.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/flow/AbstractInterpreter.java
Thu Aug  2 06:10:05 2007
@@ -32,6 +32,7 @@
 import org.apache.avalon.framework.thread.SingleThreaded;
 import org.apache.cocoon.configuration.Settings;
 import org.apache.cocoon.environment.Redirector;
+import org.apache.cocoon.objectmodel.ObjectModel;
 import org.apache.cocoon.processing.ProcessInfoProvider;
 import org.apache.excalibur.source.SourceUtil;
 
@@ -68,6 +69,7 @@
     protected ServiceManager manager;
     protected ContinuationsManager continuationsMgr;
     protected ProcessInfoProvider processInfoProvider;
+    protected ObjectModel newObjectModel;
 
     /** The settings of Cocoon. */
     protected Settings settings;
@@ -118,6 +120,7 @@
         this.continuationsMgr = (ContinuationsManager)sm.lookup(ContinuationsManager.ROLE);
         this.settings = (Settings)this.manager.lookup(Settings.ROLE);
         this.processInfoProvider = (ProcessInfoProvider)this.manager.lookup(ProcessInfoProvider.ROLE);
+        this.newObjectModel = (ObjectModel)this.manager.lookup(ObjectModel.ROLE);
     }
 
     /**
@@ -136,9 +139,11 @@
             this.manager.release( this.continuationsMgr );
             this.manager.release( this.settings );
             this.manager.release( this.processInfoProvider );
+            this.manager.release(this.newObjectModel);
             this.continuationsMgr = null;
             this.settings = null;
             this.processInfoProvider = null;
+            this.newObjectModel = null;
             this.manager = null;
         }
     }
@@ -186,8 +191,8 @@
         if (SourceUtil.indexOfSchemeColon(uri) == -1) {
             uri = "cocoon:/" + uri;
             final Map objectModel = this.processInfoProvider.getObjectModel();
-            FlowHelper.setWebContinuation(objectModel, continuation);
-            FlowHelper.setContextObject(objectModel, bizData);
+            FlowHelper.setWebContinuation(objectModel, newObjectModel, continuation);
+            FlowHelper.setContextObject(objectModel, bizData, newObjectModel);
             if (redirector.hasRedirected()) {
                 throw new IllegalStateException("Pipeline has already been processed for
this request");
             }

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/flow/FlowHelper.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/flow/FlowHelper.java?view=diff&rev=562102&r1=562101&r2=562102
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/flow/FlowHelper.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/flow/FlowHelper.java
Thu Aug  2 06:10:05 2007
@@ -18,6 +18,8 @@
 
 import java.util.Map;
 
+import org.apache.cocoon.objectmodel.ObjectModel;
+
 /**
  * Provides the interface between the flow controller layer and the 
  * view layer. A view can obtain the context object sent by a flow
@@ -68,10 +70,11 @@
      * Set the web continuation associated with the current request
      *
      * @param objectModel The Cocoon Environment's object model
+     * @param newObjectModel TODO
      * @param kont The web continuation
      */
     public final static void setWebContinuation(Map objectModel,
-                                          WebContinuation kont) {
+                                          ObjectModel newObjectModel, WebContinuation kont)
{
         objectModel.put(CONTINUATION_OBJECT, kont);
     }
 
@@ -80,8 +83,9 @@
      *
      * @param objectModel The Cocoon Environment's object model
      * @param obj The context object 
+     * @param newObjectModel TODO
      */
-    public final static void setContextObject(Map objectModel, Object obj) {
+    public final static void setContextObject(Map objectModel, Object obj, ObjectModel newObjectModel)
{
         objectModel.put(CONTEXT_OBJECT, obj);
     }
 }



Mime
View raw message