cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject svn commit: rev 35686 - in cocoon/branches/butterfly/src: java/org/apache/butterfly/servlet webapp
Date Wed, 04 Aug 2004 15:32:00 GMT
Author: ugo
Date: Wed Aug  4 08:31:59 2004
New Revision: 35686

Added:
   cocoon/branches/butterfly/src/webapp/sitemap.groovy
Removed:
   cocoon/branches/butterfly/src/java/org/apache/butterfly/servlet/sitemap.groovy
Modified:
   cocoon/branches/butterfly/src/java/org/apache/butterfly/servlet/ButterflyServlet.java
Log:
Moved sitemap to webapp directory.


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  4 08:31:59 2004
@@ -18,6 +18,7 @@
 import groovy.lang.GroovyClassLoader;
 import groovy.lang.GroovyObject;
 
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.net.MalformedURLException;
 
@@ -112,7 +113,9 @@
         GroovyClassLoader loader = new GroovyClassLoader(parent);
         try {
             Class pipelineClass = loader.parseClass(getClass().getResourceAsStream("Pipeline.groovy"));
-            Class sitemapClass = loader.parseClass(getClass().getResourceAsStream("sitemap.groovy"));
+            // Parse the main sitemap
+            FileInputStream fis = new FileInputStream(this.servletContext.getResource("sitemap.groovy").getFile());
+            Class sitemapClass = loader.parseClass(fis);
             GroovyObject sitemap = (GroovyObject) sitemapClass.newInstance();
             sitemap.setProperty("beanFactory", this.applicationContext);
             Object[] args = { uri };

Added: cocoon/branches/butterfly/src/webapp/sitemap.groovy
==============================================================================
--- (empty file)
+++ cocoon/branches/butterfly/src/webapp/sitemap.groovy	Wed Aug  4 08:31:59 2004
@@ -0,0 +1,28 @@
+/*
+ * Copyright 1999-2004 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.
+ */
+class Sitemap extends Pipeline {
+  
+    void setup(String requestPath) {
+        if (requestPath =~ ".*\.html") {
+            generate "testdata/welcome.xml"
+            transform "trax", "testdata/welcome.xslt" 
+            serialize "xml"
+        }
+        else {
+            println("No matches for URI [" + requestPath + "]");
+        }
+    }
+}
\ No newline at end of file

Mime
View raw message