cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r616936 - in /cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main: java/org/apache/cocoon/micro/it/ resources/COB-INF/ resources/COB-INF/aggregation/ resources/COB-INF/xslt/ resources/META-INF/cocoon/spring/
Date Wed, 30 Jan 2008 22:48:53 GMT
Author: reinhard
Date: Wed Jan 30 14:48:41 2008
New Revision: 616936

URL: http://svn.apache.org/viewvc?rev=616936&view=rev
Log:
add tests for aggregation, parameter passing and xslt transformations

Added:
    cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/java/org/apache/cocoon/micro/it/ParameterPassingMatcher.java
  (with props)
    cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/aggregation/
    cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/aggregation/include.xml
  (with props)
    cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/aggregation/sub.xml
  (with props)
    cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/
    cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/main.xslt
  (with props)
    cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/sub-file.xslt
  (with props)
    cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/sub-servlet.xslt
  (with props)
Modified:
    cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/overview.html
    cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/sitemap.xmap
    cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/META-INF/cocoon/spring/cocoon-micro-it-sitemap-components.xml

Added: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/java/org/apache/cocoon/micro/it/ParameterPassingMatcher.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/java/org/apache/cocoon/micro/it/ParameterPassingMatcher.java?rev=616936&view=auto
==============================================================================
--- cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/java/org/apache/cocoon/micro/it/ParameterPassingMatcher.java
(added)
+++ cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/java/org/apache/cocoon/micro/it/ParameterPassingMatcher.java
Wed Jan 30 14:48:41 2008
@@ -0,0 +1,21 @@
+package org.apache.cocoon.micro.it;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.cocoon.matching.Matcher;
+import org.apache.cocoon.sitemap.PatternException;
+
+public class ParameterPassingMatcher implements Matcher {
+
+    public Map match(String pattern, Map objectModel, Parameters parameters) throws PatternException
{
+        if("empty".equals(pattern)) {
+            return null;
+        }
+        Map<String, Object> returnMap = new HashMap<String, Object>();
+        returnMap.put("param1", "simple");
+        return returnMap;
+    }
+
+}

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/java/org/apache/cocoon/micro/it/ParameterPassingMatcher.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/java/org/apache/cocoon/micro/it/ParameterPassingMatcher.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/java/org/apache/cocoon/micro/it/ParameterPassingMatcher.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/aggregation/include.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/aggregation/include.xml?rev=616936&view=auto
==============================================================================
--- cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/aggregation/include.xml
(added)
+++ cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/aggregation/include.xml
Wed Jan 30 14:48:41 2008
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<sample>
+  <i:include xmlns:i="http://apache.org/cocoon/include/1.0"
+    src="servlet:/aggregation/sub-request"/>
+</sample>

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/aggregation/include.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/aggregation/include.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/aggregation/include.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/aggregation/sub.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/aggregation/sub.xml?rev=616936&view=auto
==============================================================================
--- cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/aggregation/sub.xml
(added)
+++ cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/aggregation/sub.xml
Wed Jan 30 14:48:41 2008
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<sub>sub</sub>

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/aggregation/sub.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/aggregation/sub.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/aggregation/sub.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/overview.html
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/overview.html?rev=616936&r1=616935&r2=616936&view=diff
==============================================================================
--- cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/overview.html
(original)
+++ cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/overview.html
Wed Jan 30 14:48:41 2008
@@ -60,5 +60,18 @@
 	<ul>
 		<li><a href="object-model/request-parameters?a=1&b=2&c=3">All request
parameters</a>: Print all request parameters.</li>
 	</ul>
+	<h2>Aggregation</h2>
+	<ul>
+		<li><a href="aggregation/include-transformer">Include-Transformer</a>:
Aggregate XML using the IncludeTransformer.</li>
+	</ul>
+	<h2>XSLT</h2>
+	<ul>
+		<li><a href="xslt/main">XSLT Transformation</a>: An XSLT transformation
that includes stylesheets via file and servlet protocol.</li>
+	</ul>
+	<h2>Parameter passing</h2>
+	<ul>
+		<li><a href="parameter-passing/working">Matching Matcher</a>: Passing
a named parameter from a matcher to the sitemap.</li>
+		<li><a href="parameter-passing/failing">Not-Matching Matcher</a>: Passing
null from a matcher to the sitemap.</li>
+	</ul>
   </body>
 </html>

Modified: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/sitemap.xmap?rev=616936&r1=616935&r2=616936&view=diff
==============================================================================
--- cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/sitemap.xmap
(original)
+++ cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/sitemap.xmap
Wed Jan 30 14:48:41 2008
@@ -110,6 +110,48 @@
       </map:match>
     </map:pipeline>
 
