cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r649983 - /cocoon/whiteboard/corona/trunk/corona-controller/src/main/java/org/apache/cocoon/corona/controller/SpringControllerComponent.java
Date Sun, 20 Apr 2008 21:25:59 GMT
Author: reinhard
Date: Sun Apr 20 14:25:58 2008
New Revision: 649983

URL: http://svn.apache.org/viewvc?rev=649983&view=rev
Log:
COCOON-2203
Provide both the Sitemap parameters and the input parameters for the Controller. (patch by
Steven Dolg)

Modified:
    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/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=649983&r1=649982&r2=649983&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
Sun Apr 20 14:25:58 2008
@@ -19,6 +19,7 @@
 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;
@@ -30,36 +31,70 @@
 public class SpringControllerComponent implements Starter, Finisher, ApplicationContextAware
{
 
     private ApplicationContext applicationContext;
+    private String beanName;
     private OutputStream outputStream;
     private Map<String, Object> parameters;
-    private String beanName;
     private String selector;
+    private Map<String, ? extends Object> configuration;
 
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.pipeline.component.Starter#execute()
+     */
     public void execute() {
-        Controller controller = (Controller) this.applicationContext.getBean(Controller.class.getName()
+ "/"
-                + this.beanName, Controller.class);
-        controller.invoke(this.outputStream, this.selector, this.parameters);
+        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);
     }
 
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.pipeline.component.Finisher#getContentType()
+     */
     public String getContentType() {
         return null;
     }
 
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
+     */
     public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
{
         this.applicationContext = applicationContext;
     }
 
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.pipeline.component.PipelineComponent#setConfiguration(java.util.Map)
+     */
     public void setConfiguration(Map<String, ? extends Object> configuration) {
+        this.configuration = configuration;
         this.beanName = (String) configuration.get("controller");
         this.selector = (String) configuration.get("select");
     }
 
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.pipeline.component.PipelineComponent#setInputParameters(java.util.Map)
+     */
     public void setInputParameters(Map<String, Object> parameters) {
         this.parameters = parameters;
     }
 
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.apache.cocoon.corona.pipeline.component.Finisher#setOutputStream(java.io.OutputStream)
+     */
     public void setOutputStream(OutputStream outputStream) {
         this.outputStream = outputStream;
     }
 }
-



Mime
View raw message