cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r654540 - in /cocoon/whiteboard/corona/trunk/corona-controller/src/main/java/org/apache/cocoon/corona/controller: Controller.java DemoControllerDispatcher.java SpringControllerComponent.java
Date Thu, 08 May 2008 14:45:03 GMT
Author: reinhard
Date: Thu May  8 07:45:03 2008
New Revision: 654540

URL: http://svn.apache.org/viewvc?rev=654540&view=rev
Log:
COCOON-2206 - patch by Steven Dolg

Pass sitemap and input parameters separately to prevent conflicts and make explicit which
parameters are part of the configuration (iow sitemap) and which are part of the input (iow
request).


Modified:
    cocoon/whiteboard/corona/trunk/corona-controller/src/main/java/org/apache/cocoon/corona/controller/Controller.java
    cocoon/whiteboard/corona/trunk/corona-controller/src/main/java/org/apache/cocoon/corona/controller/DemoControllerDispatcher.java
    cocoon/whiteboard/corona/trunk/corona-controller/src/main/java/org/apache/cocoon/corona/controller/SpringControllerComponent.java

Modified: cocoon/whiteboard/corona/trunk/corona-controller/src/main/java/org/apache/cocoon/corona/controller/Controller.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-controller/src/main/java/org/apache/cocoon/corona/controller/Controller.java?rev=654540&r1=654539&r2=654540&view=diff
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-controller/src/main/java/org/apache/cocoon/corona/controller/Controller.java
(original)
+++ cocoon/whiteboard/corona/trunk/corona-controller/src/main/java/org/apache/cocoon/corona/controller/Controller.java
Thu May  8 07:45:03 2008
@@ -23,6 +23,7 @@
 
 public interface Controller {
 
-    void invoke(OutputStream outputStream, String string, Map<String, ? extends Object>
parameters);
+    void invoke(OutputStream outputStream, String string, Map<String, ? extends Object>
inputParameters,
+            Map<String, ? extends Object> configuration);
 
 }

Modified: cocoon/whiteboard/corona/trunk/corona-controller/src/main/java/org/apache/cocoon/corona/controller/DemoControllerDispatcher.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-controller/src/main/java/org/apache/cocoon/corona/controller/DemoControllerDispatcher.java?rev=654540&r1=654539&r2=654540&view=diff
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-controller/src/main/java/org/apache/cocoon/corona/controller/DemoControllerDispatcher.java
(original)
+++ cocoon/whiteboard/corona/trunk/corona-controller/src/main/java/org/apache/cocoon/corona/controller/DemoControllerDispatcher.java
Thu May  8 07:45:03 2008
@@ -24,17 +24,12 @@
 import java.net.URL;
 import java.util.Map;
 
-import org.springframework.beans.BeansException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
+public class DemoControllerDispatcher implements Controller {
 
-public class DemoControllerDispatcher implements Controller, ApplicationContextAware {
-
-    private ApplicationContext applicationContext;
-
-    public void invoke(OutputStream outputStream, String select, Map<String, ? extends
Object> parameters) {
+    public void invoke(OutputStream outputStream, String select, Map<String, ? extends
Object> inputParameters,
+            Map<String, ? extends Object> configuration) {
         try {
-//            URL url = new URL("servlet:/read/javascript-resource-explicit");
+            // URL url = new URL("servlet:/read/javascript-resource-explicit");
             URL url = new URL("http://www.springframework.org/schema/context/spring-context-2.5.xsd");
             InputStream inputStream = url.openStream();
 
@@ -55,8 +50,4 @@
             throw new RuntimeException(e);
         }
     }
-
-    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
{
-        this.applicationContext = applicationContext;
-    }
 }

Modified: cocoon/whiteboard/corona/trunk/corona-controller/src/main/java/org/apache/cocoon/corona/controller/SpringControllerComponent.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-controller/src/main/java/org/apache/cocoon/corona/controller/SpringControllerComponent.java?rev=654540&r1=654539&r2=654540&view=diff
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-controller/src/main/java/org/apache/cocoon/corona/controller/SpringControllerComponent.java
(original)
+++ cocoon/whiteboard/corona/trunk/corona-controller/src/main/java/org/apache/cocoon/corona/controller/SpringControllerComponent.java
Thu May  8 07:45:03 2008
@@ -19,7 +19,6 @@
 package org.apache.cocoon.corona.controller;
 
 import java.io.OutputStream;
-import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.cocoon.corona.pipeline.component.Finisher;
@@ -45,10 +44,7 @@
     public void execute() {
         Controller controller = (Controller) this.applicationContext.getBean(Controller.class.getName()
+ "/" + this.beanName,
                 Controller.class);
-        Map<String, Object> controllerParameters = new HashMap<String, Object>();
-        controllerParameters.putAll(this.configuration);
-        controllerParameters.putAll(this.parameters);
-        controller.invoke(this.outputStream, this.selector, controllerParameters);
+        controller.invoke(this.outputStream, this.selector, this.parameters, this.configuration);
     }
 
     /**



Mime
View raw message