+    <!-- ~~~~~~~~~~~~~~~~ aggregation ~~~~~~~~~~~~~~~ -->
+    <map:pipeline>
+      <map:match pattern="aggregation/include-transformer">
+        <map:generate src="aggregation/include.xml"/>
+        <map:transform type="include"/>
+        <map:serialize type="xml"/>
+      </map:match>
+      <map:match pattern="aggregation/sub-request">
+        <map:generate src="aggregation/sub.xml"/>
+        <map:serialize type="xml"/>
+      </map:match>
+    </map:pipeline>
+
+    <!-- ~~~~~~~~~~~~~~~~ aggregation ~~~~~~~~~~~~~~~ -->
+    <map:pipeline>
+      <map:match pattern="xslt/main">
+        <map:generate src="sax-pipeline/simple.xml"/>
+        <map:transform src="xslt/main.xslt"/>
+        <map:serialize type="xml"/>
+      </map:match>
+      <map:match pattern="xslt/sub-servlet.xslt">
+        <map:generate src="xslt/sub-servlet.xslt"/>
+        <map:serialize type="xml"/>
+      </map:match>
+    </map:pipeline>
+
+    <!-- ~~~~~~~~~~~~~~~~ matcher: parameter passing ~~~~~~~~~~~~~~~ -->
+    <map:pipeline>
+      <map:match pattern="parameter-passing/failing">
+        <map:match type="parameter-passing" pattern="empty">
+          <map:generate src="sax-pipeline/simple.xml"/>
+          <map:serialize/>
+        </map:match>
+      </map:match>
+      <map:match pattern="parameter-passing/working">
+        <map:match type="parameter-passing">
+          <map:generate src="sax-pipeline/simple.xml"/>
+          <map:serialize type="xml"/>
+        </map:match>
+      </map:match>
+    </map:pipeline>
+
     <!-- ~~~~~~~~~~~~~~~~ object model ~~~~~~~~~~~~~~~ -->
     <map:pipeline>
       <map:match pattern="object-model/request-parameters">

Added: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/main.xslt
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/main.xslt?rev=616936&view=auto
==============================================================================
--- cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/main.xslt
(added)
+++ cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/main.xslt
Wed Jan 30 14:48:41 2008
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+  <xsl:include href="sub-file.xslt"/>
+  <xsl:include href="servlet:/xslt/sub-servlet.xslt"/>
+
+  <xsl:template match="/">
+    <xslt>
+      <servlet>
+        <xsl:call-template name="servlet"/>
+      </servlet>
+      <file>
+        <xsl:call-template name="file"/>
+      </file>
+    </xslt>
+  </xsl:template>
+
+</xsl:stylesheet>

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/main.xslt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/main.xslt
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/main.xslt
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/sub-file.xslt
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/sub-file.xslt?rev=616936&view=auto
==============================================================================
--- cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/sub-file.xslt
(added)
+++ cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/sub-file.xslt
Wed Jan 30 14:48:41 2008
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+  <xsl:template name="file">
+    <xsl:text>file</xsl:text>
+  </xsl:template>
+
+</xsl:stylesheet>

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/sub-file.xslt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/sub-file.xslt
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/sub-file.xslt
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/sub-servlet.xslt
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/sub-servlet.xslt?rev=616936&view=auto
==============================================================================
--- cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/sub-servlet.xslt
(added)
+++ cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/sub-servlet.xslt
Wed Jan 30 14:48:41 2008
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+  <xsl:template name="servlet">
+    <xsl:text>servlet</xsl:text>
+  </xsl:template>
+
+</xsl:stylesheet>

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/sub-servlet.xslt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/sub-servlet.xslt
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/xslt/sub-servlet.xslt
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/META-INF/cocoon/spring/cocoon-micro-it-sitemap-components.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/META-INF/cocoon/spring/cocoon-micro-it-sitemap-components.xml?rev=616936&r1=616935&r2=616936&view=diff
==============================================================================
--- cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/META-INF/cocoon/spring/cocoon-micro-it-sitemap-components.xml
(original)
+++ cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/META-INF/cocoon/spring/cocoon-micro-it-sitemap-components.xml
Wed Jan 30 14:48:41 2008
@@ -26,6 +26,10 @@
 
   <bean name="org.apache.cocoon.generation.Generator/date" class="org.apache.cocoon.micro.it.DateGenerator"/>
 
-  <bean name="org.apache.cocoon.generation.Generator/request-parameters" class="org.apache.cocoon.micro.it.RequestParametersGenerator"/>
+  <bean name="org.apache.cocoon.generation.Generator/request-parameters"
+    class="org.apache.cocoon.micro.it.RequestParametersGenerator"/>
+
+  <bean name="org.apache.cocoon.matching.Matcher/parameter-passing"
+    class="org.apache.cocoon.micro.it.ParameterPassingMatcher"/>
 
 </beans>



Mime
View raw message