<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>cvs@cocoon.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/"/>
<id>http://mail-archives.apache.org/mod_mbox/cocoon-cvs/</id>
<updated>2009-12-09T13:26:06Z</updated>
<entry>
<title>svn commit: r888725 - in /cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon: profiling/ProfilingIntegrationTest.java sitemap/SitemapBuilderTest.java</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200912.mbox/%3c20091209081425.254B6238899B@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091209081425-254B6238899B@eris-apache-org%3e</id>
<updated>2009-12-09T08:14:25Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Wed Dec  9 08:14:24 2009
New Revision: 888725

URL: http://svn.apache.org/viewvc?rev=888725&amp;view=rev
Log:
Fix ProfilingIntegrationTest which doesn't need the CallStack anymore
@AfterClass method that closes the appcontext (ProfilingIntegrationTest)

Modified:
    cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/ProfilingIntegrationTest.java
    cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java

Modified: cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/ProfilingIntegrationTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/ProfilingIntegrationTest.java?rev=888725&amp;r1=888724&amp;r2=888725&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/ProfilingIntegrationTest.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/ProfilingIntegrationTest.java
Wed Dec  9 08:14:24 2009
@@ -22,7 +22,6 @@
 
 import java.io.ByteArrayOutputStream;
 import java.net.URL;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -35,19 +34,16 @@
 import org.apache.cocoon.profiling.profiler.PipelineComponentProfiler;
 import org.apache.cocoon.sax.component.XMLSerializer;
 import org.apache.cocoon.servlet.util.HttpContextHelper;
-import org.apache.cocoon.servletservice.CallStackHelper;
 import org.apache.cocoon.sitemap.ComponentProvider;
 import org.apache.cocoon.sitemap.Invocation;
 import org.apache.cocoon.sitemap.InvocationImpl;
-import org.apache.cocoon.sitemap.MockServletContext;
 import org.apache.cocoon.sitemap.SitemapBuilder;
 import org.apache.cocoon.sitemap.node.SitemapNode;
 import org.apache.cocoon.sitemap.objectmodel.ObjectModel;
-import org.junit.After;
+import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class ProfilingIntegrationTest {
@@ -56,7 +52,7 @@
 
     SitemapNode sitemap;
 
-    private static ApplicationContext applicationContext;
+    private static ClassPathXmlApplicationContext applicationContext;
 
     private static ComponentProvider componentProvider;
 
@@ -76,19 +72,18 @@
         this.servlet = (SitemapServlet) applicationContext.getBean("MockSitemapServlet");
         this.servlet.setTestcase(this);
         this.output = new ByteArrayOutputStream();
-
-        Map&lt;String, Object&gt; emptyMap = Collections.emptyMap();
-        CallStackHelper.enterServlet(new MockServletContext(), new MockHttpServletRequest(emptyMap),
-                new MockHttpServletResponse());
     }
 
-    @After
-    public void tearDown() throws Exception {
-        CallStackHelper.leaveServlet();
+    @AfterClass
+    public static void shutdownApplicationContext() {
+        applicationContext.close();
     }
 
-    private static ApplicationContext getApplicationContext() {
+    private static ClassPathXmlApplicationContext getApplicationContext() {
         return new ClassPathXmlApplicationContext(new String[] {
+        "cocoon-sample-test-collector.xml",
+
+        "cocoon-profiling-test-component.xml",
 
         "META-INF/cocoon/spring/cocoon-sitemap.xml",
 
@@ -102,16 +97,11 @@
 
         "META-INF/cocoon/spring/cocoon-expression-language.xml",
 
-        "META-INF/cocoon/spring/cocoon-servlet-collector.xml",
-
         "META-INF/cocoon/spring/cocoon-servlet-component.xml",
 
         "META-INF/cocoon/spring/cocoon-controller.xml",
 
         "META-INF/cocoon/spring/cocoon-profiling-component.xml",
-
-        "cocoon-profiling-test-component.xml",
-
         });
     }
 

Modified: cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java?rev=888725&amp;r1=888724&amp;r2=888725&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java
Wed Dec  9 08:14:24 2009
@@ -164,13 +164,27 @@
         super.setUp();
 
         ApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[]
{
-                "META-INF/cocoon/spring/cocoon-sitemap.xml", "META-INF/cocoon/spring/cocoon-pipeline-action.xml",
-                "META-INF/cocoon/spring/cocoon-pipeline-component.xml", "META-INF/cocoon/spring/cocoon-pipeline.xml",
+                "cocoon-sample-test-collector.xml",
+
+                "META-INF/cocoon/spring/cocoon-pipeline.xml",
+
+                "META-INF/cocoon/spring/cocoon-pipeline-action.xml",
+
+                "META-INF/cocoon/spring/cocoon-pipeline-component.xml",
+
+                "META-INF/cocoon/spring/cocoon-sitemap.xml",
+
                 "META-INF/cocoon/spring/cocoon-sitemap-node.xml",
+
                 "META-INF/cocoon/spring/cocoon-expression-language.xml",
+
                 "META-INF/cocoon/spring/cocoon-sample-sitemap-components.xml",
-                "META-INF/cocoon/spring/cocoon-servlet-component.xml", "META-INF/cocoon/spring/cocoon-controller.xml",
-                "cocoon-sample-test-collector.xml" });
+
+                "META-INF/cocoon/spring/cocoon-servlet-component.xml",
+
+                "META-INF/cocoon/spring/cocoon-controller.xml"
+
+                 });
 
         this.componentProvider = (ComponentProvider) applicationContext
                 .getBean("org.apache.cocoon.sitemap.ComponentProvider");




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r888393 - in /cocoon/cocoon3/trunk: cocoon-sample/src/test/java/org/apache/cocoon/sitemap/ cocoon-sample/src/test/resources/ cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ cocoon-servlet/src/main/resources/META-INF/cocoon...</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200912.mbox/%3c20091208132037.A446323888E3@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091208132037-A446323888E3@eris-apache-org%3e</id>
<updated>2009-12-08T13:20:37Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Tue Dec  8 13:20:36 2009
New Revision: 888393

URL: http://svn.apache.org/viewvc?rev=888393&amp;view=rev
Log:
separate reponse header data collection from the store: provide two store implementations,
one based on ThreadLocals and the other on the ServletService-Framework CallStack

Added:
    cocoon/cocoon3/trunk/cocoon-sample/src/test/resources/cocoon-sample-test-collector.xml
  (with props)
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/CallStackCollectorDataStore.java
  (with props)
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/CollectorDataStore.java
  (with props)
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ThreadLocalCollectorDataStore.java
  (with props)
Modified:
    cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ResponseHeaderCollector.java
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-collector.xml

Modified: cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java?rev=888393&amp;r1=888392&amp;r2=888393&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java
Tue Dec  8 13:20:36 2009
@@ -19,7 +19,6 @@
 package org.apache.cocoon.sitemap;
 
 import java.net.URL;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -30,10 +29,10 @@
 import org.apache.cocoon.sample.action.CustomException;
 import org.apache.cocoon.servlet.collector.ResponseHeaderCollector;
 import org.apache.cocoon.servlet.util.HttpContextHelper;
-import org.apache.cocoon.servletservice.CallStackHelper;
 import org.apache.cocoon.sitemap.node.InvocationResult;
 import org.apache.cocoon.sitemap.node.SitemapNode;
 import org.apache.cocoon.sitemap.objectmodel.ObjectModel;
+import org.apache.commons.io.output.NullOutputStream;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
@@ -43,31 +42,16 @@
     private SitemapBuilder sitemapBuilder;
     private ComponentProvider componentProvider;
 
-    public void testErrorHandlingGlobal() {
-        // TODO: currently this cannot work since some components for error
-        // handling are still missing
-        // Invocation invocation =
-        // this.buildInvocation("error-handling/custom-error");
-        // InvocationResult invocationResult = this.sitemap.invoke(invocation);
-        // assertNotNull(invocationResult);
-        // assertSame(InvocationResult.COMPLETED, invocationResult);
-        //
-        // // invocation should be marked as error-invocation
-        // assertTrue(invocation.isErrorInvocation());
-        // // the throwable should be our exception
-        // assertTrue(invocation.getThrowable().toString(),
-        // invocation.getThrowable() instanceof CustomException);
-    }
-
-
     public void testErrorHandlingPipeline() throws Exception {
         Invocation invocation = this.buildInvocation("error-handling/custom-error-per-pipeline-error-handling");
         MockHttpServletResponse mockHttpServletResponse = new MockHttpServletResponse();
         HttpContextHelper.storeResponse(mockHttpServletResponse, invocation.getParameters());
 
         this.sitemap.invoke(invocation);
+
         // invocation should be marked as error-invocation
         assertTrue(invocation.isErrorInvocation());
+
         // the throwable should be our exception
         assertTrue("Expected CustomException but received " + invocation.getThrowable(),
                 invocation.getThrowable() instanceof CustomException);
@@ -120,6 +104,7 @@
         requestParameters.put("c", "3");
         HttpContextHelper.storeRequest(new MockHttpServletRequest(requestParameters), invocation.getParameters());
         this.sitemap.invoke(invocation);
+
         // invocation not should be marked as error-invocation
         assertFalse(invocation.isErrorInvocation());
     }
@@ -138,34 +123,16 @@
         assertFalse("InvocationImpl is marked as erroneous", invocation.isErrorInvocation());
     }
 
-    // TODO: steven.dolg [2008-02-21]: cannot work until expression-language is
-    // integrated correctly
-    // public void testExpressionLanguage2() {
-    // InvocationImpl invocation =
-    // this.buildInvocation("expression-language/nested2/test");
-    // this.sitemap.invoke(invocation);
-    // // invocation should not be marked as error-invocation
-    // assertFalse(invocation.isErrorInvocation());
-    // }
-
-    // TODO: steven.dolg [2008-02-21]: cannot work until expression-language is
-    // integrated correctly
-    // public void testExpressionLanguage3() {
-    // InvocationImpl invocation =
-    // this.buildInvocation("expression-language/nested3/test");
-    // this.sitemap.invoke(invocation);
-    // // invocation should not be marked as error-invocation
-    // assertFalse(invocation.isErrorInvocation());
-    // }
-
     public void testReadPipelineExplicit() {
         Invocation invocation = this.buildInvocation("read/javascript-resource-explicit");
         assertTrue(this.sitemap.invoke(invocation).isCompleted());
+
         // invocation should not be marked as error-invocation
         assertFalse(invocation.isErrorInvocation());
 
         invocation = this.buildInvocation("read/javascript-resource-explicit");
         assertTrue(this.sitemap.invoke(invocation).isCompleted());
+
         // invocation should not be marked as error-invocation
         assertFalse(invocation.isErrorInvocation());
     }
@@ -173,6 +140,7 @@
     public void testReadPipelineImplicit() {
         Invocation invocation = this.buildInvocation("read/javascript-resource-implicit.js");
         assertTrue(this.sitemap.invoke(invocation).isCompleted());
+
         // invocation should not be marked as error-invocation
         assertFalse(invocation.isErrorInvocation());
     }
@@ -185,6 +153,7 @@
         invocation.setParameters(parameters);
 
         assertTrue(this.sitemap.invoke(invocation).isCompleted());
+
         // invocation should not be marked as error-invocation
         assertFalse("InvocationImpl is marked as erroneous.", invocation.isErrorInvocation());
         assertTrue(response.hasRedirected());
@@ -200,8 +169,8 @@
                 "META-INF/cocoon/spring/cocoon-sitemap-node.xml",
                 "META-INF/cocoon/spring/cocoon-expression-language.xml",
                 "META-INF/cocoon/spring/cocoon-sample-sitemap-components.xml",
-                "META-INF/cocoon/spring/cocoon-servlet-collector.xml",
-                "META-INF/cocoon/spring/cocoon-servlet-component.xml", "META-INF/cocoon/spring/cocoon-controller.xml"
});
+                "META-INF/cocoon/spring/cocoon-servlet-component.xml", "META-INF/cocoon/spring/cocoon-controller.xml",
+                "cocoon-sample-test-collector.xml" });
 
         this.componentProvider = (ComponentProvider) applicationContext
                 .getBean("org.apache.cocoon.sitemap.ComponentProvider");
@@ -209,21 +178,10 @@
         URL sitemapURL = this.getClass().getResource("/COB-INF/sitemap.xmap");
         this.sitemapBuilder = (SitemapBuilder) applicationContext.getBean("org.apache.cocoon.sitemap.SitemapBuilder");
         this.sitemap = this.sitemapBuilder.build(sitemapURL);
-
-        Map&lt;String, String&gt; emptyMap = Collections.emptyMap();
-        CallStackHelper.enterServlet(new MockServletContext(), new MockHttpServletRequest(emptyMap),
-                new MockHttpServletResponse());
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-
-        CallStackHelper.leaveServlet();
     }
 
     private Invocation buildInvocation(String request) {
-        InvocationImpl invocation = new InvocationImpl(System.out);
+        InvocationImpl invocation = new InvocationImpl(new NullOutputStream());
 
         invocation.setBaseURL(this.getClass().getResource("/COB-INF/"));
         invocation.setRequestURI(request);

Added: cocoon/cocoon3/trunk/cocoon-sample/src/test/resources/cocoon-sample-test-collector.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/test/resources/cocoon-sample-test-collector.xml?rev=888393&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/test/resources/cocoon-sample-test-collector.xml
(added)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/test/resources/cocoon-sample-test-collector.xml
Tue Dec  8 13:20:36 2009
@@ -0,0 +1,30 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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
+  und
+--&gt;
+&lt;!-- $Id$ --&gt;
+&lt;beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:aop="http://www.springframework.org/schema/aop"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"&gt;
+
+  &lt;aop:aspectj-autoproxy proxy-target-class="false" /&gt;
+ 
+  &lt;bean id="org.apache.cocoon.servlet.collector.ResponseHeaderCollector" class="org.apache.cocoon.servlet.collector.ResponseHeaderCollector"
/&gt;
+&lt;/beans&gt;

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/test/resources/cocoon-sample-test-collector.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/test/resources/cocoon-sample-test-collector.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/test/resources/cocoon-sample-test-collector.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/CallStackCollectorDataStore.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/CallStackCollectorDataStore.java?rev=888393&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/CallStackCollectorDataStore.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/CallStackCollectorDataStore.java
Tue Dec  8 13:20:36 2009
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.servlet.collector;
+
+import org.apache.cocoon.callstack.CallStack;
+
+public class CallStackCollectorDataStore implements CollectorDataStore {
+
+    public Object get(String key) {
+        return CallStack.getCurrentFrame().getAttribute(key);
+    }
+
+    public void set(String key, Object value) {
+        CallStack.getCurrentFrame().setAttribute(key, value);
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/CallStackCollectorDataStore.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/CallStackCollectorDataStore.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/CallStackCollectorDataStore.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/CollectorDataStore.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/CollectorDataStore.java?rev=888393&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/CollectorDataStore.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/CollectorDataStore.java
Tue Dec  8 13:20:36 2009
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.servlet.collector;
+
+public interface CollectorDataStore {
+
+    Object get(String key);
+
+    void set(String key, Object value);
+}

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/CollectorDataStore.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/CollectorDataStore.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/CollectorDataStore.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ResponseHeaderCollector.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ResponseHeaderCollector.java?rev=888393&amp;r1=888392&amp;r2=888393&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ResponseHeaderCollector.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ResponseHeaderCollector.java
Tue Dec  8 13:20:36 2009
@@ -18,7 +18,6 @@
 
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.cocoon.callstack.CallStack;
 import org.apache.cocoon.pipeline.Pipeline;
 import org.apache.cocoon.pipeline.component.PipelineComponent;
 import org.apache.cocoon.sitemap.Invocation;
@@ -31,6 +30,8 @@
 @Aspect
 public class ResponseHeaderCollector {
 
+    private static CollectorDataStore collectorDataStore = new ThreadLocalCollectorDataStore();
+
     private static final String KEY_LAST_MODIFIED = ResponseHeaderCollector.class.getName()
+ "/last-modified";
     private static final String KEY_MIME_TYPE = ResponseHeaderCollector.class.getName() +
"/mime-type";
     private static final String KEY_STATUS_CODE = ResponseHeaderCollector.class.getName()
+ "/status-code";
@@ -73,8 +74,12 @@
         return invocationResult;
     }
 
+    public void setCollectorDataStore(CollectorDataStore collectorDataStore) {
+        ResponseHeaderCollector.collectorDataStore = collectorDataStore;
+    }
+
     public static long getLastModified() {
-        Object lastModified = CallStack.getCurrentFrame().getAttribute(KEY_LAST_MODIFIED);
+        Object lastModified = collectorDataStore.get(KEY_LAST_MODIFIED);
 
         if (lastModified == null) {
             return -1;
@@ -84,11 +89,11 @@
     }
 
     public static String getMimeType() {
-        return (String) CallStack.getCurrentFrame().getAttribute(KEY_MIME_TYPE);
+        return (String) collectorDataStore.get(KEY_MIME_TYPE);
     }
 
     public static int getStatusCode() {
-        Integer statusCode = (Integer) CallStack.getCurrentFrame().getAttribute(KEY_STATUS_CODE);
+        Integer statusCode = (Integer) collectorDataStore.get(KEY_STATUS_CODE);
 
         if (statusCode == null) {
             return HttpServletResponse.SC_OK;
@@ -98,14 +103,14 @@
     }
 
     public static void setLastModified(Long lastModified) {
-        CallStack.getCurrentFrame().setAttribute(KEY_LAST_MODIFIED, lastModified);
+        collectorDataStore.set(KEY_LAST_MODIFIED, lastModified);
     }
 
     public static void setMimeType(String mimeType) {
-        CallStack.getCurrentFrame().setAttribute(KEY_MIME_TYPE, mimeType);
+        collectorDataStore.set(KEY_MIME_TYPE, mimeType);
     }
 
     public static void setStatusCode(int statusCode) {
-        CallStack.getCurrentFrame().setAttribute(KEY_STATUS_CODE, statusCode);
+        collectorDataStore.set(KEY_STATUS_CODE, statusCode);
     }
 }

Added: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ThreadLocalCollectorDataStore.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ThreadLocalCollectorDataStore.java?rev=888393&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ThreadLocalCollectorDataStore.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ThreadLocalCollectorDataStore.java
Tue Dec  8 13:20:36 2009
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.servlet.collector;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class ThreadLocalCollectorDataStore implements CollectorDataStore {
+
+    private static ThreadLocal&lt;Map&lt;String, Object&gt;&gt; threadStore = new ThreadLocal&lt;Map&lt;String,
Object&gt;&gt;();
+
+    public ThreadLocalCollectorDataStore() {
+        threadStore.set(new HashMap&lt;String, Object&gt;());
+    }
+
+    public Object get(String key) {
+        return threadStore.get().get(key);
+    }
+
+    public void set(String key, Object value) {
+        threadStore.get().put(key, value);
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ThreadLocalCollectorDataStore.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ThreadLocalCollectorDataStore.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ThreadLocalCollectorDataStore.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cocoon/cocoon3/trunk/cocoon-servlet/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-collector.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-collector.xml?rev=888393&amp;r1=888392&amp;r2=888393&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-collector.xml
(original)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-collector.xml
Tue Dec  8 13:20:36 2009
@@ -26,5 +26,9 @@
 
   &lt;aop:aspectj-autoproxy proxy-target-class="false" /&gt;
  
-  &lt;bean id="org.apache.cocoon.servlet.collector.ResponseHeaderCollector" class="org.apache.cocoon.servlet.collector.ResponseHeaderCollector"
/&gt;
+  &lt;bean id="org.apache.cocoon.servlet.collector.ResponseHeaderCollector" class="org.apache.cocoon.servlet.collector.ResponseHeaderCollector"&gt;
+    &lt;property name="collectorDataStore"&gt;
+      &lt;bean class="org.apache.cocoon.servlet.collector.CallStackCollectorDataStore" /&gt;
+    &lt;/property&gt;
+  &lt;/bean&gt;
 &lt;/beans&gt;




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r888151 - in /cocoon/cocoon3/trunk: cocoon-rest/src/main/java/org/apache/cocoon/rest/controller/ cocoon-sample/src/test/java/org/apache/cocoon/profiling/ cocoon-sample/src/test/java/org/apache/cocoon/sitemap/ cocoon-servlet/src/main/java/or...</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200912.mbox/%3c20091207215532.6FF352388998@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091207215532-6FF352388998@eris-apache-org%3e</id>
<updated>2009-12-07T21:55:30Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Mon Dec  7 21:55:28 2009
New Revision: 888151

URL: http://svn.apache.org/viewvc?rev=888151&amp;view=rev
Log:
one aspect for all collectors (will also make stacktraces more readable)

Added:
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/InvalidStatusCodeException.java
  (with props)
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ResponseHeaderCollector.java
  (with props)
Removed:
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/node/LastModifiedCollector.java
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/node/MimeTypeCollector.java
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/node/StatusCodeCollector.java
Modified:
    cocoon/cocoon3/trunk/cocoon-rest/src/main/java/org/apache/cocoon/rest/controller/SpringRESTController.java
    cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/MockXMLSitemapServlet.java
    cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceSerializer.java
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-collector.xml
    cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/WicketReader.java

Modified: cocoon/cocoon3/trunk/cocoon-rest/src/main/java/org/apache/cocoon/rest/controller/SpringRESTController.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-rest/src/main/java/org/apache/cocoon/rest/controller/SpringRESTController.java?rev=888151&amp;r1=888150&amp;r2=888151&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-rest/src/main/java/org/apache/cocoon/rest/controller/SpringRESTController.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-rest/src/main/java/org/apache/cocoon/rest/controller/SpringRESTController.java
Mon Dec  7 21:55:28 2009
@@ -43,8 +43,7 @@
 import org.apache.cocoon.rest.controller.response.RestResponse;
 import org.apache.cocoon.rest.controller.response.RestResponseMetaData;
 import org.apache.cocoon.rest.controller.util.AnnotationCollector;
-import org.apache.cocoon.servlet.node.MimeTypeCollector;
-import org.apache.cocoon.servlet.node.StatusCodeCollector;
+import org.apache.cocoon.servlet.collector.ResponseHeaderCollector;
 import org.apache.cocoon.servlet.util.HttpContextHelper;
 import org.apache.cocoon.servlet.util.SettingsHelper;
 import org.apache.cocoon.sitemap.util.ExceptionHandler;
@@ -88,10 +87,10 @@
             RestResponseMetaData restResponseMetaData = restResponse.execute(outputStream,
inputParameters);
 
             // set the status-code with the result produced by the restResponse execution
-            StatusCodeCollector.setStatusCode(restResponseMetaData.getStatusCode());
+            ResponseHeaderCollector.setStatusCode(restResponseMetaData.getStatusCode());
 
             // set the content type with the result produced by the restResponse execution
-            MimeTypeCollector.setMimeType(restResponseMetaData.getContentType());
+            ResponseHeaderCollector.setMimeType(restResponseMetaData.getContentType());
 
             // return the content type
             return restResponseMetaData.getContentType();

Modified: cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/MockXMLSitemapServlet.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/MockXMLSitemapServlet.java?rev=888151&amp;r1=888150&amp;r2=888151&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/MockXMLSitemapServlet.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/MockXMLSitemapServlet.java
Mon Dec  7 21:55:28 2009
@@ -32,8 +32,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.cocoon.servlet.node.LastModifiedCollector;
-import org.apache.cocoon.servlet.node.MimeTypeCollector;
+import org.apache.cocoon.servlet.collector.ResponseHeaderCollector;
 import org.apache.cocoon.servlet.util.HttpContextHelper;
 import org.apache.cocoon.sitemap.Invocation;
 
@@ -74,7 +73,7 @@
 
             // collect meta information from the previous run of the sitemap
             // engine
-            long lastModified = LastModifiedCollector.getLastModified();
+            long lastModified = ResponseHeaderCollector.getLastModified();
             int contentLengh = baos.size();
 
             // send the Last-Modified header
@@ -85,7 +84,7 @@
             response.setHeader("X-Cocoon-Version", this.version);
 
             // Content-Type handling
-            String mimeType = MimeTypeCollector.getMimeType();
+            String mimeType = ResponseHeaderCollector.getMimeType();
             if (mimeType == null || "".equals(mimeType) || "content/unknown".equals(mimeType))
{
                 mimeType = this.servletConfig.getServletContext().getMimeType(request.getRequestURI());
             }

Modified: cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java?rev=888151&amp;r1=888150&amp;r2=888151&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java
Mon Dec  7 21:55:28 2009
@@ -28,7 +28,7 @@
 import junit.framework.TestCase;
 
 import org.apache.cocoon.sample.action.CustomException;
-import org.apache.cocoon.servlet.node.StatusCodeCollector;
+import org.apache.cocoon.servlet.collector.ResponseHeaderCollector;
 import org.apache.cocoon.servlet.util.HttpContextHelper;
 import org.apache.cocoon.servletservice.CallStackHelper;
 import org.apache.cocoon.sitemap.node.InvocationResult;
@@ -72,7 +72,7 @@
         assertTrue("Expected CustomException but received " + invocation.getThrowable(),
                 invocation.getThrowable() instanceof CustomException);
 
-        assertEquals(501, StatusCodeCollector.getStatusCode());
+        assertEquals(501, ResponseHeaderCollector.getStatusCode());
     }
 
     public void testGenerator() throws Exception {
@@ -86,7 +86,7 @@
 
         // invocation should not be marked as error-invocation
         assertFalse(invocation.isErrorInvocation());
-        assertEquals(401, StatusCodeCollector.getStatusCode());
+        assertEquals(401, ResponseHeaderCollector.getStatusCode());
     }
 
     public void testNoMatchingPipeline() throws Exception {

Modified: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java?rev=888151&amp;r1=888150&amp;r2=888151&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
Mon Dec  7 21:55:28 2009
@@ -36,9 +36,7 @@
 
 import org.apache.cocoon.callstack.CallStack;
 import org.apache.cocoon.configuration.Settings;
-import org.apache.cocoon.servlet.node.LastModifiedCollector;
-import org.apache.cocoon.servlet.node.MimeTypeCollector;
-import org.apache.cocoon.servlet.node.StatusCodeCollector;
+import org.apache.cocoon.servlet.collector.ResponseHeaderCollector;
 import org.apache.cocoon.servlet.util.HttpContextHelper;
 import org.apache.cocoon.servlet.util.ManifestUtils;
 import org.apache.cocoon.servlet.util.ObjectModelProvider;
@@ -95,7 +93,7 @@
                 return;
             }
 
-            // if it runs ouside of the Servlet-Service framework, the CallStack has
+            // if it runs outside of the Servlet-Service framework, the CallStack has
             // to be prepared
             try {
                 CallStackHelper.enterServlet(this.servletContext, request, response);
@@ -281,7 +279,7 @@
                 this.servletContext), baos);
 
         // collect meta information from the previous run of the sitemap engine
-        long lastModified = LastModifiedCollector.getLastModified();
+        long lastModified = ResponseHeaderCollector.getLastModified();
         int contentLengh = baos.size();
 
         // send the Last-Modified header
@@ -311,7 +309,7 @@
         }
 
         // Content-Type handling
-        String mimeType = MimeTypeCollector.getMimeType();
+        String mimeType = ResponseHeaderCollector.getMimeType();
         if (mimeType == null || "".equals(mimeType) || "content/unknown".equals(mimeType))
{
             mimeType = this.servletContext.getMimeType(request.getRequestURI());
         }
@@ -320,7 +318,7 @@
         }
 
         // Status code handling
-        int statusCode = StatusCodeCollector.getStatusCode();
+        int statusCode = ResponseHeaderCollector.getStatusCode();
         response.setStatus(statusCode);
 
         // write the sitemap result to the output stream

Added: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/InvalidStatusCodeException.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/InvalidStatusCodeException.java?rev=888151&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/InvalidStatusCodeException.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/InvalidStatusCodeException.java
Mon Dec  7 21:55:28 2009
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+/**
+ * 
+ */
+package org.apache.cocoon.servlet.collector;
+
+public class InvalidStatusCodeException extends RuntimeException {
+
+    private static final long serialVersionUID = 1L;
+
+    public InvalidStatusCodeException(String message, Throwable t) {
+        super(message, t);
+    }
+}
\ No newline at end of file

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/InvalidStatusCodeException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/InvalidStatusCodeException.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/InvalidStatusCodeException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ResponseHeaderCollector.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ResponseHeaderCollector.java?rev=888151&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ResponseHeaderCollector.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ResponseHeaderCollector.java
Mon Dec  7 21:55:28 2009
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.servlet.collector;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.cocoon.callstack.CallStack;
+import org.apache.cocoon.pipeline.Pipeline;
+import org.apache.cocoon.pipeline.component.PipelineComponent;
+import org.apache.cocoon.sitemap.Invocation;
+import org.apache.cocoon.sitemap.node.InvocationResult;
+import org.apache.cocoon.sitemap.node.SerializeNode;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+
+@Aspect
+public class ResponseHeaderCollector {
+
+    private static final String KEY_LAST_MODIFIED = ResponseHeaderCollector.class.getName()
+ "/last-modified";
+    private static final String KEY_MIME_TYPE = ResponseHeaderCollector.class.getName() +
"/mime-type";
+    private static final String KEY_STATUS_CODE = ResponseHeaderCollector.class.getName()
+ "/status-code";
+
+    @SuppressWarnings("unchecked")
+    @Around("execution(* org.apache.cocoon.pipeline.Pipeline.execute(..))")
+    public Object interceptInvoke(ProceedingJoinPoint proceedingJoinPoint) throws Throwable
{
+        Object result = proceedingJoinPoint.proceed();
+        Pipeline&lt;PipelineComponent&gt; pipeline = (Pipeline&lt;PipelineComponent&gt;)
proceedingJoinPoint.getTarget();
+
+        // last modified
+        long lastModified = pipeline.getLastModified();
+        if (lastModified &gt; -1 || getLastModified() &lt;= 0) {
+            setLastModified(lastModified);
+        }
+
+        // mime type
+        String newValue = pipeline.getContentType();
+        if (newValue != null) {
+            setMimeType(newValue);
+        }
+
+        return result;
+    }
+
+    @Around("execution(* org.apache.cocoon.sitemap.node.SerializeNode.invoke(..)) &amp;&amp;
args(invocation)")
+    public Object interceptInvoke(ProceedingJoinPoint proceedingJoinPoint, Invocation invocation)
throws Throwable {
+        SerializeNode target = (SerializeNode) proceedingJoinPoint.getTarget();
+        String statusCode = invocation.resolveParameter(target.getParameters().get("status-code"));
+
+        InvocationResult invocationResult = (InvocationResult) proceedingJoinPoint.proceed();
+        if (invocationResult.isContinued() &amp;&amp; statusCode != null) {
+            try {
+                setStatusCode(Integer.valueOf(statusCode));
+            } catch (NumberFormatException nfe) {
+                throw new InvalidStatusCodeException("The status-code '" + statusCode + "
is not valid number.", nfe);
+            }
+        }
+
+        return invocationResult;
+    }
+
+    public static long getLastModified() {
+        Object lastModified = CallStack.getCurrentFrame().getAttribute(KEY_LAST_MODIFIED);
+
+        if (lastModified == null) {
+            return -1;
+        }
+
+        return (Long) lastModified;
+    }
+
+    public static String getMimeType() {
+        return (String) CallStack.getCurrentFrame().getAttribute(KEY_MIME_TYPE);
+    }
+
+    public static int getStatusCode() {
+        Integer statusCode = (Integer) CallStack.getCurrentFrame().getAttribute(KEY_STATUS_CODE);
+
+        if (statusCode == null) {
+            return HttpServletResponse.SC_OK;
+        }
+
+        return statusCode;
+    }
+
+    public static void setLastModified(Long lastModified) {
+        CallStack.getCurrentFrame().setAttribute(KEY_LAST_MODIFIED, lastModified);
+    }
+
+    public static void setMimeType(String mimeType) {
+        CallStack.getCurrentFrame().setAttribute(KEY_MIME_TYPE, mimeType);
+    }
+
+    public static void setStatusCode(int statusCode) {
+        CallStack.getCurrentFrame().setAttribute(KEY_STATUS_CODE, statusCode);
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ResponseHeaderCollector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ResponseHeaderCollector.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/collector/ResponseHeaderCollector.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceSerializer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceSerializer.java?rev=888151&amp;r1=888150&amp;r2=888151&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceSerializer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceSerializer.java
Mon Dec  7 21:55:28 2009
@@ -28,7 +28,7 @@
 import org.apache.cocoon.pipeline.util.URLConnectionUtils;
 import org.apache.cocoon.sax.AbstractSAXSerializer;
 import org.apache.cocoon.sax.util.XMLUtils;
-import org.apache.cocoon.servlet.node.StatusCodeCollector;
+import org.apache.cocoon.servlet.collector.ResponseHeaderCollector;
 import org.apache.cocoon.xml.sax.SAXBuffer;
 import org.apache.commons.io.IOUtils;
 import org.xml.sax.SAXException;
@@ -60,7 +60,7 @@
             if (urlConnection instanceof HttpURLConnection) {
                 HttpURLConnection servletURLConnection = (HttpURLConnection) urlConnection;
                 int statusCode = servletURLConnection.getResponseCode();
-                StatusCodeCollector.setStatusCode(statusCode);
+                ResponseHeaderCollector.setStatusCode(statusCode);
             }
         } catch (IOException e) {
             throw new SAXException("Can't copy result of servlet service to the output stream",
e);

Modified: cocoon/cocoon3/trunk/cocoon-servlet/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-collector.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-collector.xml?rev=888151&amp;r1=888150&amp;r2=888151&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-collector.xml
(original)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-collector.xml
Mon Dec  7 21:55:28 2009
@@ -22,14 +22,9 @@
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:aop="http://www.springframework.org/schema/aop"
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
-  http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"&gt;
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"&gt;
 
   &lt;aop:aspectj-autoproxy proxy-target-class="false" /&gt;
  
-  &lt;bean id="org.apache.cocoon.servlet.node.StatusCodeCollector" class="org.apache.cocoon.servlet.node.StatusCodeCollector"
/&gt;
-
-  &lt;bean id="org.apache.cocoon.servlet.node.MimeTypeCollector" class="org.apache.cocoon.servlet.node.MimeTypeCollector"
/&gt;
-  
-  &lt;bean id="org.apache.cocoon.servlet.node.LastModifiedCollector" class="org.apache.cocoon.servlet.node.LastModifiedCollector"
/&gt;
-  
+  &lt;bean id="org.apache.cocoon.servlet.collector.ResponseHeaderCollector" class="org.apache.cocoon.servlet.collector.ResponseHeaderCollector"
/&gt;
 &lt;/beans&gt;

Modified: cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/WicketReader.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/WicketReader.java?rev=888151&amp;r1=888150&amp;r2=888151&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/WicketReader.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/WicketReader.java
Mon Dec  7 21:55:28 2009
@@ -43,7 +43,7 @@
 import org.apache.cocoon.pipeline.SetupException;
 import org.apache.cocoon.pipeline.component.Finisher;
 import org.apache.cocoon.pipeline.component.Starter;
-import org.apache.cocoon.servlet.node.LastModifiedCollector;
+import org.apache.cocoon.servlet.collector.ResponseHeaderCollector;
 import org.apache.cocoon.servlet.util.HttpContextHelper;
 import org.apache.commons.io.IOUtils;
 import org.apache.wicket.protocol.http.WicketFilter;
@@ -293,7 +293,7 @@
 
         public void setDateHeader(String name, long date) {
             if ("Last-Modified".equals(name)) {
-                LastModifiedCollector.setLastModified(date);
+                ResponseHeaderCollector.setLastModified(date);
             }
             this.response.setDateHeader(name, date);
         }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887605 - /cocoon/trunk/tools/cocoon-maven-plugin/src/main/java/org/apache/cocoon/maven/rcl/PrepareWebappMojo.java</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200912.mbox/%3c20091205224546.8790923888FD@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091205224546-8790923888FD@eris-apache-org%3e</id>
<updated>2009-12-05T22:45:46Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Sat Dec  5 22:45:45 2009
New Revision: 887605

URL: http://svn.apache.org/viewvc?rev=887605&amp;view=rev
Log:
don't swallow the exception

Modified:
    cocoon/trunk/tools/cocoon-maven-plugin/src/main/java/org/apache/cocoon/maven/rcl/PrepareWebappMojo.java

Modified: cocoon/trunk/tools/cocoon-maven-plugin/src/main/java/org/apache/cocoon/maven/rcl/PrepareWebappMojo.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-maven-plugin/src/main/java/org/apache/cocoon/maven/rcl/PrepareWebappMojo.java?rev=887605&amp;r1=887604&amp;r2=887605&amp;view=diff
==============================================================================
--- cocoon/trunk/tools/cocoon-maven-plugin/src/main/java/org/apache/cocoon/maven/rcl/PrepareWebappMojo.java
(original)
+++ cocoon/trunk/tools/cocoon-maven-plugin/src/main/java/org/apache/cocoon/maven/rcl/PrepareWebappMojo.java
Sat Dec  5 22:45:45 2009
@@ -453,7 +453,7 @@
             FileUtils.copyDirectory(this.customWebappDirectory, webAppBaseDir);
         } catch (IOException e) {
             throw new MojoExecutionException("Can't copy custom webapp files (directory:
'" + this.customWebappDirectory
-                            + ") to the web application in preparation.");
+                            + ") to the web application in preparation.", e);
         }
     }
 




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r884454 - /cocoon/cocoon3/trunk/pom.xml</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091126080329.9EAB023888C5@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091126080329-9EAB023888C5@eris-apache-org%3e</id>
<updated>2009-11-26T08:03:29Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Nov 26 08:03:29 2009
New Revision: 884454

URL: http://svn.apache.org/viewvc?rev=884454&amp;view=rev
Log:
Cocoon-Wicket integration
maven-eclipse-plugin 2.7 has some bugs if you use Spring AOP in your application

Modified:
    cocoon/cocoon3/trunk/pom.xml

Modified: cocoon/cocoon3/trunk/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/pom.xml?rev=884454&amp;r1=884453&amp;r2=884454&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/pom.xml (original)
+++ cocoon/cocoon3/trunk/pom.xml Thu Nov 26 08:03:29 2009
@@ -30,19 +30,20 @@
   
   &lt;modules&gt;  
     &lt;module&gt;cocoon-all&lt;/module&gt;
-    &lt;module&gt;cocoon-controller&lt;/module&gt;    
-    &lt;module&gt;cocoon-optional&lt;/module&gt;    
-    &lt;module&gt;cocoon-monitoring&lt;/module&gt;      
+    &lt;module&gt;cocoon-controller&lt;/module&gt;
+    &lt;module&gt;cocoon-monitoring&lt;/module&gt;
+    &lt;module&gt;cocoon-optional&lt;/module&gt;
     &lt;module&gt;cocoon-pipeline&lt;/module&gt;
+    &lt;module&gt;cocoon-profiling&lt;/module&gt;
     &lt;module&gt;cocoon-rest&lt;/module&gt;
-    &lt;module&gt;cocoon-sample&lt;/module&gt;         
-    &lt;module&gt;cocoon-servlet&lt;/module&gt;    
+    &lt;module&gt;cocoon-sample&lt;/module&gt;
+    &lt;module&gt;cocoon-sax&lt;/module&gt;
+    &lt;module&gt;cocoon-servlet&lt;/module&gt;
     &lt;module&gt;cocoon-sitemap&lt;/module&gt;
     &lt;module&gt;cocoon-stax&lt;/module&gt;
-    &lt;module&gt;cocoon-profiling&lt;/module&gt;
     &lt;module&gt;cocoon-stringtemplate&lt;/module&gt;    
+    &lt;module&gt;cocoon-wicket&lt;/module&gt;
     &lt;module&gt;parent&lt;/module&gt;
-    &lt;module&gt;cocoon-sax&lt;/module&gt;
   &lt;/modules&gt;
   
   &lt;build&gt;
@@ -56,7 +57,7 @@
       &lt;/plugin&gt; 
       &lt;plugin&gt;
         &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
-        &lt;version&gt;2.7&lt;/version&gt;
+        &lt;version&gt;2.5.1&lt;/version&gt;
       &lt;/plugin&gt;
       &lt;plugin&gt;
         &lt;artifactId&gt;maven-idea-plugin&lt;/artifactId&gt;




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r884453 - /cocoon/cocoon3/trunk/cocoon-docs/src/site/apt/roadmap.apt</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091126080210.D894423888C5@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091126080210-D894423888C5@eris-apache-org%3e</id>
<updated>2009-11-26T08:02:10Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Nov 26 08:02:10 2009
New Revision: 884453

URL: http://svn.apache.org/viewvc?rev=884453&amp;view=rev
Log:
update the list of ideas for C3

Modified:
    cocoon/cocoon3/trunk/cocoon-docs/src/site/apt/roadmap.apt

Modified: cocoon/cocoon3/trunk/cocoon-docs/src/site/apt/roadmap.apt
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-docs/src/site/apt/roadmap.apt?rev=884453&amp;r1=884452&amp;r2=884453&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-docs/src/site/apt/roadmap.apt (original)
+++ cocoon/cocoon3/trunk/cocoon-docs/src/site/apt/roadmap.apt Thu Nov 26 08:02:10 2009
@@ -2,7 +2,7 @@
   Roadmap
  -----
  -----
- 2008
+ 2009
  -----
 
 Cocoon 3 Roadmap
@@ -14,21 +14,23 @@
 * Unscheduled simple features
 
     These tasks are a good starting point for everybody who wants to contribute to Cocoon
3.
+
+    * Rename the FileGenerator to SaxGenerator and provide constructors for URL, File, String,

+      InputStream and Writer. (cocoon-pipeline)
     
-    * Improved error handling (review exception handling in general) and error reporting
(cocoon-sitemap)
+    * [XSLT] Improved error handling in XSLT transformer. Show detailed information
+      provided by the XSLT engine where an error occurs. (cocoon-pipeline)
     
-    * Improved error handling in XSLT transformer (cocoon-pipeline)
-
-    * EHCache integration for caching pipelines (cocoon-pipeline)
+    * [XSLT] Make the TraxTransformer a CachingPipelineComponent. (cocoon-pipeline)
+    
+    * [XSLT] Use the Cocoon 2.2 org.apache.cocoon.components.xslt.XSLTProcessorImpl (cocoon-pipeline)
     
     * Support custom matchers (&lt;&lt;&lt;\&lt;map:match type="my-custom-matcher"/\&gt;&gt;&gt;&gt;)
     
-    * Support the XInclude standard (cocoon-pipeline)
+    * Support the XInclude standard. See {{{https://issues.apache.org/jira/browse/COCOON3-3}
COCOON3-3}} ( (cocoon-pipeline)
     
     * Enable file uploads (cocoon-servlet)
     
-    * Support annotation-based REST controller URL mapping similar to JSR311 (cocoon-rest)
-    
 * Advanced unscheduled features
     
     * In the case of a conditional GET a pipeline doesn't need to be executed in every case.

@@ -38,8 +40,6 @@
     
     * Improve caching when the servlet protocol is used (cocoon-servlet/cocoon-sitemap)
     
-    * Cleanup pipeline configuration and object model:
-    
     * Using SAX buffers in servlet protocol (cocoon-servlet, cocoon-servlet-service-fw-impl)
     
     * Review package structure for OSGi (all)
@@ -49,18 +49,25 @@
     * Provide XML catalog support: find a way to make the entity resolver of the SAX parser
       configurable in the case of using pipeline components directly (cocoon-pipeline) as
well as when they
       are used together with Spring (cocoon-sitemap) 
-
-    * STaX-based pipeline components for XML processing (file generator, XSLT transformer,
XML serializer, 
-      abstract XML transformer for custom STaX-based transformers) (cocoon-stax)
+      
+    * EHCache as caching provider for pipelines (cocoon-pipeline)
+    
+    * Find a general mechanism to provide global pipeline settings (see entity resolver and
XML catalog support) (cocoon-pipeline)
     
-    * Collect profiling information when a pipeline is being executed (cocoon-sitemap/cocoon-servlet)
+    * Merge all collector components (MimeTypeCollector, StatusCodeCollector, LastModifiedCollector)
into one in order to avoid 
+      those many around advices (one is enough). (cocoon-servlet).       
+        
+    * Adapter to use Cocoon 2.2 sitemap components from within Cocoon 3 OR migrate some more
components (cocoon-pipeline)
     
-    * Adapter to use Cocoon 2.2 sitemap components from within Cocoon 3 OR migrate some more
components (e.g. FOP serializer etc.) (cocoon-pipeline)
+    * Provide adapters that enable the mix of different component types in the same pipeline
(cocoon-pipeline)
     
+    * If an exception is thrown, show the sitemap execution path. See Cocoon 2.2 for this
feature (cocoon-sitemap)    
+
     * Content-based routing in pipelines (cocoon-pipeline)
     
-    * Enable nested pipelines (cocoon-pipeline)
+    * Enable nested pipelines (cocoon-pipeline)    
     
-    * Provide adapters that enable the mix of different component types in the same pipeline
(cocoon-pipeline)
+    * Define a sitemap directly in a Spring bean declaration where a Cocoon sitemap servlet-service
is defined.
     
-    * A stateless forms framework optimized for RESTful web applications. (cocoon-rest) (reinhard/steven)
    
+    * Provide an Ant task that allows to execute a Cocoon pipeline.
+    
\ No newline at end of file




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r884451 - /cocoon/cocoon3/trunk/cocoon-docs/src/changes/changes.xml</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091126080113.6CC0423888D1@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091126080113-6CC0423888D1@eris-apache-org%3e</id>
<updated>2009-11-26T08:01:13Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Nov 26 08:01:13 2009
New Revision: 884451

URL: http://svn.apache.org/viewvc?rev=884451&amp;view=rev
Log:
document recent changes and give credit

Modified:
    cocoon/cocoon3/trunk/cocoon-docs/src/changes/changes.xml

Modified: cocoon/cocoon3/trunk/cocoon-docs/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-docs/src/changes/changes.xml?rev=884451&amp;r1=884450&amp;r2=884451&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-docs/src/changes/changes.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-docs/src/changes/changes.xml Thu Nov 26 08:01:13 2009
@@ -36,6 +36,10 @@
         [cocoon-pipeline] Cleanup PipelineComponent#finish(): It's not the concern of a pipeline
component
         to know about exceptions that happen somewhere in the pipeline.
       &lt;/action&gt;      
+      &lt;action dev="stevendolg" type="update"&gt;
+        [cocoon-pipeline] The CachingPipeline creates the CacheKey as the last step in the
setup() phase
+        (instead of the first step of the execute() phase).
+      &lt;/action&gt;      
       &lt;action dev="reinhard" type="add"&gt;
         [cocoon-pipeline] Set an entity resolver on the SAX parser that returns an empty
input source. This
         prevents the SAX parser from accessing any URIs used in entities.  
@@ -49,11 +53,11 @@
       &lt;action dev="stevendolg" type="add"&gt;
         [cocoon-pipeline] Introduce an exception hierarchy for pipeline components 
         (ProcessingException and SetupException extend both PipelineException).
-      &lt;/action&gt;      
+      &lt;/action&gt;    
       &lt;action dev="reinhard" type="add" issue="COCOON3-2" due-to="Simone Tripodi"&gt;
         [cocoon-pipeline] Add a SchemaProcessorTransformer that validates the SAX event 
         stream against an XML schema.    
-      &lt;/action&gt;      
+      &lt;/action&gt;            
       &lt;action dev="stevendolg" type="fix" issue="COCOON3-23"&gt;
         [cocoon-pipeline] StackOverflowError on CachingPipeline.setup(OutputStream).
       &lt;/action&gt;      
@@ -76,6 +80,9 @@
         [cocoon-stax] Java 5 support.
       &lt;/action&gt;
       
+      &lt;action dev="reinhard" type="add" issue="COCOON3-6" due-to="Simone Tripodi"&gt;
+        [cocoon-sax] Enhance the reusability of the XSLTTransformer and support Xalan's XSLTC
engine.
+      &lt;/action&gt;          
       &lt;action dev="stevendolg" type="fix" &gt;
         [cocoon-sax] Create a separate SAX module that contains all SAX specific classes.
       &lt;/action&gt;
@@ -87,6 +94,14 @@
       &lt;/action&gt;
 
       &lt;action dev="reinhard" type="update"&gt;
+        [cocoon-sitemap] Support {jexl:cocoon.request.ssf} expression to test if this is
a call within
+        the Servlet-Service framework.
+      &lt;/action&gt;      
+      &lt;action dev="reinhard" type="update"&gt;
+        [cocoon-sitemap] Remove the duplicated AttributesImpl. Use the implementation coming
with the
+        org.apache.cocoon.xml:cocoon-xml library instead.
+      &lt;/action&gt;      
+      &lt;action dev="reinhard" type="update"&gt;
         [cocoon-sitemap] Update the WildcardMatcherHelper to the latest version of Cocoon
2.2.
       &lt;/action&gt;      
       &lt;action dev="reinhard" type="add"&gt;
@@ -103,9 +118,17 @@
       &lt;/action&gt;
       
       &lt;action dev="reinhard" type="add"&gt;
+        [cocoon-servlet] Move the request processing into a separate class org.apache.cocoon.servlet.RequestProcessor.
+        It also takes care of the suble differences whether a request is performed by the
Servlet-Service framework
+        call or by a 'normal' external request. This was necessary to avoid code duplication
when integrating with Wicket.
+      &lt;/action&gt;
+      &lt;action dev="reinhard" type="add"&gt;
         [cocoon-servlet] Add org.apache.cocoon.servlet.util.ServletServiceUtils to use a
Servlet-Service servlet 
         by reference and get an InputStream of a resource.
       &lt;/action&gt;
+      &lt;action dev="reinhard" type="fix"&gt;
+        [cocoon-servlet] The ServletServiceSerializer sets a status code (instead of always
sending 200 responses).
+      &lt;/action&gt;
       
       &lt;action dev="reinhard" type="add"&gt;
         [cocoon-rest] Support for JAX-RS (JSR 311) controllers as an alternative to the Cocoon
specific REST support.
@@ -115,7 +138,7 @@
         [cocoon-rest] Don't lose the status-code produced by the called servlet-service in
REST controller instances.
       &lt;/action&gt;      
       &lt;action dev="stevendolg" type="fix" issue="COCOON3-32"&gt;
-        [cocoon-rest] Check if a REST controller is a proxy. If it is one use the target
object to apply the supported
+        [cocoon-rest] Check if a REST controller is a proxy. If it is one, target object
is used to apply the supported
         annotations. 
       &lt;/action&gt;           
       &lt;action dev="stevendolg" type="update"&gt;
@@ -126,14 +149,37 @@
       &lt;action dev="reinhard" type="add"&gt;
         [cocoon-rest] The ControllerContextHelper provides a static method to directly store
a context
         object in the request.
-      &lt;/action&gt;      
-      &lt;action dev="reinhard" type="fix"&gt;
-        [cocoon-rest] The stream() method of the StreamingResponse interface can return the
content type.  
       &lt;/action&gt;
       &lt;action dev="reinhard" type="add"&gt;
         [cocoon-rest] The @Inject annotation supports org.apache.cocoon.configuration.Settings
and 
         javax.servlet.ServletContext injections.
       &lt;/action&gt;
+      
+      &lt;action dev="reinhard" type="add"&gt;
+        [cocoon-stringtemplate] The StringTemplateGenerator doesn't use controller context
parameters as attributes anymore.
+        This allows its usage outside of servlet environments. For the use with a Cocoon
controller implementation 
+        org.apache.cocoon.stringtemplate.ControllerContextAwareStringTemplateGenerator was
added. This generator is also
+        used as the bean 'generator:string-template' to be referred in sitemaps 
+        (e.g. &amp;lt;map:generator src=&amp;quot;string-template&amp;quot; src=&amp;quot;...&amp;quot;
/&amp;gt;)
+      &lt;/action&gt;
+      
+      &lt;action dev="reinhard" type="add"&gt;
+        [cocoon-wicket] Provide a reader component that delegates to a Wicket application.
+      &lt;/action&gt;
+      &lt;action dev="reinhard" type="add"&gt;
+        [cocoon-wicket] Provide a Wicket RequestTargetURLCodingStrategy that is able to mount
+        a Cocoon sitemap.
+      &lt;/action&gt;
+      &lt;action dev="reinhard" type="add"&gt;
+        [cocoon-wicket] The samples to integrate Wicket into Cocoon are added to the cocoon-samples
module. 
+      &lt;/action&gt;
+      &lt;action dev="reinhard" type="add"&gt;
+        [cocoon-wicket] Introduce a new module (cocoon-samples-wicket-webapp) that contains
the samples
+        that show how to integration Cocoon into Wicket. 
+      &lt;/action&gt;
+      &lt;action dev="reinhard" type="add"&gt;
+        [cocoon-wicket] Introduce a new module that contains the Cocoon-Wicket integration
(both directions).
+      &lt;/action&gt;
 
       &lt;action dev="reinhard" type="add" due-to="Dariusz Luksza" issue="COCOON3-33"&gt;
         [cocoon-monitoring] Support logging reconfiguration via JMX
@@ -179,11 +225,23 @@
         (cocoon-pipeline, cocoon-sitemap, cocoon-servlet).      
       &lt;/action&gt;
       
+      &lt;action dev="reinhard" type="update"&gt;
+        [all] Update Cocoon Servlet-Service Framework Impl to 1.2.0
+      &lt;/action&gt;      
+      &lt;action dev="reinhard" type="update"&gt;
+        [all] Update Cocoon Block Deployment to 1.1.0
+      &lt;/action&gt;      
+      &lt;action dev="reinhard" type="update"&gt;
+        [all] Update Cocoon JNet to 1.1.0
+      &lt;/action&gt;      
+      &lt;action dev="reinhard" type="update"&gt;
+        [all] Update Cocoon Spring Configurator to 2.1.0.
+      &lt;/action&gt;      
       &lt;action dev="reinhard" type="add" issue="COCOON3-21" due-to="Andreas Pieber"&gt;
         [all] Add a bash script to run the Cocoon 3 build with all tests and checks activated.
       &lt;/action&gt;      
       &lt;action dev="reinhard" type="update"&gt;
-        [all] Upgrade to Spring 2.5.6 and AspectJ 1.6.1.
+        [all] Update to Spring 2.5.6 and AspectJ 1.6.1.
       &lt;/action&gt;    
       &lt;action dev="reinhard" type="add" issue="COCOON3-1" due-to="Simone Tripodi"&gt;
         [all] Set serialVersionUID on all serializeable classes.




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r884449 - in /cocoon/cocoon3/trunk/cocoon-docs/src: docbkx/index.xml docbkx/reference/wicket.xml site/site.xml</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091126080035.E658D23888FE@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091126080035-E658D23888FE@eris-apache-org%3e</id>
<updated>2009-11-26T08:00:35Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Nov 26 08:00:35 2009
New Revision: 884449

URL: http://svn.apache.org/viewvc?rev=884449&amp;view=rev
Log:
Cocoon-Wicket integration docs

Added:
    cocoon/cocoon3/trunk/cocoon-docs/src/docbkx/reference/wicket.xml   (with props)
Modified:
    cocoon/cocoon3/trunk/cocoon-docs/src/docbkx/index.xml
    cocoon/cocoon3/trunk/cocoon-docs/src/site/site.xml

Modified: cocoon/cocoon3/trunk/cocoon-docs/src/docbkx/index.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-docs/src/docbkx/index.xml?rev=884449&amp;r1=884448&amp;r2=884449&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-docs/src/docbkx/index.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-docs/src/docbkx/index.xml Thu Nov 26 08:00:35 2009
@@ -47,4 +47,6 @@
   &lt;xi:include href="reference/sitemaps.xml" /&gt;
 
   &lt;xi:include href="reference/web-applications.xml" /&gt;
+  
+  &lt;xi:include href="reference/wicket.xml" /&gt;
 &lt;/book&gt;

Added: cocoon/cocoon3/trunk/cocoon-docs/src/docbkx/reference/wicket.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-docs/src/docbkx/reference/wicket.xml?rev=884449&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-docs/src/docbkx/reference/wicket.xml (added)
+++ cocoon/cocoon3/trunk/cocoon-docs/src/docbkx/reference/wicket.xml Thu Nov 26 08:00:35 2009
@@ -0,0 +1,320 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+--&gt;
+&lt;!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"&gt;
+&lt;chapter id="wicket-integration"&gt;
+  &lt;title&gt;Wicket Integration&lt;/title&gt;
+  
+  &lt;section id="wicket.introduction"&gt;
+    &lt;title&gt;Introduction&lt;/title&gt;
+    &lt;para&gt;
+      Apache Wicket has become on of the most popular web frameworks of these days.
+      Especially developers with a strong Java background benefit from its Java-centric approach
because all
+      object-oriented features can be applied. This results in highly reusable code.
+    &lt;/para&gt;
+    &lt;para&gt;
+      On the other side Cocoon implementing the pipe/filter pattern has its merits in the

+      field of generating resources in different output formats. 
+    &lt;/para&gt;
+    &lt;para&gt;
+      The Cocoon-Wicket integration module bridges between those two web application frameworks
+      in order to use the strenghts of both. This integration supports the integration of
+      Cocoon into Wicket as well as the integration of Wicket into Cocoon.
+    &lt;/para&gt;
+    &lt;para&gt;&lt;emphasis&gt;Note:&lt;/emphasis&gt; This is &lt;emphasis&gt;not&lt;/emphasis&gt;
an introduction into Apache Wicket. This documentation
+      explains to the experienced Wicket user what needs to be done to integrate Cocoon 3
into a Wicket application.
+    &lt;/para&gt;        
+  &lt;/section&gt;
+
+  &lt;section id="wicket.wicket-cocoon-integration"&gt;
+    &lt;title&gt;Integrate Cocoon into Wicket&lt;/title&gt;
+    &lt;para&gt;
+      The integration of Cocoon into Wicket is available in several ways:  
+      &lt;itemizedlist&gt;
+        &lt;listitem&gt;
+          &lt;para&gt;A &lt;emphasis&gt;Cocoon sitemap&lt;/emphasis&gt; can be mounted as

+          &lt;ulink url="http://wicket.apache.org/docs/1.4/org/apache/wicket/request/target/coding/IRequestTargetUrlCodingStrategy.html"&gt;&lt;literal&gt;IRequestTargetUrlCodingStrategy&lt;/literal&gt;&lt;/ulink&gt;&lt;/para&gt;
+        &lt;/listitem&gt;
+        &lt;listitem&gt;
+          &lt;para&gt;A single &lt;emphasis&gt;Cocoon pipeline&lt;/emphasis&gt; can be mounted
as &lt;ulink url="http://wicket.apache.org/docs/1.4/org/apache/wicket/request/target/coding/IRequestTargetUrlCodingStrategy.html"&gt;&lt;literal&gt;IRequestTargetUrlCodingStrategy&lt;/literal&gt;&lt;/ulink&gt;
(not implemented yet)&lt;/para&gt;
+        &lt;/listitem&gt;
+        &lt;listitem&gt;
+          &lt;para&gt;A &lt;emphasis&gt;CocoonSAXPipeline Wicket component&lt;/emphasis&gt;
can be added to a 
+          &lt;ulink url="http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/WebPage.html"&gt;&lt;literal&gt;WebPage&lt;/literal&gt;&lt;/ulink&gt;&lt;/para&gt;
+        &lt;/listitem&gt;
+      &lt;/itemizedlist&gt;      
+    &lt;/para&gt;
+    &lt;para&gt;
+      Whatever approach is chosen, the first step is adding &lt;literal&gt;cocoon-wicket&lt;/literal&gt;
and all
+      its transitive dependencies to your project's classpath:
+    &lt;/para&gt;
+    &lt;programlisting language="xml"&gt;&lt;![CDATA[&lt;dependency&gt;
+  &lt;groupId&gt;org.apache.cocoon.wicket&lt;/groupId&gt;
+  &lt;artifactId&gt;cocoon-wicket&lt;/artifactId&gt;
+  &lt;version&gt;3.0.0-alpha-2&lt;/version&gt;
+&lt;/dependency&gt;]]&gt;&lt;/programlisting&gt;    
+
+    &lt;section id="wicket.wicket-cocoon-integration.sitemap"&gt;
+      &lt;title&gt;Mount a Cocoon sitemap&lt;/title&gt;
+      &lt;para&gt;
+        Mounting in the context of Wicket means a class implementing &lt;ulink url="http://wicket.apache.org/docs/1.4/org/apache/wicket/request/target/coding/IRequestTargetUrlCodingStrategy.html"&gt;&lt;literal&gt;IRequestTargetUrlCodingStrategy&lt;/literal&gt;&lt;/ulink&gt;
+        is added to a Wicket web application. This interface is implemented by &lt;literal&gt;CocoonSitemap&lt;/literal&gt;:
         
+      &lt;/para&gt;
+      &lt;programlistingco&gt;
+        &lt;areaspec&gt;
+          &lt;area id="wicket.wicket-cocoon-integration.sitemap.mount" coords="9" /&gt;
+        &lt;/areaspec&gt;      
+      &lt;programlisting language="java"&gt;&lt;![CDATA[import org.apache.cocoon.wicket.target.CocoonSitemap;
+import org.apache.wicket.protocol.http.WebApplication;
+
+public class SomeWebApplication extends WebApplication {
+
+    @Override
+    protected void init() {
+        ...
+        this.mount(new CocoonSitemap("/sitemap", "/sitemap.xmap.xml"));
+        ...
+    }
+}]]&gt;&lt;/programlisting&gt;
+       &lt;calloutlist&gt;
+         &lt;callout arearefs="wicket.wicket-cocoon-integration.sitemap.mount"&gt;
+           &lt;para&gt;
+             The first parameter is the mount path which is a part of the request URI that
should be
+             handled by &lt;literal&gt;CocoonSitemap&lt;/literal&gt;. The second parameter
is the location of
+             the sitemap relativ to the servlet context.  
+           &lt;/para&gt;
+         &lt;/callout&gt;
+       &lt;/calloutlist&gt;
+     &lt;/programlistingco&gt;   
+     &lt;para&gt;
+       Additionally you have to make sure that all Spring bean definitions provided by the
Cocoon modules are
+       loaded into the web application's Spring application context. Cocoon's own bean definitions
are located in
+       &lt;literal&gt;META-INF/cocoon/spring/*.xml&lt;/literal&gt;.
+     &lt;/para&gt;
+     &lt;para&gt;
+       The simplest solution for this task is referring to the Cocoon Spring Configurator
in your main Spring application context, 
+       which is usually located in &lt;literal&gt;[servlet-context-base-directory]/WEB-INF/applicationContext.xml&lt;/literal&gt;.
It will
+       automatically load all bean definitions located in &lt;literal&gt;META-INF/cocoon/spring/*.xml&lt;/literal&gt;
of all libraries
+       on the classpath.
+       The &lt;ulink url="http://cocoon.apache.org/subprojects/configuration/1.0/spring-configurator/2.1/1303_1_1.html"&gt;
+       Cocoon Spring Configurator documentation&lt;/ulink&gt; contains further details.
+     &lt;/para&gt;   
+     &lt;para&gt;
+       Note that the Spring Configurator is one of the transitive dependencies of &lt;literal&gt;cocoon-wicket&lt;/literal&gt;.
+     &lt;/para&gt;
+     &lt;para&gt;
+       That's it! Everything else is the same as using Cocoon 3 outside of Wicket except
that the
+       &lt;literal&gt;servlet:/&lt;/literal&gt; protocol won't work in this environment.
+     &lt;/para&gt;
+    &lt;/section&gt;
+    
+    &lt;section id="wicket.wicket-cocoon-integration.pipeline"&gt;
+      &lt;title&gt;Mount a Cocoon pipeline&lt;/title&gt;
+      &lt;para&gt;
+        &lt;emphasis&gt;NOTE: This hasn't been implemented yet!&lt;/emphasis&gt;
+      &lt;/para&gt;
+      &lt;para&gt;
+        Mounting a Cocoon pipeline follows the same idea as mounting a whole sitemap. However,
it's only a single pipeline
+        that is added to Wicket's URI path and that this can be done without having to write
any XML.
+      &lt;/para&gt;
+      &lt;para&gt;
+        All that needs to be done is subclassing from &lt;literal&gt;org.apache.cocoon.wicket.AbstractCocoonPipeline&lt;/literal&gt;
+        and implementing its &lt;literal&gt;addComponents&lt;/literal&gt; method:
+      &lt;/para&gt;
+      &lt;programlistingco&gt;
+        &lt;areaspec&gt;
+          &lt;area id="wicket.wicket-cocoon-integration.pipeline.mount" coords="9" /&gt;
+        &lt;/areaspec&gt;      
+        &lt;programlisting language="java"&gt;&lt;![CDATA[import com.mycompany.MyCocoonPipeline;
+import org.apache.wicket.protocol.http.WebApplication;
+
+public class SomeWebApplication extends WebApplication 
+
+    @Override
+    protected void init() {
+        ...
+        this.mount(new MyCocoonPipeline("/my-pipeline"));
+        ...
+    }
+}]]&gt;&lt;/programlisting&gt;
+       &lt;calloutlist&gt;
+         &lt;callout arearefs="wicket.wicket-cocoon-integration.pipeline.mount"&gt;
+           &lt;para&gt;
+             The only parameter is the path where the pipeline should be be mounted by Wicket.
 
+           &lt;/para&gt;
+         &lt;/callout&gt;
+       &lt;/calloutlist&gt;
+     &lt;/programlistingco&gt;
+      &lt;para&gt;
+        In &lt;literal&gt;MyCocoonPipeline&lt;/literal&gt; all that needs to be done is subclassing
from 
+        &lt;literal&gt;org.apache.cocoon.wicket.AbstractCocoonPipeline&lt;/literal&gt; and
implementing its abstract method 
+        &lt;literal&gt;addComponents&lt;/literal&gt;:
+      &lt;/para&gt;       
+      &lt;programlistingco&gt;
+        &lt;areaspec&gt;
+          &lt;area id="wicket.wicket-cocoon-integration.pipeline.def" coords="9" /&gt;
+        &lt;/areaspec&gt;      
+      &lt;programlisting language="java"&gt;&lt;![CDATA[package com.mycompany;
+import org.apache.cocoon.wicket.AbstractCocoonPipeline;
+import org.apache.wicket.protocol.http.WebApplication;
+
+public class MyCocoonPipeline extends 
+    org.apache.cocoon.wicket.AbstractCocoonPipeline&lt;SAXPipelineComponent&gt;
+
+    @Override
+    protected void addComponents() {
+        this.addComponent(new FileGenerator(this.getClass().getResource("test.xml")));
+        this.addComponent(new XSLTTransformer(this.getClass().getResource("test.xsl")));
       
+        this.addComponent(new XMLSerializer());        
+    }
+}]]&gt;&lt;/programlisting&gt;
+       &lt;calloutlist&gt;
+         &lt;callout arearefs="wicket.wicket-cocoon-integration.pipeline.def"&gt;
+           &lt;para&gt;
+             Add all pipeline components that are required.  
+           &lt;/para&gt;
+         &lt;/callout&gt;
+       &lt;/calloutlist&gt;
+     &lt;/programlistingco&gt;      
+    &lt;/section&gt;    
+    
+    &lt;section id="wicket.wicket-cocoon-integration.component"&gt;
+      &lt;title&gt;CocoonSAXPipeline Wicket component&lt;/title&gt;
+      &lt;para&gt;
+        The third alternative of using Cocoon in Wicket is adding a Cocoon pipeline as 
+        &lt;ulink url="http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/WebComponent.html"&gt;&lt;literal&gt;WebComponent&lt;/literal&gt;&lt;/ulink&gt;.
+        This is as simple as instantiating &lt;literal&gt;CocoonSAXPipeline&lt;/literal&gt;
and adding
+        all generators and transformers that are required: 
+      &lt;/para&gt;
+      &lt;programlistingco&gt;
+        &lt;areaspec&gt;
+          &lt;area id="wicket.wicket-cocoon-integration.component.new" coords="11" /&gt;
+          &lt;area id="wicket.wicket-cocoon-integration.component.add" coords="13" /&gt;
+        &lt;/areaspec&gt;      
+      &lt;programlisting language="java"&gt;&lt;![CDATA[import org.apache.cocoon.pipeline.NonCachingPipeline;
+import org.apache.cocoon.sax.SAXPipelineComponent;
+import org.apache.cocoon.sax.component.StringGenerator;
+import org.apache.cocoon.sax.component.XSLTTransformer;
+import org.apache.cocoon.wicket.CocoonSAXPipeline;
+import org.apache.wicket.markup.html.WebPage;
+      
+    public class Homepage extends WebPage {
+
+    public Homepage() {
+        CocoonSAXPipeline pipeline = new CocoonSAXPipeline("cocoon-pipeline-component",
+                new NonCachingPipeline&lt;SAXPipelineComponent&gt;());
+        pipeline.addComponent(new StringGenerator("&lt;b&gt;hello, Cocoon!&lt;/b&gt;"));
+        pipeline.addComponent(new XSLTTransformer(
+                this.getClass().getResource("transform.xslt")));
+        this.add(pipeline);
+    }
+}
+]]&gt;&lt;/programlisting&gt;
+       &lt;calloutlist&gt;
+         &lt;callout arearefs="wicket.wicket-cocoon-integration.component.new"&gt;
+           &lt;para&gt;
+             Instantiate the component  
+           &lt;/para&gt;
+         &lt;/callout&gt;
+         &lt;callout arearefs="wicket.wicket-cocoon-integration.component.add"&gt;
+           &lt;para&gt;
+             Adding SAX pipeline components
+           &lt;/para&gt;
+         &lt;/callout&gt;
+       &lt;/calloutlist&gt;
+     &lt;/programlistingco&gt;  
+     &lt;para&gt;
+       The pipeline's result is added to the HTML produced by this page. This is the reason
+       why only generators and transformers can be added to this component because the
+       pipeline is always serialized as XHTML. An XHTMLSerializer is added implicitly to
+       each pipeline.
+     &lt;/para&gt;       
+    &lt;/section&gt;
+  &lt;/section&gt;
+  
+  &lt;section id="wicket.cocoon-wicket-integration"&gt;
+    &lt;title&gt;Integrate Wicket into Cocoon&lt;/title&gt;
+    &lt;para&gt;
+      &lt;emphasis&gt;Note:&lt;/emphasis&gt; The integration of Wicket into Cocoon os mostly
a proof of concept. 
+      It is experimental and has neither been optimized nor tested yet.
+    &lt;/para&gt;
+    &lt;para&gt;
+      The integration of Wicket into Cocoon means that the output of Wicket is added to the
content stream of a pipeline.
+      The currently available solution is a reader but alternatively a generator or a transformer
would offer an even more
+      alternatives. 
+    &lt;/para&gt;
+    &lt;para&gt;
+      As pointed out for the Wicket-Cocoon integration, the first step in every case is adding
&lt;literal&gt;cocoon-wicket&lt;/literal&gt; and all
+      its transitive dependencies to your project's classpath:
+    &lt;/para&gt;
+    &lt;programlisting language="xml"&gt;&lt;![CDATA[&lt;dependency&gt;
+  &lt;groupId&gt;org.apache.cocoon.wicket&lt;/groupId&gt;
+  &lt;artifactId&gt;cocoon-wicket&lt;/artifactId&gt;
+  &lt;version&gt;3.0.0-alpha-2&lt;/version&gt;
+&lt;/dependency&gt;]]&gt;&lt;/programlisting&gt;    
+    &lt;section id="wicket.cocoon-wicket.reader"&gt;
+      &lt;title&gt;Wicket reader&lt;/title&gt;
+      &lt;para&gt;
+        By using the Wicket reader a servlet request is referred to a Wicket web application.
The current implementation
+        expects exactly one Wicket web application being available as Spring bean:
+      &lt;/para&gt;
+    &lt;programlisting language="xml"&gt;&lt;![CDATA[&lt;beans&gt;
+  &lt;bean id="wicketWebapp" 
+    class="com.mycompany.MyWicketWebapp"/&gt;
+&lt;/beans&gt;]]&gt;&lt;/programlisting&gt;          
+      &lt;para&gt;
+        By adding the bean definition file as resource into &lt;literal&gt;META-INF/cocoon/spring&lt;/literal&gt;
the 
+        Wicket web application bean will be loaded automatically.
+      &lt;/para&gt;
+      &lt;para&gt;
+        Then the Wicket reader has be to used in the sitemap:
+      &lt;/para&gt;
+      &lt;programlistingco&gt;
+        &lt;areaspec&gt;
+          &lt;area id="wicket.cocoon-wicket-integration.pipeline.match" coords="5" /&gt;
+          &lt;area id="wicket.cocoon-wicket-integration.pipeline.reader" coords="6" /&gt;
+        &lt;/areaspec&gt;      
+        &lt;programlisting language="xml"&gt;&lt;![CDATA[&lt;map:sitemap&gt;
+  &lt;map:pipelines&gt;    
+    &lt;map:pipeline type="noncaching"&gt;
+      &lt;map:match wildcard="my-wicket-app/**"&gt;
+        &lt;map:read type="wicket" base-path="/my-wicket-app" /&gt;
+      &lt;/map:match&gt;
+    &lt;/map:pipeline&gt;
+  &lt;/map:pipelines&gt;
+&lt;/map:sitemap&gt;]]&gt;&lt;/programlisting&gt;
+       &lt;calloutlist&gt;
+         &lt;callout arearefs="wicket.cocoon-wicket-integration.pipeline.match"&gt;
+           &lt;para&gt;
+             Use a &lt;literal&gt;**&lt;/literal&gt; wildcard to match all requests that
start with
+             &lt;literal&gt;my-wicket-app&lt;/literal&gt;.           
+           &lt;/para&gt;
+         &lt;/callout&gt;
+         &lt;callout arearefs="wicket.cocoon-wicket-integration.pipeline.reader"&gt;
+           &lt;para&gt;
+             The name of the reader is &lt;literal&gt;wicket&lt;/literal&gt;. It's also required
+             to define the base path so that Wicket can calclulate realtive URLs correctly.
+           &lt;/para&gt;
+         &lt;/callout&gt;
+       &lt;/calloutlist&gt;
+     &lt;/programlistingco&gt;    
+    &lt;/section&gt;    
+  &lt;/section&gt;
+&lt;/chapter&gt;

Propchange: cocoon/cocoon3/trunk/cocoon-docs/src/docbkx/reference/wicket.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-docs/src/docbkx/reference/wicket.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-docs/src/docbkx/reference/wicket.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: cocoon/cocoon3/trunk/cocoon-docs/src/site/site.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-docs/src/site/site.xml?rev=884449&amp;r1=884448&amp;r2=884449&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-docs/src/site/site.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-docs/src/site/site.xml Thu Nov 26 08:00:35 2009
@@ -30,9 +30,7 @@
       &lt;item name="Index" href="index.html" /&gt;
       &lt;item name="Changelog" href="changes-report.html" /&gt;
       &lt;item name="Roadmap" href="roadmap.html" /&gt;
-      &lt;!-- 
       &lt;item name="Userguide" href="reference/index.html" /&gt;
-       --&gt;
       &lt;item name="Features" href="features.html" /&gt;
     &lt;/menu&gt;
     &lt;menu name="Project"&gt;




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r884447 - /cocoon/cocoon3/trunk/parent/pom.xml</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091126075951.350B623888FE@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091126075951-350B623888FE@eris-apache-org%3e</id>
<updated>2009-11-26T07:59:51Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Nov 26 07:59:50 2009
New Revision: 884447

URL: http://svn.apache.org/viewvc?rev=884447&amp;view=rev
Log:
Cocoon-Wicket integration

Modified:
    cocoon/cocoon3/trunk/parent/pom.xml

Modified: cocoon/cocoon3/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/parent/pom.xml?rev=884447&amp;r1=884446&amp;r2=884447&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/parent/pom.xml (original)
+++ cocoon/cocoon3/trunk/parent/pom.xml Thu Nov 26 07:59:50 2009
@@ -362,11 +362,32 @@
         &lt;version&gt;3.2.9&lt;/version&gt;
       &lt;/dependency&gt;      
       &lt;dependency&gt;
+        &lt;groupId&gt;org.apache.wicket&lt;/groupId&gt;
+        &lt;artifactId&gt;wicket&lt;/artifactId&gt;
+        &lt;version&gt;1.4.1&lt;/version&gt;
+      &lt;/dependency&gt;
+      &lt;dependency&gt;
+        &lt;groupId&gt;org.apache.wicket&lt;/groupId&gt;
+        &lt;artifactId&gt;wicket-spring&lt;/artifactId&gt;
+        &lt;version&gt;1.4.1&lt;/version&gt;
+        &lt;exclusions&gt;
+          &lt;exclusion&gt;
+            &lt;groupId&gt;org.springframework&lt;/groupId&gt;
+            &lt;artifactId&gt;spring&lt;/artifactId&gt;
+          &lt;/exclusion&gt;
+        &lt;/exclusions&gt;
+      &lt;/dependency&gt;          
+      &lt;dependency&gt;
         &lt;groupId&gt;org.apache.xmlgraphics&lt;/groupId&gt;
         &lt;artifactId&gt;fop&lt;/artifactId&gt;
         &lt;version&gt;0.95&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
+        &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
+        &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
+        &lt;version&gt;1.4.2&lt;/version&gt;
+      &lt;/dependency&gt;      
+      &lt;dependency&gt;
         &lt;groupId&gt;xml-apis&lt;/groupId&gt;
         &lt;artifactId&gt;xml-apis&lt;/artifactId&gt;
         &lt;version&gt;1.3.02&lt;/version&gt;
@@ -433,6 +454,11 @@
         &lt;artifactId&gt;cocoon-stringtemplate&lt;/artifactId&gt;
         &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
       &lt;/dependency&gt;
+      &lt;dependency&gt;
+        &lt;groupId&gt;org.apache.cocoon.wicket&lt;/groupId&gt;
+        &lt;artifactId&gt;cocoon-wicket&lt;/artifactId&gt;
+        &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
+      &lt;/dependency&gt;      
 
       &lt;!-- Test dependencies --&gt;
       &lt;dependency&gt;
@@ -509,6 +535,11 @@
       &lt;plugin&gt;
         &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
         &lt;artifactId&gt;rat-maven-plugin&lt;/artifactId&gt;
+        &lt;configuration&gt;
+          &lt;excludes&gt;
+            &lt;exclude&gt;bin/**&lt;/exclude&gt;
+          &lt;/excludes&gt;            
+        &lt;/configuration&gt;        
       &lt;/plugin&gt;
       &lt;plugin&gt;
         &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
@@ -822,12 +853,14 @@
       &lt;modules&gt;
         &lt;module&gt;../cocoon-docs&lt;/module&gt;
         &lt;module&gt;../cocoon-sample-webapp&lt;/module&gt;
+        &lt;module&gt;../cocoon-sample-wicket-webapp&lt;/module&gt;
       &lt;/modules&gt;
     &lt;/profile&gt;
     &lt;profile&gt;
       &lt;id&gt;it&lt;/id&gt;
       &lt;modules&gt;
         &lt;module&gt;../cocoon-sample-webapp&lt;/module&gt;
+        &lt;module&gt;../cocoon-sample-wicket-webapp&lt;/module&gt;
       &lt;/modules&gt;
       &lt;build&gt;
         &lt;plugins&gt;




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r884446 - in /cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it: RedirectTest.java SaxPipelineTest.java ServletServiceTest.java</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091126075911.6105723889CB@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091126075911-6105723889CB@eris-apache-org%3e</id>
<updated>2009-11-26T07:59:11Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Nov 26 07:59:10 2009
New Revision: 884446

URL: http://svn.apache.org/viewvc?rev=884446&amp;view=rev
Log:
test {jexl:cocoon.request.ssf}

Modified:
    cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/RedirectTest.java
    cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/SaxPipelineTest.java
    cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/ServletServiceTest.java

Modified: cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/RedirectTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/RedirectTest.java?rev=884446&amp;r1=884445&amp;r2=884446&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/RedirectTest.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/RedirectTest.java
Thu Nov 26 07:59:10 2009
@@ -37,6 +37,6 @@
         this.loadXmlPage("redirect/sax-pipeline/simple-xml");
         assertEquals(200, this.response.getStatusCode());
         assertEquals("text/xml", this.response.getContentType());
-        this.assertXPath("/html/body/p", "3");
+        this.assertXPath("/html/body/p", "3-true");
     }
 }

Modified: cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/SaxPipelineTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/SaxPipelineTest.java?rev=884446&amp;r1=884445&amp;r2=884446&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/SaxPipelineTest.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/SaxPipelineTest.java
Thu Nov 26 07:59:10 2009
@@ -49,7 +49,7 @@
         this.loadXmlPage("/sax-pipeline/simple-xml");
         assertTrue(this.response.getStatusCode() == 200);
         assertEquals("text/xml", this.response.getContentType());
-        this.assertXPath("/html/body/p", "3");
+        this.assertXPath("/html/body/p", "3-false");
     }
 
     /**

Modified: cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/ServletServiceTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/ServletServiceTest.java?rev=884446&amp;r1=884445&amp;r2=884446&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/ServletServiceTest.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/ServletServiceTest.java
Thu Nov 26 07:59:10 2009
@@ -25,7 +25,7 @@
         this.loadXmlPage("ssf/local");
         assertTrue(this.response.getStatusCode() == 200);
         assertEquals("text/xml", this.response.getContentType());
-        this.assertXPath("/html/body/p", "3");
+        this.assertXPath("/html/body/p[1]", "3-true");
     }
 
     public void testSimpleServletServiceCallingAResource() throws Exception {
@@ -47,12 +47,12 @@
         this.loadXmlPage("ssf/calling-a-transformer-servlet-service");
         assertTrue(this.response.getStatusCode() == 200);
         assertEquals("text/xml", this.response.getContentType());
-        this.assertXPath("/html/body/p", "transformer-pipeline");
+        this.assertXPath("/html/body/p[1]", "transformer-pipeline");
     }
 
     public void testCallingASerializerServletService() throws Exception {
         this.loadXmlPage("ssf/calling-a-serializer-servlet-service");
-        assertTrue(this.response.getStatusCode() == 200);
+        assertTrue(this.response.getStatusCode() == 210);
         assertEquals("text/xml", this.response.getContentType());
         this.assertXPath("/html/body/p", "serializer-pipeline");
     }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r884445 - /cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/ProfilingTest.java</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091126075812.3C18523888FE@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091126075812-3C18523888FE@eris-apache-org%3e</id>
<updated>2009-11-26T07:58:12Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Nov 26 07:58:11 2009
New Revision: 884445

URL: http://svn.apache.org/viewvc?rev=884445&amp;view=rev
Log:
use the changed location of the profiling resources

Modified:
    cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/ProfilingTest.java

Modified: cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/ProfilingTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/ProfilingTest.java?rev=884445&amp;r1=884444&amp;r2=884445&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/ProfilingTest.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/ProfilingTest.java
Thu Nov 26 07:58:11 2009
@@ -27,13 +27,13 @@
         String profilingId = this.response.getResponseHeaderValue("X-Cocoon-Profiling-ID");
         assertNotNull("Profiling ID not found", profilingId);
 
-        this.loadResponse("controller/profiling/" + profilingId);
+        this.loadResponse("cocoon-profiling/" + profilingId);
         assertEquals(200, this.response.getStatusCode());
         assertTrue(this.response.getContentAsString().length() &gt; 100);
         assertTrue(this.response.getContentAsString().length() &gt; 100);
         assertEquals("text/xml", this.response.getContentType());
 
-        this.loadResponse("controller/profiling/" + profilingId + ".png");
+        this.loadResponse("cocoon-profiling/" + profilingId + ".png");
         assertEquals(200, this.response.getStatusCode());
         assertTrue(this.response.getContentAsString().length() &gt; 100);
         assertEquals("image/png", this.response.getContentType());




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r884444 - in /cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it: CocoonHtmlUnitTestCase.java WicketTest.java</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091126075644.5B2B223888FE@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091126075644-5B2B223888FE@eris-apache-org%3e</id>
<updated>2009-11-26T07:56:44Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Nov 26 07:56:43 2009
New Revision: 884444

URL: http://svn.apache.org/viewvc?rev=884444&amp;view=rev
Log:
add Wicket integration test

Added:
    cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/WicketTest.java
  (with props)
Modified:
    cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/CocoonHtmlUnitTestCase.java

Modified: cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/CocoonHtmlUnitTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/CocoonHtmlUnitTestCase.java?rev=884444&amp;r1=884443&amp;r2=884444&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/CocoonHtmlUnitTestCase.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/CocoonHtmlUnitTestCase.java
Thu Nov 26 07:56:43 2009
@@ -32,5 +32,4 @@
         }
         return new URL(baseUrl);
     }
-
 }

Added: cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/WicketTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/WicketTest.java?rev=884444&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/WicketTest.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/WicketTest.java
Thu Nov 26 07:56:43 2009
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.it;
+
+/**
+ * Test the Cocoon-Wicket integration
+ */
+public class WicketTest extends CocoonHtmlUnitTestCase {
+
+    /**
+     * The the Wicket homepage.
+     */
+     public void testHomepage() throws Exception {
+        this.loadResponse("/wicket/hello-wicket");
+        assertTrue(this.response.getStatusCode() == 200);
+        assertEquals("text/html", this.response.getContentType());
+    }
+
+    /**
+     * A Wicket redirect
+     */
+     public void testRedirect() throws Exception {
+        this.loadResponse("/wicket/");
+        assertTrue(this.response.getStatusCode() == 302);
+        assertTrue(this.response.getResponseHeaderValue("Location").endsWith("/wicket/hello-wicket"));
+    }
+
+    /**
+     * A Wicket resource
+     */
+    public void testWicketAjaxResource() throws Exception {
+        this.loadResponse("/wicket/resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js");
+        assertTrue(this.response.getStatusCode() == 200);
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/WicketTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/WicketTest.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/WicketTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r884443 - in /cocoon/cocoon3/trunk/cocoon-sample: ./ src/main/java/org/apache/cocoon/sample/wicket/ src/main/resources/COB-INF/ src/main/resources/COB-INF/sax-pipeline/ src/main/resources/META-INF/cocoon/spring/ src/main/resources/META-INF/...</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091126075508.D8CD123889CB@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091126075508-D8CD123889CB@eris-apache-org%3e</id>
<updated>2009-11-26T07:55:08Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Nov 26 07:55:07 2009
New Revision: 884443

URL: http://svn.apache.org/viewvc?rev=884443&amp;view=rev
Log:
add Cocoon-Wicket integration samples
some minor cleanup work

Added:
    cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/
    cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/CocoonSampleWicketWebapp.java
  (with props)
    cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/HelloWicketPage.java
  (with props)
    cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/OtherPage.java
  (with props)
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/spring/cocoon-sample-wicket.xml
  (with props)
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/xpatch/cocoon-sample-block-deployment.xweb
      - copied unchanged from r833327, cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/xpatch/cocoon-block-deployment.xweb
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/cocoon/
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/cocoon/sample/
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/cocoon/sample/wicket/
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/cocoon/sample/wicket/HelloWicketPage.html
  (with props)
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/cocoon/sample/wicket/OtherPage.html
  (with props)
Removed:
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/xpatch/cocoon-block-deployment.xweb
Modified:
    cocoon/cocoon3/trunk/cocoon-sample/pom.xml
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/overview.html
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sax-pipeline/simple.xslt
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap
    cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/ProfilingIntegrationTest.java
    cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java

Modified: cocoon/cocoon3/trunk/cocoon-sample/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/pom.xml?rev=884443&amp;r1=884442&amp;r2=884443&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-sample/pom.xml Thu Nov 26 07:55:07 2009
@@ -38,6 +38,7 @@
   &lt;description&gt;Cocoon 3 samples.&lt;/description&gt;
 
   &lt;dependencies&gt;
+    &lt;!-- Cocoon libraries --&gt;
     &lt;dependency&gt;
       &lt;groupId&gt;org.apache.cocoon.rest&lt;/groupId&gt;
       &lt;artifactId&gt;cocoon-rest&lt;/artifactId&gt;
@@ -47,6 +48,10 @@
       &lt;artifactId&gt;cocoon-stringtemplate&lt;/artifactId&gt;
     &lt;/dependency&gt;
     &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.cocoon.wicket&lt;/groupId&gt;
+      &lt;artifactId&gt;cocoon-wicket&lt;/artifactId&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
       &lt;groupId&gt;org.apache.cocoon.profiling&lt;/groupId&gt;
       &lt;artifactId&gt;cocoon-profiling&lt;/artifactId&gt;
     &lt;/dependency&gt;
@@ -60,7 +65,7 @@
       &lt;scope&gt;provided&lt;/scope&gt;
     &lt;/dependency&gt;    
 
-    &lt;!-- Optional Cocoon libraries --&gt;    
+    &lt;!-- Optional libraries --&gt;    
     &lt;dependency&gt;
       &lt;groupId&gt;org.apache.cocoon.optional&lt;/groupId&gt;
       &lt;artifactId&gt;cocoon-optional&lt;/artifactId&gt;
@@ -72,15 +77,28 @@
     &lt;dependency&gt;
       &lt;groupId&gt;org.apache.cocoon&lt;/groupId&gt;
       &lt;artifactId&gt;cocoon-serializers-charsets&lt;/artifactId&gt;
-    &lt;/dependency&gt;      
-    
-    &lt;!-- Other dependencies --&gt;
+    &lt;/dependency&gt; 
+    &lt;dependency&gt;
+      &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
+      &lt;artifactId&gt;jersey-core&lt;/artifactId&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
+      &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
+    &lt;/dependency&gt;              
+  
+    &lt;!--  Logging dependencies --&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
+      &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
+      &lt;scope&gt;runtime&lt;/scope&gt;
+    &lt;/dependency&gt;    
     &lt;dependency&gt;
       &lt;groupId&gt;log4j&lt;/groupId&gt;
       &lt;artifactId&gt;log4j&lt;/artifactId&gt;
       &lt;scope&gt;runtime&lt;/scope&gt;
     &lt;/dependency&gt;
-
+    
     &lt;!--  Test dependencies --&gt;
     &lt;dependency&gt;
       &lt;groupId&gt;junit&lt;/groupId&gt;
@@ -93,9 +111,6 @@
     &lt;plugins&gt;
       &lt;plugin&gt;
         &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
-        &lt;!-- configuration&gt;
-          &lt;useProjectReferences&gt;false&lt;/useProjectReferences&gt;
-        &lt;/configuration--&gt;
       &lt;/plugin&gt;
       &lt;plugin&gt;
         &lt;groupId&gt;org.apache.cocoon&lt;/groupId&gt;

Added: cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/CocoonSampleWicketWebapp.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/CocoonSampleWicketWebapp.java?rev=884443&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/CocoonSampleWicketWebapp.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/CocoonSampleWicketWebapp.java
Thu Nov 26 07:55:07 2009
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.sample.wicket;
+
+import org.apache.wicket.Page;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
+
+public class CocoonSampleWicketWebapp extends WebApplication {
+
+    @Override
+    public Class&lt;? extends Page&gt; getHomePage() {
+        return HelloWicketPage.class;
+    }
+
+    @Override
+    protected void init() {
+        this.addComponentInstantiationListener(new SpringComponentInjector(this));
+        this.mountBookmarkablePage("hello-wicket", HelloWicketPage.class);
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/CocoonSampleWicketWebapp.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/CocoonSampleWicketWebapp.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/CocoonSampleWicketWebapp.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/HelloWicketPage.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/HelloWicketPage.java?rev=884443&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/HelloWicketPage.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/HelloWicketPage.java
Thu Nov 26 07:55:07 2009
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.sample.wicket;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.Link;
+
+public class HelloWicketPage extends WebPage {
+
+    private AjaxFallbackLink&lt;Object&gt; ajaxFallbackLink;
+    private Label text;
+    private int counter = 1;
+
+    public HelloWicketPage() {
+        this.add(new Label("message", "hello, wicket!"));
+        this.text = new Label("text", "text-1");
+        this.text.setOutputMarkupId(true);
+        this.add(this.text);
+
+        this.ajaxFallbackLink = new AjaxFallbackLink&lt;Object&gt;("link") {
+
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public void onClick(AjaxRequestTarget target) {
+                HelloWicketPage.this.text.setDefaultModelObject("text-" + ++HelloWicketPage.this.counter);
+                target.addComponent(HelloWicketPage.this.text);
+            }
+        };
+        this.add(this.ajaxFallbackLink);
+
+        this.add(new Link&lt;Object&gt;("link-other-page") {
+
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public void onClick() {
+                this.setResponsePage(OtherPage.class);
+            }
+        });
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/HelloWicketPage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/HelloWicketPage.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/HelloWicketPage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/OtherPage.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/OtherPage.java?rev=884443&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/OtherPage.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/OtherPage.java
Thu Nov 26 07:55:07 2009
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.sample.wicket;
+
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.link.Link;
+
+public class OtherPage extends WebPage {
+
+    public OtherPage() {
+        this.add(new Link&lt;Object&gt;("link") {
+
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public void onClick() {
+                this.setResponsePage(HelloWicketPage.class);
+            }
+        });
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/OtherPage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/OtherPage.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/java/org/apache/cocoon/sample/wicket/OtherPage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/overview.html
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/overview.html?rev=884443&amp;r1=884442&amp;r2=884443&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/overview.html (original)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/overview.html Thu Nov 26
07:55:07 2009
@@ -115,5 +115,9 @@
   	&lt;li&gt;&lt;a href="serializers/exhtml"&gt;eXHTML&lt;/a&gt;: A pedantinc XHTML serializer
encoding all recognized entities with their proper HTML names.&lt;/li&gt;
   	&lt;li&gt;&lt;a href="serializers/ehtml"&gt;eHTML&lt;/a&gt;: A serializer converting XHTML
into plain old HTML.&lt;/li&gt;
   &lt;/ul&gt;
+  &lt;h2&gt;Cocoon-Wicket integration&lt;/h2&gt;
+  &lt;ul&gt;
+  	&lt;li&gt;&lt;a href="wicket/"&gt;Wicket Reader&lt;/a&gt;: A reader defers redirects a
request to a Wicket application.&lt;/li&gt;
+  &lt;/ul&gt;
   &lt;/body&gt;
 &lt;/html&gt;

Modified: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sax-pipeline/simple.xslt
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sax-pipeline/simple.xslt?rev=884443&amp;r1=884442&amp;r2=884443&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sax-pipeline/simple.xslt
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sax-pipeline/simple.xslt
Thu Nov 26 07:55:07 2009
@@ -27,9 +27,7 @@
 
       &lt;body&gt;
         &lt;h1&gt;Simple Pipeline&lt;/h1&gt;
-        &lt;p&gt;
-          &lt;xsl:value-of select="$myParam" /&gt;
-        &lt;/p&gt;
+        &lt;p&gt;&lt;xsl:value-of select="$myParam" /&gt;&lt;/p&gt;
       &lt;/body&gt;
     &lt;/html&gt;
   &lt;/xsl:template&gt;

Modified: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap?rev=884443&amp;r1=884442&amp;r2=884443&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap (original)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap Thu Nov 26
07:55:07 2009
@@ -57,7 +57,7 @@
       &lt;map:match pattern="sax-pipeline/simple-xml"&gt;
         &lt;map:generate src="sax-pipeline/simple.xml" /&gt;
         &lt;map:transform src="sax-pipeline/simple.xslt"&gt;
-          &lt;map:parameter name="myParam" value="3" /&gt;
+          &lt;map:parameter name="myParam" value="3-{jexl:cocoon.request.ssf}" /&gt;
         &lt;/map:transform&gt;
         &lt;map:serialize type="xml" /&gt;
       &lt;/map:match&gt;
@@ -140,7 +140,7 @@
         &lt;map:transform src="sax-pipeline/simple.xslt"&gt;
           &lt;map:parameter name="myParam" value="serializer-pipeline" /&gt;
         &lt;/map:transform&gt;
-        &lt;map:serialize type="xml" /&gt;
+        &lt;map:serialize type="xml" status-code="210"/&gt;
       &lt;/map:match&gt;
       &lt;map:match pattern="ssf/calling-a-transformer-servlet-service"&gt;
         &lt;map:generate src="sax-pipeline/simple.xml" /&gt;
@@ -312,12 +312,12 @@
 
     &lt;!-- ~~~~~~~~~~~~~~~~ aggregation ~~~~~~~~~~~~~~~ --&gt;
     &lt;map:pipeline&gt;
-      &lt;map:match pattern="aggregation/include-transformer"&gt;
+      &lt;map:match equals="aggregation/include-transformer"&gt;
         &lt;map:generate src="aggregation/include.xml" /&gt;
         &lt;map:transform type="include" /&gt;
         &lt;map:serialize type="xml" /&gt;
       &lt;/map:match&gt;
-      &lt;map:match pattern="aggregation/sub-request"&gt;
+      &lt;map:match equals="aggregation/sub-request"&gt;
         &lt;map:generate src="aggregation/sub.xml" /&gt;
         &lt;map:serialize type="xml" /&gt;
       &lt;/map:match&gt;
@@ -325,12 +325,12 @@
 
     &lt;!-- ~~~~~~~~~~~~~~~~ xslt ~~~~~~~~~~~~~~~ --&gt;
     &lt;map:pipeline&gt;
-      &lt;map:match pattern="xslt/main"&gt;
+      &lt;map:match equals="xslt/main"&gt;
         &lt;map:generate src="sax-pipeline/simple.xml" /&gt;
         &lt;map:transform src="xslt/main.xslt" /&gt;
         &lt;map:serialize type="xml" /&gt;
       &lt;/map:match&gt;
-      &lt;map:match pattern="xslt/sub-servlet.xslt"&gt;
+      &lt;map:match equals="xslt/sub-servlet.xslt"&gt;
         &lt;map:generate src="xslt/sub-servlet.xslt" /&gt;
         &lt;map:serialize type="xml" /&gt;
       &lt;/map:match&gt;
@@ -356,7 +356,7 @@
 
     &lt;!-- ~~~~~~~~~~~~~~~~ object model ~~~~~~~~~~~~~~~ --&gt;
     &lt;map:pipeline&gt;
-      &lt;map:match pattern="object-model/request-parameters"&gt;
+      &lt;map:match equals="object-model/request-parameters"&gt;
         &lt;map:generate type="request-parameters" /&gt;
         &lt;map:serialize type="xml" /&gt;
       &lt;/map:match&gt;
@@ -364,13 +364,6 @@
 
     &lt;!-- ~~~~~~~~~~~~~~~~ controller ~~~~~~~~~~~~~~~ --&gt;
     &lt;map:pipeline&gt;
-      &lt;map:match pattern="controller/profiling/{id}.png"&gt;
-        &lt;map:serialize type="profilingpng" id="{map:id}" /&gt;
-      &lt;/map:match&gt;
-      &lt;map:match pattern="controller/profiling/{id}"&gt;
-        &lt;map:generate type="profiling" id="{map:id}" /&gt;
-        &lt;map:serialize type="xml" /&gt;
-      &lt;/map:match&gt;
       &lt;map:match pattern="controller/{id}/{name}"&gt;
         &lt;controller:call controller="rest-controller" select="org.apache.cocoon.sample.controller.DemoRESTController"&gt;
           &lt;map:parameter name="id" value="{map:id}" /&gt;
@@ -385,11 +378,11 @@
 
     &lt;!-- ~~~~~~~~~~~~~~~~ redirect ~~~~~~~~~~~~~~~ --&gt;
     &lt;map:pipeline&gt;
-      &lt;map:match pattern="redirect/www.orf.at"&gt;
+      &lt;map:match equals="redirect/www.orf.at"&gt;
         &lt;servlet:redirect-to uri="http://www.orf.at" /&gt;
       &lt;/map:match&gt;
       &lt;!-- Redirecting to a servlet service doesn't work --&gt;
-      &lt;map:match pattern="redirect/sax-pipeline/simple-xml"&gt;
+      &lt;map:match equals="redirect/sax-pipeline/simple-xml"&gt;
         &lt;servlet:redirect-to uri="servlet:/sax-pipeline/simple-xml"/&gt;
       &lt;/map:match&gt;
     &lt;/map:pipeline&gt;
@@ -404,7 +397,7 @@
     &lt;/map:pipeline&gt;
 
     &lt;map:pipeline&gt;
-      &lt;map:match pattern="error-handling/custom-error-per-pipeline-error-handling"&gt;
+      &lt;map:match equals="error-handling/custom-error-per-pipeline-error-handling"&gt;
         &lt;map:act type="error-throwing" /&gt;
         &lt;map:generate src="sax-pipeline/simple.xml" /&gt;
         &lt;map:serialize type="xml" /&gt;
@@ -417,7 +410,7 @@
     
     &lt;!-- FOP --&gt;
     &lt;map:pipeline&gt;
-      &lt;map:match pattern="fop/test.pdf"&gt;
+      &lt;map:match equals="fop/test.pdf"&gt;
         &lt;map:generate src="fop/page.xml" /&gt;
         &lt;map:transform src="fop/page2fo.xsl" /&gt;
         &lt;map:serialize type="fo2pdf" /&gt;
@@ -448,6 +441,13 @@
         &lt;map:serialize type="ehtml" encoding="iso-8859-1"/&gt;
       &lt;/map:match&gt;    
     &lt;/map:pipeline&gt;
+    
+    &lt;!-- Cocoon Wicket integration --&gt;
+    &lt;map:pipeline type="noncaching"&gt;
+      &lt;map:match wildcard="wicket/**"&gt;
+        &lt;map:read type="wicket" base-path="/wicket" /&gt;
+      &lt;/map:match&gt;
+    &lt;/map:pipeline&gt;
  
     &lt;!-- Global error handling --&gt;
     &lt;map:handle-errors&gt;

Added: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/spring/cocoon-sample-wicket.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/spring/cocoon-sample-wicket.xml?rev=884443&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/spring/cocoon-sample-wicket.xml
(added)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/spring/cocoon-sample-wicket.xml
Thu Nov 26 07:55:07 2009
@@ -0,0 +1,26 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+ --&gt;
+&lt;!-- $Id$ --&gt;
+&lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"&gt;
+
+  &lt;bean id="org.apache.cocoon.sample.wicket.CocoonSampleWicketWebapp" 
+    class="org.apache.cocoon.sample.wicket.CocoonSampleWicketWebapp"/&gt;
+&lt;/beans&gt;

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/spring/cocoon-sample-wicket.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/spring/cocoon-sample-wicket.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/spring/cocoon-sample-wicket.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/cocoon/sample/wicket/HelloWicketPage.html
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/cocoon/sample/wicket/HelloWicketPage.html?rev=884443&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/cocoon/sample/wicket/HelloWicketPage.html
(added)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/cocoon/sample/wicket/HelloWicketPage.html
Thu Nov 26 07:55:07 2009
@@ -0,0 +1,27 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+ --&gt;
+&lt;html&gt;
+  &lt;body&gt;
+  	&lt;p wicket:id="message"&gt;[title]&lt;/p&gt;
+	&lt;p wicket:id="text"&gt;[text]&lt;/p&gt;
+	&lt;p&gt;&lt;a href="#" wicket:id="link"&gt;change text&lt;/a&gt;&lt;/p&gt;
+	&lt;p&gt;&lt;a href="#" wicket:id="link-other-page"&gt;Link to another page&lt;/a&gt;&lt;/p&gt;
+  &lt;/body&gt;	
+&lt;/html&gt;
\ No newline at end of file

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/cocoon/sample/wicket/HelloWicketPage.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/cocoon/sample/wicket/HelloWicketPage.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/cocoon/sample/wicket/OtherPage.html
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/cocoon/sample/wicket/OtherPage.html?rev=884443&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/cocoon/sample/wicket/OtherPage.html
(added)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/cocoon/sample/wicket/OtherPage.html
Thu Nov 26 07:55:07 2009
@@ -0,0 +1,24 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+ --&gt;
+&lt;html&gt;
+  &lt;body&gt;
+  	&lt;p&gt;back to the &lt;a href="#" wicket:id="link"&gt;HomePage&lt;/a&gt;
+  &lt;/body&gt;	
+&lt;/html&gt;
\ No newline at end of file

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/cocoon/sample/wicket/OtherPage.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/org/apache/cocoon/sample/wicket/OtherPage.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Modified: cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/ProfilingIntegrationTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/ProfilingIntegrationTest.java?rev=884443&amp;r1=884442&amp;r2=884443&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/ProfilingIntegrationTest.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/profiling/ProfilingIntegrationTest.java
Thu Nov 26 07:55:07 2009
@@ -102,7 +102,7 @@
 
         "META-INF/cocoon/spring/cocoon-expression-language.xml",
 
-        "META-INF/cocoon/spring/cocoon-servlet-node.xml",
+        "META-INF/cocoon/spring/cocoon-servlet-collector.xml",
 
         "META-INF/cocoon/spring/cocoon-servlet-component.xml",
 

Modified: cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java?rev=884443&amp;r1=884442&amp;r2=884443&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/test/java/org/apache/cocoon/sitemap/SitemapBuilderTest.java
Thu Nov 26 07:55:07 2009
@@ -60,7 +60,6 @@
     }
 
 
-    @SuppressWarnings("unchecked")
     public void testErrorHandlingPipeline() throws Exception {
         Invocation invocation = this.buildInvocation("error-handling/custom-error-per-pipeline-error-handling");
         MockHttpServletResponse mockHttpServletResponse = new MockHttpServletResponse();
@@ -76,7 +75,6 @@
         assertEquals(501, StatusCodeCollector.getStatusCode());
     }
 
-    @SuppressWarnings("unchecked")
     public void testGenerator() throws Exception {
         Invocation invocation = this.buildInvocation("sax-pipeline/unauthorized");
         MockHttpServletResponse mockHttpServletResponse = new MockHttpServletResponse();
@@ -91,7 +89,6 @@
         assertEquals(401, StatusCodeCollector.getStatusCode());
     }
 
-    @SuppressWarnings("unchecked")
     public void testNoMatchingPipeline() throws Exception {
         Invocation invocation = this.buildInvocation("unknown");
         InvocationResult invocationResult = this.sitemap.invoke(invocation);
@@ -102,7 +99,6 @@
                 .getThrowable() instanceof NoMatchingPipelineException);
     }
 
-    @SuppressWarnings("unchecked")
     public void testController() throws Exception {
         Invocation invocation = this.buildInvocation("controller/invoke");
         InvocationResult invocationResult = this.sitemap.invoke(invocation);
@@ -110,7 +106,6 @@
         assertTrue(invocationResult.isCompleted());
     }
 
-    @SuppressWarnings("unchecked")
     public void testXSLT() throws Exception {
         Invocation invocation = this.buildInvocation("xslt/main");
         InvocationResult invocationResult = this.sitemap.invoke(invocation);
@@ -205,7 +200,7 @@
                 "META-INF/cocoon/spring/cocoon-sitemap-node.xml",
                 "META-INF/cocoon/spring/cocoon-expression-language.xml",
                 "META-INF/cocoon/spring/cocoon-sample-sitemap-components.xml",
-                "META-INF/cocoon/spring/cocoon-servlet-node.xml",
+                "META-INF/cocoon/spring/cocoon-servlet-collector.xml",
                 "META-INF/cocoon/spring/cocoon-servlet-component.xml", "META-INF/cocoon/spring/cocoon-controller.xml"
});
 
         this.componentProvider = (ComponentProvider) applicationContext




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r884441 - in /cocoon/cocoon3/trunk/cocoon-servlet/src/main/resources/META-INF/cocoon/spring: cocoon-servlet-collector.xml cocoon-servlet-node.xml</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091126075200.C039F23888FE@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091126075200-C039F23888FE@eris-apache-org%3e</id>
<updated>2009-11-26T07:52:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Nov 26 07:52:00 2009
New Revision: 884441

URL: http://svn.apache.org/viewvc?rev=884441&amp;view=rev
Log:
a better name for the collectors Spring bean definition file

Added:
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-collector.xml
      - copied unchanged from r824908, cocoon/cocoon3/trunk/cocoon-servlet/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-node.xml
Removed:
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-node.xml



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r884440 - /cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091126075106.98AAA23888FE@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091126075106-98AAA23888FE@eris-apache-org%3e</id>
<updated>2009-11-26T07:51:06Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Nov 26 07:51:06 2009
New Revision: 884440

URL: http://svn.apache.org/viewvc?rev=884440&amp;view=rev
Log:
make the preparation of request parameters reusable (for the Wicket integration)

Modified:
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java

Modified: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java?rev=884440&amp;r1=884439&amp;r2=884440&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
Thu Nov 26 07:51:06 2009
@@ -128,7 +128,7 @@
     }
 
     @SuppressWarnings("unchecked")
-    private Map&lt;String, Object&gt; getInvocationParameters(HttpServletRequest req) {
+    private static Map&lt;String, Object&gt; getInvocationParameters(HttpServletRequest req)
{
         Map&lt;String, Object&gt; invocationParameters = new HashMap&lt;String, Object&gt;();
 
         for (Enumeration&lt;String&gt; names = req.getParameterNames(); names.hasMoreElements();)
{
@@ -247,13 +247,28 @@
         }
     }
 
-    private Map&lt;String, Object&gt; prepareParameters(HttpServletRequest request, HttpServletResponse
response,
-            Settings settings) {
-        Map&lt;String, Object&gt; parameters = this.getInvocationParameters(request);
+    public static Map&lt;String, Object&gt; prepareParameters(HttpServletRequest request,
HttpServletResponse response,
+            Settings settings, ServletContext servletContext) {
+        if (request == null) {
+            throw new NullPointerException("Request mustn't be null.");
+        }
+        if (response == null) {
+            throw new NullPointerException("Response mustn't be null.");
+        }
+        if (servletContext == null) {
+            throw new NullPointerException("ServletContext mustn't be null.");
+        }
+
+        Map&lt;String, Object&gt; parameters = getInvocationParameters(request);
+
         HttpContextHelper.storeRequest(request, parameters);
         HttpContextHelper.storeResponse(response, parameters);
-        HttpContextHelper.storeServletContext(this.servletContext, parameters);
-        SettingsHelper.storeSettings(settings, parameters);
+        HttpContextHelper.storeServletContext(servletContext, parameters);
+
+        if (settings != null) {
+            SettingsHelper.storeSettings(settings, parameters);
+        }
+
         return parameters;
     }
 
@@ -262,7 +277,8 @@
 
         // invoke the sitemap engine
         ByteArrayOutputStream baos = new ByteArrayOutputStream(8192);
-        this.invoke(this.calcSitemapRequestURI(request), this.prepareParameters(request,
response, settings), baos);
+        this.invoke(this.calcSitemapRequestURI(request), prepareParameters(request, response,
settings,
+                this.servletContext), baos);
 
         // collect meta information from the previous run of the sitemap engine
         long lastModified = LastModifiedCollector.getLastModified();




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r884437 - /cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/util/ObjectModelProvider.java</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091126074936.5058E23888FE@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091126074936-5058E23888FE@eris-apache-org%3e</id>
<updated>2009-11-26T07:49:36Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Nov 26 07:49:35 2009
New Revision: 884437

URL: http://svn.apache.org/viewvc?rev=884437&amp;view=rev
Log:
provide a property 'ssf' that returns true of false depending whether the current request
is an internal Servlet-Service framework request. This can be used e.g. with the expression
{jexl:cocoon.request.ssf}

Modified:
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/util/ObjectModelProvider.java

Modified: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/util/ObjectModelProvider.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/util/ObjectModelProvider.java?rev=884437&amp;r1=884436&amp;r2=884437&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/util/ObjectModelProvider.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/util/ObjectModelProvider.java
Thu Nov 26 07:49:35 2009
@@ -22,6 +22,7 @@
 import javax.servlet.http.HttpServletRequestWrapper;
 
 import org.apache.cocoon.servlet.controller.ControllerContextHelper;
+import org.apache.cocoon.servletservice.util.ServletServiceRequest;
 import org.apache.cocoon.sitemap.objectmodel.ObjectModel;
 
 public class ObjectModelProvider {
@@ -59,5 +60,13 @@
         public String get(String key) {
             return this.getParameter(key);
         }
+
+        public boolean isSsf() {
+            if(this.getRequest() instanceof ServletServiceRequest) {
+                return true;
+            }
+
+            return false;
+        }
     }
 }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r884434 - /cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/node/LastModifiedCollector.java</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091126074615.271FA23889CB@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091126074615-271FA23889CB@eris-apache-org%3e</id>
<updated>2009-11-26T07:46:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Nov 26 07:46:14 2009
New Revision: 884434

URL: http://svn.apache.org/viewvc?rev=884434&amp;view=rev
Log:
Make sure that the LastModifiedCollector always returns something useful

Modified:
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/node/LastModifiedCollector.java

Modified: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/node/LastModifiedCollector.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/node/LastModifiedCollector.java?rev=884434&amp;r1=884433&amp;r2=884434&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/node/LastModifiedCollector.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/node/LastModifiedCollector.java
Thu Nov 26 07:46:14 2009
@@ -29,14 +29,19 @@
     private static final String CALL_FRAME_KEY = LastModifiedCollector.class.getName() +
"/last-modified";
 
     public static long getLastModified() {
-        return (Long) CallStack.getCurrentFrame().getAttribute(CALL_FRAME_KEY);
+        Object lastModified = CallStack.getCurrentFrame().getAttribute(CALL_FRAME_KEY);
+
+        if (lastModified == null) {
+            return -1;
+        }
+
+        return (Long) lastModified;
     }
 
-    private static void setLastModified(Long lastModified) {
+    public static void setLastModified(Long lastModified) {
         CallStack.getCurrentFrame().setAttribute(CALL_FRAME_KEY, lastModified);
     }
 
-
     @SuppressWarnings("unchecked")
     @Around("execution(* org.apache.cocoon.pipeline.Pipeline.execute(..))")
     public Object interceptInvoke(ProceedingJoinPoint proceedingJoinPoint) throws Throwable
{
@@ -44,7 +49,9 @@
 
         Pipeline&lt;PipelineComponent&gt; pipeline = (Pipeline&lt;PipelineComponent&gt;)
proceedingJoinPoint.getTarget();
         long lastModified = pipeline.getLastModified();
-        setLastModified(lastModified);
+        if (lastModified &gt; -1 || getLastModified() &lt;= 0) {
+            setLastModified(lastModified);
+        }
 
         return result;
     }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r884433 [1/2] - in /cocoon/cocoon3/trunk: cocoon-sample-wicket-webapp/ cocoon-sample-wicket-webapp/src/ cocoon-sample-wicket-webapp/src/main/ cocoon-sample-wicket-webapp/src/main/java/ cocoon-sample-wicket-webapp/src/main/java/org/ cocoon-s...</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091126074541.BE49423888FE@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091126074541-BE49423888FE@eris-apache-org%3e</id>
<updated>2009-11-26T07:45:41Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Nov 26 07:45:38 2009
New Revision: 884433

URL: http://svn.apache.org/viewvc?rev=884433&amp;view=rev
Log:
New module cocoon-wicket that contains all integration classes
New module cocoon-sample-wicket-webapp that contains Wicket-Cocoon integration samples

Added:
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/LICENSE.txt   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/NOTICE.txt   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/pom.xml   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonSAXPipeline.java   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonWicketSampleReloadingWicketFilter.java   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonWicketSampleWebApplication.java   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Error404Page.html   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Error404Page.java   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Homepage.html   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Homepage.java   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/transform.xslt   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/resources/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/resources/META-INF/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/resources/META-INF/cocoon/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/resources/META-INF/cocoon/properties/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/resources/META-INF/cocoon/properties/cocoon-wicket-sample-webapp.properties   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/applicationContext.xml   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/log4j.xml   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/web.xml   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/read/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/read/javascript-resource.js   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sax-pipeline/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sax-pipeline/simple.xml   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sax-pipeline/simple.xslt   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sitemap.xmap.xml   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/it/
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/it/CocoonWicketHtmlUnitTestCase.java   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/it/SitemapRequestTargetTest.java   (with props)
    cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/resources/
    cocoon/cocoon3/trunk/cocoon-wicket/   (with props)
    cocoon/cocoon3/trunk/cocoon-wicket/LICENSE.txt   (with props)
    cocoon/cocoon3/trunk/cocoon-wicket/NOTICE.txt   (with props)
    cocoon/cocoon3/trunk/cocoon-wicket/pom.xml   (with props)
    cocoon/cocoon3/trunk/cocoon-wicket/src/
    cocoon/cocoon3/trunk/cocoon-wicket/src/main/
    cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/
    cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/
    cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/
    cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/
    cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/
    cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/
    cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/WicketReader.java   (with props)
    cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/target/
    cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/target/CocoonSitemap.java   (with props)
    cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/target/CocoonSitemapRequestTarget.java   (with props)
    cocoon/cocoon3/trunk/cocoon-wicket/src/main/resources/
    cocoon/cocoon3/trunk/cocoon-wicket/src/main/resources/META-INF/
    cocoon/cocoon3/trunk/cocoon-wicket/src/main/resources/META-INF/cocoon/
    cocoon/cocoon3/trunk/cocoon-wicket/src/main/resources/META-INF/cocoon/spring/
    cocoon/cocoon3/trunk/cocoon-wicket/src/main/resources/META-INF/cocoon/spring/cocoon-wicket.xml   (with props)
    cocoon/cocoon3/trunk/cocoon-wicket/src/test/
    cocoon/cocoon3/trunk/cocoon-wicket/src/test/java/
    cocoon/cocoon3/trunk/cocoon-wicket/src/test/resources/

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Nov 26 07:45:38 2009
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/LICENSE.txt
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/LICENSE.txt?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/LICENSE.txt (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/LICENSE.txt Thu Nov 26 07:45:38 2009
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/LICENSE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/LICENSE.txt
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/LICENSE.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/NOTICE.txt
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/NOTICE.txt?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/NOTICE.txt (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/NOTICE.txt Thu Nov 26 07:45:38 2009
@@ -0,0 +1,5 @@
+Apache Cocoon
+Copyright 1999-2009 The Apache Software Foundation.
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/NOTICE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/NOTICE.txt
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/NOTICE.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/pom.xml?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/pom.xml (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/pom.xml Thu Nov 26 07:45:38 2009
@@ -0,0 +1,185 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+--&gt;
+&lt;!-- $Id$ --&gt;
+&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;packaging&gt;war&lt;/packaging&gt;
+  
+  &lt;parent&gt;
+    &lt;groupId&gt;org.apache.cocoon.parent&lt;/groupId&gt;
+    &lt;artifactId&gt;cocoon-parent&lt;/artifactId&gt;
+    &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
+    &lt;relativePath&gt;../parent/pom.xml&lt;/relativePath&gt;
+  &lt;/parent&gt;
+  &lt;groupId&gt;org.apache.cocoon.sample-wicket-webapp&lt;/groupId&gt;
+  &lt;artifactId&gt;cocoon-sample-wicket-webapp&lt;/artifactId&gt;
+  &lt;name&gt;Apache Cocoon 3: Wicket Integration Webapp Sample&lt;/name&gt;
+  &lt;description&gt;An Apache Wicket web application that uses Cocoon sitemaps and pipelines.&lt;/description&gt;
+  
+  &lt;dependencies&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.cocoon.wicket&lt;/groupId&gt;
+      &lt;artifactId&gt;cocoon-wicket&lt;/artifactId&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
+      &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
+    &lt;/dependency&gt;
+    
+    &lt;!--  Logging dependencies --&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
+      &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
+      &lt;scope&gt;runtime&lt;/scope&gt;
+    &lt;/dependency&gt;    
+    &lt;dependency&gt;
+      &lt;groupId&gt;log4j&lt;/groupId&gt;
+      &lt;artifactId&gt;log4j&lt;/artifactId&gt;
+      &lt;scope&gt;runtime&lt;/scope&gt;
+    &lt;/dependency&gt;    
+    
+    &lt;!-- Test dependencies --&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.cocoon&lt;/groupId&gt;
+      &lt;artifactId&gt;cocoon-it-fw&lt;/artifactId&gt;
+      &lt;scope&gt;test&lt;/scope&gt;
+    &lt;/dependency&gt;    
+  &lt;/dependencies&gt;    
+  
+  &lt;build&gt;
+    &lt;resources&gt;
+      &lt;resource&gt;
+        &lt;filtering&gt;false&lt;/filtering&gt;
+        &lt;directory&gt;src/main/resources&lt;/directory&gt;
+      &lt;/resource&gt;
+      &lt;resource&gt;
+        &lt;filtering&gt;false&lt;/filtering&gt;
+        &lt;directory&gt;src/main/java&lt;/directory&gt;
+        &lt;includes&gt;
+          &lt;include&gt;**&lt;/include&gt;
+        &lt;/includes&gt;
+        &lt;excludes&gt;
+          &lt;exclude&gt;**/*.java&lt;/exclude&gt;
+        &lt;/excludes&gt;
+      &lt;/resource&gt;
+    &lt;/resources&gt;
+    &lt;testResources&gt;
+      &lt;testResource&gt;
+        &lt;filtering&gt;false&lt;/filtering&gt;
+        &lt;directory&gt;src/test/java&lt;/directory&gt;
+        &lt;includes&gt;
+          &lt;include&gt;**&lt;/include&gt;
+        &lt;/includes&gt;
+        &lt;excludes&gt;
+          &lt;exclude&gt;**/*.java&lt;/exclude&gt;
+        &lt;/excludes&gt;
+      &lt;/testResource&gt;
+    &lt;/testResources&gt;  
+    &lt;plugins&gt;
+      &lt;plugin&gt;
+        &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
+        &lt;version&gt;2.0.2&lt;/version&gt;
+      &lt;/plugin&gt;
+      &lt;plugin&gt;
+        &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;
+        &lt;artifactId&gt;maven-jetty-plugin&lt;/artifactId&gt;
+        &lt;configuration&gt;
+          &lt;connectors&gt;
+            &lt;connector implementation="org.mortbay.jetty.nio.SelectChannelConnector"&gt;
+              &lt;port&gt;8891&lt;/port&gt;
+              &lt;maxIdleTime&gt;30000&lt;/maxIdleTime&gt;
+            &lt;/connector&gt;
+          &lt;/connectors&gt;
+          &lt;webAppSourceDirectory&gt;${project.build.directory}/${pom.artifactId}-${pom.version}&lt;/webAppSourceDirectory&gt;
+          &lt;contextPath&gt;/&lt;/contextPath&gt;
+        &lt;/configuration&gt;
+      &lt;/plugin&gt;
+      &lt;plugin&gt;
+        &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
+        &lt;configuration&gt;
+          &lt;excludes&gt;
+            &lt;exclude&gt;**/cocoon/**&lt;/exclude&gt;
+          &lt;/excludes&gt;
+        &lt;/configuration&gt;
+      &lt;/plugin&gt;      
+    &lt;/plugins&gt;
+  &lt;/build&gt;
+  
+  &lt;profiles&gt;
+    &lt;profile&gt;
+      &lt;!-- Unfortunately this these integration tests don't run when the 
+           cocoon-sample-webapp integrationt tests run before --&gt;
+      &lt;id&gt;it-wicket&lt;/id&gt;
+      &lt;build&gt;
+        &lt;plugins&gt;
+          &lt;!-- Integration tests --&gt;
+          &lt;plugin&gt;
+            &lt;groupId&gt;org.apache.cocoon&lt;/groupId&gt;
+            &lt;artifactId&gt;cocoon-it-fw&lt;/artifactId&gt;
+            &lt;configuration&gt;
+              &lt;webAppDirectory&gt;./target/${project.artifactId}-${project.version}&lt;/webAppDirectory&gt;
+            &lt;/configuration&gt;
+            &lt;executions&gt;
+              &lt;execution&gt;
+                &lt;id&gt;jetty-start&lt;/id&gt;
+                &lt;goals&gt;
+                  &lt;goal&gt;jetty-start&lt;/goal&gt;
+                &lt;/goals&gt;
+                &lt;phase&gt;pre-integration-test&lt;/phase&gt;
+              &lt;/execution&gt;
+              &lt;execution&gt;
+                &lt;id&gt;jetty-stop&lt;/id&gt;
+                &lt;goals&gt;
+                  &lt;goal&gt;jetty-stop&lt;/goal&gt;
+                &lt;/goals&gt;
+                &lt;phase&gt;post-integration-test&lt;/phase&gt;
+              &lt;/execution&gt;
+            &lt;/executions&gt;
+          &lt;/plugin&gt;
+          &lt;plugin&gt;
+            &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
+            &lt;configuration&gt;
+              &lt;excludes&gt;
+                &lt;exclude&gt;**/cocoon/**&lt;/exclude&gt;
+              &lt;/excludes&gt;
+            &lt;/configuration&gt;
+            &lt;executions&gt;
+              &lt;execution&gt;
+                &lt;id&gt;integration-test&lt;/id&gt;
+                &lt;goals&gt;
+                  &lt;goal&gt;test&lt;/goal&gt;
+                &lt;/goals&gt;
+                &lt;phase&gt;integration-test&lt;/phase&gt;
+                &lt;configuration&gt;
+                  &lt;excludes&gt;
+                    &lt;exclude&gt;none&lt;/exclude&gt;
+                  &lt;/excludes&gt;
+                  &lt;includes&gt;
+                    &lt;include&gt;**/cocoon/**&lt;/include&gt;
+                  &lt;/includes&gt;
+                &lt;/configuration&gt;
+              &lt;/execution&gt;
+            &lt;/executions&gt;
+          &lt;/plugin&gt;
+        &lt;/plugins&gt;
+      &lt;/build&gt;
+    &lt;/profile&gt;
+  &lt;/profiles&gt;    
+&lt;/project&gt;
\ No newline at end of file

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonSAXPipeline.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonSAXPipeline.java?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonSAXPipeline.java (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonSAXPipeline.java Thu Nov 26 07:45:38 2009
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+/**
+ *
+ */
+package org.apache.cocoon.sample.wicket;
+
+import java.io.ByteArrayOutputStream;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.cocoon.configuration.Settings;
+import org.apache.cocoon.pipeline.Pipeline;
+import org.apache.cocoon.pipeline.ProcessingException;
+import org.apache.cocoon.sax.SAXPipelineComponent;
+import org.apache.cocoon.sax.SAXProducer;
+import org.apache.cocoon.sax.component.XMLSerializer;
+import org.apache.cocoon.servlet.RequestProcessor;
+import org.apache.wicket.RequestCycle;
+import org.apache.wicket.markup.ComponentTag;
+import org.apache.wicket.markup.MarkupStream;
+import org.apache.wicket.markup.html.WebComponent;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.protocol.http.WebRequest;
+import org.apache.wicket.protocol.http.WebResponse;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class CocoonSAXPipeline extends WebComponent {
+
+    private static final long serialVersionUID = 1L;
+
+    private Pipeline&lt;SAXPipelineComponent&gt; pipeline;
+
+    @SpringBean
+    private Settings settings;
+
+    CocoonSAXPipeline(String id, Pipeline&lt;SAXPipelineComponent&gt; pipeline) {
+        super(id);
+        this.pipeline = pipeline;
+    }
+
+    public void addComponent(SAXProducer component) {
+        this.pipeline.addComponent(component);
+    }
+
+    @Override
+    protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
+        this.pipeline.addComponent(createXMLSerializer());
+
+        HttpServletRequest request = ((WebRequest) RequestCycle.get().getRequest()).getHttpServletRequest();
+        HttpServletResponse response = ((WebResponse) RequestCycle.get().getResponse()).getHttpServletResponse();
+        ServletContext servletContext = WebApplication.get().getServletContext();
+        Map&lt;String, Object&gt; parameters = RequestProcessor.prepareParameters(request, response, this.settings,
+                servletContext);
+
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        this.pipeline.setup(baos, parameters);
+
+        try {
+            this.pipeline.execute();
+        } catch (Exception e) {
+            throw new ProcessingException("Error while execution a Cocoon pipeline.", e);
+        }
+
+        this.replaceComponentTagBody(markupStream, openTag, new String(baos.toByteArray()));
+    }
+
+    private static XMLSerializer createXMLSerializer() {
+        XMLSerializer xmlSerializer = new XMLSerializer();
+
+        Properties format = new Properties();
+        format.put("encoding", "UTF-8");
+        format.put("method", "xml");
+        format.put("omit-xml-declaration", "yes");
+        xmlSerializer.setFormat(format);
+
+        return xmlSerializer;
+    }
+}
\ No newline at end of file

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonSAXPipeline.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonSAXPipeline.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonSAXPipeline.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonWicketSampleReloadingWicketFilter.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonWicketSampleReloadingWicketFilter.java?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonWicketSampleReloadingWicketFilter.java (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonWicketSampleReloadingWicketFilter.java Thu Nov 26 07:45:38 2009
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.sample.wicket;
+
+import org.apache.wicket.application.ReloadingClassLoader;
+import org.apache.wicket.protocol.http.ReloadingWicketFilter;
+
+public class CocoonWicketSampleReloadingWicketFilter extends ReloadingWicketFilter {
+
+    static {
+        ReloadingClassLoader.includePattern("org.apache.cocoon.sample.wicket.*");
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonWicketSampleReloadingWicketFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonWicketSampleReloadingWicketFilter.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonWicketSampleReloadingWicketFilter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonWicketSampleWebApplication.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonWicketSampleWebApplication.java?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonWicketSampleWebApplication.java (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonWicketSampleWebApplication.java Thu Nov 26 07:45:38 2009
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.sample.wicket;
+
+import org.apache.cocoon.wicket.target.CocoonSitemap;
+import org.apache.wicket.Application;
+import org.apache.wicket.Page;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.request.target.coding.HybridUrlCodingStrategy;
+import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
+
+public class CocoonWicketSampleWebApplication extends WebApplication {
+
+    @Override
+    public Class&lt;? extends Page&gt; getHomePage() {
+        return Homepage.class;
+    }
+
+    @Override
+    protected void init() {
+        super.init();
+
+        // setup Spring
+        this.addComponentInstantiationListener(new SpringComponentInjector(this));
+
+        // mounts
+        this.mount(new CocoonSitemap("/sitemap", "/sitemap.xmap.xml"));
+        this.mount(new HybridUrlCodingStrategy("/404.html", Error404Page.class));
+
+        // settings
+        this.getMarkupSettings().setStripWicketTags(true);
+    }
+
+    public static CocoonWicketSampleWebApplication get() {
+        return (CocoonWicketSampleWebApplication) Application.get();
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonWicketSampleWebApplication.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonWicketSampleWebApplication.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/CocoonWicketSampleWebApplication.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Error404Page.html
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Error404Page.html?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Error404Page.html (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Error404Page.html Thu Nov 26 07:45:38 2009
@@ -0,0 +1,28 @@
+&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+--&gt;
+&lt;!-- $Id: pom.xml 829840 2009-10-26 15:53:36Z reinhard $ --&gt;
+&lt;html lang="en" xmlns="http://www.w3.org/1999/xhtml"&gt;
+  &lt;head&gt;
+    &lt;title&gt;Error 404&lt;/title&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;h1&gt;Error 404&lt;/h1&gt;
+  &lt;/body&gt;	
+&lt;/html&gt;

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Error404Page.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Error404Page.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Error404Page.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Error404Page.java?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Error404Page.java (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Error404Page.java Thu Nov 26 07:45:38 2009
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.sample.wicket;
+
+import org.apache.wicket.markup.html.WebPage;
+
+public class Error404Page extends WebPage {
+
+}

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Error404Page.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Error404Page.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Error404Page.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Homepage.html
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Homepage.html?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Homepage.html (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Homepage.html Thu Nov 26 07:45:38 2009
@@ -0,0 +1,30 @@
+&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+--&gt;
+&lt;!-- $Id: pom.xml 829840 2009-10-26 15:53:36Z reinhard $ --&gt;
+&lt;html lang="de" xmlns="http://www.w3.org/1999/xhtml"&gt;
+  &lt;head&gt;
+    &lt;title&gt;Cocoon/Wicket samples&lt;/title&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;h1&gt;Cocoon/Wicket samples&lt;/h1&gt;
+	&lt;h2&gt;Content produced by the CocoonPipelineComponent&lt;/h2&gt;
+	&lt;p wicket:id="cocoon-pipeline-component"&gt;[cocoon-pipeline-component content]&lt;/p&gt;
+  &lt;/body&gt;	
+&lt;/html&gt;

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Homepage.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Homepage.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Homepage.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Homepage.java?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Homepage.java (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Homepage.java Thu Nov 26 07:45:38 2009
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.sample.wicket;
+
+import org.apache.cocoon.pipeline.NonCachingPipeline;
+import org.apache.cocoon.sax.SAXPipelineComponent;
+import org.apache.cocoon.sax.component.StringGenerator;
+import org.apache.cocoon.sax.component.XSLTTransformer;
+import org.apache.wicket.markup.html.WebPage;
+
+public class Homepage extends WebPage {
+
+    public Homepage() {
+        CocoonSAXPipeline pipeline = new CocoonSAXPipeline("cocoon-pipeline-component",
+                new NonCachingPipeline&lt;SAXPipelineComponent&gt;());
+        pipeline.addComponent(new StringGenerator("&lt;b&gt;hello, Cocoon!&lt;/b&gt;"));
+        pipeline.addComponent(new XSLTTransformer(this.getClass().getResource("transform.xslt")));
+
+        this.add(pipeline);
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Homepage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Homepage.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/Homepage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/transform.xslt
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/transform.xslt?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/transform.xslt (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/transform.xslt Thu Nov 26 07:45:38 2009
@@ -0,0 +1,24 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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.
+--&gt;
+&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt;
+
+  &lt;xsl:template match="/"&gt;
+    &lt;i&gt;test&lt;/i&gt;
+  &lt;/xsl:template&gt;
+
+&lt;/xsl:stylesheet&gt;

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/transform.xslt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/transform.xslt
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/java/org/apache/cocoon/sample/wicket/transform.xslt
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/resources/META-INF/cocoon/properties/cocoon-wicket-sample-webapp.properties
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/resources/META-INF/cocoon/properties/cocoon-wicket-sample-webapp.properties?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/resources/META-INF/cocoon/properties/cocoon-wicket-sample-webapp.properties (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/resources/META-INF/cocoon/properties/cocoon-wicket-sample-webapp.properties Thu Nov 26 07:45:38 2009
@@ -0,0 +1,16 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You 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.
+
+cocoon-wicket-sample.log-dir=./target
\ No newline at end of file

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/resources/META-INF/cocoon/properties/cocoon-wicket-sample-webapp.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/resources/META-INF/cocoon/properties/cocoon-wicket-sample-webapp.properties
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/resources/META-INF/cocoon/properties/cocoon-wicket-sample-webapp.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/applicationContext.xml?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/applicationContext.xml (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/applicationContext.xml Thu Nov 26 07:45:38 2009
@@ -0,0 +1,39 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+ --&gt;
+&lt;!-- $Id$ --&gt;
+&lt;beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xmlns:configurator="http://cocoon.apache.org/schema/configurator"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
+                           http://cocoon.apache.org/schema/configurator http://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.1.xsd"&gt;
+    
+  &lt;!-- Activate Cocoon Spring Configurator --&gt;
+  &lt;configurator:settings/&gt;
+
+  &lt;!-- Configure Log4j --&gt;
+  &lt;bean name="org.apache.cocoon.spring.configurator.log4j"
+        class="org.apache.cocoon.spring.configurator.log4j.Log4JConfigurator"
+        scope="singleton"&gt;
+    &lt;property name="settings" ref="org.apache.cocoon.configuration.Settings"/&gt;
+    &lt;property name="resource" value="/WEB-INF/log4j.xml"/&gt;
+  &lt;/bean&gt;
+&lt;/beans&gt;

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/applicationContext.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/applicationContext.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/applicationContext.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/log4j.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/log4j.xml?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/log4j.xml (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/log4j.xml Thu Nov 26 07:45:38 2009
@@ -0,0 +1,52 @@
+&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+ --&gt;
+&lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&gt;
+
+&lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"&gt;
+  &lt;appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"&gt;
+    &lt;layout class="org.apache.log4j.PatternLayout"&gt;
+      &lt;param name="ConversionPattern" value="%d{ISO8601} [%p] [%t] [%c] - %m%n" /&gt;
+    &lt;/layout&gt;
+  &lt;/appender&gt;
+
+  &lt;appender name="CORE" class="org.apache.log4j.RollingFileAppender"&gt;
+    &lt;param name="File" value="${cocoon-wicket-sample.log-dir}/cocoon-wicket.log" /&gt;
+    &lt;param name="Append" value="true" /&gt;
+    &lt;param name="MaxFileSize" value="2MB"/&gt;
+    &lt;param name="MaxBackupIndex" value="30"/&gt;
+    &lt;layout class="org.apache.log4j.PatternLayout"&gt;
+      &lt;param name="ConversionPattern" value="%d{ISO8601} %-5p %t %c - %m%n"/&gt;
+    &lt;/layout&gt;
+  &lt;/appender&gt;
+
+  &lt;logger name="org.apache.cocoon"&gt;
+    &lt;level value="DEBUG" /&gt;
+  &lt;/logger&gt;
+  
+  &lt;logger name="org.apache.wicket"&gt;
+    &lt;level value="DEBUG" /&gt;
+  &lt;/logger&gt;
+  
+  &lt;root&gt;
+    &lt;priority value="INFO"/&gt;
+    &lt;appender-ref ref="CORE"/&gt;
+    &lt;appender-ref ref="CONSOLE"/&gt;
+  &lt;/root&gt;
+&lt;/log4j:configuration&gt;

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/log4j.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/log4j.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/log4j.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/web.xml?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/web.xml (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/web.xml Thu Nov 26 07:45:38 2009
@@ -0,0 +1,53 @@
+&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+ --&gt;
+&lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"&gt;
+
+	&lt;display-name&gt;Apache Cocoon/Wicket Sample&lt;/display-name&gt;
+	
+	&lt;listener&gt;
+	  &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
+	&lt;/listener&gt;
+
+	&lt;filter&gt;
+	  &lt;filter-name&gt;cocoon-wicket-sample&lt;/filter-name&gt;
+	  &lt;filter-class&gt;org.apache.cocoon.sample.wicket.CocoonWicketSampleReloadingWicketFilter&lt;/filter-class&gt;
+	  &lt;init-param&gt;
+	    &lt;param-name&gt;applicationClassName&lt;/param-name&gt;
+	    &lt;param-value&gt;org.apache.cocoon.sample.wicket.CocoonWicketSampleWebApplication&lt;/param-value&gt;
+	  &lt;/init-param&gt;
+	  &lt;init-param&gt;
+	    &lt;param-name&gt;wicket.configuration&lt;/param-name&gt;
+	    &lt;param-value&gt;deployment&lt;/param-value&gt;
+	  &lt;/init-param&gt;
+	&lt;/filter&gt;
+	
+	&lt;filter-mapping&gt;
+	  &lt;filter-name&gt;cocoon-wicket-sample&lt;/filter-name&gt;
+	  &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
+      &lt;dispatcher&gt;REQUEST&lt;/dispatcher&gt;
+      &lt;dispatcher&gt;ERROR&lt;/dispatcher&gt;
+	&lt;/filter-mapping&gt;
+  
+    &lt;error-page&gt;
+      &lt;error-code&gt;404&lt;/error-code&gt;
+      &lt;location&gt;/404.html&lt;/location&gt;
+    &lt;/error-page&gt;
+&lt;/web-app&gt;

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/read/javascript-resource.js
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/read/javascript-resource.js?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/read/javascript-resource.js (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/read/javascript-resource.js Thu Nov 26 07:45:38 2009
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+function x() {
+  alert('x');
+  
+}

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/read/javascript-resource.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/read/javascript-resource.js
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/read/javascript-resource.js
------------------------------------------------------------------------------
    svn:mime-type = text/javascript

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sax-pipeline/simple.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sax-pipeline/simple.xml?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sax-pipeline/simple.xml (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sax-pipeline/simple.xml Thu Nov 26 07:45:38 2009
@@ -0,0 +1,18 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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.
+--&gt;
+&lt;simple&gt;simple-text&lt;/simple&gt;

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sax-pipeline/simple.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sax-pipeline/simple.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sax-pipeline/simple.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sax-pipeline/simple.xslt
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sax-pipeline/simple.xslt?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sax-pipeline/simple.xslt (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sax-pipeline/simple.xslt Thu Nov 26 07:45:38 2009
@@ -0,0 +1,35 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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.
+--&gt;
+&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt;
+
+  &lt;xsl:param name="myParam" /&gt;
+
+  &lt;xsl:template match="/"&gt;
+    &lt;html&gt;
+      &lt;head&gt;
+        &lt;title&gt;Simple Pipeline&lt;/title&gt;
+      &lt;/head&gt;
+
+      &lt;body&gt;
+        &lt;h1&gt;Simple Pipeline&lt;/h1&gt;
+        &lt;p&gt;&lt;xsl:value-of select="$myParam" /&gt;&lt;/p&gt;
+      &lt;/body&gt;
+    &lt;/html&gt;
+  &lt;/xsl:template&gt;
+
+&lt;/xsl:stylesheet&gt;

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sax-pipeline/simple.xslt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sax-pipeline/simple.xslt
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sax-pipeline/simple.xslt
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sitemap.xmap.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sitemap.xmap.xml?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sitemap.xmap.xml (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sitemap.xmap.xml Thu Nov 26 07:45:38 2009
@@ -0,0 +1,39 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+ --&gt;
+&lt;!-- $Id$ --&gt;
+&lt;map:sitemap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:map="http://apache.org/cocoon/sitemap"
+  xmlns:servlet="http://apache.org/cocoon/servlet" xmlns:controller="http://apache.org/cocoon/controller"&gt;
+  
+  &lt;map:pipelines&gt;
+    &lt;map:pipeline&gt;
+      &lt;map:match equals="sax-pipeline/simple"&gt;
+        &lt;map:generate src="sax-pipeline/simple.xml" /&gt;
+        &lt;map:transform src="sax-pipeline/simple.xslt"&gt;
+          &lt;map:parameter name="myParam" value="1" /&gt;
+        &lt;/map:transform&gt;
+        &lt;map:serialize /&gt;
+      &lt;/map:match&gt;
+
+      &lt;map:match pattern="read/javascript-resource-implicit.js"&gt;
+        &lt;map:read src="read/javascript-resource.js" /&gt;
+      &lt;/map:match&gt;      
+    &lt;/map:pipeline&gt;
+  &lt;/map:pipelines&gt;
+&lt;/map:sitemap&gt;

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sitemap.xmap.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sitemap.xmap.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/main/webapp/sitemap.xmap.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/it/CocoonWicketHtmlUnitTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/it/CocoonWicketHtmlUnitTestCase.java?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/it/CocoonWicketHtmlUnitTestCase.java (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/it/CocoonWicketHtmlUnitTestCase.java Thu Nov 26 07:45:38 2009
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.sample.wicket.it;
+
+import java.net.URL;
+
+import org.apache.cocoon.tools.it.HtmlUnitTestCase;
+
+public abstract class CocoonWicketHtmlUnitTestCase extends HtmlUnitTestCase {
+
+    private static final String BASEURL = "http://localhost:8891";
+
+    @Override
+    protected URL setupBaseUrl() throws Exception {
+        String baseUrl = System.getProperty("htmlunit.base-url");
+        if (baseUrl == null) {
+            baseUrl = BASEURL;
+        }
+        return new URL(baseUrl);
+    }
+
+}

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/it/CocoonWicketHtmlUnitTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/it/CocoonWicketHtmlUnitTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/it/CocoonWicketHtmlUnitTestCase.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/it/SitemapRequestTargetTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/it/SitemapRequestTargetTest.java?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/it/SitemapRequestTargetTest.java (added)
+++ cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/it/SitemapRequestTargetTest.java Thu Nov 26 07:45:38 2009
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.sample.wicket.it;
+
+/**
+ * Wicket/Cocoon-Sitemap integration tests
+ */
+public class SitemapRequestTargetTest extends CocoonWicketHtmlUnitTestCase {
+
+    /**
+     * A simple SAX pipeline.
+     */
+    public void testIncludeTransformer() throws Exception {
+        this.loadXmlPage("/sitemap/sax-pipeline/simple");
+        assertTrue(this.response.getStatusCode() == 200);
+        assertEquals("text/xml", this.response.getContentType());
+        this.assertXPath("/html/body/p", "1");
+    }
+
+    public void testConditionalGetRequest() throws Exception {
+        this.loadResponse("/sitemap/read/javascript-resource-implicit.js");
+        String lastModified = this.response.getResponseHeaderValue("Last-Modified");
+        assertNotNull("Last-Modified has to be set at this point!", lastModified);
+        assertFalse("Last-Modified has to be set at this point!", "".equals(lastModified));
+
+        this.webClient.addRequestHeader("If-Modified-Since", lastModified);
+        this.loadResponse("/sitemap/read/javascript-resource-implicit.js");
+        assertEquals(304, this.response.getStatusCode());
+    }
+
+    /**
+     * Check if a Wicket page is returned if the sitemap doesn't match.
+     */
+    public void test404() throws Exception {
+        this.loadResponse("/sitemap/NOT_EXISTING_URL");
+        assertTrue(this.response.getStatusCode() == 404);
+        assertEquals("text/html", this.response.getContentType());
+        assertTrue(this.response.getContentAsString().contains("Error 404"));
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/it/SitemapRequestTargetTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/it/SitemapRequestTargetTest.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-wicket-webapp/src/test/java/org/apache/cocoon/sample/wicket/it/SitemapRequestTargetTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Nov 26 07:45:38 2009
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r884433 [2/2] - in /cocoon/cocoon3/trunk: cocoon-sample-wicket-webapp/ cocoon-sample-wicket-webapp/src/ cocoon-sample-wicket-webapp/src/main/ cocoon-sample-wicket-webapp/src/main/java/ cocoon-sample-wicket-webapp/src/main/java/org/ cocoon-s...</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091126074541.C3F9C23889CF@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091126074541-C3F9C23889CF@eris-apache-org%3e</id>
<updated>2009-11-26T07:45:41Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Added: cocoon/cocoon3/trunk/cocoon-wicket/LICENSE.txt
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-wicket/LICENSE.txt?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-wicket/LICENSE.txt (added)
+++ cocoon/cocoon3/trunk/cocoon-wicket/LICENSE.txt Thu Nov 26 07:45:38 2009
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/LICENSE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/LICENSE.txt
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/LICENSE.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-wicket/NOTICE.txt
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-wicket/NOTICE.txt?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-wicket/NOTICE.txt (added)
+++ cocoon/cocoon3/trunk/cocoon-wicket/NOTICE.txt Thu Nov 26 07:45:38 2009
@@ -0,0 +1,5 @@
+Apache Cocoon
+Copyright 1999-2009 The Apache Software Foundation.
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/NOTICE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/NOTICE.txt
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/NOTICE.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-wicket/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-wicket/pom.xml?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-wicket/pom.xml (added)
+++ cocoon/cocoon3/trunk/cocoon-wicket/pom.xml Thu Nov 26 07:45:38 2009
@@ -0,0 +1,74 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+ --&gt;
+&lt;!-- $Id$ --&gt;
+&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
+
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;packaging&gt;jar&lt;/packaging&gt;
+
+  &lt;parent&gt;
+    &lt;groupId&gt;org.apache.cocoon.parent&lt;/groupId&gt;
+    &lt;artifactId&gt;cocoon-parent&lt;/artifactId&gt;
+    &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
+    &lt;relativePath&gt;../parent/pom.xml&lt;/relativePath&gt;
+  &lt;/parent&gt;
+
+  &lt;groupId&gt;org.apache.cocoon.wicket&lt;/groupId&gt;
+  &lt;artifactId&gt;cocoon-wicket&lt;/artifactId&gt;
+  &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: Wicket Integration&lt;/name&gt;
+  &lt;description&gt;Integrate Apache Cocoon 3 with Apache Wicket and vice versa.&lt;/description&gt;
+
+  &lt;dependencies&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.cocoon.servlet&lt;/groupId&gt;
+      &lt;artifactId&gt;cocoon-servlet&lt;/artifactId&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
+      &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
+      &lt;scope&gt;provided&lt;/scope&gt;
+    &lt;/dependency&gt;
+    
+    &lt;!-- Wicket --&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.wicket&lt;/groupId&gt;
+      &lt;artifactId&gt;wicket&lt;/artifactId&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.wicket&lt;/groupId&gt;
+      &lt;artifactId&gt;wicket-spring&lt;/artifactId&gt;
+      &lt;exclusions&gt;
+        &lt;exclusion&gt;
+          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
+          &lt;artifactId&gt;spring&lt;/artifactId&gt;
+        &lt;/exclusion&gt;
+      &lt;/exclusions&gt;
+    &lt;/dependency&gt;         
+  
+    &lt;!--  Test dependencies --&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;junit&lt;/groupId&gt;
+      &lt;artifactId&gt;junit&lt;/artifactId&gt;
+      &lt;scope&gt;test&lt;/scope&gt;
+    &lt;/dependency&gt;
+  &lt;/dependencies&gt;
+&lt;/project&gt;

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/WicketReader.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/WicketReader.java?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/WicketReader.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/WicketReader.java
Thu Nov 26 07:45:38 2009
@@ -0,0 +1,434 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.wicket.sitemap;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+import java.util.Vector;
+
+import javax.servlet.FilterConfig;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.Servlet;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.cocoon.pipeline.ProcessingException;
+import org.apache.cocoon.pipeline.SetupException;
+import org.apache.cocoon.pipeline.component.Finisher;
+import org.apache.cocoon.pipeline.component.Starter;
+import org.apache.cocoon.servlet.node.LastModifiedCollector;
+import org.apache.cocoon.servlet.util.HttpContextHelper;
+import org.apache.commons.io.IOUtils;
+import org.apache.wicket.protocol.http.WicketFilter;
+import org.apache.wicket.spring.SpringWebApplicationFactory;
+
+/**
+ * The simplest possible integration of Wicket as a reader component.
+ */
+public class WicketReader implements Starter, Finisher {
+
+    private static final String WICKET_FILTER_NAME = "wicket.filter";
+
+    private static WicketFilter wicketFilter;
+
+    private String basePath;
+    private OutputStream cocoonOutputStream;
+    private HttpServletRequest request;
+    private HttpServletResponse response;
+    private ServletContext servletContext;
+
+    public void execute() {
+        if ("GET".equalsIgnoreCase(this.request.getMethod()) || "POST".equalsIgnoreCase(this.request.getMethod()))
{
+            try {
+                wicketFilter.doGet(this.request, this.response);
+            } catch (ServletException e) {
+                throw new ProcessingException(e);
+            } catch (IOException e) {
+                throw new ProcessingException(e);
+            }
+        }
+    }
+
+    public void finish() {
+        // nothing to do
+    }
+
+    public String getContentType() {
+        // no relevance because this is handled by Wicket
+        return null;
+    }
+
+    public void setConfiguration(Map&lt;String, ? extends Object&gt; configuration) {
+        String basePath = (String) configuration.get("base-path");
+        if (basePath == null || "".equals(basePath)) {
+            throw new SetupException("The parameter 'base-path' has to be set. "
+                    + "This is the path where Wicket will be mounted to your URI space.");
+        }
+        if (basePath.charAt(0) != '/') {
+            basePath = "/" + basePath;
+        }
+        if (basePath.endsWith("/")) {
+            basePath = basePath.substring(0, basePath.length() - 1);
+        }
+        this.basePath = basePath;
+    }
+
+    public void setOutputStream(OutputStream outputStream) {
+        this.cocoonOutputStream = outputStream;
+        this.response = new CocoonWicketHttpServletResponse(this.response, this.cocoonOutputStream);
+    }
+
+    public void setup(Map&lt;String, Object&gt; parameters) {
+        this.request = HttpContextHelper.getRequest(parameters);
+        this.response = HttpContextHelper.getResponse(parameters);
+        this.servletContext = new CocoonWicketServletContext(HttpContextHelper.getServletContext(parameters),
+                this.basePath);
+        this.initWicketFilter();
+    }
+
+    private synchronized void initWicketFilter() {
+        if (wicketFilter != null) {
+            return;
+        }
+
+        wicketFilter = new WicketFilter();
+        try {
+            wicketFilter.init(new FilterConfig() {
+
+                public String getFilterName() {
+                    return WICKET_FILTER_NAME;
+                }
+
+                public String getInitParameter(String name) {
+                    if ("applicationFactoryClassName".equals(name)) {
+                        return SpringWebApplicationFactory.class.getName();
+                    }
+                    return null;
+                }
+
+                public Enumeration&lt;String&gt; getInitParameterNames() {
+                    Vector&lt;String&gt; paramNames = new Vector&lt;String&gt;();
+                    paramNames.add("applicationFactoryClassName");
+                    return paramNames.elements();
+                }
+
+                public ServletContext getServletContext() {
+                    return WicketReader.this.servletContext;
+                }
+            });
+        } catch (ServletException e) {
+            throw new SetupException("Can't initialize Wicket.", e);
+        }
+    }
+
+    @SuppressWarnings( { "deprecation" })
+    private static class CocoonWicketHttpServletResponse implements HttpServletResponse {
+
+        private final OutputStream cocoonOutputStream;
+        private PrintWriter printWriter;
+        private final HttpServletResponse response;
+
+        public CocoonWicketHttpServletResponse(HttpServletResponse response, OutputStream
cocoonOutputStream) {
+            this.response = response;
+            this.cocoonOutputStream = cocoonOutputStream;
+        }
+
+        public void addCookie(Cookie cookie) {
+            this.response.addCookie(cookie);
+        }
+
+        public void addDateHeader(String name, long date) {
+            this.response.addDateHeader(name, date);
+        }
+
+        public void addHeader(String name, String value) {
+            this.response.addHeader(name, value);
+        }
+
+        public void addIntHeader(String name, int value) {
+            this.response.addIntHeader(name, value);
+        }
+
+        public boolean containsHeader(String name) {
+            return this.response.containsHeader(name);
+        }
+
+        public String encodeRedirectUrl(String url) {
+            return this.response.encodeRedirectUrl(url);
+        }
+
+        public String encodeRedirectURL(String url) {
+            return this.response.encodeRedirectURL(url);
+        }
+
+        public String encodeUrl(String url) {
+            return this.response.encodeUrl(url);
+        }
+
+        public String encodeURL(String url) {
+            return this.response.encodeURL(url);
+        }
+
+        public void flushBuffer() throws IOException {
+            this.response.flushBuffer();
+        }
+
+        public int getBufferSize() {
+            return this.response.getBufferSize();
+        }
+
+        public String getCharacterEncoding() {
+            return this.response.getCharacterEncoding();
+        }
+
+        public String getContentType() {
+            return this.response.getContentType();
+        }
+
+        public Locale getLocale() {
+            return this.response.getLocale();
+        }
+
+        public ServletOutputStream getOutputStream() throws IOException {
+            return new ServletOutputStream() {
+
+                @Override
+                public void write(int b) throws IOException {
+                    CocoonWicketHttpServletResponse.this.cocoonOutputStream.write(b);
+                }
+            };
+        }
+
+        public PrintWriter getWriter() throws IOException {
+            if (this.printWriter == null) {
+                this.printWriter = new PrintWriter(new OutputStreamWriter(this.cocoonOutputStream),
true) {
+                    @Override
+                    public PrintWriter append(char c) {
+                        return super.append(c);
+                    }
+
+                    @Override
+                    public PrintWriter append(CharSequence csq) {
+                        return super.append(csq);
+                    }
+
+                    @Override
+                    public void write(char[] buf, int off, int len) {
+                        super.write(buf, off, len);
+                        // flush the print-writer because otherwise it never happens at all
+                        super.flush();
+                    }
+                };
+            }
+
+            return this.printWriter;
+        }
+
+        public boolean isCommitted() {
+            return this.response.isCommitted();
+        }
+
+        public void reset() {
+            this.response.reset();
+        }
+
+        public void resetBuffer() {
+            this.response.resetBuffer();
+        }
+
+        public void sendError(int sc) throws IOException {
+            this.response.sendError(sc);
+        }
+
+        public void sendError(int sc, String msg) throws IOException {
+            this.response.sendError(sc, msg);
+        }
+
+        public void sendRedirect(String location) throws IOException {
+            this.response.sendRedirect(location);
+        }
+
+        public void setBufferSize(int size) {
+            this.response.setBufferSize(size);
+        }
+
+        public void setCharacterEncoding(String charset) {
+            this.response.setCharacterEncoding(charset);
+        }
+
+        public void setContentLength(int len) {
+            this.response.setContentLength(len);
+        }
+
+        public void setContentType(String type) {
+            this.response.setContentType(type);
+        }
+
+        public void setDateHeader(String name, long date) {
+            if ("Last-Modified".equals(name)) {
+                LastModifiedCollector.setLastModified(date);
+            }
+            this.response.setDateHeader(name, date);
+        }
+
+        public void setHeader(String name, String value) {
+            this.response.setHeader(name, value);
+        }
+
+        public void setIntHeader(String name, int value) {
+            this.response.setIntHeader(name, value);
+        }
+
+        public void setLocale(Locale loc) {
+            this.response.setLocale(loc);
+        }
+
+        public void setStatus(int sc) {
+            this.response.setStatus(sc);
+        }
+
+        public void setStatus(int sc, String sm) {
+            this.response.setStatus(sc, sm);
+        }
+    }
+
+    @SuppressWarnings( { "unchecked", "deprecation" })
+    private static class CocoonWicketServletContext implements ServletContext {
+
+        private final String basePath;
+        private final ServletContext servletContext;
+
+        public CocoonWicketServletContext(ServletContext servletContext, String basPath)
{
+            this.servletContext = servletContext;
+            this.basePath = basPath;
+        }
+
+        public Object getAttribute(String name) {
+            return this.servletContext.getAttribute(name);
+        }
+
+        public Enumeration getAttributeNames() {
+            return this.servletContext.getAttributeNames();
+        }
+
+        public ServletContext getContext(String uripath) {
+            return this.servletContext.getContext(uripath);
+        }
+
+        public String getInitParameter(String name) {
+            return this.servletContext.getInitParameter(name);
+        }
+
+        public Enumeration getInitParameterNames() {
+            return this.servletContext.getInitParameterNames();
+        }
+
+        public int getMajorVersion() {
+            return this.servletContext.getMajorVersion();
+        }
+
+        public String getMimeType(String file) {
+            return this.servletContext.getMimeType(file);
+        }
+
+        public int getMinorVersion() {
+            return this.servletContext.getMinorVersion();
+        }
+
+        public RequestDispatcher getNamedDispatcher(String name) {
+            return this.servletContext.getNamedDispatcher(name);
+        }
+
+        public String getRealPath(String path) {
+            return this.servletContext.getRealPath(path);
+        }
+
+        public RequestDispatcher getRequestDispatcher(String path) {
+            return this.servletContext.getRequestDispatcher(path);
+        }
+
+        public URL getResource(String path) throws MalformedURLException {
+            return this.servletContext.getResource(path);
+        }
+
+        public InputStream getResourceAsStream(String path) {
+            if ("/WEB-INF/web.xml".equals(path)) {
+                String filterDefinition = "&lt;web-app&gt;&lt;filter-mapping&gt;&lt;filter-name&gt;"
+ WICKET_FILTER_NAME
+                        + "&lt;/filter-name&gt;&lt;url-pattern&gt;" + this.basePath + "/*&lt;/url-pattern&gt;&lt;/filter-mapping&gt;&lt;/web-app&gt;";
+                return IOUtils.toInputStream(filterDefinition);
+            }
+            return this.servletContext.getResourceAsStream(path);
+        }
+
+        public Set getResourcePaths(String path) {
+            return this.servletContext.getResourcePaths(path);
+        }
+
+        public String getServerInfo() {
+            return this.servletContext.getServerInfo();
+        }
+
+        public Servlet getServlet(String name) throws ServletException {
+            return this.servletContext.getServlet(name);
+        }
+
+        public String getServletContextName() {
+            return this.servletContext.getServletContextName();
+        }
+
+        public Enumeration getServletNames() {
+            return this.servletContext.getServletNames();
+        }
+
+        public Enumeration getServlets() {
+            return this.servletContext.getServlets();
+        }
+
+        public void log(Exception exception, String msg) {
+            this.servletContext.log(exception, msg);
+        }
+
+        public void log(String msg) {
+            this.servletContext.log(msg);
+        }
+
+        public void log(String message, Throwable throwable) {
+            this.servletContext.log(message, throwable);
+        }
+
+        public void removeAttribute(String name) {
+            this.servletContext.removeAttribute(name);
+        }
+
+        public void setAttribute(String name, Object object) {
+            this.servletContext.setAttribute(name, object);
+        }
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/WicketReader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/WicketReader.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/WicketReader.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/target/CocoonSitemap.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/target/CocoonSitemap.java?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/target/CocoonSitemap.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/target/CocoonSitemap.java
Thu Nov 26 07:45:38 2009
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.wicket.target;
+
+import org.apache.wicket.IRequestTarget;
+import org.apache.wicket.request.RequestParameters;
+import org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy;
+
+public class CocoonSitemap extends AbstractRequestTargetUrlCodingStrategy {
+
+    private final String sitemapPath;
+    private final String mountPath;
+
+    public CocoonSitemap(final String mountPath, final String sitemapPath) {
+        super(mountPath);
+        this.mountPath = mountPath;
+        this.sitemapPath = sitemapPath;
+    }
+
+    public IRequestTarget decode(RequestParameters requestParameters) {
+        return new CocoonSitemapRequestTarget(this.sitemapPath, this.mountPath);
+    }
+
+    public CharSequence encode(IRequestTarget requestTarget) {
+        return null;
+    }
+
+    public boolean matches(IRequestTarget requestTarget) {
+        return false;
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/target/CocoonSitemap.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/target/CocoonSitemap.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/target/CocoonSitemap.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/target/CocoonSitemapRequestTarget.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/target/CocoonSitemapRequestTarget.java?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/target/CocoonSitemapRequestTarget.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/target/CocoonSitemapRequestTarget.java
Thu Nov 26 07:45:38 2009
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.wicket.target;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+
+import org.apache.cocoon.servlet.RequestProcessor;
+import org.apache.cocoon.servlet.RequestProcessor.InvalidBaseUrlException;
+import org.apache.cocoon.servlet.RequestProcessor.SitemapInitializationException;
+import org.apache.cocoon.servlet.RequestProcessor.SitemapNotFoundException;
+import org.apache.cocoon.sitemap.NoMatchingPipelineException;
+import org.apache.cocoon.spring.configurator.WebAppContextUtils;
+import org.apache.wicket.IRequestTarget;
+import org.apache.wicket.RequestCycle;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.protocol.http.WebRequest;
+import org.apache.wicket.protocol.http.WebResponse;
+import org.apache.wicket.protocol.http.request.WebErrorCodeResponseTarget;
+import org.apache.wicket.settings.IExceptionSettings;
+
+public class CocoonSitemapRequestTarget implements IRequestTarget {
+
+    private RequestProcessor requestProcessor;
+    private final String mountPath;
+
+    public CocoonSitemapRequestTarget(final String sitemapPath, String mountPath) {
+        this.mountPath = mountPath;
+        synchronized (this) {
+            if (this.requestProcessor != null) {
+                return;
+            }
+
+            try {
+                this.requestProcessor = new RequestProcessor(WebApplication.get().getServletContext(),
sitemapPath,
+                        WebAppContextUtils.getCurrentWebApplicationContext());
+            } catch (SitemapNotFoundException e) {
+                throw new CocoonRuntimeException("Can't initialize Cocoon sitemap.", e);
+            } catch (InvalidBaseUrlException e) {
+                throw new CocoonRuntimeException("Invalid base URL for the Cocoon sitemap.",
e);
+            } catch (SitemapInitializationException e) {
+                throw new CocoonRuntimeException("Can't initialize Cocoon sitemap.", e);
+            }
+        }
+    }
+
+    public void detach(RequestCycle requestCycle) {
+    }
+
+    public void respond(RequestCycle requestCycle) {
+        try {
+            HttpServletRequest request = new CocoonWicketRequestWrapper(((WebRequest) requestCycle.getRequest())
+                    .getHttpServletRequest());
+            this.requestProcessor.service(request,
+                    ((WebResponse) requestCycle.getResponse()).getHttpServletResponse());
+        } catch (NoMatchingPipelineException e) {
+            WebApplication.get().getExceptionSettings().setUnexpectedExceptionDisplay(
+                    IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);
+            RequestCycle.get().setRequestTarget(new WebErrorCodeResponseTarget(404));
+        } catch (Exception e) {
+            throw new CocoonRuntimeException("Error occurred while executing a Cocoon sitemap.",
e);
+        }
+    }
+
+    public static class CocoonRuntimeException extends RuntimeException {
+
+        private static final long serialVersionUID = 1L;
+
+        public CocoonRuntimeException(String msg, Throwable cause) {
+            super(msg, cause);
+        }
+    }
+
+    private class CocoonWicketRequestWrapper extends HttpServletRequestWrapper {
+
+        private final HttpServletRequest request;
+
+        public CocoonWicketRequestWrapper(HttpServletRequest request) {
+            super(request);
+            this.request = request;
+        }
+
+        @Override
+        public String getServletPath() {
+            return this.request.getServletPath().substring(
+                    CocoonSitemapRequestTarget.this.mountPath.length());
+        }
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/target/CocoonSitemapRequestTarget.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/target/CocoonSitemapRequestTarget.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/target/CocoonSitemapRequestTarget.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-wicket/src/main/resources/META-INF/cocoon/spring/cocoon-wicket.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-wicket/src/main/resources/META-INF/cocoon/spring/cocoon-wicket.xml?rev=884433&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-wicket/src/main/resources/META-INF/cocoon/spring/cocoon-wicket.xml
(added)
+++ cocoon/cocoon3/trunk/cocoon-wicket/src/main/resources/META-INF/cocoon/spring/cocoon-wicket.xml
Thu Nov 26 07:45:38 2009
@@ -0,0 +1,25 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+ --&gt;
+&lt;!-- $Id$ --&gt;
+&lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"&gt;
+
+  &lt;bean name="reader:wicket" class="org.apache.cocoon.wicket.sitemap.WicketReader" scope="prototype"
/&gt;
+&lt;/beans&gt;

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/src/main/resources/META-INF/cocoon/spring/cocoon-wicket.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/src/main/resources/META-INF/cocoon/spring/cocoon-wicket.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-wicket/src/main/resources/META-INF/cocoon/spring/cocoon-wicket.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r884431 - /cocoon/cocoon3/trunk/cocoon-rest/pom.xml</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091126074434.784E123889CB@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091126074434-784E123889CB@eris-apache-org%3e</id>
<updated>2009-11-26T07:44:34Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Nov 26 07:44:33 2009
New Revision: 884431

URL: http://svn.apache.org/viewvc?rev=884431&amp;view=rev
Log:
make Jersey an optional dependency

Modified:
    cocoon/cocoon3/trunk/cocoon-rest/pom.xml

Modified: cocoon/cocoon3/trunk/cocoon-rest/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-rest/pom.xml?rev=884431&amp;r1=884430&amp;r2=884431&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-rest/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-rest/pom.xml Thu Nov 26 07:44:33 2009
@@ -55,10 +55,12 @@
     &lt;dependency&gt;
       &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
       &lt;artifactId&gt;jersey-core&lt;/artifactId&gt;
+      &lt;optional&gt;true&lt;/optional&gt;
     &lt;/dependency&gt;
     &lt;dependency&gt;
       &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
       &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
+      &lt;optional&gt;true&lt;/optional&gt;      
     &lt;/dependency&gt; 
 
     &lt;dependency&gt;




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r883092 - in /cocoon/cocoon3/trunk/cocoon-stringtemplate: ./ src/main/java/org/apache/cocoon/stringtemplate/ src/main/resources/META-INF/cocoon/spring/</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091122155848.376DD23888DD@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091122155848-376DD23888DD@eris-apache-org%3e</id>
<updated>2009-11-22T15:58:48Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Sun Nov 22 15:58:47 2009
New Revision: 883092

URL: http://svn.apache.org/viewvc?rev=883092&amp;view=rev
Log:
&lt;action dev="reinhard" type="add"&gt;
  [cocoon-stringtemplate] The StringTemplateGenerator doesn't use controller context parameters
as attributes anymore.
  This allows its usage outside of servlet environments. For the use with a Cocoon controller
implementation 
  org.apache.cocoon.stringtemplate.ControllerContextAwareStringTemplateGenerator was added.
This generator is also
  used as the bean 'generator:string-template' to be referred in sitemaps 
  (e.g. &amp;lt;map:generator src=&amp;quot;string-template&amp;quot; src=&amp;quot;...&amp;quot;
/&amp;gt);
&lt;/action&gt;

Added:
    cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java
  (with props)
Modified:
    cocoon/cocoon3/trunk/cocoon-stringtemplate/pom.xml
    cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateGenerator.java
    cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/resources/META-INF/cocoon/spring/cocoon-stringtemplate-sitemap-components.xml

Modified: cocoon/cocoon3/trunk/cocoon-stringtemplate/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stringtemplate/pom.xml?rev=883092&amp;r1=883091&amp;r2=883092&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stringtemplate/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-stringtemplate/pom.xml Sun Nov 22 15:58:47 2009
@@ -38,10 +38,22 @@
   &lt;description&gt;String-Template support for Cocoon 3.&lt;/description&gt;
 
   &lt;dependencies&gt;
+    &lt;!-- Cocoon dependencies --&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.cocoon.sax&lt;/groupId&gt;
+      &lt;artifactId&gt;cocoon-sax&lt;/artifactId&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.cocoon.pipeline&lt;/groupId&gt;
+      &lt;artifactId&gt;cocoon-pipeline&lt;/artifactId&gt;
+    &lt;/dependency&gt;
     &lt;dependency&gt;
       &lt;groupId&gt;org.apache.cocoon.servlet&lt;/groupId&gt;
       &lt;artifactId&gt;cocoon-servlet&lt;/artifactId&gt;
+      &lt;optional&gt;true&lt;/optional&gt;
     &lt;/dependency&gt;
+
+    &lt;!-- Other dependencies --&gt;    
     &lt;dependency&gt;
       &lt;groupId&gt;org.antlr&lt;/groupId&gt;
       &lt;artifactId&gt;stringtemplate&lt;/artifactId&gt;
@@ -54,18 +66,12 @@
       &lt;groupId&gt;commons-lang&lt;/groupId&gt;
       &lt;artifactId&gt;commons-lang&lt;/artifactId&gt;
     &lt;/dependency&gt;
-        
+     
+    &lt;!-- Test dependencies --&gt;     
     &lt;dependency&gt;
       &lt;groupId&gt;junit&lt;/groupId&gt;
       &lt;artifactId&gt;junit&lt;/artifactId&gt;
       &lt;scope&gt;test&lt;/scope&gt;
     &lt;/dependency&gt;
   &lt;/dependencies&gt;
-
-
-  &lt;scm&gt;
-    &lt;connection&gt;scm:svn:http://svn.apache.org/repos/asf/cocoon/cocoon3/tags/cocoon-root/3.0.0-alpha-1&lt;/connection&gt;
-    &lt;developerConnection&gt;scm:svn:https://svn.apache.org/repos/asf/cocoon/cocoon3/tags/cocoon-root/3.0.0-alpha-1&lt;/developerConnection&gt;
-    &lt;url&gt;http://svn.apache.org/repos/asf/cocoon/cocoon3/tags/cocoon-root/3.0.0-alpha-1&lt;/url&gt;
-  &lt;/scm&gt;
 &lt;/project&gt;

Added: cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java?rev=883092&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java
Sun Nov 22 15:58:47 2009
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.stringtemplate;
+
+import java.net.URL;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.antlr.stringtemplate.StringTemplate;
+import org.apache.cocoon.servlet.controller.ControllerContextHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class ControllerContextAwareStringTemplateGenerator extends StringTemplateGenerator
{
+
+    private final Log logger = LogFactory.getLog(this.getClass());
+
+    public ControllerContextAwareStringTemplateGenerator() {
+        super();
+    }
+
+    @Override
+    protected void addTemplateAttributes(StringTemplate stringTemplate) {
+        super.addTemplateAttributes(stringTemplate);
+
+        // put all objects that are passed by the controller context
+        Map&lt;String, Object&gt; controllerContext = ControllerContextHelper.getContext(this.parameters);
+        for (Entry&lt;String, Object&gt; eachEntry : controllerContext.entrySet()) {
+            String key = eachEntry.getKey().replace(".", "_");
+
+            // remove already set parameters (otherwise there's some strange behavior in
some cases
+            // at least with StringTempalte 3.0
+            Object attribute = stringTemplate.getAttribute(key);
+            if (attribute != null) {
+                stringTemplate.removeAttribute(key);
+            }
+
+            stringTemplate.setAttribute(key, eachEntry.getValue());
+
+            if (this.logger.isDebugEnabled()) {
+                this.logger.debug("Passing controller context parameter as attribute: key="
+ eachEntry.getKey()
+                        + ", value=" + eachEntry.getValue());
+            }
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @see org.apache.cocoon.pipeline.component.AbstractSAXProducer#setConfiguration(java.util.Map)
+     */
+    @Override
+    public void setConfiguration(Map&lt;String, ? extends Object&gt; parameters) {
+        super.setSource((URL) parameters.get("source"));
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateGenerator.java?rev=883092&amp;r1=883091&amp;r2=883092&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateGenerator.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateGenerator.java
Sun Nov 22 15:58:47 2009
@@ -37,7 +37,6 @@
 import org.apache.cocoon.pipeline.component.Starter;
 import org.apache.cocoon.sax.AbstractSAXProducer;
 import org.apache.cocoon.sax.util.XMLUtils;
-import org.apache.cocoon.servlet.controller.ControllerContextHelper;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.logging.Log;
@@ -49,7 +48,7 @@
     private final Log logger = LogFactory.getLog(this.getClass());
 
     private URL source;
-    private Map&lt;String, Object&gt; parameters = new HashMap&lt;String, Object&gt;();
+    protected Map&lt;String, Object&gt; parameters = new HashMap&lt;String, Object&gt;();
 
     public StringTemplateGenerator() {
         super();
@@ -57,12 +56,12 @@
 
     public StringTemplateGenerator(URL source) {
         super();
-        this.source = source;
+        this.setSource(source);
     }
 
     /**
      * {@inheritDoc}
-     * 
+     *
      * @see org.apache.cocoon.pipeline.component.CachingPipelineComponent#constructCacheKey()
      */
     public CacheKey constructCacheKey() {
@@ -80,7 +79,7 @@
 
     /**
      * {@inheritDoc}
-     * 
+     *
      * @see org.apache.cocoon.pipeline.component.Starter#execute()
      */
     public void execute() {
@@ -102,15 +101,7 @@
                     }
                 });
 
-                Map&lt;String, Object&gt; controllerContext = ControllerContextHelper.getContext(this.parameters);
-                for (Entry&lt;String, Object&gt; eachEntry : controllerContext.entrySet())
{
-                    stringTemplate.setAttribute(eachEntry.getKey(), eachEntry.getValue());
-
-                    if (this.logger.isDebugEnabled()) {
-                        this.logger.debug("Passing parameter: key=" + eachEntry.getKey()
+ ", value="
-                                + eachEntry.getValue());
-                    }
-                }
+                this.addTemplateAttributes(stringTemplate);
 
                 XMLUtils.createXMLReader(this.getSAXConsumer()).parse(
                         new InputSource(new StringReader(stringTemplate.toString())));
@@ -125,15 +116,23 @@
     }
 
     /**
-     * {@inheritDoc}
-     * 
-     * @see org.apache.cocoon.pipeline.component.AbstractSAXProducer#setConfiguration(java.util.Map)
+     * Add attributes to the StringTemplate. Be careful to keep the constructCacheKey() method
+     * align.
+     *
+     * @param stringTemplate The template where the attributes are added to.
      */
-    @Override
-    public void setConfiguration(Map&lt;String, ? extends Object&gt; parameters) {
-        this.setSource((URL) parameters.get("source"));
+    protected void addTemplateAttributes(StringTemplate stringTemplate) {
+        for (Entry&lt;String, Object&gt; eachEntry : this.parameters.entrySet()) {
+            stringTemplate.setAttribute(eachEntry.getKey().replace(".", "_"), eachEntry.getValue());
+
+            if (this.logger.isDebugEnabled()) {
+                this.logger.debug("Passing pipeline parameter as attribute: key=" + eachEntry.getKey()
+ ", value="
+                        + eachEntry.getValue());
+            }
+        }
     }
 
+
     @Override
     public void setup(Map&lt;String, Object&gt; parameters) {
         this.parameters = parameters;

Modified: cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/resources/META-INF/cocoon/spring/cocoon-stringtemplate-sitemap-components.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/resources/META-INF/cocoon/spring/cocoon-stringtemplate-sitemap-components.xml?rev=883092&amp;r1=883091&amp;r2=883092&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/resources/META-INF/cocoon/spring/cocoon-stringtemplate-sitemap-components.xml
(original)
+++ cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/resources/META-INF/cocoon/spring/cocoon-stringtemplate-sitemap-components.xml
Sun Nov 22 15:58:47 2009
@@ -22,7 +22,7 @@
   http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
   http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"&gt;
 
-  &lt;bean name="generator:string-template" class="org.apache.cocoon.stringtemplate.StringTemplateGenerator"
scope="prototype" /&gt;
+  &lt;bean name="generator:string-template" class="org.apache.cocoon.stringtemplate.ControllerContextAwareStringTemplateGenerator"
scope="prototype" /&gt;
 
   &lt;bean name="reader:string-template" class="org.apache.cocoon.stringtemplate.StringTemplateReader"
scope="prototype" /&gt;
 




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r882923 - in /cocoon/cocoon3/trunk: cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/cache/ cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/cache/entry/ cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/l...</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091121151542.A9B99238899C@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091121151542-A9B99238899C@eris-apache-org%3e</id>
<updated>2009-11-21T15:15:42Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Sat Nov 21 15:15:39 2009
New Revision: 882923

URL: http://svn.apache.org/viewvc?rev=882923&amp;view=rev
Log:
COCOON3-33 support reconfiguration of properties at runtime (although this isn't persistant)
move all MBeans to org.apache.cocoon (cocoon-monitoring and cocoon-profiling)
use Spring annotations to expose the cocoon-profiling MBean

Added:
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/JmxSpringSettings.java
  (with props)
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/Log4JReconfigurator.java
  (with props)
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/LoggingConfigurationResetter.java
  (with props)
Removed:
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/log4j/Log4JReconfigurator.java
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/log4j/LoggingConfigurationResetter.java
    cocoon/cocoon3/trunk/cocoon-profiling/src/main/java/org/apache/cocoon/profiling/jmx/ProfilingManagementMBean.java
Modified:
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/cache/CacheBurstActions.java
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/cache/CacheMonitorInitializer.java
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/cache/entry/CacheEntrysMonitorInitializer.java
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/servletservice/ServletServiceMonitorInitializer.java
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsInitializer.java
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/resources/META-INF/cocoon/spring/cocoon-monitoring.xml
    cocoon/cocoon3/trunk/cocoon-profiling/src/main/java/org/apache/cocoon/profiling/jmx/ProfilingManagement.java
    cocoon/cocoon3/trunk/cocoon-profiling/src/main/resources/META-INF/cocoon/spring/cocoon-profiling-component.xml

Modified: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/cache/CacheBurstActions.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/cache/CacheBurstActions.java?rev=882923&amp;r1=882922&amp;r2=882923&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/cache/CacheBurstActions.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/cache/CacheBurstActions.java
Sat Nov 21 15:15:39 2009
@@ -38,7 +38,7 @@
  * This class can perform burst operation (like cleaning specified cache elements) on all
cache data.
  *
  */
-@ManagedResource(objectName = "org.apache.cocoon.monitoring:group=Cache,name=CacheBurstActions",
description = "This module can perform burst operation (like cleaning specified cache elements)
on all cache data.")
+@ManagedResource(objectName = "org.apache.cocoon:group=Cache,name=CacheBurstActions", description
= "This module can perform burst operation (like cleaning specified cache elements) on all
cache data.")
 public class CacheBurstActions {
 
     private final List&lt;Cache&gt; caches;

Modified: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/cache/CacheMonitorInitializer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/cache/CacheMonitorInitializer.java?rev=882923&amp;r1=882922&amp;r2=882923&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/cache/CacheMonitorInitializer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/cache/CacheMonitorInitializer.java
Sat Nov 21 15:15:39 2009
@@ -35,7 +35,8 @@
     public CacheMonitorInitializer(Map&lt;String, Cache&gt; caches, MBeanExporter exporter)
{
         for (Cache cache : caches.values()) {
             // '=' is disallowed in ObjectName so it is replaced by ' '
-            String stringName = "org.apache.cocoon.monitoring:group=Cache,subGroup=Caches,name="
+ cache.toString().replace("=", " ");
+            String stringName = "org.apache.cocoon:group=Cache,subGroup=Caches,name="
+                    + cache.toString().replace("=", " ");
 
             ObjectName name;
             try {

Modified: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/cache/entry/CacheEntrysMonitorInitializer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/cache/entry/CacheEntrysMonitorInitializer.java?rev=882923&amp;r1=882922&amp;r2=882923&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/cache/entry/CacheEntrysMonitorInitializer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/cache/entry/CacheEntrysMonitorInitializer.java
Sat Nov 21 15:15:39 2009
@@ -40,10 +40,10 @@
 import org.springframework.jmx.export.annotation.ManagedOperationParameters;
 import org.springframework.jmx.export.annotation.ManagedResource;
 
-@ManagedResource(objectName = "org.apache.cocoon.monitoring:group=Cache,name=CacheEntrysRefresher")
+@ManagedResource(objectName = "org.apache.cocoon:group=Cache,name=CacheEntrysRefresher")
 public class CacheEntrysMonitorInitializer {
 
-    private static final String namePrefix = "org.apache.cocoon.monitoring:group=Cache,subGroup=Entrys,groupName=";
+    private static final String namePrefix = "org.apache.cocoon:group=Cache,subGroup=Entrys,groupName=";
     private final Log logger = LogFactory.getLog(this.getClass());
 
     private final MBeanServer mBeanServer;

Added: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/JmxSpringSettings.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/JmxSpringSettings.java?rev=882923&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/JmxSpringSettings.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/JmxSpringSettings.java
Sat Nov 21 15:15:39 2009
@@ -0,0 +1,188 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.monitoring.reconfiguration;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.cocoon.configuration.MutableSettings;
+import org.apache.cocoon.configuration.Settings;
+import org.springframework.jmx.export.annotation.ManagedAttribute;
+import org.springframework.jmx.export.annotation.ManagedOperation;
+import org.springframework.jmx.export.annotation.ManagedOperationParameter;
+import org.springframework.jmx.export.annotation.ManagedOperationParameters;
+import org.springframework.jmx.export.annotation.ManagedResource;
+
+@ManagedResource(objectName = "org.apache.cocoon:group=Reconfiguration,name=JmxSpringSettings")
+public class JmxSpringSettings {
+
+    private final MutableSettings settings;
+
+    public JmxSpringSettings(Settings settings) {
+        this.settings = (MutableSettings) settings;
+    }
+
+    /**
+     * @see org.apache.cocoon.configuration.Settings#getProperty(java.lang.String)
+     */
+    @ManagedOperation(description = "Get the value of a property.")
+    @ManagedOperationParameters(@ManagedOperationParameter(name = "key", description = "The
name of the property."))
+    public final String getProperty(String key) {
+        return this.settings.getProperty(key);
+    }
+
+    /**
+     * @see org.apache.cocoon.configuration.Settings#getPropertyNames(java.lang.String)
+     */
+    @SuppressWarnings("unchecked")
+    @ManagedOperation(description = "Return all available property names starting with the
prefix.")
+    @ManagedOperationParameters(@ManagedOperationParameter(name = "keyPrefix", description
= "The prefix each property name must have."))
+    public final String[] listPropertys(String keyPrefix) {
+        return this.getProperties(this.settings.getPropertyNames(keyPrefix));
+    }
+
+    /**
+     * @see org.apache.cocoon.configuration.Settings#getPropertyNames()
+     */
+    @SuppressWarnings("unchecked")
+    @ManagedOperation(description = "Return all available property names.")
+    public final String[] listPropertys() {
+        return this.getProperties(this.settings.getPropertyNames());
+    }
+
+    /**
+     * @see org.apache.cocoon.configuration.Settings#getLoadClasses()
+     */
+    @SuppressWarnings("unchecked")
+    @ManagedAttribute(description = "List classes that should be loaded at initialization
time of the servlet.")
+    public final String[] listLoadClasses() {
+        return (String[]) this.settings.getLoadClasses().toArray(new String[] {});
+    }
+
+    /**
+     * @see org.apache.cocoon.configuration.Settings#getFormEncoding()
+     */
+    @ManagedAttribute(description = "The character set used to decode request parameters.")
+    public final String getFormEncoding() {
+        return this.settings.getFormEncoding();
+    }
+
+    /**
+     * @see org.apache.cocoon.configuration.Settings#getContainerEncoding()
+     */
+    @ManagedAttribute(description = "Encoding used by the container.")
+    public final String getContainerEncoding() {
+        return this.settings.getContainerEncoding();
+    }
+
+    /**
+     * @see org.apache.cocoon.configuration.Settings#getCacheDirectory()
+     */
+    @ManagedAttribute(description = "Specify where Cocoon should create its page and other
objects cache. The path specified can be either absolute or relative to the context path of
the servlet.")
+    public final String getCacheDirectory() {
+        return this.settings.getCacheDirectory();
+    }
+
+    /**
+     * @see org.apache.cocoon.configuration.Settings#getCreationTime()
+     */
+    @ManagedAttribute(description = "The creation time of the current settings instance.")
+    public final String getCreationTime() {
+        return new Date(this.settings.getCreationTime()).toString();
+    }
+
+    /**
+     * @see org.apache.cocoon.configuration.Settings#isReloadingEnabled(java.lang.String)
+     */
+    @ManagedOperation(description = "This method can be used by components to query if they
are configured to check for reloading.")
+    @ManagedOperationParameters(@ManagedOperationParameter(name = "type", description = "The
type of the component that wants to check for reload."))
+    public final boolean isReloadingEnabled(String type) {
+        return this.settings.isReloadingEnabled(type);
+    }
+
+    /**
+     * @see org.apache.cocoon.configuration.Settings#getReloadDelay(java.lang.String)
+     */
+    @ManagedOperation(description = "This method can be used by components to get the configured
delay period between checks.")
+    public final long getReloadingDelay(String type) {
+        return this.settings.getReloadDelay(type);
+    }
+
+    /**
+     * @see org.apache.cocoon.configuration.Settings#getRunningMode()
+     */
+    @ManagedAttribute(description = "Return the current running mode.")
+    public final String getRunningMode() {
+        return this.settings.getRunningMode();
+    }
+
+    /**
+     * Sets new value of property.
+     *
+     * @param key Property key that value should be changed.
+     * @param value New value of property.
+     */
+    @ManagedOperation(description = "Sets new value of property. (Note: This change is not
persistant!)")
+    @ManagedOperationParameters( {
+            @ManagedOperationParameter(name = "key", description = "Property key that value
should be changed."),
+            @ManagedOperationParameter(name = "value", description = "New value of property.")
})
+    public final void setProperty(String key, String value) {
+        Properties props = new Properties();
+        props.put(key, value);
+
+        this.settings.configure(props);
+    }
+
+    /**
+     * @see org.apache.cocoon.configuration.MutableSettings#setFormEncoding(java.lang.String)
+     */
+    @ManagedOperation(description = "Sets form encoding'. (Note: This change is not persistant!)")
+    @ManagedOperationParameters(@ManagedOperationParameter(name = "formEncoding", description
= "The formEncoding to set."))
+    public final void setFormEncoding(String formEncoding) {
+        this.settings.setFormEncoding(formEncoding);
+    }
+
+    /**
+     * @see org.apache.cocoon.configuration.MutableSettings#setContainerEncoding(java.lang.String)
+     */
+    @ManagedOperation(description = "Set the container encoding.")
+    @ManagedOperationParameters(@ManagedOperationParameter(name = "encofing", description
= "The new encoding value."))
+    public final void setContainerEncoding(String encoding) {
+        this.settings.setContainerEncoding(encoding);
+    }
+
+    /**
+     * @see org.apache.cocoon.configuration.MutableSettings#setReloadingEnabled(boolean)
+     */
+    @ManagedOperation(description = "Allow reloading. (Note: This change is not persistant!)")
+    @ManagedOperationParameters(@ManagedOperationParameter(name = "allowReload", description
= "The allowReload to set."))
+    public final void setReloadingEnabled(boolean allowReload) {
+        this.settings.setReloadingEnabled(allowReload);
+    }
+
+    private String[] getProperties(List&lt;String&gt; propertyNames) {
+        String[] result = new String[propertyNames.size()];
+
+        for (int i = 0; i &lt; propertyNames.size(); i++) {
+            String key = propertyNames.get(i);
+            result[i] = key + ": " + this.settings.getProperty(key);
+        }
+
+        return result;
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/JmxSpringSettings.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/JmxSpringSettings.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/JmxSpringSettings.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/Log4JReconfigurator.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/Log4JReconfigurator.java?rev=882923&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/Log4JReconfigurator.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/Log4JReconfigurator.java
Sat Nov 21 15:15:39 2009
@@ -0,0 +1,349 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.monitoring.reconfiguration;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Scanner;
+
+import javax.naming.ConfigurationException;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.cocoon.configuration.PropertyHelper;
+import org.apache.cocoon.configuration.Settings;
+import org.apache.commons.io.FilenameUtils;
+import org.apache.log4j.Level;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+import org.apache.log4j.PropertyConfigurator;
+import org.apache.log4j.spi.LoggerRepository;
+import org.apache.log4j.xml.DOMConfigurator;
+import org.apache.log4j.xml.Log4jEntityResolver;
+import org.springframework.jmx.export.annotation.ManagedAttribute;
+import org.springframework.jmx.export.annotation.ManagedOperation;
+import org.springframework.jmx.export.annotation.ManagedOperationParameter;
+import org.springframework.jmx.export.annotation.ManagedOperationParameters;
+import org.springframework.jmx.export.annotation.ManagedResource;
+import org.w3c.dom.Document;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * This is a JMX MBean class that expose methods for log4j configuration.
+ */
+@ManagedResource(objectName = "org.apache.cocoon:group=Reconfiguration,name=Log4JReconfigurator")
+public class Log4JReconfigurator {
+
+    private static final String[] EXTENSIONS = new String[] { "xml", "properties" };
+
+    private final Logger logger;
+    private final LoggerRepository loggerRepository;
+    private final DocumentBuilder docBuilder;
+
+    private Settings settings;
+
+    public Log4JReconfigurator() {
+        this.loggerRepository = LogManager.getLoggerRepository();
+        this.logger = Logger.getLogger(Log4JReconfigurator.class);
+
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        dbf.setValidating(true);
+
+        try {
+            this.docBuilder = dbf.newDocumentBuilder();
+        } catch (ParserConfigurationException e) {
+            this.logger.fatal(e.getMessage(), e);
+            throw new RuntimeException(e);
+        }
+        this.docBuilder.setErrorHandler(new DefaultHandler());
+        this.docBuilder.setEntityResolver(new Log4jEntityResolver());
+    }
+
+    /**
+     * Find all configured loggers and returns is as a array of &lt;code&gt;String&lt;/code&gt;s
+     *
+     * @return list of all configured loggers with their level.
+     */
+    @ManagedAttribute(description = "Return a list of all configured loggers with their level.")
+    public final String[] getLoggers() {
+        List&lt;String&gt; result = new ArrayList&lt;String&gt;();
+
+        @SuppressWarnings("unchecked")
+        Enumeration&lt;Logger&gt; currentLoggers = this.loggerRepository.getCurrentLoggers();
+        while (currentLoggers.hasMoreElements()) {
+            Logger tmpLogger = currentLoggers.nextElement();
+            if (tmpLogger.getLevel() != null) {
+                result.add(tmpLogger.getName() + ": " + tmpLogger.getLevel());
+            }
+        }
+
+        return result.toArray(new String[] {});
+    }
+
+    /**
+     * Sets logging level for a particular package or a class.
+     *
+     * @param category name of the log category (usually a package or class name) whose log
level
+     *            should be changed.
+     * @param newLogLevel new log level for that category. Available log levels are:
+     *            &lt;code&gt;OFF&lt;/code&gt;, &lt;code&gt;INFO&lt;/code&gt;, &lt;code&gt;WARN&lt;/code&gt;,
&lt;code&gt;ERROR&lt;/code&gt;,
+     *            &lt;code&gt;FATAL&lt;/code&gt;, &lt;code&gt;TRACE&lt;/code&gt;, &lt;code&gt;DEBUG&lt;/code&gt;,
&lt;code&gt;ALL&lt;/code&gt;
+     * @return &lt;code&gt;true&lt;/code&gt; if operation was successful, &lt;code&gt;false&lt;/code&gt;
otherwise.
+     */
+    @ManagedOperation(description = "Sets logging level for a particular package or a class.
Returns "
+            + "true if operation was successful.")
+    @ManagedOperationParameters(value = {
+            @ManagedOperationParameter(name = "category", description = "Name of the log
category (usually "
+                    + "a package or class name) whose log level should be changed."),
+            @ManagedOperationParameter(name = "newLevel", description = "New log level for
that category. "
+                    + "Available log levels are: OFF, INFO, WARN, ERROR, FATAL, TRACE, DEBUG,
ALL") })
+    public final boolean setLoggingLevel(final String category, final String newLogLevel)
{
+        boolean result = false;
+
+        Logger logger = this.loggerRepository.getLogger(category);
+        if (logger != null) {
+            logger.setLevel(Level.toLevel(newLogLevel.toUpperCase()));
+            result = true;
+        }
+
+        return result;
+    }
+
+    /**
+     * Sets new logging level for amount of time. After timeout log level is set back to
old value.
+     *
+     * @param category name of the log category (usually a package or class name) whose log
level
+     *            should be changed.
+     * @param temporalLogLevel temporal log level for that category that should be set for
specified
+     *            amount of time.
+     * @param timeOut amount of time that temporalLevel should be active. Value of timeOut
should
+     *            match regular expression: ^[0-9.]+[dhm]?$ where &lt;code&gt;d&lt;/code&gt;
means day,
+     *            &lt;code&gt;h&lt;/code&gt; hours and &lt;code&gt;m&lt;/code&gt; minutes
+     * @return &lt;code&gt;true&lt;/code&gt; if operation was successful, &lt;code&gt;false&lt;/code&gt;
otherwise.
+     */
+    @ManagedOperation(description = "Sets new logging level for amount of time. After timeout
log level is set"
+            + " back to old value.")
+    @ManagedOperationParameters(value = {
+            @ManagedOperationParameter(name = "category", description = "Name of the log
category (usually"
+                    + " a package or class name) whose log level should be changed."),
+            @ManagedOperationParameter(name = "temporalLevel", description = "Temporal log
level for that "
+                    + "category that should be set for specified amount of time."),
+            @ManagedOperationParameter(name = "timeOut", description = "Amount of time that
temporalLevel "
+                    + "should be active. Value of timeOut should match regular expression:
^[0-9.]+[dhm]?$ "
+                    + "where 'd' means day, 'h' hours and 'm' minutes") })
+    public final boolean setLoggingTempoporalLevel(final String category, final String temporalLogLevel,
+            final String timeOut) {
+        if (!timeOut.matches("^[0-9.]+[dhm]?$")) {
+            throw new UnsupportedOperationException("Unsupported time-out format: " + timeOut);
+        }
+
+        boolean result = false;
+        Logger logger = this.loggerRepository.getLogger(category);
+        if (logger != null) {
+            Level oldLevel = logger.getLevel();
+            LoggingConfigurationResetter restoreThread = new LoggingConfigurationResetter(logger,
oldLevel, timeOut
+                    .toLowerCase());
+            logger.setLevel(Level.toLevel(temporalLogLevel));
+            restoreThread.start();
+            result = true;
+        }
+
+        return result;
+    }
+
+    /**
+     * Allows to change configuration of log4j on the fly. This function support both XML
and
+     * properties configuration files. Before reloading the configuration it checks that
the new
+     * config file contains at least one appender and all output files are accessible (for
XML
+     * configs it also validate XML syntax using schema or DTD)
+     *
+     * @param path absolute path to configuration file located on the server.
+     * @return &lt;code&gt;true&lt;/code&gt; if operation was successful, &lt;code&gt;false&lt;/code&gt;
otherwise.
+     * @throws Exception if something unusual happens
+     */
+    @ManagedOperation(description = "Allows to change configuration of log4j on the fly.
This function support "
+            + "both XML and properties configuration files. Before reloading configuration
it checks that the new "
+            + "config file contains at least one appender and all output files are accessible
(for XML configs it"
+            + "also validate XML syntax using schema or DTD)")
+    @ManagedOperationParameters(value = { @ManagedOperationParameter(name = "configFilePath",
description = "Absolute path to configuration file.") })
+    public final boolean loadNewConfigurationFile(String path) throws Exception {
+        path = path.trim();
+
+        // check extension
+        if (FilenameUtils.isExtension(path, EXTENSIONS)) {
+            File newConfig = new File(path);
+
+            if (!newConfig.exists()) {
+                this.logger.fatal("Cannot find file: " + path);
+                throw new FileNotFoundException("Cannot find file: " + path);
+            } else if (!newConfig.canRead()) {
+                this.logAndThrowIOException("Cannot read file: " + path);
+            }
+
+            if (FilenameUtils.isExtension(path, "xml")) {
+                this.loadNewXMLConfigurationFile(path);
+            } else {
+                this.loadNewPropertiesConfigurationFile(path);
+            }
+        } else {
+            String message = "Unsupported file format: " + FilenameUtils.getExtension(path);
+            this.logger.fatal(message);
+            throw new ConfigurationException(message);
+        }
+
+        return true;
+    }
+
+    /**
+     * Inject the settings object.
+     *
+     * @param s The settings bean.
+     */
+    public final void setSettings(final Settings s) {
+        this.settings = s;
+    }
+
+    /**
+     * Loads XML config file specified by &lt;code&gt;path&lt;/code&gt; parameter. Then this
file is validate
+     * against DTD or schema, after that every appender is checked that it output file is
+     * accessible.
+     *
+     * @param path absolute path to XML configuration file.
+     * @throws Exception if something unusual happens
+     */
+    private void loadNewXMLConfigurationFile(final String path) throws Exception {
+        Document doc;
+        try { // validate XML config file
+            doc = this.docBuilder.parse(path);
+        } catch (Exception e) {
+            this.logger.fatal(e.getMessage(), e);
+            throw new IOException("Config file parse exception: " + e.getMessage());
+        }
+
+        // check access for all log files
+        NodeList appenderList = doc.getElementsByTagName("appender");
+        for (int i = 0; i &lt; appenderList.getLength(); i++) {
+            NodeList childNodes = appenderList.item(i).getChildNodes();
+            for (int j = 0; j &lt; childNodes.getLength(); j++) {
+                Node item = childNodes.item(j);
+                this.extractLogFilespathAndValidate(item);
+            }
+        }
+
+        // apply new settings
+        DOMConfigurator.configure(path);
+    }
+
+    /**
+     * Extracts path to log file from XML configuration node and checks that it exist and
is
+     * writable.
+     *
+     * @param item
+     * @throws IOException if directory doesn't exist or isn't writable
+     */
+    private void extractLogFilespathAndValidate(final Node item) throws IOException {
+        if (!item.getNodeName().equalsIgnoreCase("param")) {
+            return;
+        }
+
+        NamedNodeMap itemAttributes = item.getAttributes();
+        if (itemAttributes == null) {
+            return;
+        }
+
+        Node paramName = itemAttributes.getNamedItem("name");
+        if (paramName != null &amp;&amp; paramName.getNodeValue().equalsIgnoreCase("file"))
{
+            Node paramValue = itemAttributes.getNamedItem("value");
+            if (paramValue != null) {
+                String logpath = paramValue.getNodeValue();
+                this.validateLogFile(logpath);
+            }
+        }
+    }
+
+    /**
+     * Loads properties config file specified by &lt;code&gt;path&lt;/code&gt; parameter.
Then it validate that
+     * file contains configuration for at least one appender and validate all configured
log files
+     * that they path exist and it is writable.
+     *
+     * @param path absolute path to properties configuration file.
+     * @throws Exception if something unusual happens
+     */
+    private void loadNewPropertiesConfigurationFile(final String path) throws ConfigurationException,
IOException {
+        boolean result = false;
+        File file = new File(path);
+
+        // search for appender configuration
+        Scanner fileScanner = new Scanner(file);
+        while (fileScanner.hasNext()) {
+            String line = fileScanner.nextLine();
+            if (!result &amp;&amp; line.toLowerCase().matches("^log4j\\.appender\\.[\\w\\.]+=[\\w\\.]+$"))
{
+                PropertyConfigurator.configure(file.getPath());
+                result = true; // we got our "at least one appender" ;)
+            }
+
+            if (line.toLowerCase().matches("^log4j\\.appender\\.[\\w]+\\.file=[\\w\\.\\{\\}\\$/\\:]+$"))
{
+                String[] logFile = line.split("=");
+                this.validateLogFile(logFile[1]);
+            }
+        }
+
+        if (!result) {
+            throw new ConfigurationException(
+                    "No configured appenders, there should be at least one appender confgured.");
+        }
+    }
+
+    /**
+     * Helper method that logs exception and throws IOException.
+     *
+     * @param message that should be logged and passed to exception
+     * @throws IOException always throws this exception
+     */
+    private void logAndThrowIOException(final String message) throws IOException {
+        this.logger.fatal(message);
+        throw new IOException(message);
+    }
+
+    /**
+     * Validate log file path that it exists and is writable.
+     *
+     * @param logPath path to log file
+     * @throws IOException if log file directory doesn't exist or is read only
+     */
+    private void validateLogFile(String logPath) throws IOException {
+        String logDirpath = FilenameUtils.getFullPath(PropertyHelper.replace(logPath, this.settings));
+
+        if (logDirpath.length() == 0) { // if logDirpath is empty
+            logDirpath = "."; // current directory is log directory
+        }
+
+        if (!new File(logDirpath).exists()) {
+            this.logAndThrowIOException("Log directory: " + logDirpath + " does not exist.");
+        } else if (!new File(logPath).canWrite()) {
+            this.logAndThrowIOException("Log file: " + logPath + " is read only.");
+        }
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/Log4JReconfigurator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/Log4JReconfigurator.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/Log4JReconfigurator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/LoggingConfigurationResetter.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/LoggingConfigurationResetter.java?rev=882923&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/LoggingConfigurationResetter.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/LoggingConfigurationResetter.java
Sat Nov 21 15:15:39 2009
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.monitoring.reconfiguration;
+
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+/**
+ * This class starts a new thread that restores the logging level for a particular class
or package
+ * (after a defined amount of time).
+ */
+public class LoggingConfigurationResetter {
+
+    private final long delay;
+    private final Logger logger;
+    private final Level oldLogLevel;
+
+    /**
+     * @param logger instance of logger that logging level should changed
+     * @param oldLevel logging level value that should be set after timeout
+     * @param timeout value of timeout. Is should match regular expression: ^[0-9.]+[dhm]?$
+     *          where &lt;code&gt;d&lt;/code&gt; means day, &lt;code&gt;h&lt;/code&gt; hours
and &lt;code&gt;m&lt;/code&gt;
+     *          minutes
+     */
+    public LoggingConfigurationResetter(final Logger logger, Level oldLevel, String timeout)
{
+
+        this.logger = logger;
+        this.oldLogLevel = oldLevel;
+
+        long factor;
+        char unit = timeout.charAt(timeout.length() - 1); // get last char, it should be
our unit
+        switch (unit) {
+        case 's': // second
+            factor = 1 * 1000;
+            break;
+        case 'm': // minute
+            factor = 60 * 1000;
+            break;
+        case 'h': // hour
+            factor = 60 * 60 * 1000;
+            break;
+        case 'd': // day
+            factor = 24 * 60 * 60 * 1000;
+            break;
+        default:
+            String message = "Unsupported unit: " + unit;
+            throw new UnsupportedOperationException(message);
+        }
+
+        float multipler = Float.parseFloat(timeout.substring(0, timeout.length() - 1));
+        this.delay = Math.round(multipler * factor);
+    }
+
+    /**
+     * Starts thread
+     */
+    public void start() {
+        TimerTask task = new TimerTask() {
+
+            @Override
+            public void run() {
+                LoggingConfigurationResetter.this.logger.setLevel(LoggingConfigurationResetter.this.oldLogLevel);
+            }
+
+            @Override
+            public boolean cancel() {
+                this.run(); // set old level on task cancel
+                return super.cancel();
+            }
+        };
+
+        Timer timer = new Timer("Restore " + this.logger.getName() + " to level" + this.oldLogLevel,
true);
+        timer.schedule(task, this.delay);
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/LoggingConfigurationResetter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/LoggingConfigurationResetter.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/reconfiguration/LoggingConfigurationResetter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/servletservice/ServletServiceMonitorInitializer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/servletservice/ServletServiceMonitorInitializer.java?rev=882923&amp;r1=882922&amp;r2=882923&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/servletservice/ServletServiceMonitorInitializer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/servletservice/ServletServiceMonitorInitializer.java
Sat Nov 21 15:15:39 2009
@@ -52,7 +52,7 @@
 
             ServletServiceContext servletServiceContext = (ServletServiceContext) servletContext;
             ObjectName name = null;
-            String stringName = "org.apache.cocoon.monitoring:group=ServletServices,name=["
+            String stringName = "org.apache.cocoon:group=ServletServices,name=["
                     + this.getMountPath(servletServiceContext) + "] " + servletName;
             try {
                 name = new ObjectName(stringName);

Modified: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsInitializer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsInitializer.java?rev=882923&amp;r1=882922&amp;r2=882923&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsInitializer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsInitializer.java
Sat Nov 21 15:15:39 2009
@@ -31,7 +31,7 @@
 
     public StatisticsInitializer(Map&lt;String, StatisticsEnabled&gt; statsSources, MBeanExporter
exporter) {
         for (StatisticsEnabled stat : statsSources.values()) {
-            String stringName = "org.apache.cocoon.monitoring:group=Statistics,name=" + stat.statisticsSourceName();
+            String stringName = "org.apache.cocoon:group=Statistics,name=" + stat.statisticsSourceName();
 
             ObjectName name;
             try {

Modified: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/resources/META-INF/cocoon/spring/cocoon-monitoring.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/resources/META-INF/cocoon/spring/cocoon-monitoring.xml?rev=882923&amp;r1=882922&amp;r2=882923&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/resources/META-INF/cocoon/spring/cocoon-monitoring.xml
(original)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/resources/META-INF/cocoon/spring/cocoon-monitoring.xml
Sat Nov 21 15:15:39 2009
@@ -44,10 +44,14 @@
   &lt;bean id="org.apache.cocoon.monitoring.jmxAttributeSource"
     class="org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource" /&gt;
   
-  &lt;bean id="org.apache.cocoon.monitoring.log4j.Log4JReconfigurator"
-    class="org.apache.cocoon.monitoring.log4j.Log4JReconfigurator" scope="singleton"&gt;
+  &lt;bean id="org.apache.cocoon.monitoring.reconfiguration.Log4JReconfigurator"
+    class="org.apache.cocoon.monitoring.reconfiguration.Log4JReconfigurator" scope="singleton"&gt;
     &lt;property name="settings" ref="org.apache.cocoon.configuration.Settings" /&gt;
   &lt;/bean&gt;
+  
+  &lt;bean id="org.apache.cocoon.monitoring.reconfiguration.JmxSpringSettings" class="org.apache.cocoon.monitoring.reconfiguration.JmxSpringSettings"&gt;
+    &lt;constructor-arg index="0" ref="org.apache.cocoon.configuration.Settings" /&gt;
+  &lt;/bean&gt;
 
   &lt;bean id="org.apache.cocoon.monitoring.servletservice.ServletServiceMonitorInitializer"
     class="org.apache.cocoon.monitoring.servletservice.ServletServiceMonitorInitializer"
&gt;

Modified: cocoon/cocoon3/trunk/cocoon-profiling/src/main/java/org/apache/cocoon/profiling/jmx/ProfilingManagement.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-profiling/src/main/java/org/apache/cocoon/profiling/jmx/ProfilingManagement.java?rev=882923&amp;r1=882922&amp;r2=882923&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-profiling/src/main/java/org/apache/cocoon/profiling/jmx/ProfilingManagement.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-profiling/src/main/java/org/apache/cocoon/profiling/jmx/ProfilingManagement.java
Sat Nov 21 15:15:39 2009
@@ -16,25 +16,32 @@
  */
 package org.apache.cocoon.profiling.jmx;
 
+import org.springframework.jmx.export.annotation.ManagedAttribute;
+import org.springframework.jmx.export.annotation.ManagedOperation;
+import org.springframework.jmx.export.annotation.ManagedResource;
+
 /**
- * 
  * This MBean provides management functionality for cocoon-profiling and offers a possibility
to
  * enable/disable cocoon profiling.
- * 
- * If you want to test this, simply run cocoon-sample and connect with jconsole
+ *
+ * If you want to test this, simply run cocoon-sample and connect with jconsole.
  */
-public class ProfilingManagement implements ProfilingManagementMBean {
+@ManagedResource(objectName = "org.apache.cocoon:group=Profiling,name=Enable/Disable")
+public class ProfilingManagement {
 
     private boolean enabled = true;
 
+    @ManagedAttribute(description = "Is profiling enabled.")
     public boolean isEnabled() {
         return this.enabled;
     }
 
+    @ManagedOperation(description = "Enable profiling.")
     public void enable() {
         this.enabled = true;
     }
 
+    @ManagedOperation(description = "Disable profiling.")
     public void disable() {
         this.enabled = false;
     }

Modified: cocoon/cocoon3/trunk/cocoon-profiling/src/main/resources/META-INF/cocoon/spring/cocoon-profiling-component.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-profiling/src/main/resources/META-INF/cocoon/spring/cocoon-profiling-component.xml?rev=882923&amp;r1=882922&amp;r2=882923&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-profiling/src/main/resources/META-INF/cocoon/spring/cocoon-profiling-component.xml
(original)
+++ cocoon/cocoon3/trunk/cocoon-profiling/src/main/resources/META-INF/cocoon/spring/cocoon-profiling-component.xml
Sat Nov 21 15:15:39 2009
@@ -17,15 +17,15 @@
   specific language governing permissions and limitations
   under the License.
  --&gt;
-&lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+&lt;beans xmlns="http://www.springframework.org/schema/beans" 
+
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:aop="http://www.springframework.org/schema/aop"
   xmlns:configurator="http://cocoon.apache.org/schema/configurator"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans
-  http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
-  http://www.springframework.org/schema/aop
-  http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
-  http://cocoon.apache.org/schema/configurator http://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.1.xsd
-  "&gt;
+  
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
+                      http://cocoon.apache.org/schema/configurator http://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.1.xsd"&gt;
 
   &lt;!-- spring --&gt;
   &lt;bean id="org.apache.cocoon.profiling.spring.AutomaticProfilerInstaller"




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r882917 - in /cocoon/cocoon3/trunk/cocoon-monitoring: ./ src/main/java/org/apache/cocoon/monitoring/statistics/ src/main/java/org/apache/cocoon/monitoring/statistics/aspects/ src/main/resources/META-INF/cocoon/spring/ src/test/ src/test/jav...</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091121144240.03F5823888D4@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091121144240-03F5823888D4@eris-apache-org%3e</id>
<updated>2009-11-21T14:42:39Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Sat Nov 21 14:42:35 2009
New Revision: 882917

URL: http://svn.apache.org/viewvc?rev=882917&amp;view=rev
Log:
COCOON3-41 This patch adds the StatisticsCollector class that will be collecting all statistics in this module. This class support getting list of most- and less-usage entry's and also get usage of "key" in given time.

Added:
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/Statistics.java   (with props)
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsCollector.java   (with props)
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsEnabled.java   (with props)
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsInitializer.java   (with props)
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsSourceEnabled.java   (with props)
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/CacheStatisticsAspect.java   (with props)
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/PipelineHitCountStatisticsAspect.java   (with props)
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/ServletHitCountStatisticsAspect.java   (with props)
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/UrlHitCountStatisticsAspect.java   (with props)
    cocoon/cocoon3/trunk/cocoon-monitoring/src/test/
    cocoon/cocoon3/trunk/cocoon-monitoring/src/test/java/
    cocoon/cocoon3/trunk/cocoon-monitoring/src/test/java/org/
    cocoon/cocoon3/trunk/cocoon-monitoring/src/test/java/org/apache/
    cocoon/cocoon3/trunk/cocoon-monitoring/src/test/java/org/apache/cocoon/
    cocoon/cocoon3/trunk/cocoon-monitoring/src/test/java/org/apache/cocoon/monitoring/
    cocoon/cocoon3/trunk/cocoon-monitoring/src/test/java/org/apache/cocoon/monitoring/statistics/
    cocoon/cocoon3/trunk/cocoon-monitoring/src/test/java/org/apache/cocoon/monitoring/statistics/StatisticsCollectorTest.java   (with props)
Modified:
    cocoon/cocoon3/trunk/cocoon-monitoring/pom.xml
    cocoon/cocoon3/trunk/cocoon-monitoring/src/main/resources/META-INF/cocoon/spring/cocoon-monitoring.xml

Modified: cocoon/cocoon3/trunk/cocoon-monitoring/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/pom.xml?rev=882917&amp;r1=882916&amp;r2=882917&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/pom.xml Sat Nov 21 14:42:35 2009
@@ -64,7 +64,18 @@
       &lt;groupId&gt;log4j&lt;/groupId&gt;
       &lt;artifactId&gt;log4j&lt;/artifactId&gt;
     &lt;/dependency&gt;
-
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.cocoon.pipeline&lt;/groupId&gt;
+      &lt;artifactId&gt;cocoon-pipeline&lt;/artifactId&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;commons-lang&lt;/groupId&gt;
+      &lt;artifactId&gt;commons-lang&lt;/artifactId&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.springframework&lt;/groupId&gt;
+      &lt;artifactId&gt;spring-aop&lt;/artifactId&gt;
+    &lt;/dependency&gt;
     &lt;!--  Test dependencies --&gt;
     &lt;dependency&gt;
       &lt;groupId&gt;junit&lt;/groupId&gt;

Added: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/Statistics.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/Statistics.java?rev=882917&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/Statistics.java (added)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/Statistics.java Sat Nov 21 14:42:35 2009
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.cocoon.monitoring.statistics;
+
+import java.util.Map;
+
+import org.springframework.jmx.export.annotation.ManagedAttribute;
+import org.springframework.jmx.export.annotation.ManagedOperation;
+import org.springframework.jmx.export.annotation.ManagedOperationParameter;
+import org.springframework.jmx.export.annotation.ManagedOperationParameters;
+import org.springframework.jmx.export.annotation.ManagedResource;
+
+@ManagedResource
+public class Statistics {
+
+    private final StatisticsSourceEnabled stats;
+
+    public Statistics(StatisticsEnabled stats) {
+        this.stats = stats.getStatistics();
+    }
+
+    @ManagedAttribute(description = "Returns all hit count since system start.")
+    public double getAllHitCount() {
+        return this.stats.getHitCountSum();
+    }
+
+    @ManagedAttribute(description = "Returns a map of all hits and their counts.")
+    public Map&lt;String, Double&gt; getHits() {
+        return this.stats.getHits();
+    }
+
+    @ManagedOperation(description = "Returns a map of all hits and their counts limited by a time parameter.")
+    @ManagedOperationParameters( { @ManagedOperationParameter(name = "time", description = "Time in miliseconds.") })
+    public Map&lt;String, Long&gt; getHits(long time) {
+        return this.stats.getHits(time);
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/Statistics.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/Statistics.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/Statistics.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsCollector.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsCollector.java?rev=882917&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsCollector.java (added)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsCollector.java Sat Nov 21 14:42:35 2009
@@ -0,0 +1,190 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.cocoon.monitoring.statistics;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
+
+public class StatisticsCollector implements StatisticsSourceEnabled {
+
+    /**
+    * Default refresh time: 10s;
+    */
+    public static final long DEFAULT_REFRESH_DELAY = 1000 * 10;
+
+    /**
+    * Default value of maxKeepTime: 24h.
+    */
+    public static final long DEFAULT_MAX_KEEP_TIME = 1000 * 60 * 60 * 24;
+
+    private final Map&lt;String, Double&gt; allHitCount;
+    private final Map&lt;String, List&lt;Long&gt;&gt; coutners;
+    private final long maxKeepTime;
+
+    /**
+     * This constructor uses default values of {@link StatisticsCollector#DEFAULT_MAX_KEEP_TIME DEFAULT_MAX_KEEP_TIME},
+     * and {@link StatisticsCollector#DEFAULT_REFRESH_DELAY DEFAULT_REFRESH_DELAY} to pass into
+     * {@link StatisticsCollector#StatisticsCollector(long, long) StatisticsCollector(long, long)}
+     */
+    public StatisticsCollector() {
+        this(DEFAULT_MAX_KEEP_TIME, DEFAULT_REFRESH_DELAY);
+    }
+
+    /**
+     *
+     * @param maxKeepTime how long (in milliseconds) should be statistics data kept in collector
+     * @param refreshDelay delay time (in milliseconds) between run of cleaning thread, that will remove entry's
+     *          are older than value in &lt;code&gt;maxKeepTime&lt;/code&gt;
+     */
+    public StatisticsCollector(long maxKeepTime, long refreshDelay) {
+        this.maxKeepTime = maxKeepTime;
+        this.allHitCount = Collections.synchronizedMap(new HashMap&lt;String, Double&gt;());
+        this.coutners = Collections.synchronizedMap(new HashMap&lt;String, List&lt;Long&gt;&gt;());
+
+        this.initCleaningThread(refreshDelay);
+    }
+
+    /** @{inheritDoc} */
+    public Map&lt;String, Double&gt; getHits() {
+        return new HashMap&lt;String, Double&gt;(this.allHitCount); // defense copy
+    }
+
+    /** @{inheritDoc} */
+    public Map&lt;String, Long&gt; getHits(long time) {
+        final Map&lt;String, Long&gt; result = new HashMap&lt;String, Long&gt;();
+        long timeBorder = new Date().getTime() - time;
+
+        for (String key : this.coutners.keySet()) {
+            long sum = 0;
+            for (long item : this.coutners.get(key)) {
+                if (item &gt; timeBorder) {
+                    sum++;
+                }
+            }
+            result.put(key, sum);
+        }
+
+        return result;
+    }
+
+    /** @{inheritDoc} */
+    public double getHitCount(String key) {
+        return this.allHitCount.containsKey(key) ? this.allHitCount.get(key) : 0;
+    }
+
+    /** @{inheritDoc} */
+    public double getHitCountSum() {
+        double result = 0;
+        for (Double count : this.allHitCount.values()) {
+            result += count;
+        }
+        return result;
+    }
+
+    /** @{inheritDoc} */
+    public long getRequestCount(String key, long time) {
+        if (!this.coutners.containsKey(key)) {
+            return 0;
+        }
+
+        List&lt;Long&gt; counter = this.coutners.get(key);
+
+        long hitCount = 0;
+        long currentTimestamp = new Date().getTime() - time;
+
+        for (Long timestamp : counter) {
+            if (timestamp &gt; 0 &amp;&amp; currentTimestamp &lt; timestamp) {
+                hitCount++;
+            }
+        }
+
+        return hitCount;
+    }
+
+    /**
+     * Only adds key into counter but don't increment hit count for this
+     * &lt;code&gt;key&lt;/code&gt;. It is useful if you want to have this &lt;code&gt;key&lt;/code&gt; in a list
+     * of all used key's with value &lt;strong&gt;0&lt;/strong&gt; (i.e. for registered but never used
+     * cache entry's).
+     *
+     * @param key
+     */
+    public void putKey(String key) {
+        this.insertDataIntoCounter(key, -1l);
+    }
+
+    /**
+     * Increment value of counter for particular &lt;code&gt;key&lt;/code&gt;.
+     *
+     * &lt;p&gt;In fact this method adds actual time (in milliseconds) into list that is connected with
+     * this &lt;code&gt;key&lt;/code&gt;.
+     *
+     * @param key
+     */
+    public void incerementCounter(String key) {
+        this.insertDataIntoCounter(key, new Date().getTime());
+    }
+
+    private void insertDataIntoCounter(String key, long data) {
+        if (!this.coutners.containsKey(key)) {
+            List&lt;Long&gt; list = new ArrayList&lt;Long&gt;();
+            list.add(data);
+            this.coutners.put(key, list);
+        } else {
+            this.coutners.get(key).add(data);
+        }
+
+        if (this.allHitCount.containsKey(key) &amp;&amp; data &gt; 0) {
+            this.allHitCount.put(key, this.allHitCount.get(key) + 1);
+        } else if (data &gt; 0) {
+            this.allHitCount.put(key, 1d);
+        } else {
+            this.allHitCount.put(key, 0d);
+        }
+    }
+
+    private void initCleaningThread(long refreshDelay) {
+        Timer cleaningTimer = new Timer("RequestCounterCleaningTask", true);
+        cleaningTimer.scheduleAtFixedRate(new TimerTask() {
+
+            @Override
+            public void run() {
+                List&lt;Long&gt; toRemove = new ArrayList&lt;Long&gt;();
+                long currentTimestamp = new Date().getTime();
+
+                for (List&lt;Long&gt; counter : StatisticsCollector.this.coutners.values()) {
+                    for (Long timestamp : counter) {
+                        if (timestamp &gt; 0 &amp;&amp; currentTimestamp - timestamp &gt; StatisticsCollector.this.maxKeepTime) {
+                            toRemove.add(timestamp);
+                        }
+                    }
+                    counter.removeAll(toRemove);
+                    toRemove.clear();
+                }
+
+            }
+        }, refreshDelay, refreshDelay);
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsCollector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsCollector.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsCollector.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsEnabled.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsEnabled.java?rev=882917&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsEnabled.java (added)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsEnabled.java Sat Nov 21 14:42:35 2009
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.cocoon.monitoring.statistics;
+
+
+public interface StatisticsEnabled {
+
+    String statisticsSourceName();
+
+    StatisticsSourceEnabled getStatistics();
+}

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsEnabled.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsEnabled.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsEnabled.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsInitializer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsInitializer.java?rev=882917&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsInitializer.java (added)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsInitializer.java Sat Nov 21 14:42:35 2009
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.monitoring.statistics;
+
+import java.util.Map;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.jmx.export.MBeanExporter;
+
+public class StatisticsInitializer {
+
+    private final Log logger = LogFactory.getLog(this.getClass());
+
+    public StatisticsInitializer(Map&lt;String, StatisticsEnabled&gt; statsSources, MBeanExporter exporter) {
+        for (StatisticsEnabled stat : statsSources.values()) {
+            String stringName = "org.apache.cocoon.monitoring:group=Statistics,name=" + stat.statisticsSourceName();
+
+            ObjectName name;
+            try {
+                name = new ObjectName(stringName);
+            } catch (MalformedObjectNameException e) {
+                this.logger.error("Invalid name of manager resource: " + stringName, e);
+                continue;
+            } catch (NullPointerException e) {
+                this.logger.error("Should never happened. Value of name parameter always is different than null.", e);
+                continue;
+            }
+
+            exporter.registerManagedResource(new Statistics(stat), name);
+        }
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsInitializer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsInitializer.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsInitializer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsSourceEnabled.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsSourceEnabled.java?rev=882917&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsSourceEnabled.java (added)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsSourceEnabled.java Sat Nov 21 14:42:35 2009
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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,in ascending order
+ * 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.
+ */
+package org.apache.cocoon.monitoring.statistics;
+
+import java.util.Map;
+
+public interface StatisticsSourceEnabled {
+
+    /**
+     * Returns sum for all hit count for given key. It will return &lt;strong&gt;0&lt;strong&gt; if given key does not
+     * have any statistics data (that means, that &lt;strong&gt;0&lt;/strong&gt; if given key does not exist in statistics
+     * source).
+     *
+     * @param key
+     * @return hit count for passed arguments
+     */
+    public double getHitCount(String key);
+
+    /**
+     * Returns all hit count for this statistics source (sum of all hit counts for all contained key's).
+     *
+     * @return
+     */
+    double getHitCountSum();
+
+    /**
+     * Returns unordered {@link Map} of summed value of all hit
+     *
+     * @return
+     */
+    Map&lt;String, Double&gt; getHits();
+
+    /**
+     * Returns unordered {@link Map}, where &lt;code&gt;key&lt;/code&gt; is source name and &lt;code&gt;value&lt;/code&gt; is
+     * sum of hit count, limited only to entry's that are younger then &lt;code&gt;time&lt;/code&gt; parameter
+     *
+     * @param time
+     * @return
+     */
+    Map&lt;String, Long&gt; getHits(long time);
+
+    /**
+     * Returns hit count for particular &lt;code&gt;key&lt;/code&gt; in particular &lt;code&gt;time&lt;/code&gt;
+     *
+     * @param key
+     * @param time
+     * @return
+     */
+    long getRequestCount(String key, long time);
+
+}

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsSourceEnabled.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsSourceEnabled.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/StatisticsSourceEnabled.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/CacheStatisticsAspect.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/CacheStatisticsAspect.java?rev=882917&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/CacheStatisticsAspect.java (added)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/CacheStatisticsAspect.java Sat Nov 21 14:42:35 2009
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.monitoring.statistics.aspects;
+
+import org.apache.cocoon.monitoring.statistics.StatisticsCollector;
+import org.apache.cocoon.monitoring.statistics.StatisticsEnabled;
+import org.apache.cocoon.monitoring.statistics.StatisticsSourceEnabled;
+import org.apache.cocoon.pipeline.caching.CacheKey;
+import org.aspectj.lang.annotation.After;
+import org.aspectj.lang.annotation.Aspect;
+
+@Aspect
+public class CacheStatisticsAspect implements StatisticsEnabled {
+
+    private final StatisticsCollector collector;
+
+    public CacheStatisticsAspect() {
+        this(StatisticsCollector.DEFAULT_MAX_KEEP_TIME, StatisticsCollector.DEFAULT_REFRESH_DELAY);
+    }
+
+    public CacheStatisticsAspect(long maxKeepTime, long refreshDelay) {
+        this.collector = new StatisticsCollector(maxKeepTime, refreshDelay);
+    }
+
+    @After("execution(* put(..)) &amp;&amp; target(org.apache.cocoon.pipeline.caching.Cache) &amp;&amp; args(key, ..)")
+    public void handleCachePutRequest(CacheKey key) throws Throwable {
+        this.collector.putKey(key.toString());
+    }
+
+    @After("execution(* get(..)) &amp;&amp; target(org.apache.cocoon.pipeline.caching.Cache) &amp;&amp; args(key, ..)")
+    public void handleCacheGetRequest(CacheKey key) throws Throwable {
+        this.collector.incerementCounter(key.toString());
+    }
+
+    public StatisticsSourceEnabled getStatistics() {
+        return this.collector;
+    }
+
+    public String statisticsSourceName() {
+        return "CacheHitCount";
+    }
+
+}

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/CacheStatisticsAspect.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/CacheStatisticsAspect.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/CacheStatisticsAspect.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/PipelineHitCountStatisticsAspect.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/PipelineHitCountStatisticsAspect.java?rev=882917&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/PipelineHitCountStatisticsAspect.java (added)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/PipelineHitCountStatisticsAspect.java Sat Nov 21 14:42:35 2009
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.monitoring.statistics.aspects;
+
+import org.apache.cocoon.monitoring.statistics.StatisticsCollector;
+import org.apache.cocoon.monitoring.statistics.StatisticsEnabled;
+import org.apache.cocoon.monitoring.statistics.StatisticsSourceEnabled;
+import org.aspectj.lang.annotation.Aspect;
+
+@Aspect
+public class PipelineHitCountStatisticsAspect implements StatisticsEnabled {
+
+    private final StatisticsCollector collector;
+
+    public PipelineHitCountStatisticsAspect() {
+        this(StatisticsCollector.DEFAULT_MAX_KEEP_TIME, StatisticsCollector.DEFAULT_REFRESH_DELAY);
+    }
+
+    public PipelineHitCountStatisticsAspect(long maxKeepTime, long refreshDelay) {
+        this.collector = new StatisticsCollector(maxKeepTime, refreshDelay);
+    }
+
+    public StatisticsSourceEnabled getStatistics() {
+        return this.collector;
+    }
+
+    public String statisticsSourceName() {
+        return "PipeLineHitCount";
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/PipelineHitCountStatisticsAspect.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/PipelineHitCountStatisticsAspect.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/PipelineHitCountStatisticsAspect.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/ServletHitCountStatisticsAspect.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/ServletHitCountStatisticsAspect.java?rev=882917&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/ServletHitCountStatisticsAspect.java (added)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/ServletHitCountStatisticsAspect.java Sat Nov 21 14:42:35 2009
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.monitoring.statistics.aspects;
+
+import org.apache.cocoon.monitoring.statistics.StatisticsCollector;
+import org.apache.cocoon.monitoring.statistics.StatisticsEnabled;
+import org.apache.cocoon.monitoring.statistics.StatisticsSourceEnabled;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+
+@Aspect
+public class ServletHitCountStatisticsAspect implements StatisticsEnabled {
+
+    private final StatisticsCollector collector;
+
+    public ServletHitCountStatisticsAspect() {
+        this(StatisticsCollector.DEFAULT_MAX_KEEP_TIME, StatisticsCollector.DEFAULT_REFRESH_DELAY);
+    }
+
+    public ServletHitCountStatisticsAspect(long maxKeepTime, long refreshDelaty) {
+        this.collector = new StatisticsCollector(maxKeepTime, refreshDelaty);
+    }
+
+    @Around("execution(* service(..)) &amp;&amp; target(javax.servlet.Servlet))")
+    public Object handleServletRequest(ProceedingJoinPoint pjp) throws Throwable {
+        String className = pjp.getTarget().getClass().getName();
+        if (!className.startsWith("$Proxy")) {
+            this.collector.incerementCounter(className);
+        }
+        return pjp.proceed(pjp.getArgs());
+    }
+
+    public StatisticsSourceEnabled getStatistics() {
+        return this.collector;
+    }
+
+    public String statisticsSourceName() {
+        return "ServletHitCount";
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/ServletHitCountStatisticsAspect.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/ServletHitCountStatisticsAspect.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/ServletHitCountStatisticsAspect.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/UrlHitCountStatisticsAspect.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/UrlHitCountStatisticsAspect.java?rev=882917&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/UrlHitCountStatisticsAspect.java (added)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/UrlHitCountStatisticsAspect.java Sat Nov 21 14:42:35 2009
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.monitoring.statistics.aspects;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.cocoon.monitoring.statistics.StatisticsCollector;
+import org.apache.cocoon.monitoring.statistics.StatisticsEnabled;
+import org.apache.cocoon.monitoring.statistics.StatisticsSourceEnabled;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+
+@Aspect
+public class UrlHitCountStatisticsAspect implements StatisticsEnabled {
+
+    private final StatisticsCollector collector;
+
+    public UrlHitCountStatisticsAspect() {
+        this(StatisticsCollector.DEFAULT_MAX_KEEP_TIME, StatisticsCollector.DEFAULT_REFRESH_DELAY);
+    }
+
+    public UrlHitCountStatisticsAspect(long maxKeepTime, long refreshDelaty) {
+        this.collector = new StatisticsCollector(maxKeepTime, refreshDelaty);
+    }
+
+    @Around("execution(* service(..)) &amp;&amp; target(javax.servlet.Servlet) &amp;&amp; args(req, ..)")
+    public Object handleUrlRequest(ProceedingJoinPoint pjp, HttpServletRequest req) throws Throwable {
+        String className = pjp.getTarget().getClass().getName();
+        if (!className.startsWith("$Proxy")) {
+            this.collector.incerementCounter(req.getRequestURI());
+        }
+        return pjp.proceed(pjp.getArgs());
+    }
+
+    public StatisticsSourceEnabled getStatistics() {
+        return this.collector;
+    }
+
+    public String statisticsSourceName() {
+        return "UrlHitCount";
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/UrlHitCountStatisticsAspect.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/UrlHitCountStatisticsAspect.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/java/org/apache/cocoon/monitoring/statistics/aspects/UrlHitCountStatisticsAspect.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cocoon/cocoon3/trunk/cocoon-monitoring/src/main/resources/META-INF/cocoon/spring/cocoon-monitoring.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/main/resources/META-INF/cocoon/spring/cocoon-monitoring.xml?rev=882917&amp;r1=882916&amp;r2=882917&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/main/resources/META-INF/cocoon/spring/cocoon-monitoring.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/main/resources/META-INF/cocoon/spring/cocoon-monitoring.xml Sat Nov 21 14:42:35 2009
@@ -18,9 +18,13 @@
   under the License.
  --&gt;
 &lt;beans xmlns="http://www.springframework.org/schema/beans"
+
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:configurator="http://cocoon.apache.org/schema/configurator"
+  xmlns:aop="http://www.springframework.org/schema/aop"  
+  
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd  
                       http://cocoon.apache.org/schema/configurator http://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.1.xsd"&gt;
 
   &lt;bean id="exporter" class="org.springframework.jmx.export.MBeanExporter"&gt;
@@ -71,4 +75,20 @@
     &lt;/constructor-arg&gt;
     &lt;constructor-arg ref="exporter" index="1" /&gt;
   &lt;/bean&gt;
+  
+  &lt;!--  configuration for statistics submodule --&gt;
+  &lt;bean id="org.apache.cocoon.monitoring.statistics.aspects.ServletHitCountStatisticsAspect" class="org.apache.cocoon.monitoring.statistics.aspects.ServletHitCountStatisticsAspect" /&gt;
+  
+  &lt;bean id="org.apache.cocoon.monitoring.statistics.aspects.UrlHitCountStatisticsAspect" class="org.apache.cocoon.monitoring.statistics.aspects.UrlHitCountStatisticsAspect" /&gt;
+  
+  &lt;bean id="org.apache.cocoon.monitoring.statistics.aspects.CacheStatisticsAspect" class="org.apache.cocoon.monitoring.statistics.aspects.CacheStatisticsAspect" /&gt;
+  
+  &lt;bean id="org.apache.cocoon.monitoring.statistics.StatisticsInitializer" class="org.apache.cocoon.monitoring.statistics.StatisticsInitializer"&gt;
+    &lt;constructor-arg index="0"&gt;
+      &lt;configurator:bean-map type="org.apache.cocoon.monitoring.statistics.StatisticsEnabled" /&gt;
+    &lt;/constructor-arg&gt;
+    &lt;constructor-arg ref="exporter" index="1" /&gt;
+  &lt;/bean&gt;
+  
+  &lt;aop:aspectj-autoproxy/&gt;
 &lt;/beans&gt;

Added: cocoon/cocoon3/trunk/cocoon-monitoring/src/test/java/org/apache/cocoon/monitoring/statistics/StatisticsCollectorTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/src/test/java/org/apache/cocoon/monitoring/statistics/StatisticsCollectorTest.java?rev=882917&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/src/test/java/org/apache/cocoon/monitoring/statistics/StatisticsCollectorTest.java (added)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/src/test/java/org/apache/cocoon/monitoring/statistics/StatisticsCollectorTest.java Sat Nov 21 14:42:35 2009
@@ -0,0 +1,210 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.cocoon.monitoring.statistics;
+
+import static org.junit.Assert.*;
+
+import java.util.Map;
+
+import org.junit.Test;
+
+public class StatisticsCollectorTest {
+
+    private static final String testKey1 = "test1";
+    private static final String testKey2 = "test2";
+    private static final String testKey3 = "test3";
+
+    @Test
+    public void testGetHitCount() {
+        StatisticsCollector collector = new StatisticsCollector();
+        collector.incerementCounter(testKey1);
+        assertEquals(1, collector.getHitCount(testKey1), 0);
+
+        collector.incerementCounter(testKey1);
+        assertEquals(2, collector.getHitCount(testKey1), 0);
+
+        collector.incerementCounter(testKey2);
+        assertEquals(1, collector.getHitCount(testKey2), 0);
+
+        collector.incerementCounter(testKey2);
+        assertEquals(2, collector.getHitCount(testKey2), 0);
+
+        collector.incerementCounter(testKey1);
+        assertEquals(3, collector.getHitCount(testKey1), 0);
+    }
+
+    @Test
+    public void testGetAllHitCount() {
+        StatisticsCollector collector = new StatisticsCollector();
+        collector.incerementCounter(testKey1);
+        assertEquals(1, collector.getHitCountSum(), 0);
+
+        collector.incerementCounter(testKey1);
+        assertEquals(2, collector.getHitCountSum(), 0);
+
+        collector.incerementCounter(testKey2);
+        assertEquals(3, collector.getHitCountSum(), 0);
+
+        collector.incerementCounter(testKey2);
+        assertEquals(4, collector.getHitCountSum(), 0);
+
+        collector.incerementCounter(testKey1);
+        assertEquals(5, collector.getHitCountSum(), 0);
+    }
+
+    @Test
+    public void testGetHitCountList() {
+        StatisticsCollector collector = new StatisticsCollector(100000, 100000);
+
+        collector.incerementCounter(testKey1);
+        collector.incerementCounter(testKey1);
+        collector.incerementCounter(testKey1);
+
+        collector.incerementCounter(testKey2);
+
+        this.sleep(60);
+
+        collector.incerementCounter(testKey3);
+        collector.incerementCounter(testKey3);
+        collector.incerementCounter(testKey3);
+        collector.incerementCounter(testKey3);
+
+        collector.incerementCounter(testKey2);
+
+        Map&lt;String, Long&gt; timeOut50ms = collector.getHits(50);
+        Map&lt;String, Long&gt; timeOut70ms = collector.getHits(70);
+
+        assertEquals(3, timeOut50ms.size());
+
+        assertTrue(timeOut50ms.containsKey(testKey3));
+        assertEquals(4, timeOut50ms.get(testKey3).longValue());
+
+        assertTrue(timeOut50ms.containsKey(testKey2));
+        assertEquals(1, timeOut50ms.get(testKey2).longValue());
+
+        assertTrue(timeOut50ms.containsKey(testKey1));
+        assertEquals(0, timeOut50ms.get(testKey1).longValue());
+
+        assertEquals(3, timeOut50ms.size());
+
+        assertTrue(timeOut70ms.containsKey(testKey3));
+        assertEquals(4, timeOut70ms.get(testKey3).longValue());
+
+        assertTrue(timeOut70ms.containsKey(testKey1));
+        assertEquals(3, timeOut70ms.get(testKey1).longValue());
+
+        assertTrue(timeOut70ms.containsKey(testKey2));
+        assertEquals(2, timeOut70ms.get(testKey2).longValue());
+
+    }
+
+    @Test
+    public void testGetRequestCount() {
+        StatisticsCollector collector = new StatisticsCollector(1000, 1000);
+
+        collector.incerementCounter(testKey1);
+
+        this.sleep(10);
+        assertEquals(1, collector.getRequestCount(testKey1, 50), 0);
+
+        this.sleep(300);
+        collector.incerementCounter(testKey1);
+        assertEquals(1, collector.getRequestCount(testKey1, 50), 0);
+        assertEquals(2, collector.getRequestCount(testKey1, 500), 0);
+
+        this.sleep(900);
+        collector.incerementCounter(testKey1);
+        assertEquals(1, collector.getRequestCount(testKey1, 50), 0);
+        assertEquals(1, collector.getRequestCount(testKey1, 500), 0);
+        assertEquals(2, collector.getRequestCount(testKey1, 1000), 0);
+
+        this.sleep(100);
+        assertEquals(1, collector.getRequestCount(testKey1, 1000), 0);
+
+        // wait for cleaning action
+        this.sleep(1000);
+
+        // check that everything was cleaned
+        assertEquals(0, collector.getRequestCount(testKey1, 50), 0);
+        assertEquals(0, collector.getRequestCount(testKey1, 500), 0);
+        assertEquals(0, collector.getRequestCount(testKey1, 1000), 0);
+
+    }
+
+    @Test
+    public void testIncerementCounter() {
+        StatisticsCollector collector = new StatisticsCollector();
+        collector.incerementCounter(testKey1);
+        assertEquals(1, collector.getHitCountSum(), 0);
+
+        Map&lt;String, Long&gt; map = collector.getHits(100);
+
+        assertEquals(1, map.size());
+        assertTrue(map.containsKey(testKey1));
+        assertEquals(1, map.get(testKey1).longValue());
+    }
+
+    @Test
+    public void testGetAllHitCountMap() {
+        StatisticsCollector collector = new StatisticsCollector();
+
+        collector.incerementCounter(testKey1);
+        collector.incerementCounter(testKey2);
+        collector.incerementCounter(testKey3);
+        collector.incerementCounter(testKey1);
+        collector.incerementCounter(testKey2);
+        collector.incerementCounter(testKey1);
+
+        Map&lt;String, Double&gt; allHitMap = collector.getHits();
+
+        assertEquals(3, allHitMap.size());
+
+        assertTrue(allHitMap.containsKey(testKey1));
+        assertTrue(allHitMap.containsKey(testKey2));
+        assertTrue(allHitMap.containsKey(testKey3));
+
+        assertEquals(3, allHitMap.get(testKey1), 0);
+        assertEquals(2, allHitMap.get(testKey2), 0);
+        assertEquals(1, allHitMap.get(testKey3), 0);
+
+        allHitMap.put(testKey1, 40d);
+        assertNotSame(40, collector.getHits().get(testKey1));
+    }
+
+    @Test
+    public void testPutKey() {
+        StatisticsCollector collector = new StatisticsCollector();
+        collector.putKey(testKey1);
+
+        assertEquals(0, collector.getHitCountSum(), 0);
+        assertEquals(1, collector.getHits(100).size(), 0);
+
+        assertEquals(0, collector.getRequestCount(testKey1, 100));
+        assertEquals(0, collector.getHits(100).get(testKey1).floatValue(), 0);
+    }
+
+    private void sleep(long time) {
+        try {
+            Thread.sleep(time);
+        } catch (final InterruptedException e) {
+            throw new RuntimeException("Should never happens!");
+        }
+    }
+
+}

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/test/java/org/apache/cocoon/monitoring/statistics/StatisticsCollectorTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/test/java/org/apache/cocoon/monitoring/statistics/StatisticsCollectorTest.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-monitoring/src/test/java/org/apache/cocoon/monitoring/statistics/StatisticsCollectorTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r882882 - /cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/CachingPipeline.java</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091121105757.3552023888C5@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091121105757-3552023888C5@eris-apache-org%3e</id>
<updated>2009-11-21T10:57:57Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Sat Nov 21 10:57:56 2009
New Revision: 882882

URL: http://svn.apache.org/viewvc?rev=882882&amp;view=rev
Log:
create the cachekey as last step of the pipeline setup phase

Modified:
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/CachingPipeline.java

Modified: cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/CachingPipeline.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/CachingPipeline.java?rev=882882&amp;r1=882881&amp;r2=882882&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/CachingPipeline.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/CachingPipeline.java
Sat Nov 21 10:57:56 2009
@@ -109,7 +109,6 @@
             this.logger.debug("Used cache: " + this.cache);
         }
 
-        this.cacheKey = this.constructCacheKey();
         // checked for a cached value first
         CacheValue cachedValue = this.getCachedValue(this.cacheKey);
         if (this.isCacheKeyValid(cachedValue)) {
@@ -139,6 +138,7 @@
         if (this.cacheKey == null) {
             return -1;
         }
+
         return this.cacheKey.getLastModified();
     }
 
@@ -174,6 +174,8 @@
         this.cachingOutputStream = new CachingOutputStream(outputStream);
 
         super.setup(this.cachingOutputStream, parameters);
+
+        this.cacheKey = this.constructCacheKey();
     }
 
     protected CacheValue getCachedValue(CacheKey cacheKey) {




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r882881 - in /cocoon/cocoon3/trunk/cocoon-sax: ./ src/main/java/org/apache/cocoon/sax/component/ src/main/java/org/apache/cocoon/sax/util/ src/test/java/org/apache/cocoon/sax/ src/test/resources/META-INF/ src/test/resources/META-INF/services/</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091121105541.3F44E23888D6@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091121105541-3F44E23888D6@eris-apache-org%3e</id>
<updated>2009-11-21T10:55:40Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Sat Nov 21 10:55:38 2009
New Revision: 882881

URL: http://svn.apache.org/viewvc?rev=882881&amp;view=rev
Log:
COCOON3-6 Enhance the reusability of the XSLTTransformer and support Xalan's XSLTC engine.
Thanks Simone

Added:
    cocoon/cocoon3/trunk/cocoon-sax/src/test/resources/META-INF/
    cocoon/cocoon3/trunk/cocoon-sax/src/test/resources/META-INF/services/
    cocoon/cocoon3/trunk/cocoon-sax/src/test/resources/META-INF/services/javax.xml.transform.TransformerFactory
Removed:
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/XSLTProcessorErrorListener.java
Modified:
    cocoon/cocoon3/trunk/cocoon-sax/pom.xml
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/XSLTTransformer.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/util/TransformationUtils.java
    cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java

Modified: cocoon/cocoon3/trunk/cocoon-sax/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/pom.xml?rev=882881&amp;r1=882880&amp;r2=882881&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-sax/pom.xml Sat Nov 21 10:55:38 2009
@@ -70,6 +70,78 @@
       &lt;groupId&gt;xmlunit&lt;/groupId&gt;
       &lt;artifactId&gt;xmlunit&lt;/artifactId&gt;
       &lt;scope&gt;test&lt;/scope&gt;
-    &lt;/dependency&gt;    
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;xalan&lt;/groupId&gt;
+      &lt;artifactId&gt;xalan&lt;/artifactId&gt;
+      &lt;version&gt;2.7.1&lt;/version&gt;
+      &lt;scope&gt;test&lt;/scope&gt;
+      &lt;exclusions&gt;
+        &lt;exclusion&gt;
+          &lt;groupId&gt;xml-apis&lt;/groupId&gt;
+          &lt;artifactId&gt;xml-apis&lt;/artifactId&gt;
+        &lt;/exclusion&gt;
+      &lt;/exclusions&gt;
+    &lt;/dependency&gt;
   &lt;/dependencies&gt;
+
+  &lt;build&gt;
+    &lt;plugins&gt;
+      &lt;plugin&gt;
+        &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
+        &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
+        &lt;executions&gt;
+          &lt;execution&gt;
+            &lt;phase&gt;test-compile&lt;/phase&gt;
+            &lt;goals&gt;
+              &lt;goal&gt;exec&lt;/goal&gt;
+            &lt;/goals&gt;
+          &lt;/execution&gt;
+        &lt;/executions&gt;
+        &lt;configuration&gt;
+          &lt;executable&gt;java&lt;/executable&gt;
+          &lt;classpathScope&gt;test&lt;/classpathScope&gt;
+          &lt;arguments&gt;
+            &lt;argument&gt;-classpath&lt;/argument&gt;
+            &lt;classpath/&gt;
+            &lt;argument&gt;org.apache.xalan.xsltc.cmdline.Compile&lt;/argument&gt;
+            &lt;argument&gt;-d&lt;/argument&gt;
+            &lt;argument&gt;target/test-classes&lt;/argument&gt;
+            &lt;argument&gt;-p&lt;/argument&gt;
+            &lt;argument&gt;org.apache.cocoon.sax&lt;/argument&gt;
+            &lt;argument&gt;-o&lt;/argument&gt;
+            &lt;argument&gt;CompiledXslt&lt;/argument&gt;
+            &lt;argument&gt;src/test/resources/test.xslt&lt;/argument&gt;
+          &lt;/arguments&gt;
+        &lt;/configuration&gt;
+      &lt;/plugin&gt;
+    &lt;/plugins&gt;
+  &lt;/build&gt;
+  
+  &lt;profiles&gt;
+    &lt;profile&gt;
+      &lt;id&gt;it&lt;/id&gt;
+      &lt;build&gt;
+        &lt;plugins&gt;
+          &lt;plugin&gt;
+            &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
+            &lt;artifactId&gt;rat-maven-plugin&lt;/artifactId&gt;
+            &lt;configuration&gt;
+              &lt;excludes&gt;
+                &lt;exclude&gt;src/test/resources/META-INF/services/javax.xml.transform.TransformerFactory&lt;/exclude&gt;
+              &lt;/excludes&gt;
+            &lt;/configuration&gt;            
+            &lt;executions&gt;
+              &lt;execution&gt;
+                &lt;phase&gt;verify&lt;/phase&gt;
+                &lt;goals&gt;
+                  &lt;goal&gt;check&lt;/goal&gt;
+                &lt;/goals&gt;
+              &lt;/execution&gt;
+            &lt;/executions&gt;
+          &lt;/plugin&gt;          
+        &lt;/plugins&gt;
+      &lt;/build&gt;        
+    &lt;/profile&gt;  
+  &lt;/profiles&gt;   
 &lt;/project&gt;

Modified: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/XSLTTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/XSLTTransformer.java?rev=882881&amp;r1=882880&amp;r2=882881&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/XSLTTransformer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/XSLTTransformer.java
Sat Nov 21 10:55:38 2009
@@ -20,13 +20,17 @@
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.regex.Pattern;
 
+import javax.xml.transform.Source;
+import javax.xml.transform.Templates;
 import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.sax.SAXResult;
 import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.sax.TemplatesHandler;
 import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.transform.stream.StreamSource;
 
 import org.apache.cocoon.pipeline.SetupException;
 import org.apache.cocoon.pipeline.util.StringRepresentation;
@@ -35,63 +39,173 @@
 import org.apache.cocoon.sax.util.SAXConsumerAdapter;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
 
 public class XSLTTransformer extends AbstractSAXTransformer {
 
+    /**
+     * A generic transformer factory to parse XSLTs.
+     */
+    private static final SAXTransformerFactory TRAX_FACTORY = createNewSAXTransformerFactory();
+
+    /**
+     * The XSLT parameters name pattern.
+     */
+    private static final Pattern XSLT_PARAMETER_NAME_PATTERN = Pattern.compile("[a-zA-Z_][\\w\\-\\.]*");
+
+    /**
+     * This class log.
+     */
     private final Log log = LogFactory.getLog(XSLTTransformer.class);
+
+    /**
+     * The XSLT parameters reference.
+     */
     private Map&lt;String, Object&gt; parameters;
+
+    /**
+     * The XSLT URL source.
+     */
     private URL source;
 
+    /**
+     * The XSLT Template reference.
+     */
+    private Templates templates;
+
+    /**
+     * Empty constructor, used in sitemap.
+     */
     public XSLTTransformer() {
         super();
     }
 
-    public XSLTTransformer(URL source) {
+    /**
+     * Creates a new transformer reading the XSLT from the URL source.
+     *
+     * @param source the XSLT URL source
+     */
+    public XSLTTransformer(final URL source) {
         this(source, null);
     }
 
-    public XSLTTransformer(URL source, Map&lt;String, Object&gt; parameters) {
+    /**
+     * Creates a new transformer reading the XSLT from the URL source and setting the Transformer
+     * Factory attributes.
+     *
+     * This constructor is useful when users want to perform XSLT transformation using &lt;a
+     * href="http://xml.apache.org/xalan-j/xsltc_usage.html"&gt;xsltc&lt;/a&gt;.
+     *
+     * @param source the XSLT URL source
+     * @param attributes the Transformer Factory attributes
+     */
+    public XSLTTransformer(final URL source, final Map&lt;String, Object&gt; attributes)
{
         super();
+        this.loadXSLT(source, attributes);
+    }
+
+    /**
+     * Method useful to create a new transformer reading the XSLT from the URL source and
setting
+     * the Transformer Factory attributes.
+     *
+     * This method is useful when users want to perform XSLT transformation using &lt;a
+     * href="http://xml.apache.org/xalan-j/xsltc_usage.html"&gt;xsltc&lt;/a&gt;.
+     *
+     * @param source the XSLT URL source
+     * @param attributes the Transformer Factory attributes
+     */
+    private void loadXSLT(final URL source, final Map&lt;String, Object&gt; attributes) {
         if (source == null) {
             throw new IllegalArgumentException("The parameter 'source' mustn't be null.");
         }
 
-        this.parameters = parameters;
         this.source = source;
+
+        Source urlSource = new StreamSource(this.source.toExternalForm());
+
+        SAXTransformerFactory transformerFactory;
+        if (attributes != null &amp;&amp; !attributes.isEmpty()) {
+            transformerFactory = createNewSAXTransformerFactory();
+            for (Entry&lt;String, Object&gt; attribute : attributes.entrySet()) {
+                String name = attribute.getKey();
+                Object value = attribute.getValue();
+                transformerFactory.setAttribute(name, value);
+            }
+        } else {
+            transformerFactory = TRAX_FACTORY;
+        }
+
+        try {
+            this.templates = transformerFactory.newTemplates(urlSource);
+        } catch (TransformerConfigurationException e) {
+            throw new SetupException("Impossible to read XSLT from '" + this.source.toExternalForm()
+                    + "', see nested exception", e);
+        }
     }
 
     /**
-     * Test if the name is a valid parameter name for XSLT
+     * Sets the XSLT parameters to be applied to XSLT stylesheet.
+     *
+     * @param parameters the XSLT parameters to be applied to XSLT stylesheet
      */
-    private static boolean isValidXSLTParameterName(String name) {
-        return name.matches("[a-zA-Z_][\\w\\-\\.]*");
+    public void setParameters(final Map&lt;String, ? extends Object&gt; parameters) {
+        if (parameters != null) {
+            this.parameters = new HashMap&lt;String, Object&gt;(parameters);
+        } else {
+            this.parameters = null;
+        }
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
-    public void setConfiguration(Map&lt;String, ? extends Object&gt; configuration) {
-        this.source = (URL) configuration.get("source");
+    @SuppressWarnings("unchecked")
+    public void setConfiguration(final Map&lt;String, ? extends Object&gt; configuration)
{
+        try {
+            this.source = (URL) configuration.get("source");
+        } catch (ClassCastException cce) {
+            throw new SetupException("The configuration value of 'source' can't be cast to
java.net.URL.", cce);
+        }
 
-        this.parameters = new HashMap&lt;String, Object&gt;(configuration);
+        if (this.source != null) {
+            Object attributesObj = configuration.get("attributes");
+            if (attributesObj != null &amp;&amp; attributesObj instanceof Map) {
+                this.loadXSLT(this.source, (Map) attributesObj);
+            } else {
+                this.loadXSLT(this.source, null);
+            }
+        } else {
+            if (this.log.isDebugEnabled()) {
+                this.log.debug("Impossible to load XSLT parameters from '" + this.source
+                        + "' source, make sure it is NOT null and is a valid URL");
+            }
+        }
+
+        this.setParameters(configuration);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
-    protected void setSAXConsumer(SAXConsumer consumer) {
+    protected void setSAXConsumer(final SAXConsumer consumer) {
         TransformerHandler transformerHandler;
         try {
-            transformerHandler = this.createTransformerHandler();
+            transformerHandler = TRAX_FACTORY.newTransformerHandler(this.templates);
         } catch (Exception ex) {
             throw new SetupException("Could not initialize transformer handler.", ex);
         }
 
-        final Map&lt;String, Object&gt; map = this.getLogicSheetParameters();
-        if (map != null) {
+        if (this.parameters != null) {
             final Transformer transformer = transformerHandler.getTransformer();
 
-            for (Entry&lt;String, Object&gt; entry : map.entrySet()) {
-                transformer.setParameter(entry.getKey(), entry.getValue());
+            for (Entry&lt;String, Object&gt; entry : this.parameters.entrySet()) {
+                String name = entry.getKey();
+
+                // is valid XSLT parameter name
+                if (XSLT_PARAMETER_NAME_PATTERN.matcher(name).matches()) {
+                    transformer.setParameter(name, entry.getValue());
+                }
             }
         }
 
@@ -109,40 +223,13 @@
         super.setSAXConsumer(saxConsumerAdapter);
     }
 
-    private TransformerHandler createTransformerHandler() throws Exception {
-        SAXTransformerFactory transformerFactory = (SAXTransformerFactory) TransformerFactory.newInstance();
-        TemplatesHandler templatesHandler = transformerFactory.newTemplatesHandler();
-
-        XMLReader xmlReader = XMLReaderFactory.createXMLReader();
-        xmlReader.setContentHandler(templatesHandler);
-        String systemId = this.source.toURI().toString();
-        InputSource inputSource = new InputSource(systemId);
-        xmlReader.parse(inputSource);
-
-        // Create transformer handler
-        final TransformerHandler handler = transformerFactory.newTransformerHandler(templatesHandler.getTemplates());
-        handler.getTransformer().setErrorListener(
-                new XSLTProcessorErrorListener(this.log, this.source.toExternalForm()));
-
-        return handler;
-    }
-
-    private Map&lt;String, Object&gt; getLogicSheetParameters() {
-        if (this.parameters == null) {
-            return null;
-        }
-
-        Map&lt;String, Object&gt; result = new HashMap&lt;String, Object&gt;();
-
-        for (Entry&lt;String, Object&gt; entry : this.parameters.entrySet()) {
-            String name = entry.getKey();
-
-            if (isValidXSLTParameterName(name)) {
-                result.put(name, entry.getValue());
-            }
-        }
-
-        return result;
+    /**
+     * Utility method to create a new transformer factory.
+     *
+     * @return a new transformer factory
+     */
+    private static SAXTransformerFactory createNewSAXTransformerFactory() {
+        return (SAXTransformerFactory) TransformerFactory.newInstance();
     }
 
     @Override

Modified: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/util/TransformationUtils.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/util/TransformationUtils.java?rev=882881&amp;r1=882880&amp;r2=882881&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/util/TransformationUtils.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/util/TransformationUtils.java
Sat Nov 21 10:55:38 2009
@@ -164,7 +164,9 @@
 
         pipeline.addComponent(new StringGenerator(xmlString));
         for (URL xsltUrl : xsltUrls) {
-            pipeline.addComponent(new XSLTTransformer(xsltUrl, xsltParameters));
+            XSLTTransformer xsltTransformer = new XSLTTransformer(xsltUrl);
+            xsltTransformer.setParameters(xsltParameters);
+            pipeline.addComponent(xsltTransformer);
         }
         pipeline.addComponent(new XMLSerializer(outputProperties));
 

Modified: cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java?rev=882881&amp;r1=882880&amp;r2=882881&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java
Sat Nov 21 10:55:38 2009
@@ -19,6 +19,8 @@
 package org.apache.cocoon.sax;
 
 import java.io.ByteArrayOutputStream;
+import java.util.HashMap;
+import java.util.Map;
 
 import junit.framework.TestCase;
 
@@ -33,7 +35,7 @@
 
     /**
      * A pipeline that performs a simple transformation: generator -&amp;gt; transformer
-&amp;gt;
-     * serializer
+     * serializer.
      */
     public void testPipelineWithTransformer() throws Exception {
         Pipeline&lt;SAXPipelineComponent&gt; pipeline = new NonCachingPipeline&lt;SAXPipelineComponent&gt;();
@@ -48,4 +50,28 @@
         Diff diff = new Diff("&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;&lt;p&gt;&lt;/p&gt;",
new String(baos.toByteArray()));
         assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
     }
+
+    /**
+     * A pipeline that performs a simple transformation: generator -&amp;gt; transformer
-&amp;gt;
+     * serializer; the transformer uses a compiled XSLT using Xalan xsltc.
+     * 
+     * @throws Exception if any error occurs.
+     */
+    public void testPipelineWithCompiledXSLT() throws Exception {
+        Map&lt;String, Object&gt; attributes = new HashMap&lt;String, Object&gt;();
+        attributes.put("translet-name", "CompiledXslt");
+        attributes.put("package-name", "org.apache.cocoon.sax");
+
+        Pipeline&lt;SAXPipelineComponent&gt; pipeline = new NonCachingPipeline&lt;SAXPipelineComponent&gt;();
+        pipeline.addComponent(new StringGenerator("&lt;x&gt;&lt;/x&gt;"));
+        pipeline.addComponent(new XSLTTransformer(this.getClass().getResource("/test.xslt"),
attributes));
+        pipeline.addComponent(new XMLSerializer());
+
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        pipeline.setup(baos);
+        pipeline.execute();
+
+        Diff diff = new Diff("&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;&lt;p&gt;&lt;/p&gt;",
new String(baos.toByteArray()));
+        assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
+    }
 }

Added: cocoon/cocoon3/trunk/cocoon-sax/src/test/resources/META-INF/services/javax.xml.transform.TransformerFactory
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/test/resources/META-INF/services/javax.xml.transform.TransformerFactory?rev=882881&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/test/resources/META-INF/services/javax.xml.transform.TransformerFactory
(added)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/test/resources/META-INF/services/javax.xml.transform.TransformerFactory
Sat Nov 21 10:55:38 2009
@@ -0,0 +1 @@
+org.apache.xalan.xsltc.trax.TransformerFactoryImpl




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r882879 - /cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/AbstractPipeline.java</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091121103808.736DE23888C5@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091121103808-736DE23888C5@eris-apache-org%3e</id>
<updated>2009-11-21T10:38:08Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Sat Nov 21 10:38:07 2009
New Revision: 882879

URL: http://svn.apache.org/viewvc?rev=882879&amp;view=rev
Log:
no need to have to statements

Modified:
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/AbstractPipeline.java

Modified: cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/AbstractPipeline.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/AbstractPipeline.java?rev=882879&amp;r1=882878&amp;r2=882879&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/AbstractPipeline.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/AbstractPipeline.java
Sat Nov 21 10:38:07 2009
@@ -82,8 +82,7 @@
      * @see org.apache.cocoon.pipeline.Pipeline#getContentType()
      */
     public String getContentType() {
-        Finisher last = this.getFinisher();
-        return last.getContentType();
+        return this.getFinisher().getContentType();
     }
 
     public long getLastModified() {




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r882878 - /cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceSerializer.java</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091121103648.ED57E23888C5@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091121103648-ED57E23888C5@eris-apache-org%3e</id>
<updated>2009-11-21T10:36:48Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Sat Nov 21 10:36:48 2009
New Revision: 882878

URL: http://svn.apache.org/viewvc?rev=882878&amp;view=rev
Log:
Set the status code returned by the servlet-connection instead of always returning 200

Modified:
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceSerializer.java

Modified: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceSerializer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceSerializer.java?rev=882878&amp;r1=882877&amp;r2=882878&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceSerializer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceSerializer.java
Sat Nov 21 10:36:48 2009
@@ -17,6 +17,7 @@
 package org.apache.cocoon.servlet.ssf;
 
 import java.io.IOException;
+import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLConnection;
@@ -27,6 +28,7 @@
 import org.apache.cocoon.pipeline.util.URLConnectionUtils;
 import org.apache.cocoon.sax.AbstractSAXSerializer;
 import org.apache.cocoon.sax.util.XMLUtils;
+import org.apache.cocoon.servlet.node.StatusCodeCollector;
 import org.apache.cocoon.xml.sax.SAXBuffer;
 import org.apache.commons.io.IOUtils;
 import org.xml.sax.SAXException;
@@ -52,6 +54,14 @@
         try {
             XMLUtils.toOutputStream(this.getUrlConnection().getOutputStream(), this.saxBuffer);
             IOUtils.copy(this.getUrlConnection().getInputStream(), this.getOutputStream());
+
+            // set the status code
+            URLConnection urlConnection = this.getUrlConnection();
+            if (urlConnection instanceof HttpURLConnection) {
+                HttpURLConnection servletURLConnection = (HttpURLConnection) urlConnection;
+                int statusCode = servletURLConnection.getResponseCode();
+                StatusCodeCollector.setStatusCode(statusCode);
+            }
         } catch (IOException e) {
             throw new SAXException("Can't copy result of servlet service to the output stream",
e);
         } finally {




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r882877 - /cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/ExceptionGenerator.java</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091121103138.0A8C923888C5@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091121103138-0A8C923888C5@eris-apache-org%3e</id>
<updated>2009-11-21T10:31:37Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Sat Nov 21 10:31:37 2009
New Revision: 882877

URL: http://svn.apache.org/viewvc?rev=882877&amp;view=rev
Log:
Use cocoon-xml implementation of AttributesImpl

Modified:
    cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/ExceptionGenerator.java

Modified: cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/ExceptionGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/ExceptionGenerator.java?rev=882877&amp;r1=882876&amp;r2=882877&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/ExceptionGenerator.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/ExceptionGenerator.java
Sat Nov 21 10:31:37 2009
@@ -27,7 +27,7 @@
 import org.apache.cocoon.pipeline.component.Starter;
 import org.apache.cocoon.sax.AbstractSAXProducer;
 import org.apache.cocoon.sitemap.util.ParameterHelper;
-import org.apache.cocoon.sitemap.xml.AttributesImpl;
+import org.apache.cocoon.xml.sax.AttributesImpl;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r882875 - in /cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap: SitemapBuilder.java xml/</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091121103015.B9DDC23888C5@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091121103015-B9DDC23888C5@eris-apache-org%3e</id>
<updated>2009-11-21T10:30:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Sat Nov 21 10:30:15 2009
New Revision: 882875

URL: http://svn.apache.org/viewvc?rev=882875&amp;view=rev
Log:
The SitemapBuilder throws a custom unchecked exception when the build of the sitemap fails
(usually this means it is not recoverable)

Removed:
    cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/xml/
Modified:
    cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/SitemapBuilder.java

Modified: cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/SitemapBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/SitemapBuilder.java?rev=882875&amp;r1=882874&amp;r2=882875&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/SitemapBuilder.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/SitemapBuilder.java
Sat Nov 21 10:30:15 2009
@@ -37,17 +37,25 @@
 
     private SitemapNodeFactory sitemapNodeFactory;
 
-    public SitemapNode build(URL sitemap) throws Exception {
+    public SitemapNode build(URL sitemap) {
+        if (sitemap == null) {
+            throw new NullPointerException("A valid sitemap URL has to be passed.");
+        }
+
         SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
         saxParserFactory.setNamespaceAware(true);
         // saxParserFactory.setSchema(SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema").newSchema());
 
-        SAXParser saxParser = saxParserFactory.newSAXParser();
-
-        InputStream inputStream = sitemap.openStream();
         SitemapHandler sitemapHandler = new SitemapHandler();
-        saxParser.parse(inputStream, sitemapHandler);
-        inputStream.close();
+        try {
+            SAXParser saxParser = saxParserFactory.newSAXParser();
+
+            InputStream inputStream = sitemap.openStream();
+            saxParser.parse(inputStream, sitemapHandler);
+            inputStream.close();
+        } catch (Exception e) {
+            throw new SitemapBuilderException("Can't build sitemap.", e);
+        }
 
         return sitemapHandler.getSitemap();
     }
@@ -60,7 +68,16 @@
         return SitemapBuilder.this.sitemapNodeFactory.createNode(localName, parameters);
     }
 
-    class SitemapHandler extends DefaultHandler {
+    private static class SitemapBuilderException extends RuntimeException {
+
+        private static final long serialVersionUID = 1L;
+
+        public SitemapBuilderException(String msg, Throwable t) {
+            super(msg, t);
+        }
+    }
+
+    private class SitemapHandler extends DefaultHandler {
 
         private SitemapNode currentNode;
         private SitemapNode sitemap;




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r882636 - in /cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet: RequestProcessor.java XMLSitemapServlet.java</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091120163241.610F123888D4@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091120163241-610F123888D4@eris-apache-org%3e</id>
<updated>2009-11-20T16:32:40Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Fri Nov 20 16:32:39 2009
New Revision: 882636

URL: http://svn.apache.org/viewvc?rev=882636&amp;view=rev
Log:
split the XMLSitemapServlet into two parts: one servlet specific one and the other responsible
for the request processing. This helps with the integration into Wicket.

Added:
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
  (with props)
Modified:
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/XMLSitemapServlet.java

Added: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java?rev=882636&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
Fri Nov 20 16:32:39 2009
@@ -0,0 +1,361 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+/**
+ *
+ */
+package org.apache.cocoon.servlet;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.cocoon.callstack.CallStack;
+import org.apache.cocoon.configuration.Settings;
+import org.apache.cocoon.servlet.node.LastModifiedCollector;
+import org.apache.cocoon.servlet.node.MimeTypeCollector;
+import org.apache.cocoon.servlet.node.StatusCodeCollector;
+import org.apache.cocoon.servlet.util.HttpContextHelper;
+import org.apache.cocoon.servlet.util.ManifestUtils;
+import org.apache.cocoon.servlet.util.ObjectModelProvider;
+import org.apache.cocoon.servlet.util.SettingsHelper;
+import org.apache.cocoon.servletservice.CallStackHelper;
+import org.apache.cocoon.sitemap.Invocation;
+import org.apache.cocoon.sitemap.InvocationImpl;
+import org.apache.cocoon.sitemap.SitemapBuilder;
+import org.apache.cocoon.sitemap.node.SitemapNode;
+import org.apache.cocoon.spring.configurator.ResourceUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.BeanFactory;
+
+public class RequestProcessor {
+
+    private static final long serialVersionUID = 1L;
+
+    private URL baseURL;
+    private BeanFactory beanFactory;
+    private boolean inServletServiceFramework;
+    private final Log logger = LogFactory.getLog(this.getClass());
+    private ServletContext servletContext;
+    private SitemapNode sitemapNode;
+    private String sitemapPath;
+    private String version = "";
+
+    public RequestProcessor(ServletContext servletContext, String sitemapPath, BeanFactory
beanFactory)
+            throws SitemapNotFoundException, InvalidBaseUrlException, SitemapInitializationException
{
+        if (servletContext == null) {
+            throw new NullPointerException("A 'ServletContext' has to be passed.");
+        }
+        if (beanFactory == null) {
+            throw new NullPointerException("A Spring 'BeanFactory' has to be passed.");
+        }
+
+        this.servletContext = servletContext;
+        this.sitemapPath = sitemapPath;
+        this.beanFactory = beanFactory;
+
+        this.initializeInServletServiceFramework();
+        this.initializeBaseURL();
+        this.initializeVersionNumber();
+        this.initializeSitemap();
+    }
+
+    public void service(HttpServletRequest request, HttpServletResponse response) throws
IOException, ServletException {
+        long start = System.nanoTime();
+        this.logRequest(request);
+
+        try {
+            if (this.inServletServiceFramework) {
+                this.sendSitemapResponse(request, response);
+                return;
+            }
+
+            // if it runs ouside of the Servlet-Service framework, the CallStack has
+            // to be prepared
+            try {
+                CallStackHelper.enterServlet(this.servletContext, request, response);
+                this.sendSitemapResponse(request, response);
+            } finally {
+                CallStackHelper.leaveServlet();
+            }
+        } finally {
+            if (this.logger.isInfoEnabled()) {
+                this.logger.info("Sitemap execution for " + request.getRequestURI() + " took
"
+                        + (System.nanoTime() - start) / 1000000f + " ms.");
+            }
+        }
+    }
+
+    private String calcSitemapRequestURI(HttpServletRequest request) {
+        if (!this.inServletServiceFramework) {
+            return request.getServletPath();
+        }
+
+        // the Servlet-Service framework uses the servlet path as mount
+        // path of a servlet
+        String contextPath = request.getContextPath();
+        String mountPath = request.getServletPath();
+        return request.getRequestURI().substring(contextPath.length() + mountPath.length());
+    }
+
+    private URL getBaseURL() {
+        return this.baseURL;
+    }
+
+    @SuppressWarnings("unchecked")
+    private Map&lt;String, Object&gt; getInvocationParameters(HttpServletRequest req) {
+        Map&lt;String, Object&gt; invocationParameters = new HashMap&lt;String, Object&gt;();
+
+        for (Enumeration&lt;String&gt; names = req.getParameterNames(); names.hasMoreElements();)
{
+            String name = names.nextElement();
+            invocationParameters.put(name, req.getParameter(name));
+        }
+
+        return invocationParameters;
+    }
+
+    private String getSitemapPath() {
+        String sitemapPath = this.sitemapPath;
+        if (sitemapPath == null) {
+            sitemapPath = "/sitemap.xmap";
+        }
+
+        if (!sitemapPath.startsWith("/")) {
+            sitemapPath = "/" + sitemapPath;
+        }
+
+        return sitemapPath;
+    }
+
+    private void initializeBaseURL() throws InvalidBaseUrlException {
+        try {
+            String baseURL = this.getSitemapPath();
+            baseURL = baseURL.substring(0, baseURL.lastIndexOf('/') + 1);
+
+            this.baseURL = this.servletContext.getResource(baseURL);
+
+            if (this.logger.isDebugEnabled()) {
+                this.logger.debug("Setting the baseURL to " + this.baseURL);
+            }
+        } catch (MalformedURLException e) {
+            throw new InvalidBaseUrlException("An exception occurred while retrieving the
base "
+                    + "URL from the servlet context.", e);
+        }
+    }
+
+    private void initializeInServletServiceFramework() {
+        this.inServletServiceFramework = CallStack.getCurrentFrame() != null;
+    }
+
+    private void initializeSitemap() throws SitemapNotFoundException, SitemapInitializationException
{
+        URL url = null;
+        SitemapBuilder sitemapBuilder = null;
+        try {
+            sitemapBuilder = (SitemapBuilder) this.beanFactory.getBean(SitemapBuilder.class.getName());
+            url = this.servletContext.getResource(this.getSitemapPath());
+        } catch (Exception e) {
+            throw new SitemapInitializationException("Can't initialize sitemap.", e);
+        }
+
+        // if the sitemap URL can't be resolved by the ServletContext, null is returned
+        if (url == null) {
+            // prepare a meaningful exception
+            String baseURL = this.getBaseURL().toExternalForm();
+            if (baseURL.endsWith("/")) {
+                baseURL = baseURL.substring(0, baseURL.length() - 1);
+            }
+            throw new SitemapNotFoundException("Can't find sitemap at " + baseURL + this.getSitemapPath());
+        }
+
+        this.sitemapNode = sitemapBuilder.build(url);
+    }
+
+    /**
+     * Read versioning information from the Cocoon 3 Servlet module
+     */
+    private void initializeVersionNumber() {
+        Properties pomProperties = ResourceUtils.getPOMProperties("org.apache.cocoon.servlet",
"cocoon-servlet");
+        if (pomProperties == null) {
+            return;
+        }
+
+        String servletModuleVersion = pomProperties.getProperty("version");
+        if (servletModuleVersion != null) {
+            this.version = servletModuleVersion;
+        }
+
+        if (this.version.endsWith("SNAPSHOT")) {
+            String buildNumber = "";
+            try {
+                String buildNumberAttr = ManifestUtils.getAttribute(this.getClass(), "Implementation-Build");
+                if (buildNumberAttr != null &amp;&amp; !"".equals(buildNumberAttr) &amp;&amp;
!"na".equals(buildNumberAttr)) {
+                    buildNumber = "/rev" + buildNumberAttr;
+                }
+            } catch (IOException e) {
+                if (this.logger.isDebugEnabled()) {
+                    this.logger.debug("Error while reading an attribute from the manifest.",
e);
+                }
+            }
+            this.version += buildNumber;
+        }
+    }
+
+    private void invoke(String requestURI, Map&lt;String, Object&gt; parameters, OutputStream
outputStream) {
+        InvocationImpl invocation = (InvocationImpl) this.beanFactory.getBean(Invocation.class.getName());
+
+        invocation.setBaseURL(this.getBaseURL());
+        invocation.setRequestURI(requestURI);
+        invocation.setParameters(parameters);
+        invocation.setOutputStream(outputStream);
+        invocation.setObjectModel(ObjectModelProvider.provide(parameters));
+
+        this.sitemapNode.invoke(invocation);
+    }
+
+    private void logRequest(HttpServletRequest request) {
+        if (this.logger.isInfoEnabled()) {
+            this.logger.info("Performing " + request.getMethod().toUpperCase() + " request
at "
+                    + request.getRequestURI());
+        }
+        if (this.logger.isDebugEnabled()) {
+            this.logger.debug("The base URL for this request is " + this.getBaseURL());
+        }
+    }
+
+    private Map&lt;String, Object&gt; prepareParameters(HttpServletRequest request, HttpServletResponse
response,
+            Settings settings) {
+        Map&lt;String, Object&gt; parameters = this.getInvocationParameters(request);
+        HttpContextHelper.storeRequest(request, parameters);
+        HttpContextHelper.storeResponse(response, parameters);
+        HttpContextHelper.storeServletContext(this.servletContext, parameters);
+        SettingsHelper.storeSettings(settings, parameters);
+        return parameters;
+    }
+
+    private void sendSitemapResponse(HttpServletRequest request, HttpServletResponse response)
throws IOException {
+        Settings settings = (Settings) this.beanFactory.getBean(Settings.class.getName());
+
+        // invoke the sitemap engine
+        ByteArrayOutputStream baos = new ByteArrayOutputStream(8192);
+        this.invoke(this.calcSitemapRequestURI(request), this.prepareParameters(request,
response, settings), baos);
+
+        // collect meta information from the previous run of the sitemap engine
+        long lastModified = LastModifiedCollector.getLastModified();
+        int contentLengh = baos.size();
+
+        // send the Last-Modified header
+        if (lastModified &gt; -1) {
+            response.setDateHeader("Last-Modified", lastModified);
+        }
+
+        // set the X-Cocoon-Version header
+        if (!"false".equals(settings.getProperty("org.apache.cocoon.show-version"))) {
+            response.setHeader("X-Cocoon-Version", this.version);
+        }
+
+        // conditional request support
+        long ifLastModifiedSince = request.getDateHeader("If-Modified-Since");
+        if (ifLastModifiedSince &gt; 0 &amp;&amp; lastModified &gt; 0) {
+            if (ifLastModifiedSince / 1000 &gt;= lastModified / 1000) {
+                response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
+
+                if (this.logger.isInfoEnabled()) {
+                    this.logger.info("The requested resource " + request.getRequestURI()
+                            + " hasn't changed: ifLastModifiedSince=" + ifLastModifiedSince
+ ", lastModified="
+                            + lastModified + ". Hence 304 (NOT_MODIFIED) was sent as status
code.");
+                }
+
+                return;
+            }
+        }
+
+        // Content-Type handling
+        String mimeType = MimeTypeCollector.getMimeType();
+        if (mimeType == null || "".equals(mimeType) || "content/unknown".equals(mimeType))
{
+            mimeType = this.servletContext.getMimeType(request.getRequestURI());
+        }
+        if (mimeType != null) {
+            response.setContentType(mimeType);
+        }
+
+        // Status code handling
+        int statusCode = StatusCodeCollector.getStatusCode();
+        response.setStatus(statusCode);
+
+        // write the sitemap result to the output stream
+        if (contentLengh &gt; 0) {
+            response.setContentLength(contentLengh);
+            if (this.logger.isInfoEnabled()) {
+                this.logger.info("Going to send response: mimeType=" + mimeType + ", contentLength="
+ contentLengh
+                        + ", statusCode=" + statusCode + ", lastModified=" + lastModified);
+            }
+
+            response.getOutputStream().write(baos.toByteArray());
+        }
+    }
+
+    public static class InvalidBaseUrlException extends RequestProcessorException {
+
+        private static final long serialVersionUID = 1L;
+
+        public InvalidBaseUrlException(String message, Throwable cause) {
+            super(message, cause);
+        }
+    }
+
+    public static class RequestProcessorException extends Exception {
+
+        private static final long serialVersionUID = 1L;
+
+        public RequestProcessorException(String message) {
+            super(message);
+        }
+
+        public RequestProcessorException(String message, Throwable cause) {
+            super(message, cause);
+        }
+    }
+
+    public static class SitemapInitializationException extends RequestProcessorException
{
+
+        private static final long serialVersionUID = 1L;
+
+        public SitemapInitializationException(String message, Throwable cause) {
+            super(message, cause);
+        }
+    }
+
+    public static class SitemapNotFoundException extends RequestProcessorException {
+
+        private static final long serialVersionUID = 1L;
+
+        public SitemapNotFoundException(String message) {
+            super(message);
+        }
+    }
+}
\ No newline at end of file

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/XMLSitemapServlet.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/XMLSitemapServlet.java?rev=882636&amp;r1=882635&amp;r2=882636&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/XMLSitemapServlet.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/XMLSitemapServlet.java
Fri Nov 20 16:32:39 2009
@@ -18,241 +18,50 @@
  */
 package org.apache.cocoon.servlet;
 
-import java.io.ByteArrayOutputStream;
 import java.io.IOException;
-import java.io.OutputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
 
-import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.cocoon.configuration.Settings;
-import org.apache.cocoon.servlet.node.LastModifiedCollector;
-import org.apache.cocoon.servlet.node.MimeTypeCollector;
-import org.apache.cocoon.servlet.node.StatusCodeCollector;
-import org.apache.cocoon.servlet.util.HttpContextHelper;
-import org.apache.cocoon.servlet.util.ManifestUtils;
-import org.apache.cocoon.servlet.util.ObjectModelProvider;
-import org.apache.cocoon.servlet.util.SettingsHelper;
-import org.apache.cocoon.sitemap.Invocation;
-import org.apache.cocoon.sitemap.InvocationImpl;
-import org.apache.cocoon.sitemap.SitemapBuilder;
-import org.apache.cocoon.sitemap.node.SitemapNode;
-import org.apache.cocoon.spring.configurator.ResourceUtils;
+import org.apache.cocoon.spring.configurator.WebAppContextUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.BeanFactory;
-import org.springframework.beans.factory.BeanFactoryAware;
 
-public class XMLSitemapServlet extends HttpServlet implements BeanFactoryAware {
+/**
+ * The Cocoon 3 servlet. It works with and without the Servlet-Service framework.
+ */
+public class XMLSitemapServlet extends HttpServlet {
 
     private static final long serialVersionUID = 1L;
-    private BeanFactory beanFactory;
 
-    private boolean initialized;
+    private RequestProcessor requestProcessor;
     private final Log logger = LogFactory.getLog(this.getClass());
-    private ServletConfig servletConfig;
-    private SitemapNode sitemapNode;
-    private String version = "";
 
     @Override
-    public void init(ServletConfig config) throws ServletException {
-        this.servletConfig = config;
-        super.init(this.servletConfig);
-        this.initVersionNumber();
-    }
-
-    public void invoke(String requestURI, Map&lt;String, Object&gt; parameters, OutputStream
outputStream)
-            throws ServletException {
-        InvocationImpl invocation = (InvocationImpl) this.beanFactory.getBean(Invocation.class.getName());
-
-        invocation.setBaseURL(this.getBaseURL());
-        invocation.setRequestURI(requestURI);
-        invocation.setParameters(parameters);
-        invocation.setOutputStream(outputStream);
-        invocation.setObjectModel(ObjectModelProvider.provide(parameters));
-
-        this.sitemapNode.invoke(invocation);
-    }
-
-    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
-        this.beanFactory = beanFactory;
-    }
-
-    @Override
-    protected void service(HttpServletRequest request, HttpServletResponse response) throws
ServletException,
-            IOException {
-        long start = System.nanoTime();
-        this.logRequest(request);
-
+    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
IOException {
         this.lazyInitialize();
 
         try {
-            Settings settings = (Settings) this.beanFactory.getBean(Settings.class.getName());
-
-            // assemble parameters
-            Map&lt;String, Object&gt; parameters = this.getInvocationParameters(request);
-            HttpContextHelper.storeRequest(request, parameters);
-            HttpContextHelper.storeResponse(response, parameters);
-            HttpContextHelper.storeServletContext(this.getServletContext(), parameters);
-            SettingsHelper.storeSettings(settings, parameters);
-
-            // invoke the sitemap engine
-            ByteArrayOutputStream baos = new ByteArrayOutputStream(8192);
-            this.invoke(this.calcSitemapRequestURI(request), parameters, baos);
-
-            // collect meta information from the previous run of the sitemap engine
-            long lastModified = LastModifiedCollector.getLastModified();
-            int contentLengh = baos.size();
-
-            // send the Last-Modified header
-            if (lastModified &gt; -1) {
-                response.setDateHeader("Last-Modified", lastModified);
-            }
-
-            // set the X-Cocoon-Version header
-            if (!"false".equals(settings.getProperty("org.apache.cocoon.show-version")))
{
-                response.setHeader("X-Cocoon-Version", this.version);
-            }
-
-            // conditional request support
-            long ifLastModifiedSince = request.getDateHeader("If-Modified-Since");
-            if (ifLastModifiedSince &gt; 0 &amp;&amp; ifLastModifiedSince / 1000 &gt;= lastModified
/ 1000 &amp;&amp; lastModified &gt; 0) {
-                response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
-                if (this.logger.isInfoEnabled()) {
-                    this.logger.info("The requested resource " + request.getRequestURI()
-                            + " hasn't changed: ifLastModifiedSince=" + ifLastModifiedSince
+ ", lastModified="
-                            + lastModified + ". Hence 304 (NOT_MODIFIED) was sent as status
code.");
-                }
-
-                return;
-            }
-
-            // Content-Type handling
-            String mimeType = MimeTypeCollector.getMimeType();
-            if (mimeType == null || "".equals(mimeType) || "content/unknown".equals(mimeType))
{
-                mimeType = this.servletConfig.getServletContext().getMimeType(request.getRequestURI());
-            }
-            if (mimeType != null) {
-                response.setContentType(mimeType);
-            }
-
-            // Status code handling
-            int statusCode = StatusCodeCollector.getStatusCode();
-            response.setStatus(statusCode);
-
-            // write the sitemap result to the output stream
-            if (contentLengh &gt; 0) {
-                response.setContentLength(contentLengh);
-                if (this.logger.isInfoEnabled()) {
-                    this.logger.info("Going to send response: mimeType=" + mimeType + ",
contentLength=" + contentLengh
-                            + ", statusCode=" + statusCode + ", lastModified=" + lastModified);
-                }
-
-                response.getOutputStream().write(baos.toByteArray());
-            }
-        } catch (Exception e) {
-            throw this.wrapException(e, "An exception occurred while executing the sitemap.");
-        } finally {
-            this.logger.info("Sitemap execution took " + (System.nanoTime() - start) / 1000000f
+ " ms.");
-        }
-    }
-
-    private String calcSitemapRequestURI(HttpServletRequest request) {
-        String contextPath = request.getContextPath();
-        String mountPath = request.getServletPath();
-        return request.getRequestURI().substring(contextPath.length() + mountPath.length());
-    }
-
-    private URL getBaseURL() throws ServletException {
-        try {
-            return this.servletConfig.getServletContext().getResource("/");
-        } catch (MalformedURLException e) {
-            throw this.wrapException(e, "An exception occurred while retrieving the base
"
-                    + "URL from the servlet context.");
+            this.requestProcessor.service(req, resp);
+        } catch (RuntimeException e) {
+            this.wrapException(e, "Cocoon can't process the request.");
         }
     }
 
-    @SuppressWarnings("unchecked")
-    private Map&lt;String, Object&gt; getInvocationParameters(HttpServletRequest req) {
-        Map&lt;String, Object&gt; invocationParameters = new HashMap&lt;String, Object&gt;();
-
-        for (Enumeration&lt;String&gt; names = req.getParameterNames(); names.hasMoreElements();)
{
-            String name = names.nextElement();
-            invocationParameters.put(name, req.getParameter(name));
-        }
-
-        return invocationParameters;
-    }
-
-    private String getSitemapPath() {
-        String sitemapPath = this.getInitParameter("sitemap-path");
-        if (sitemapPath == null) {
-            sitemapPath = "/sitemap.xmap";
-        }
-
-        if (!sitemapPath.startsWith("/")) {
-            sitemapPath = "/" + sitemapPath;
-        }
-
-        return sitemapPath;
-    }
-
-    /**
-     * Read versioning information from the Cocoon 3 Servlet module
-     */
-    private void initVersionNumber() {
-        String servletModuleVersion = ResourceUtils.getPOMProperties("org.apache.cocoon.servlet",
"cocoon-servlet")
-                .getProperty("version");
-        if (servletModuleVersion != null) {
-            this.version = servletModuleVersion;
-        }
-
-        if (this.version.endsWith("SNAPSHOT")) {
-            String buildNumber = "";
-            try {
-                String buildNumberAttr = ManifestUtils.getAttribute(this.getClass(), "Implementation-Build");
-                if (buildNumberAttr != null &amp;&amp; !"".equals(buildNumberAttr) &amp;&amp;
!"na".equals(buildNumberAttr)) {
-                    buildNumber = "/rev" + buildNumberAttr;
-                }
-            } catch (IOException e) {
-                if (this.logger.isDebugEnabled()) {
-                    this.logger.debug("Error while reading an attribute from the manifest.",
e);
-                }
+    private void lazyInitialize() throws ServletException {
+        synchronized (this) {
+            if (this.requestProcessor != null) {
+                return;
             }
-            this.version += buildNumber;
-        }
-    }
 
-    private synchronized void lazyInitialize() throws ServletException {
-        if (!this.initialized) {
             try {
-                SitemapBuilder sitemapBuilder = (SitemapBuilder) this.beanFactory.getBean(SitemapBuilder.class
-                        .getName());
-                URL url = this.servletConfig.getServletContext().getResource(this.getSitemapPath());
-                this.sitemapNode = sitemapBuilder.build(url);
+                this.requestProcessor = new RequestProcessor(this.getServletContext(), this
+                        .getInitParameter("sitemap-path"), WebAppContextUtils.getCurrentWebApplicationContext());
             } catch (Exception e) {
-                throw this.wrapException(e, "An exception occurred while building the sitemap.");
+                this.wrapException(e, "Can't initialize the RequestProcessor correctly.");
             }
-            this.initialized = true;
-        }
-    }
-
-    private void logRequest(HttpServletRequest request) throws ServletException {
-        if (this.logger.isInfoEnabled()) {
-            this.logger.info("Performing " + request.getMethod().toUpperCase() + " request
at "
-                    + request.getRequestURI());
-        }
-        if (this.logger.isDebugEnabled()) {
-            this.logger.debug("The base URL for this request is " + this.getBaseURL());
         }
     }
 




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r833329 - /cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/PipelineComponent.java</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091106093846.A4164238888F@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091106093846-A4164238888F@eris-apache-org%3e</id>
<updated>2009-11-06T09:38:46Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Fri Nov  6 09:38:46 2009
New Revision: 833329

URL: http://svn.apache.org/viewvc?rev=833329&amp;view=rev
Log:
Remove empty line

Modified:
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/PipelineComponent.java

Modified: cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/PipelineComponent.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/PipelineComponent.java?rev=833329&amp;r1=833328&amp;r2=833329&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/PipelineComponent.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/PipelineComponent.java
Fri Nov  6 09:38:46 2009
@@ -34,7 +34,6 @@
     /**
      * This method is called after pipeline run - regardless if the run was
      * successful or an exception was thrown.
-     * 
      */
     void finish();
 




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r833328 - in /cocoon/cocoon3/trunk/cocoon-profiling/src: main/java/org/apache/cocoon/profiling/profiler/ main/resources/COB-INF/ test/java/org/apache/cocoon/profiling/ test/resources/org/apache/cocoon/profiling/</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091106093642.B2806238888F@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091106093642-B2806238888F@eris-apache-org%3e</id>
<updated>2009-11-06T09:36:42Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Fri Nov  6 09:36:42 2009
New Revision: 833328

URL: http://svn.apache.org/viewvc?rev=833328&amp;view=rev
Log:
cleanup the URI space for profiling URLs

Modified:
    cocoon/cocoon3/trunk/cocoon-profiling/src/main/java/org/apache/cocoon/profiling/profiler/ServletProfiler.java
    cocoon/cocoon3/trunk/cocoon-profiling/src/main/resources/COB-INF/sitemap.xmap
    cocoon/cocoon3/trunk/cocoon-profiling/src/test/java/org/apache/cocoon/profiling/TestServletProfiler.java
    cocoon/cocoon3/trunk/cocoon-profiling/src/test/resources/org/apache/cocoon/profiling/simple.xml

Modified: cocoon/cocoon3/trunk/cocoon-profiling/src/main/java/org/apache/cocoon/profiling/profiler/ServletProfiler.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-profiling/src/main/java/org/apache/cocoon/profiling/profiler/ServletProfiler.java?rev=833328&amp;r1=833327&amp;r2=833328&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-profiling/src/main/java/org/apache/cocoon/profiling/profiler/ServletProfiler.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-profiling/src/main/java/org/apache/cocoon/profiling/profiler/ServletProfiler.java
Fri Nov  6 09:36:42 2009
@@ -30,7 +30,7 @@
  */
 public class ServletProfiler extends Profiler&lt;Servlet&gt; {
 
-    private final static String PROFILING_CONTROLLER_PATH = "controller/profiling/";
+    private final static String PROFILING_CONTROLLER_PATH = "cocoon-profiling/";
     private final static String PROFILING_ID_HEADER = "X-Cocoon-Profiling-ID";
     private final static String PROFILING_URL_HEADER = "X-Cocoon-Profiling-URL";
     private String mountPath;

Modified: cocoon/cocoon3/trunk/cocoon-profiling/src/main/resources/COB-INF/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-profiling/src/main/resources/COB-INF/sitemap.xmap?rev=833328&amp;r1=833327&amp;r2=833328&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-profiling/src/main/resources/COB-INF/sitemap.xmap (original)
+++ cocoon/cocoon3/trunk/cocoon-profiling/src/main/resources/COB-INF/sitemap.xmap Fri Nov
 6 09:36:42 2009
@@ -21,17 +21,15 @@
   xmlns:servlet="http://apache.org/cocoon/servlet" xmlns:controller="http://apache.org/cocoon/controller"&gt;
 
   &lt;map:pipelines&gt;
-
     &lt;!-- ~~~~~~~~~~~~~~~~ profiling controller ~~~~~~~~~~~~~~~ --&gt;
     &lt;map:pipeline&gt;
-      &lt;map:match pattern="controller/profiling/{id}.png"&gt;
+      &lt;map:match pattern="{id}.png"&gt;
         &lt;map:serialize type="profilingpng" id="{map:id}" /&gt;
       &lt;/map:match&gt;
-      &lt;map:match pattern="controller/profiling/{id}"&gt;
+      &lt;map:match pattern="{id}"&gt;
         &lt;map:generate type="profiling" id="{map:id}" /&gt;
         &lt;map:serialize type="xml" /&gt;
       &lt;/map:match&gt;
     &lt;/map:pipeline&gt;
-
   &lt;/map:pipelines&gt;
 &lt;/map:sitemap&gt;

Modified: cocoon/cocoon3/trunk/cocoon-profiling/src/test/java/org/apache/cocoon/profiling/TestServletProfiler.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-profiling/src/test/java/org/apache/cocoon/profiling/TestServletProfiler.java?rev=833328&amp;r1=833327&amp;r2=833328&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-profiling/src/test/java/org/apache/cocoon/profiling/TestServletProfiler.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-profiling/src/test/java/org/apache/cocoon/profiling/TestServletProfiler.java
Fri Nov  6 09:36:42 2009
@@ -36,25 +36,25 @@
 
     @Test
     public void testRelativeUrl() {
-        assertEquals("controller/profiling/ID", this.servletProfiler.createRelativeUrl(
+        assertEquals("cocoon-profiling/ID", this.servletProfiler.createRelativeUrl(
                 "http://localhost/myproject/home.html", "ID"));
 
-        assertEquals("../controller/profiling/ID", this.servletProfiler.createRelativeUrl(
+        assertEquals("../cocoon-profiling/ID", this.servletProfiler.createRelativeUrl(
                 "http://localhost/myproject/foo/home.html", "ID"));
 
-        assertEquals("../../controller/profiling/ID", this.servletProfiler.createRelativeUrl(
+        assertEquals("../../cocoon-profiling/ID", this.servletProfiler.createRelativeUrl(
                 "http://localhost/myproject/foo/bar/home.html", "ID"));
 
-        assertEquals("../../../controller/profiling/ID", this.servletProfiler.createRelativeUrl(
+        assertEquals("../../../cocoon-profiling/ID", this.servletProfiler.createRelativeUrl(
                 "http://localhost/myproject/foo/bar/buz/home.html", "ID"));
 
-        assertEquals("../../../controller/profiling/ID", this.servletProfiler.createRelativeUrl(
+        assertEquals("../../../cocoon-profiling/ID", this.servletProfiler.createRelativeUrl(
                 "http://localhost/myproject/foo/bar/buz/home.html?a=1", "ID"));
 
-        assertEquals("../../../controller/profiling/ID", this.servletProfiler.createRelativeUrl(
+        assertEquals("../../../cocoon-profiling/ID", this.servletProfiler.createRelativeUrl(
                 "http://localhost/myproject/foo/bar/buz/home.html?a=1&amp;b=2", "ID"));
 
-        assertEquals("../../../controller/profiling/ID", this.servletProfiler.createRelativeUrl(
+        assertEquals("../../../cocoon-profiling/ID", this.servletProfiler.createRelativeUrl(
                 "http://localhost/myproject/foo/bar/buz/home.html?a=1&amp;b=/", "ID"));
     }
 }

Modified: cocoon/cocoon3/trunk/cocoon-profiling/src/test/resources/org/apache/cocoon/profiling/simple.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-profiling/src/test/resources/org/apache/cocoon/profiling/simple.xml?rev=833328&amp;r1=833327&amp;r2=833328&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-profiling/src/test/resources/org/apache/cocoon/profiling/simple.xml
(original)
+++ cocoon/cocoon3/trunk/cocoon-profiling/src/test/resources/org/apache/cocoon/profiling/simple.xml
Fri Nov  6 09:36:42 2009
@@ -1,17 +1,20 @@
 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
-  &lt;!--
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements. See the NOTICE file distributed with this
-    work for additional information regarding copyright ownership. The ASF
-    licenses this file to you 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
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
-  --&gt;
+      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.
+ --&gt;
 &lt;simple&gt;simple-text&lt;/simple&gt;




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r833327 - in /cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/xpatch: ./ cocoon-block-deployment.xweb</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091106093513.017A6238888F@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091106093513-017A6238888F@eris-apache-org%3e</id>
<updated>2009-11-06T09:35:12Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Fri Nov  6 09:35:12 2009
New Revision: 833327

URL: http://svn.apache.org/viewvc?rev=833327&amp;view=rev
Log:
enable block-deployment (necessary that the blockcontext:/ protocol works)

Added:
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/xpatch/
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/xpatch/cocoon-block-deployment.xweb
  (with props)

Added: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/xpatch/cocoon-block-deployment.xweb
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/xpatch/cocoon-block-deployment.xweb?rev=833327&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/xpatch/cocoon-block-deployment.xweb
(added)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/xpatch/cocoon-block-deployment.xweb
Fri Nov  6 09:35:12 2009
@@ -0,0 +1,29 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+ --&gt;
+&lt;!-- $Id$ --&gt;
+&lt;xweb xpath="/web-app" 
+      unless="comment()[contains(., 'Cocoon Block-Deployment Listener')]" 
+      insert-after="filter-mapping[last()]"&gt;
+
+  &lt;!-- Cocoon Block-Deployment Listener --&gt;
+  &lt;listener&gt;
+    &lt;listener-class&gt;org.apache.cocoon.blockdeployment.BlockDeploymentServletContextListener&lt;/listener-class&gt;
+  &lt;/listener&gt;
+&lt;/xweb&gt;

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/xpatch/cocoon-block-deployment.xweb
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/xpatch/cocoon-block-deployment.xweb
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/xpatch/cocoon-block-deployment.xweb
------------------------------------------------------------------------------
    svn:mime-type = text/xml




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r832898 - /cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/ReloadingServletFilter.java</title>
<author><name>andreas@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200911.mbox/%3c20091104231048.2532F2388874@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091104231048-2532F2388874@eris-apache-org%3e</id>
<updated>2009-11-04T23:10:47Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: andreas
Date: Wed Nov  4 23:10:47 2009
New Revision: 832898

URL: http://svn.apache.org/viewvc?rev=832898&amp;view=rev
Log:
[minor change] fixed typo

Modified:
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/ReloadingServletFilter.java

Modified: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/ReloadingServletFilter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/ReloadingServletFilter.java?rev=832898&amp;r1=832897&amp;r2=832898&amp;view=diff
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/ReloadingServletFilter.java
(original)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/ReloadingServletFilter.java
Wed Nov  4 23:10:47 2009
@@ -79,7 +79,7 @@
         try {
             Thread.currentThread().setContextClassLoader(ReloadingClassloaderManager.getClassLoader(this.context));
 
-            // Inlitialize the actual filter
+            // Initialize the actual filter
             this.filter.init(config);
         } finally {
             Thread.currentThread().setContextClassLoader(old);




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r829840 - in /cocoon/cocoon3/trunk: ./ cocoon-all/ cocoon-archetype-block/ cocoon-archetype-parent/ cocoon-archetype-sample/ cocoon-archetype-webapp/ cocoon-controller/ cocoon-docs/ cocoon-monitoring/ cocoon-optional/ cocoon-pipeline/ cocoo...</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200910.mbox/%3c20091026155337.A8E06238889C@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091026155337-A8E06238889C@eris-apache-org%3e</id>
<updated>2009-10-26T15:53:37Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Mon Oct 26 15:53:36 2009
New Revision: 829840

URL: http://svn.apache.org/viewvc?rev=829840&amp;view=rev
Log:
use the full project name

Modified:
    cocoon/cocoon3/trunk/cocoon-all/pom.xml
    cocoon/cocoon3/trunk/cocoon-archetype-block/pom.xml
    cocoon/cocoon3/trunk/cocoon-archetype-parent/pom.xml
    cocoon/cocoon3/trunk/cocoon-archetype-sample/pom.xml
    cocoon/cocoon3/trunk/cocoon-archetype-webapp/pom.xml
    cocoon/cocoon3/trunk/cocoon-controller/pom.xml
    cocoon/cocoon3/trunk/cocoon-docs/pom.xml
    cocoon/cocoon3/trunk/cocoon-monitoring/pom.xml
    cocoon/cocoon3/trunk/cocoon-optional/pom.xml
    cocoon/cocoon3/trunk/cocoon-pipeline/pom.xml
    cocoon/cocoon3/trunk/cocoon-profiling-firebug/pom.xml
    cocoon/cocoon3/trunk/cocoon-profiling/pom.xml
    cocoon/cocoon3/trunk/cocoon-rest/pom.xml
    cocoon/cocoon3/trunk/cocoon-sample-webapp/pom.xml
    cocoon/cocoon3/trunk/cocoon-sample/pom.xml
    cocoon/cocoon3/trunk/cocoon-sax/pom.xml
    cocoon/cocoon3/trunk/cocoon-servlet/pom.xml
    cocoon/cocoon3/trunk/cocoon-sitemap/pom.xml
    cocoon/cocoon3/trunk/cocoon-stax/pom.xml
    cocoon/cocoon3/trunk/cocoon-stringtemplate/pom.xml
    cocoon/cocoon3/trunk/parent/pom.xml
    cocoon/cocoon3/trunk/pom.xml

Modified: cocoon/cocoon3/trunk/cocoon-all/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-all/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-all/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-all/pom.xml Mon Oct 26 15:53:36 2009
@@ -29,10 +29,12 @@
     &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
     &lt;relativePath&gt;../parent&lt;/relativePath&gt;
   &lt;/parent&gt;
+  
   &lt;groupId&gt;org.apache.cocoon.all&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-all&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
-  &lt;name&gt;Cocoon 3: All dependencies [jar]&lt;/name&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: All dependencies&lt;/name&gt;
   &lt;description&gt;This module can be used to get all Cocoon 3 dependencies in one go.&lt;/description&gt;
 
   &lt;dependencies&gt;

Modified: cocoon/cocoon3/trunk/cocoon-archetype-block/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-archetype-block/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-archetype-block/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-archetype-block/pom.xml Mon Oct 26 15:53:36 2009
@@ -32,5 +32,5 @@
   &lt;groupId&gt;org.apache.cocoon.archetype-block&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-archetype-block&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
-  &lt;name&gt;Cocoon 3: Block Archetype [arch]&lt;/name&gt;
+  &lt;name&gt;Apache Cocoon 3: Block Archetype&lt;/name&gt;
 &lt;/project&gt;

Modified: cocoon/cocoon3/trunk/cocoon-archetype-parent/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-archetype-parent/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-archetype-parent/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-archetype-parent/pom.xml Mon Oct 26 15:53:36 2009
@@ -32,5 +32,6 @@
   &lt;groupId&gt;org.apache.cocoon.archetype-parent&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-archetype-parent&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
-  &lt;name&gt;Cocoon 3: Parent Archetype [arch]&lt;/name&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: Parent Archetype&lt;/name&gt;
 &lt;/project&gt;

Modified: cocoon/cocoon3/trunk/cocoon-archetype-sample/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-archetype-sample/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-archetype-sample/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-archetype-sample/pom.xml Mon Oct 26 15:53:36 2009
@@ -28,10 +28,12 @@
     &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
     &lt;relativePath&gt;../parent/pom.xml&lt;/relativePath&gt;
   &lt;/parent&gt;  
+  
   &lt;groupId&gt;org.apache.cocoon.archetype-sample&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-archetype-sample&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;  
-  &lt;name&gt;Cocoon 3: Sample Archetype [arch]&lt;/name&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: Sample Archetype&lt;/name&gt;
   
   &lt;build&gt;
     &lt;plugins&gt;

Modified: cocoon/cocoon3/trunk/cocoon-archetype-webapp/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-archetype-webapp/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-archetype-webapp/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-archetype-webapp/pom.xml Mon Oct 26 15:53:36 2009
@@ -32,5 +32,6 @@
   &lt;groupId&gt;org.apache.cocoon.archetype-webapp&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-archetype-webapp&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
-  &lt;name&gt;Cocoon 3: Web Application Archetype [arch]&lt;/name&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: Web Application Archetype&lt;/name&gt;
 &lt;/project&gt;

Modified: cocoon/cocoon3/trunk/cocoon-controller/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-controller/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-controller/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-controller/pom.xml Mon Oct 26 15:53:36 2009
@@ -33,7 +33,8 @@
   &lt;groupId&gt;org.apache.cocoon.controller&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-controller&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
-  &lt;name&gt;Cocoon 3: Controller [jar]&lt;/name&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: Controller&lt;/name&gt;
   &lt;description&gt;Controller for Cocoon sitemaps.&lt;/description&gt;
 
   &lt;dependencies&gt;

Modified: cocoon/cocoon3/trunk/cocoon-docs/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-docs/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-docs/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-docs/pom.xml Mon Oct 26 15:53:36 2009
@@ -34,8 +34,9 @@
   &lt;groupId&gt;org.apache.cocoon.docs&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-docs&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
-  &lt;name&gt;Cocoon 3: Documentation&lt;/name&gt;
-  &lt;description&gt;Cocoon 3 - Reference guide and user manuals.&lt;/description&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: Documentation&lt;/name&gt;
+  &lt;description&gt;The website, a reference guide and user manuals.&lt;/description&gt;
 
   &lt;distributionManagement&gt;
     &lt;site&gt;

Modified: cocoon/cocoon3/trunk/cocoon-monitoring/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-monitoring/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-monitoring/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-monitoring/pom.xml Mon Oct 26 15:53:36 2009
@@ -31,7 +31,8 @@
   &lt;groupId&gt;org.apache.cocoon.monitoring&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-monitoring&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
-  &lt;name&gt;Cocoon 3: Monitoring [jar]&lt;/name&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: Monitoring&lt;/name&gt;
   &lt;description&gt;Monitoring support for Cocoon 3.&lt;/description&gt;
 
   &lt;dependencies&gt;

Modified: cocoon/cocoon3/trunk/cocoon-optional/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-optional/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-optional/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-optional/pom.xml Mon Oct 26 15:53:36 2009
@@ -29,10 +29,12 @@
     &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
     &lt;relativePath&gt;../parent&lt;/relativePath&gt;
   &lt;/parent&gt;
+  
   &lt;groupId&gt;org.apache.cocoon.optional&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-optional&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
-  &lt;name&gt;Cocoon 3: Optional [jar]&lt;/name&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: Optional&lt;/name&gt;
   &lt;description&gt;
     This is an optional module for Cocoon 3. It contains all the stuff that requires additional

     3rd-party libraries that shouldn't become part of one of the Cocoon 3 core modules 

Modified: cocoon/cocoon3/trunk/cocoon-pipeline/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-pipeline/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-pipeline/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-pipeline/pom.xml Mon Oct 26 15:53:36 2009
@@ -29,10 +29,12 @@
     &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
     &lt;relativePath&gt;../parent&lt;/relativePath&gt;
   &lt;/parent&gt;
+  
   &lt;groupId&gt;org.apache.cocoon.pipeline&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-pipeline&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
-  &lt;name&gt;Cocoon 3: Pipeline [jar]&lt;/name&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: Pipeline&lt;/name&gt;
   &lt;description&gt;The core of Cocoon 3. A Servlet API independent implementation of pipelines.&lt;/description&gt;
 
   &lt;dependencies&gt;

Modified: cocoon/cocoon3/trunk/cocoon-profiling-firebug/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-profiling-firebug/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-profiling-firebug/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-profiling-firebug/pom.xml Mon Oct 26 15:53:36 2009
@@ -23,7 +23,9 @@
 
   &lt;groupId&gt;org.apache.cocoon.profiling.firebug&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-profiling-firebug&lt;/artifactId&gt;
-  &lt;name&gt;Cocoon 3: Profiling Firebug Plugin [xpi]&lt;/name&gt;
+  &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: Profiling Firebug Plugin&lt;/name&gt;
   &lt;description&gt;Cocoon 3 profiling Firebug plugin.&lt;/description&gt;
 
   &lt;build&gt;

Modified: cocoon/cocoon3/trunk/cocoon-profiling/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-profiling/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-profiling/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-profiling/pom.xml Mon Oct 26 15:53:36 2009
@@ -32,8 +32,9 @@
 
   &lt;groupId&gt;org.apache.cocoon.profiling&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-profiling&lt;/artifactId&gt;
-  &lt;name&gt;Cocoon 3: Profiling [jar]&lt;/name&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: Profiling&lt;/name&gt;
   &lt;description&gt;Cocoon 3 profiling components.&lt;/description&gt;
 
   &lt;dependencies&gt;

Modified: cocoon/cocoon3/trunk/cocoon-rest/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-rest/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-rest/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-rest/pom.xml Mon Oct 26 15:53:36 2009
@@ -33,7 +33,8 @@
   &lt;groupId&gt;org.apache.cocoon.rest&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-rest&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
-  &lt;name&gt;Cocoon 3: REST support [jar]&lt;/name&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: REST support&lt;/name&gt;
   &lt;description&gt;RESTful web services with Cocoon 3.&lt;/description&gt;
 
   &lt;dependencies&gt;

Modified: cocoon/cocoon3/trunk/cocoon-sample-webapp/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-webapp/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-webapp/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-sample-webapp/pom.xml Mon Oct 26 15:53:36 2009
@@ -33,7 +33,9 @@
   &lt;groupId&gt;org.apache.cocoon.sample-webapp&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-sample-webapp&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
-  &lt;name&gt;Cocoon 3: Webapplication sample [war]&lt;/name&gt;  
+  
+  &lt;name&gt;Apache Cocoon 3: Webapplication sample&lt;/name&gt;  
+  &lt;description&gt;A web application module that contains all samples.&lt;/description&gt;
 
   &lt;build&gt;
     &lt;plugins&gt;

Modified: cocoon/cocoon3/trunk/cocoon-sample/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-sample/pom.xml Mon Oct 26 15:53:36 2009
@@ -33,7 +33,8 @@
   &lt;groupId&gt;org.apache.cocoon.sample&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-sample&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
-  &lt;name&gt;Cocoon 3: Sample [jar]&lt;/name&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: Sample&lt;/name&gt;
   &lt;description&gt;Cocoon 3 samples.&lt;/description&gt;
 
   &lt;dependencies&gt;

Modified: cocoon/cocoon3/trunk/cocoon-sax/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-sax/pom.xml Mon Oct 26 15:53:36 2009
@@ -29,10 +29,12 @@
     &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
     &lt;relativePath&gt;../parent&lt;/relativePath&gt;
   &lt;/parent&gt;
+  
   &lt;groupId&gt;org.apache.cocoon.sax&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-sax&lt;/artifactId&gt;
-  &lt;name&gt;Cocoon 3: SAX [jar]&lt;/name&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
+
+  &lt;name&gt;Apache Cocoon 3: SAX&lt;/name&gt;
   &lt;description&gt;Cocoon 3 SAX pipeline components.&lt;/description&gt;
 
   &lt;dependencies&gt;

Modified: cocoon/cocoon3/trunk/cocoon-servlet/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-servlet/pom.xml Mon Oct 26 15:53:36 2009
@@ -33,7 +33,8 @@
   &lt;groupId&gt;org.apache.cocoon.servlet&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-servlet&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
-  &lt;name&gt;Cocoon 3: Servlet [jar]&lt;/name&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: Servlet&lt;/name&gt;
   &lt;description&gt;Using Cocoon 3 within the Servlet Service framework.&lt;/description&gt;
 
   &lt;dependencies&gt;

Modified: cocoon/cocoon3/trunk/cocoon-sitemap/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sitemap/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sitemap/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-sitemap/pom.xml Mon Oct 26 15:53:36 2009
@@ -33,7 +33,8 @@
   &lt;groupId&gt;org.apache.cocoon.sitemap&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-sitemap&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
-  &lt;name&gt;Cocoon 3: Sitemap [jar]&lt;/name&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: Sitemap&lt;/name&gt;
   &lt;description&gt;A sitemap language interpreter.&lt;/description&gt;
 
   &lt;dependencies&gt;

Modified: cocoon/cocoon3/trunk/cocoon-stax/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stax/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stax/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-stax/pom.xml Mon Oct 26 15:53:36 2009
@@ -29,8 +29,9 @@
 
   &lt;groupId&gt;org.apache.cocoon.stax&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-stax&lt;/artifactId&gt;
-  &lt;name&gt;Cocoon 3: StAX [jar]&lt;/name&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: StAX&lt;/name&gt;
   &lt;description&gt;Cocoon 3 components required for building StAX pipelines and components.&lt;/description&gt;
 
   &lt;dependencies&gt;

Modified: cocoon/cocoon3/trunk/cocoon-stringtemplate/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stringtemplate/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stringtemplate/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-stringtemplate/pom.xml Mon Oct 26 15:53:36 2009
@@ -33,7 +33,8 @@
   &lt;groupId&gt;org.apache.cocoon.stringtemplate&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-stringtemplate&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
-  &lt;name&gt;Cocoon 3: String Templates [jar]&lt;/name&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: String Templates&lt;/name&gt;
   &lt;description&gt;String-Template support for Cocoon 3.&lt;/description&gt;
 
   &lt;dependencies&gt;

Modified: cocoon/cocoon3/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/parent/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/parent/pom.xml (original)
+++ cocoon/cocoon3/trunk/parent/pom.xml Mon Oct 26 15:53:36 2009
@@ -28,11 +28,16 @@
     &lt;artifactId&gt;apache&lt;/artifactId&gt;
     &lt;version&gt;4&lt;/version&gt;
   &lt;/parent&gt;
+  
   &lt;groupId&gt;org.apache.cocoon.parent&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-parent&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
-  &lt;name&gt;Cocoon 3: Parent [pom]&lt;/name&gt;
-  &lt;description&gt;Cocoon 3 Parent POM module contains all basic configurations for the
Maven 2 based build system.&lt;/description&gt;
+  
+  &lt;name&gt;Apache Cocoon 3: Parent&lt;/name&gt;
+  &lt;description&gt;
+    The Apache Cocoon 3 Parent POM module contains all basic configurations 
+    for the Maven 2 based build system.
+  &lt;/description&gt;
   &lt;inceptionYear&gt;2008&lt;/inceptionYear&gt;
 
   &lt;developers&gt;
@@ -778,6 +783,11 @@
           &lt;plugin&gt;
             &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
             &lt;artifactId&gt;rat-maven-plugin&lt;/artifactId&gt;
+            &lt;configuration&gt;
+              &lt;excludes&gt;
+                &lt;exclude&gt;bin&lt;/exclude&gt;
+              &lt;/excludes&gt;            
+            &lt;/configuration&gt;
             &lt;executions&gt;
               &lt;execution&gt;
                 &lt;phase&gt;verify&lt;/phase&gt;

Modified: cocoon/cocoon3/trunk/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/pom.xml?rev=829840&amp;r1=829839&amp;r2=829840&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/pom.xml (original)
+++ cocoon/cocoon3/trunk/pom.xml Mon Oct 26 15:53:36 2009
@@ -24,9 +24,10 @@
   &lt;groupId&gt;org.apache.cocoon.root&lt;/groupId&gt;
   &lt;artifactId&gt;cocoon-root&lt;/artifactId&gt;
   &lt;version&gt;3.0.0-alpha-2-SNAPSHOT&lt;/version&gt;
-  &lt;name&gt;Cocoon 3: Root [pom]&lt;/name&gt;
+  
   &lt;!-- Cocoon 3 Root. Required because of  http://maven.markmail.org/message/5m5uhkdczmghqxsk
--&gt;
-
+  &lt;name&gt;Apache Cocoon 3: Root&lt;/name&gt;
+  
   &lt;modules&gt;  
     &lt;module&gt;cocoon-all&lt;/module&gt;
     &lt;module&gt;cocoon-controller&lt;/module&gt;    
@@ -55,7 +56,7 @@
       &lt;/plugin&gt; 
       &lt;plugin&gt;
         &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
-        &lt;version&gt;2.5.1&lt;/version&gt;
+        &lt;version&gt;2.7&lt;/version&gt;
       &lt;/plugin&gt;
       &lt;plugin&gt;
         &lt;artifactId&gt;maven-idea-plugin&lt;/artifactId&gt;




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r826480 - /cocoon/cocoon3/trunk/parent/pom.xml</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200910.mbox/%3c20091018182215.998DF23888BD@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091018182215-998DF23888BD@eris-apache-org%3e</id>
<updated>2009-10-18T18:22:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Sun Oct 18 18:22:15 2009
New Revision: 826480

URL: http://svn.apache.org/viewvc?rev=826480&amp;view=rev
Log:
upgrade plugin versions, fix missing plugin versions, upgrade some dependencies to latest
version (commons-lang, woodstorx, xmlunit) --&gt; thanks to the Mojo Versions Maven plugin

Modified:
    cocoon/cocoon3/trunk/parent/pom.xml

Modified: cocoon/cocoon3/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/parent/pom.xml?rev=826480&amp;r1=826479&amp;r2=826480&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/parent/pom.xml (original)
+++ cocoon/cocoon3/trunk/parent/pom.xml Sun Oct 18 18:22:15 2009
@@ -292,7 +292,7 @@
       &lt;dependency&gt;
         &lt;groupId&gt;commons-lang&lt;/groupId&gt;
         &lt;artifactId&gt;commons-lang&lt;/artifactId&gt;
-        &lt;version&gt;2.3&lt;/version&gt;
+        &lt;version&gt;2.4&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;commons-logging&lt;/groupId&gt;
@@ -354,7 +354,7 @@
       &lt;dependency&gt;
         &lt;groupId&gt;org.codehaus.woodstox&lt;/groupId&gt;
         &lt;artifactId&gt;wstx-asl&lt;/artifactId&gt;
-        &lt;version&gt;3.2.7&lt;/version&gt;
+        &lt;version&gt;3.2.9&lt;/version&gt;
       &lt;/dependency&gt;      
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.xmlgraphics&lt;/groupId&gt;
@@ -461,7 +461,7 @@
         &lt;groupId&gt;xmlunit&lt;/groupId&gt;
         &lt;artifactId&gt;xmlunit&lt;/artifactId&gt;
         &lt;scope&gt;test&lt;/scope&gt;
-        &lt;version&gt;1.2&lt;/version&gt;
+        &lt;version&gt;1.3&lt;/version&gt;
       &lt;/dependency&gt;      
     &lt;/dependencies&gt;
   &lt;/dependencyManagement&gt;
@@ -526,6 +526,10 @@
             &lt;/manifestEntries&gt;
           &lt;/archive&gt;
         &lt;/configuration&gt;
+      &lt;/plugin&gt;     
+      &lt;plugin&gt;
+        &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
+        &lt;artifactId&gt;versions-maven-plugin&lt;/artifactId&gt;
       &lt;/plugin&gt;      
     &lt;/plugins&gt;
     &lt;pluginManagement&gt;
@@ -558,6 +562,18 @@
           &lt;version&gt;2.1&lt;/version&gt;
         &lt;/plugin&gt;
         &lt;plugin&gt;
+          &lt;artifactId&gt;maven-clean-plugin&lt;/artifactId&gt;
+          &lt;version&gt;2.3&lt;/version&gt;
+        &lt;/plugin&gt;  
+        &lt;plugin&gt;
+          &lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
+          &lt;version&gt;2.4&lt;/version&gt;
+        &lt;/plugin&gt;      
+        &lt;plugin&gt;
+          &lt;artifactId&gt;maven-install-plugin&lt;/artifactId&gt;
+          &lt;version&gt;2.3&lt;/version&gt;
+        &lt;/plugin&gt;        
+        &lt;plugin&gt;
           &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
           &lt;version&gt;2.2-beta-2&lt;/version&gt;        
         &lt;/plugin&gt;
@@ -605,6 +621,11 @@
           &lt;version&gt;1.0-alpha-3&lt;/version&gt;
         &lt;/plugin&gt;  
         &lt;plugin&gt;
+          &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
+          &lt;artifactId&gt;versions-maven-plugin&lt;/artifactId&gt;
+          &lt;version&gt;1.0&lt;/version&gt;
+        &lt;/plugin&gt;         
+        &lt;plugin&gt;
           &lt;groupId&gt;org.codehaus.groovy.maven&lt;/groupId&gt;
           &lt;artifactId&gt;gmaven-plugin&lt;/artifactId&gt;
           &lt;version&gt;1.0-rc-3&lt;/version&gt;        




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r825435 - /cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/solr/SolrConsumer.java</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200910.mbox/%3c20091015083302.7AE122388907@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091015083302-7AE122388907@eris-apache-org%3e</id>
<updated>2009-10-15T08:33:02Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Oct 15 08:33:02 2009
New Revision: 825435

URL: http://svn.apache.org/viewvc?rev=825435&amp;view=rev
Log:
formatting

Modified:
    cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/solr/SolrConsumer.java

Modified: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/solr/SolrConsumer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/solr/SolrConsumer.java?rev=825435&amp;r1=825434&amp;r2=825435&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/solr/SolrConsumer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/solr/SolrConsumer.java
Thu Oct 15 08:33:02 2009
@@ -69,7 +69,6 @@
             if (atts.getValue("null") != null) {
                 this.isNull = StrUtils.parseBoolean(atts.getValue("null"));
             }
-
         }
 
         this.getSAXConsumer().startElement(uri, localName, qName, atts);
@@ -96,6 +95,7 @@
                 this.boost = 1.0f;
             }
         }
+
         this.getSAXConsumer().endElement(uri, localName, qName);
     }
 }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r825433 - /cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/solr/SolrConsumer.java</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200910.mbox/%3c20091015082920.D1B8B23888D0@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091015082920-D1B8B23888D0@eris-apache-org%3e</id>
<updated>2009-10-15T08:29:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Oct 15 08:29:20 2009
New Revision: 825433

URL: http://svn.apache.org/viewvc?rev=825433&amp;view=rev
Log:
COCOON-43
The SAXConsumer interfaces is already inherited from AbstractSAXTransformer

Modified:
    cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/solr/SolrConsumer.java

Modified: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/solr/SolrConsumer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/solr/SolrConsumer.java?rev=825433&amp;r1=825432&amp;r2=825433&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/solr/SolrConsumer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/solr/SolrConsumer.java
Thu Oct 15 08:29:20 2009
@@ -22,7 +22,6 @@
 
 import org.apache.cocoon.pipeline.ProcessingException;
 import org.apache.cocoon.sax.AbstractSAXTransformer;
-import org.apache.cocoon.sax.SAXConsumer;
 import org.apache.solr.client.solrj.SolrServer;
 import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer;
 import org.apache.solr.common.SolrInputDocument;
@@ -30,7 +29,7 @@
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 
-public class SolrConsumer extends AbstractSAXTransformer implements SAXConsumer {
+public class SolrConsumer extends AbstractSAXTransformer {
 
     private SolrServer solr = null;
     private boolean isNull = false;




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r825426 - /cocoon/cocoon3/trunk/cocoon-docs/src/changes/changes.xml</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200910.mbox/%3c20091015075237.E1D1323888D0@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091015075237-E1D1323888D0@eris-apache-org%3e</id>
<updated>2009-10-15T07:52:37Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Oct 15 07:52:37 2009
New Revision: 825426

URL: http://svn.apache.org/viewvc?rev=825426&amp;view=rev
Log:
. Solr consumer
. EncodingXMLSerializer, EncodingXHTMLSerializer, EncodingHTMLSerializer that use the cocoon-serializers-charsets
library instead of JAXP

Modified:
    cocoon/cocoon3/trunk/cocoon-docs/src/changes/changes.xml

Modified: cocoon/cocoon3/trunk/cocoon-docs/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-docs/src/changes/changes.xml?rev=825426&amp;r1=825425&amp;r2=825426&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-docs/src/changes/changes.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-docs/src/changes/changes.xml Thu Oct 15 07:52:37 2009
@@ -157,6 +157,13 @@
         Vienna University of Technology and to their assistant professor Dr. Alexander Schatten.
       &lt;/action&gt;
              
+      &lt;action dev="reinhard" type="add"&gt;
+        [cocoon-optional] Add serializers (XML, XHTML, HTML) that use the Apache Cocoon Serializers
Charset serializers
+        that don't rely on the JAXP API and circumvent some Xalan bugs.
+      &lt;/action&gt;       
+      &lt;action dev="thorsten" type="add" issue="COCOON3-43" due-to="Bertil Chapuis"&gt;
+        [cocoon-optional] Add a SolrConsumer that creates and adds SolrDocuments to a Solr
instance.
+      &lt;/action&gt;       
       &lt;action dev="reinhard" type="add" issue="COCOON3-7" due-to="Simone Tripodi"&gt;
         [cocoon-optional] Add a formatting objects serializer using Apache FOP.
       &lt;/action&gt;       




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r825425 - in /cocoon/cocoon3/trunk: cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/ cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/ cocoon-optional/src/main/java/org/apache/cocoon/optional/serv...</title>
<author><name>reinhard@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cocoon-cvs/200910.mbox/%3c20091015075129.245D023888D0@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091015075129-245D023888D0@eris-apache-org%3e</id>
<updated>2009-10-15T07:51:28Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: reinhard
Date: Thu Oct 15 07:51:28 2009
New Revision: 825425

URL: http://svn.apache.org/viewvc?rev=825425&amp;view=rev
Log:
add EncodingXMLSerializer, EncodingXHTMLSerializer, EncodingHTMLSerializer that use the cocoon-serializers-charsets
library instead of JAXP
add integration tests
add samples

Added:
    cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/
    cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/
    cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/
    cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/
    cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingHTMLSerializer.java
  (with props)
    cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingXHTMLSerializer.java
  (with props)
    cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingXMLSerializer.java
  (with props)
    cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/util/
    cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/util/ConfigurationUtils.java
  (with props)
    cocoon/cocoon3/trunk/cocoon-optional/src/main/resources/META-INF/cocoon/spring-optional/cocoon-optional-serializers.xml
  (with props)
    cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/SerializersTest.java
  (with props)
Modified:
    cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/ExpressionLanguageTest.java
    cocoon/cocoon3/trunk/cocoon-sample/pom.xml
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/overview.html
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap
    cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/spring/cocoon-sample-sitemap-components-optional.xml

Added: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingHTMLSerializer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingHTMLSerializer.java?rev=825425&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingHTMLSerializer.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingHTMLSerializer.java
Thu Oct 15 07:51:28 2009
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.optional.servlet.components.sax.serializers;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.Map;
+
+import org.apache.cocoon.components.serializers.util.EncodingSerializer;
+import org.apache.cocoon.optional.servlet.components.sax.serializers.util.ConfigurationUtils;
+import org.apache.cocoon.pipeline.SetupException;
+import org.apache.cocoon.pipeline.caching.CacheKey;
+import org.apache.cocoon.pipeline.caching.ParameterCacheKey;
+import org.apache.cocoon.pipeline.component.CachingPipelineComponent;
+import org.apache.cocoon.pipeline.component.Finisher;
+import org.apache.cocoon.pipeline.util.StringRepresentation;
+import org.apache.cocoon.sax.SAXConsumer;
+import org.apache.cocoon.sax.SAXPipelineComponent;
+import org.apache.cocoon.servlet.util.HttpContextHelper;
+
+/**
+ * &lt;p&gt;
+ * A serializer converting XHTML into plain old HTML.
+ * &lt;/p&gt;
+ * 
+ * &lt;p&gt;
+ * For configuration options of this serializer, please look at the {@link EncodingXHTMLSerializer}
and
+ * {@link EncodingSerializer}.
+ * &lt;/p&gt;
+ * 
+ * &lt;p&gt;
+ * Any of the XHTML document type declared or used will be converted into its HTML 4.01 counterpart,
+ * and in addition to those a "compatible" doctype can be supported to exploit a couple of
shortcuts
+ * into MSIE's rendering engine. The values for the &lt;code&gt;doctype-default&lt;/code&gt;
can then be:
+ * &lt;/p&gt;
+ * 
+ * &lt;dl&gt;
+ * &lt;dt&gt;"&lt;code&gt;none&lt;/code&gt;"&lt;/dt&gt;
+ * &lt;dd&gt;Not to emit any dococument type declaration.&lt;/dd&gt;
+ * &lt;dt&gt;"&lt;code&gt;compatible&lt;/code&gt;"&lt;/dt&gt;
+ * &lt;dd&gt;The HTML 4.01 Transitional (exploiting MSIE shortcut).&lt;/dd&gt;
+ * &lt;dt&gt;"&lt;code&gt;strict&lt;/code&gt;"&lt;/dt&gt;
+ * &lt;dd&gt;The HTML 4.01 Strict document type.&lt;/dd&gt;
+ * &lt;dt&gt;"&lt;code&gt;loose&lt;/code&gt;"&lt;/dt&gt;
+ * &lt;dd&gt;The HTML 4.01 Transitional document type.&lt;/dd&gt;
+ * &lt;dt&gt;"&lt;code&gt;frameset&lt;/code&gt;"&lt;/dt&gt;
+ * &lt;dd&gt;The HTML 4.01 Frameset document type.&lt;/dd&gt;
+ * &lt;/dl&gt;
+ *
+ * @version $Id$
+ */
+public class EncodingHTMLSerializer extends org.apache.cocoon.components.serializers.util.HTMLSerializer
implements
+        SAXPipelineComponent, Finisher, SAXConsumer, CachingPipelineComponent {
+
+    private String encoding;
+    private int indent = 0;
+    private String docType;
+
+    public CacheKey constructCacheKey() {
+        ParameterCacheKey parameterCacheKey = new ParameterCacheKey();
+        parameterCacheKey.addParameter("encoding", this.encoding);
+        parameterCacheKey.addParameter("indent", this.indent);
+        parameterCacheKey.addParameter("docType", this.docType);
+        return parameterCacheKey;
+    }
+
+    public void finish() {
+    }
+
+    public String getContentType() {
+        return this.getMimeType();
+    }
+
+    public void setConfiguration(Map&lt;String, ? extends Object&gt; configuration) {
+        try {
+            this.encoding = ConfigurationUtils.getEncoding(configuration);
+            this.setEncoding(this.encoding);
+        } catch (UnsupportedEncodingException e) {
+            throw new SetupException(e);
+        }
+
+        try {
+            this.indent = ConfigurationUtils.getIndent(configuration);
+            this.setIndentPerLevel(this.indent);
+        } catch (NumberFormatException nfe) {
+            throw new SetupException(nfe);
+        }
+
+        this.docType = (String) configuration.get("doctype-default");
+        this.setDoctypeDefault(this.docType);
+    }
+
+    @Override
+    public void setOutputStream(OutputStream outputStream) {
+        try {
+            super.setOutputStream(outputStream);
+        } catch (IOException e) {
+            throw new SetupException(e);
+        }
+    }
+
+    public void setup(Map&lt;String, Object&gt; parameters) {
+        this.setup(HttpContextHelper.getRequest(parameters));
+    }
+
+    @Override
+    public String toString() {
+        return StringRepresentation.buildString(this);
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingHTMLSerializer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingHTMLSerializer.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingHTMLSerializer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingXHTMLSerializer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingXHTMLSerializer.java?rev=825425&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingXHTMLSerializer.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingXHTMLSerializer.java
Thu Oct 15 07:51:28 2009
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.optional.servlet.components.sax.serializers;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.Map;
+
+import org.apache.cocoon.optional.servlet.components.sax.serializers.util.ConfigurationUtils;
+import org.apache.cocoon.pipeline.SetupException;
+import org.apache.cocoon.pipeline.caching.CacheKey;
+import org.apache.cocoon.pipeline.caching.ParameterCacheKey;
+import org.apache.cocoon.pipeline.component.CachingPipelineComponent;
+import org.apache.cocoon.pipeline.component.Finisher;
+import org.apache.cocoon.pipeline.util.StringRepresentation;
+import org.apache.cocoon.sax.SAXConsumer;
+import org.apache.cocoon.sax.SAXPipelineComponent;
+import org.apache.cocoon.servlet.util.HttpContextHelper;
+
+/**
+ * &lt;p&gt;
+ * A pedantinc XHTML serializer encoding all recognized entities with their proper HTML names.
+ * &lt;/p&gt;
+ * 
+ * &lt;p&gt;
+ * For configuration options of this serializer, please look at the
+ * {@link org.apache.cocoon.components.serializers.util.EncodingSerializer}, in addition
to those,
+ * this serializer also support the specification of a default doctype. This default will
be used if
+ * no document type is received in the SAX events, and can be configured in the following
way:
+ * &lt;/p&gt;
+ * 
+ * &lt;pre&gt;
+ * &amp;lt;map:serialize type=&amp;quot;exhtml&amp;quot; doctype-default=&amp;quot;mytype&amp;quot;
/&amp;gt;
+ * &lt;/pre&gt;
+ * 
+ * &lt;p&gt;
+ * The value &lt;i&gt;mytype&lt;/i&gt; can be one of:
+ * &lt;/p&gt;
+ * 
+ * &lt;dl&gt;
+ * &lt;dt&gt;"&lt;code&gt;none&lt;/code&gt;"&lt;/dt&gt;
+ * &lt;dd&gt;Not to emit any dococument type declaration.&lt;/dd&gt;
+ * &lt;dt&gt;"&lt;code&gt;strict&lt;/code&gt;"&lt;/dt&gt;
+ * &lt;dd&gt;The XHTML 1.0 Strict document type.&lt;/dd&gt;
+ * &lt;dt&gt;"&lt;code&gt;loose&lt;/code&gt;"&lt;/dt&gt;
+ * &lt;dd&gt;The XHTML 1.0 Transitional document type.&lt;/dd&gt;
+ * &lt;dt&gt;"&lt;code&gt;frameset&lt;/code&gt;"&lt;/dt&gt;
+ * &lt;dd&gt;The XHTML 1.0 Frameset document type.&lt;/dd&gt;
+ * &lt;/dl&gt;
+ * 
+ *
+ * @version $Id$
+ */
+public class EncodingXHTMLSerializer extends org.apache.cocoon.components.serializers.util.XHTMLSerializer
implements
+        SAXPipelineComponent, Finisher, SAXConsumer, CachingPipelineComponent {
+
+    private String encoding;
+    private int indent = 0;
+    private String omitXmlDeclaration;
+    private String docType;
+
+    public CacheKey constructCacheKey() {
+        ParameterCacheKey parameterCacheKey = new ParameterCacheKey();
+        parameterCacheKey.addParameter("encoding", this.encoding);
+        parameterCacheKey.addParameter("indent", this.indent);
+        parameterCacheKey.addParameter("docType", this.docType);
+        parameterCacheKey.addParameter("omitXmlDeclaration", this.omitXmlDeclaration);
+        return parameterCacheKey;
+    }
+
+    public void finish() {
+    }
+
+    public String getContentType() {
+        return this.getMimeType();
+    }
+
+    public void setConfiguration(Map&lt;String, ? extends Object&gt; configuration) {
+        try {
+            this.encoding = ConfigurationUtils.getEncoding(configuration);
+            this.setEncoding(this.encoding);
+        } catch (UnsupportedEncodingException e) {
+            throw new SetupException(e);
+        }
+
+        try {
+            this.indent = ConfigurationUtils.getIndent(configuration);
+            this.setIndentPerLevel(this.indent);
+        } catch (NumberFormatException nfe) {
+            throw new SetupException(nfe);
+        }
+
+        this.omitXmlDeclaration = (String) configuration.get("omit-xml-declaration");
+        this.setOmitXmlDeclaration(this.omitXmlDeclaration);
+
+        this.docType = (String) configuration.get("doctype-default");
+        this.setDoctypeDefault(this.docType);
+    }
+
+    @Override
+    public void setOutputStream(OutputStream outputStream) {
+        try {
+            super.setOutputStream(outputStream);
+        } catch (IOException e) {
+            throw new SetupException(e);
+        }
+    }
+
+    public void setup(Map&lt;String, Object&gt; parameters) {
+        this.setup(HttpContextHelper.getRequest(parameters));
+    }
+
+    @Override
+    public String toString() {
+        return StringRepresentation.buildString(this);
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingXHTMLSerializer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingXHTMLSerializer.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingXHTMLSerializer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingXMLSerializer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingXMLSerializer.java?rev=825425&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingXMLSerializer.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingXMLSerializer.java
Thu Oct 15 07:51:28 2009
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.optional.servlet.components.sax.serializers;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.Map;
+
+import org.apache.cocoon.optional.servlet.components.sax.serializers.util.ConfigurationUtils;
+import org.apache.cocoon.pipeline.SetupException;
+import org.apache.cocoon.pipeline.caching.CacheKey;
+import org.apache.cocoon.pipeline.caching.ParameterCacheKey;
+import org.apache.cocoon.pipeline.component.CachingPipelineComponent;
+import org.apache.cocoon.pipeline.component.Finisher;
+import org.apache.cocoon.pipeline.util.StringRepresentation;
+import org.apache.cocoon.sax.SAXConsumer;
+import org.apache.cocoon.sax.SAXPipelineComponent;
+import org.apache.cocoon.servlet.util.HttpContextHelper;
+
+/**
+ * &lt;p&gt;
+ * A fancy XML serializer not relying on the JAXP API.
+ * &lt;/p&gt;
+ *
+ * @version $Id$
+ */
+public class EncodingXMLSerializer extends org.apache.cocoon.components.serializers.util.XMLSerializer
implements
+        SAXPipelineComponent, Finisher, SAXConsumer, CachingPipelineComponent {
+
+    private String encoding;
+    private int indent = 0;
+
+    public CacheKey constructCacheKey() {
+        ParameterCacheKey parameterCacheKey = new ParameterCacheKey();
+        parameterCacheKey.addParameter("encoding", this.encoding);
+        parameterCacheKey.addParameter("indent", this.indent);
+        return parameterCacheKey;
+    }
+
+    public void finish() {
+    }
+
+    public String getContentType() {
+        return this.getMimeType();
+    }
+
+    public void setConfiguration(Map&lt;String, ? extends Object&gt; configuration) {
+        try {
+            this.encoding = ConfigurationUtils.getEncoding(configuration);
+            this.setEncoding(this.encoding);
+        } catch (UnsupportedEncodingException e) {
+            throw new SetupException(e);
+        }
+
+        try {
+            this.indent = ConfigurationUtils.getIndent(configuration);
+            this.setIndentPerLevel(this.indent);
+        } catch (NumberFormatException nfe) {
+            throw new SetupException(nfe);
+        }
+
+    }
+
+    @Override
+    public void setOutputStream(OutputStream outputStream) {
+        try {
+            super.setOutputStream(outputStream);
+        } catch (IOException e) {
+            throw new SetupException(e);
+        }
+    }
+
+    public void setup(Map&lt;String, Object&gt; parameters) {
+        this.setup(HttpContextHelper.getRequest(parameters));
+    }
+
+    @Override
+    public String toString() {
+        return StringRepresentation.buildString(this);
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingXMLSerializer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingXMLSerializer.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/EncodingXMLSerializer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/util/ConfigurationUtils.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/util/ConfigurationUtils.java?rev=825425&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/util/ConfigurationUtils.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/util/ConfigurationUtils.java
Thu Oct 15 07:51:28 2009
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.optional.servlet.components.sax.serializers.util;
+
+import java.util.Map;
+
+public class ConfigurationUtils {
+
+    private ConfigurationUtils() {
+    }
+
+    public static String getEncoding(Map&lt;String, ? extends Object&gt; configuration) {
+        String encoding = (String) configuration.get("encoding");
+    
+        if (encoding == null || "".equals(encoding)) {
+            encoding = "UTF-8";
+        }
+    
+        return encoding;
+    }
+
+    public static int getIndent(Map&lt;String, ? extends Object&gt; configuration) {
+        int indent = 0;
+        String indentConf = (String) configuration.get("indent");
+        if (indentConf != null &amp;&amp; !"".equals(indentConf)) {
+            indent = Integer.parseInt(indentConf);
+        }
+        return indent;
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/util/ConfigurationUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/util/ConfigurationUtils.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/servlet/components/sax/serializers/util/ConfigurationUtils.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-optional/src/main/resources/META-INF/cocoon/spring-optional/cocoon-optional-serializers.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-optional/src/main/resources/META-INF/cocoon/spring-optional/cocoon-optional-serializers.xml?rev=825425&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-optional/src/main/resources/META-INF/cocoon/spring-optional/cocoon-optional-serializers.xml
(added)
+++ cocoon/cocoon3/trunk/cocoon-optional/src/main/resources/META-INF/cocoon/spring-optional/cocoon-optional-serializers.xml
Thu Oct 15 07:51:28 2009
@@ -0,0 +1,32 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+ --&gt;
+&lt;!-- $Id$ --&gt;
+&lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"&gt;
+
+  &lt;bean name="serializer:exml" class="org.apache.cocoon.optional.servlet.components.sax.serializers.EncodingXMLSerializer"

+    scope="prototype" /&gt;
+
+  &lt;bean name="serializer:exhtml" class="org.apache.cocoon.optional.servlet.components.sax.serializers.EncodingXHTMLSerializer"

+    scope="prototype" /&gt;
+
+  &lt;bean name="serializer:ehtml" class="org.apache.cocoon.optional.servlet.components.sax.serializers.EncodingHTMLSerializer"

+    scope="prototype" /&gt;
+&lt;/beans&gt;

Propchange: cocoon/cocoon3/trunk/cocoon-optional/src/main/resources/META-INF/cocoon/spring-optional/cocoon-optional-serializers.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-optional/src/main/resources/META-INF/cocoon/spring-optional/cocoon-optional-serializers.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-optional/src/main/resources/META-INF/cocoon/spring-optional/cocoon-optional-serializers.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/ExpressionLanguageTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/ExpressionLanguageTest.java?rev=825425&amp;r1=825424&amp;r2=825425&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/ExpressionLanguageTest.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/ExpressionLanguageTest.java
Thu Oct 15 07:51:28 2009
@@ -57,5 +57,4 @@
         assertEquals("text/xml", this.response.getContentType());
         this.assertXPath("/simple", "simple-text");
     }
-
 }

Added: cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/SerializersTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/SerializersTest.java?rev=825425&amp;view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/SerializersTest.java
(added)
+++ cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/SerializersTest.java
Thu Oct 15 07:51:28 2009
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.cocoon.it;
+
+/**
+ * Test the serializers components.
+ */
+public class SerializersTest extends CocoonHtmlUnitTestCase {
+
+    public void testEXML() throws Exception {
+        this.loadResponse("/serializers/exml");
+        assertTrue(this.response.getStatusCode() == 200);
+        assertEquals("text/xml", this.response.getContentType());
+        assertEquals("utf-8", this.response.getContentCharSet());
+        assertTrue(this.response.getContentAsString().indexOf("-//W3C//DTD XHTML 1.0 Strict//EN")
== -1);
+    }
+
+    public void testEXHTML() throws Exception {
+        this.loadResponse("/serializers/exhtml");
+        assertTrue(this.response.getStatusCode() == 200);
+        assertEquals("text/html", this.response.getContentType());
+        assertEquals("utf-8", this.response.getContentCharSet());
+        assertTrue(this.response.getContentAsString().indexOf("-//W3C//DTD XHTML 1.0 Strict//EN")
&gt; 0);
+    }
+
+    public void testEHTML() throws Exception {
+        this.loadResponse("/serializers/ehtml");
+        assertTrue(this.response.getStatusCode() == 200);
+        assertEquals("text/html", this.response.getContentType());
+        assertEquals("iso-8859-1", this.response.getContentCharSet());
+        assertTrue(this.response.getContentAsString().indexOf("-//W3C//DTD HTML 4.01 Transitional//EN")
&gt; 0);
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/SerializersTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/SerializersTest.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sample-webapp/src/test/java/org/apache/cocoon/it/SerializersTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cocoon/cocoon3/trunk/cocoon-sample/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/pom.xml?rev=825425&amp;r1=825424&amp;r2=825425&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-sample/pom.xml Thu Oct 15 07:51:28 2009
@@ -67,7 +67,11 @@
     &lt;dependency&gt;
       &lt;groupId&gt;org.apache.xmlgraphics&lt;/groupId&gt;
       &lt;artifactId&gt;fop&lt;/artifactId&gt;
-    &lt;/dependency&gt;        
+    &lt;/dependency&gt;      
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.cocoon&lt;/groupId&gt;
+      &lt;artifactId&gt;cocoon-serializers-charsets&lt;/artifactId&gt;
+    &lt;/dependency&gt;      
     
     &lt;!-- Other dependencies --&gt;
     &lt;dependency&gt;

Modified: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/overview.html
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/overview.html?rev=825425&amp;r1=825424&amp;r2=825425&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/overview.html (original)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/overview.html Thu Oct 15
07:51:28 2009
@@ -109,5 +109,11 @@
   &lt;ul&gt;
   	&lt;li&gt;&lt;a href="fop/test.pdf"&gt;PDF&lt;/a&gt;: Create a PDF document by using Apache
FOP.&lt;/li&gt;
   &lt;/ul&gt;
+  &lt;h2&gt;Encoding Serializers&lt;/h2&gt;
+  &lt;ul&gt;
+  	&lt;li&gt;&lt;a href="serializers/exml"&gt;eXML&lt;/a&gt;: A XML serializer not relying
on the JAXP API.&lt;/li&gt;
+  	&lt;li&gt;&lt;a href="serializers/exhtml"&gt;eXHTML&lt;/a&gt;: A pedantinc XHTML serializer
encoding all recognized entities with their proper HTML names.&lt;/li&gt;
+  	&lt;li&gt;&lt;a href="serializers/ehtml"&gt;eHTML&lt;/a&gt;: A serializer converting XHTML
into plain old HTML.&lt;/li&gt;
+  &lt;/ul&gt;
   &lt;/body&gt;
 &lt;/html&gt;

Modified: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap?rev=825425&amp;r1=825424&amp;r2=825425&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap (original)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap Thu Oct 15
07:51:28 2009
@@ -415,6 +415,7 @@
       &lt;/map:handle-errors&gt;
     &lt;/map:pipeline&gt;
     
+    &lt;!-- FOP --&gt;
     &lt;map:pipeline&gt;
       &lt;map:match pattern="fop/test.pdf"&gt;
         &lt;map:generate src="fop/page.xml" /&gt;
@@ -423,6 +424,32 @@
       &lt;/map:match&gt;
     &lt;/map:pipeline&gt;
 
+    &lt;!-- Encoding serializers --&gt;
+    &lt;map:pipeline&gt;
+      &lt;map:match equals="serializers/exml"&gt;
+        &lt;map:generate src="sax-pipeline/simple.xml" /&gt;
+        &lt;map:transform src="sax-pipeline/simple.xslt"&gt;
+          &lt;map:parameter name="myParam" value="1" /&gt;
+        &lt;/map:transform&gt;
+        &lt;map:serialize type="exml" indent="2"/&gt;
+      &lt;/map:match&gt;
+      &lt;map:match equals="serializers/exhtml"&gt;
+        &lt;map:generate src="sax-pipeline/simple.xml" /&gt;
+        &lt;map:transform src="sax-pipeline/simple.xslt"&gt;
+          &lt;map:parameter name="myParam" value="2" /&gt;
+        &lt;/map:transform&gt;
+        &lt;map:serialize type="exhtml" doctype-default="strict" /&gt;
+      &lt;/map:match&gt;    
+      &lt;map:match equals="serializers/ehtml"&gt;
+        &lt;map:generate src="sax-pipeline/simple.xml" /&gt;
+        &lt;map:transform src="sax-pipeline/simple.xslt"&gt;
+          &lt;map:parameter name="myParam" value="2" /&gt;
+        &lt;/map:transform&gt;
+        &lt;map:serialize type="ehtml" encoding="iso-8859-1"/&gt;
+      &lt;/map:match&gt;    
+    &lt;/map:pipeline&gt;
+ 
+    &lt;!-- Global error handling --&gt;
     &lt;map:handle-errors&gt;
       &lt;map:select value="{jexl:cocoon.exception.class.name}"&gt;
         &lt;map:when contains="NoMatchingPipelineException"&gt;

Modified: cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/spring/cocoon-sample-sitemap-components-optional.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/spring/cocoon-sample-sitemap-components-optional.xml?rev=825425&amp;r1=825424&amp;r2=825425&amp;view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/spring/cocoon-sample-sitemap-components-optional.xml
(original)
+++ cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/spring/cocoon-sample-sitemap-components-optional.xml
Thu Oct 15 07:51:28 2009
@@ -23,4 +23,5 @@
 
   &lt;import resource="classpath:META-INF/cocoon/spring-optional/cocoon-optional-fop.xml"
/&gt;
   
+  &lt;import resource="classpath:META-INF/cocoon/spring-optional/cocoon-optional-serializers.xml"
/&gt;
 &lt;/beans&gt;




</pre>
</div>
</content>
</entry>
</feed>
