cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject svn commit: rev 36247 - in cocoon/branches/butterfly/src: java/org/apache/butterfly/servlet webapp
Date Wed, 11 Aug 2004 20:14:12 GMT
Author: ugo
Date: Wed Aug 11 13:14:11 2004
New Revision: 36247

Modified:
   cocoon/branches/butterfly/src/java/org/apache/butterfly/servlet/ButterflyServlet.java
   cocoon/branches/butterfly/src/webapp/sitemap.groovy
Log:
Pass environment to sitemap

Modified: cocoon/branches/butterfly/src/java/org/apache/butterfly/servlet/ButterflyServlet.java
==============================================================================
--- cocoon/branches/butterfly/src/java/org/apache/butterfly/servlet/ButterflyServlet.java
(original)
+++ cocoon/branches/butterfly/src/java/org/apache/butterfly/servlet/ButterflyServlet.java
Wed Aug 11 13:14:11 2004
@@ -118,7 +118,7 @@
             Class sitemapClass = loader.parseClass(fis);
             GroovyObject sitemap = (GroovyObject) sitemapClass.newInstance();
             sitemap.setProperty("beanFactory", this.applicationContext);
-            Object[] args = { uri };
+            Object[] args = { env };
             Boolean retval = (Boolean) sitemap.invokeMethod("setup", args);
             if (retval.booleanValue()) {
                 sitemap.invokeMethod("process", new Object[] { env });

Modified: cocoon/branches/butterfly/src/webapp/sitemap.groovy
==============================================================================
--- cocoon/branches/butterfly/src/webapp/sitemap.groovy	(original)
+++ cocoon/branches/butterfly/src/webapp/sitemap.groovy	Wed Aug 11 13:14:11 2004
@@ -21,18 +21,19 @@
  */
 class Sitemap extends Pipeline {
   
-    boolean setup(String requestPath) {
-        if (requestPath == "") {
+    boolean setup(environment) {
+        uri = environment.uri
+        if (uri == "") {
             generate "file", "welcome.xml", []
             transform "trax", "welcome.xslt", [] 
             serialize "xml", [ 'encoding': 'UTF-8' ]
-        } else if (m = (requestPath =~ "(.*)\.html")) {
+        } else if (m = (uri =~ "(.*)\.html")) {
             generate "file", m.group(1) + ".xml", []
             transform "trax", "welcome.xslt", []
             serialize "xml", [ 'encoding': 'UTF-8' ] 
-        } else if (m = (requestPath =~ "images/(.*)\.gif")) {
+        } else if (m = (uri =~ "images/(.*)\.gif")) {
             read "resources/images/" + m.group(1) + ".gif", "image/gif", []
-        } else if (m = (requestPath =~ "styles/(.*)\.css")) {
+        } else if (m = (uri =~ "styles/(.*)\.css")) {
             read "resources/styles/" + m.group(1) + ".css", "text/css", []
         } else {
             return false;

Mime
View raw message