You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by da...@apache.org on 2005/06/22 20:41:30 UTC

svn commit: r192973 - in /cocoon/trunk: src/webapp/ src/webapp/WEB-INF/blocks/ src/webapp/WEB-INF/blocks/mysample/ src/webapp/WEB-INF/blocks/mysample/COB-INF/ src/webapp/WEB-INF/blocks/sample/ src/webapp/WEB-INF/blocks/sample/COB-INF/ src/webapp/WEB-IN...

Author: danielf
Date: Wed Jun 22 11:41:29 2005
New Revision: 192973

URL: http://svn.apache.org/viewcvs?rev=192973&view=rev
Log:
Added two simple sample blocks the Cocoon samples a base block that can be accessed with http://localhost:8888/blocks-test/sample/ and a block that extends the first one at http://localhost:8888/blocks-test/mysample/

Added:
    cocoon/trunk/src/webapp/WEB-INF/blocks/
    cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/
    cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/COB-INF/
    cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/COB-INF/block.xml   (with props)
    cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/samples.xml   (with props)
    cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/sitemap.xmap   (with props)
    cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/test.xml   (with props)
    cocoon/trunk/src/webapp/WEB-INF/blocks/sample/
    cocoon/trunk/src/webapp/WEB-INF/blocks/sample/COB-INF/
    cocoon/trunk/src/webapp/WEB-INF/blocks/sample/COB-INF/block.xml   (with props)
    cocoon/trunk/src/webapp/WEB-INF/blocks/sample/resources/
    cocoon/trunk/src/webapp/WEB-INF/blocks/sample/resources/images/
    cocoon/trunk/src/webapp/WEB-INF/blocks/sample/resources/images/cocoon.gif   (with props)
    cocoon/trunk/src/webapp/WEB-INF/blocks/sample/resources/styles/
    cocoon/trunk/src/webapp/WEB-INF/blocks/sample/resources/styles/main.css   (with props)
    cocoon/trunk/src/webapp/WEB-INF/blocks/sample/samples.xml   (with props)
    cocoon/trunk/src/webapp/WEB-INF/blocks/sample/simple-samples2html.xsl   (with props)
    cocoon/trunk/src/webapp/WEB-INF/blocks/sample/sitemap.xmap   (with props)
    cocoon/trunk/src/webapp/WEB-INF/blocks/sample/test.xml   (with props)
    cocoon/trunk/src/webapp/WEB-INF/xconf/cocoon-blocks.xconf   (with props)
    cocoon/trunk/src/webapp/wiring.xml   (with props)
Modified:
    cocoon/trunk/src/webapp/sitemap.xmap
    cocoon/trunk/tools/targets/webapp-build.xml

Added: cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/COB-INF/block.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/COB-INF/block.xml?rev=192973&view=auto
==============================================================================
--- cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/COB-INF/block.xml (added)
+++ cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/COB-INF/block.xml Wed Jun 22 11:41:29 2005
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. 
+-->
+<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+       xsi:schemaLocation="http://apache.org/cocoon/blocks/cob/1.0 cob-schema-1.0.xsd"
+       id="http://cocoon.apache.org/blocks/mysample/1.0">
+  <name>my sample</name>
+  <description href="http://cocoon.apache.org/blocks/mysample/1.0">
+    An example sample
+  </description>
+  <state href="http://cocoon.apache.org/blocks/mysample/1.0/state.html" 
+         community="contributed" 
+         interfaces="unstable" 
+         implementation="unstable"/>
+  <license href="http://www.apache.org/licenses/">Apache License 2.0</license>
+  <author href="http://cocoon.apache.org">Apache Cocoon community</author>
+  <sitemap src="sitemap.xmap"/>
+  <extends block="http://cocoon.apache.org/blocks/sample/1.0"/>
+</block>

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/COB-INF/block.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/COB-INF/block.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/samples.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/samples.xml?rev=192973&view=auto
==============================================================================
--- cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/samples.xml (added)
+++ cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/samples.xml Wed Jun 22 11:41:29 2005
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!--+
+    | An example samples page
+    |
+    | $Id$
+    +-->
+
+<samples name="My Samples">
+
+  <group name="My Group of Samples">
+    <sample name="My sample" href="test1">
+      The complete separation between content and style
+      leads to a very powerful multi-channeling solution where you can
+      apply different stylesheets to the same content and generate different
+      flavors of it.
+    </sample>
+    <sample name="Another sample" href="test2">
+      A couple of existing web sites have been xml-ized to show you
+      how easier it is to handle pure-content markup.
+    </sample>   
+  </group>
+
+</samples>

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/samples.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/samples.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/sitemap.xmap?rev=192973&view=auto
==============================================================================
--- cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/sitemap.xmap (added)
+++ cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/sitemap.xmap Wed Jun 22 11:41:29 2005
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- SVN $Id:$ -->
+
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+
+  <map:components>
+    <source-factories>
+      <component-instance class="org.apache.cocoon.components.source.impl.BlockSourceFactory" name="block"/>
+    </source-factories>
+
+    <map:generators default="file">
+      <map:generator name="file" src="org.apache.cocoon.generation.FileGenerator"/>
+    </map:generators>
+
+    <map:serializers default="xml">
+      <map:serializer mime-type="text/xml" name="xml" src="org.apache.cocoon.serialization.XMLSerializer"/>
+    </map:serializers>
+
+    <map:readers default="resource">
+      <map:reader name="resource" src="org.apache.cocoon.reading.ResourceReader"/>
+    </map:readers>
+
+    <map:matchers default="wildcard">
+      <map:matcher name="wildcard" src="org.apache.cocoon.matching.WildcardURIMatcher"/>
+    </map:matchers>
+
+    <map:pipes default="noncaching">
+      <map:pipe name="noncaching" src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline">
+      </map:pipe>
+    </map:pipes>
+  </map:components>
+
+  <map:pipelines>
+    <map:pipeline>
+
+      <map:match pattern="samples.xml">
+        <map:generate src="samples.xml"/>
+        <map:serialize type="xml"/>
+      </map:match>
+
+      <map:match pattern="test*">
+        <map:generate src="test.xml"/>
+        <map:serialize type="xml"/>
+      </map:match>
+
+      <map:match pattern="**">
+        <map:read src="block:super:/{1}"/>
+      </map:match>
+
+    </map:pipeline>
+  </map:pipelines>
+</map:sitemap>

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/sitemap.xmap
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/sitemap.xmap
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/test.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/test.xml?rev=192973&view=auto
==============================================================================
--- cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/test.xml (added)
+++ cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/test.xml Wed Jun 22 11:41:29 2005
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><mytest/>
\ No newline at end of file

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/test.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/mysample/test.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/COB-INF/block.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/webapp/WEB-INF/blocks/sample/COB-INF/block.xml?rev=192973&view=auto
==============================================================================
--- cocoon/trunk/src/webapp/WEB-INF/blocks/sample/COB-INF/block.xml (added)
+++ cocoon/trunk/src/webapp/WEB-INF/blocks/sample/COB-INF/block.xml Wed Jun 22 11:41:29 2005
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. 
+-->
+<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+       xsi:schemaLocation="http://apache.org/cocoon/blocks/cob/1.0 cob-schema-1.0.xsd"
+       id="http://cocoon.apache.org/blocks/sample/1.0">
+  <name>sample</name>
+  <description href="http://cocoon.apache.org/blocks/sample/1.0">
+    Styling of Cocoon samples
+  </description>
+  <state href="http://cocoon.apache.org/blocks/mysample/1.0/state.html" 
+         community="contributed" 
+         interfaces="unstable" 
+         implementation="unstable"/>
+  <license href="http://www.apache.org/licenses/">Apache License 2.0</license>
+  <author href="http://cocoon.apache.org">Apache Cocoon community</author>
+  <sitemap src="sitemap.xmap"/>
+</block>

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/COB-INF/block.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/COB-INF/block.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/resources/images/cocoon.gif
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/webapp/WEB-INF/blocks/sample/resources/images/cocoon.gif?rev=192973&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/resources/images/cocoon.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/resources/styles/main.css
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/webapp/WEB-INF/blocks/sample/resources/styles/main.css?rev=192973&view=auto
==============================================================================
--- cocoon/trunk/src/webapp/WEB-INF/blocks/sample/resources/styles/main.css (added)
+++ cocoon/trunk/src/webapp/WEB-INF/blocks/sample/resources/styles/main.css Wed Jun 22 11:41:29 2005
@@ -0,0 +1,81 @@
+/*
+* Copyright 1999-2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+body { background-color: white; color: black; font-family: verdana, helvetica, arial, sans-serif; font-size: 80%; }
+
+h1 { color: #336699; text-align: center; font-size: 3em; padding-bottom: 10px; margin: 0px; }
+h2 { color: #336699; }
+h3 { color: #336699; }
+h4 { color: #336699; }
+
+a:link { color: #336699; }
+a:visited { color: #800080; }
+a:hover { color: #800080; background-color: #ffff80; }
+a:active { color: #006666; }
+
+img { border: 0; }
+.figure { text-align: center; }
+
+span.year { color: #336699; }
+
+p.copyright { text-align: center; padding-top: 10px; border-width: 1px 0px 0px 0px; border-style: solid; border-color: #336699; }
+p.author { color: #336699; padding-bottom: 10px; }
+p.block { text-align: center; }
+
+hr { height: 0px; color: #336699; }
+
+span.description { color: #336699; font-weight: bold; }
+span.switch { cursor: pointer; margin-left: 5px; text-decoration: underline; }
+
+/* Samples */
+
+.samplesGroup {
+    /* a tasteful shade of blue */
+    background-color: #BFCCDF;
+    color: black;
+    border-width: 0px 0px 2px 0px;
+    border-style: solid;
+    border-color: #336699;
+    font-size:120%;
+    padding-left: 0.2em;
+    padding-top: 0.2em;
+    padding-bottom: 0.2em;
+    margin-top: 1em;
+    margin-bottom: 0;
+ 
+    /* mozilla and some others support the fancy CSS3 borders */
+    -moz-border-radius-bottomleft: 1em;
+    border-radius-bottomleft: 1em;
+}
+
+.samplesNote {
+    color: #333333;
+    margin: 0.5em;
+    padding: 0.2em;
+    background-color: #ffffcc;
+    font-style: italic;
+}
+
+.samplesText {
+    margin-top: 0.2em;
+}
+
+div.resources {
+    text-align: right;
+}
+
+div.resources a {
+    margin: 5px;
+}

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/resources/styles/main.css
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/resources/styles/main.css
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/samples.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/webapp/WEB-INF/blocks/sample/samples.xml?rev=192973&view=auto
==============================================================================
--- cocoon/trunk/src/webapp/WEB-INF/blocks/sample/samples.xml (added)
+++ cocoon/trunk/src/webapp/WEB-INF/blocks/sample/samples.xml Wed Jun 22 11:41:29 2005
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!--+
+    | An example samples page
+    |
+    | $Id$
+    +-->
+
+<samples name="Example Samples">
+
+  <group name="A Group of Samples">
+    <sample name="A sample" href="test1">
+      The complete separation between content and style
+      leads to a very powerful multi-channeling solution where you can
+      apply different stylesheets to the same content and generate different
+      flavors of it.
+    </sample>
+    <sample name="Another sample" href="test2">
+      A couple of existing web sites have been xml-ized to show you
+      how easier it is to handle pure-content markup.
+    </sample>   
+  </group>
+
+  <group name="More Samples">
+    <sample name="Still another sample" href="test3">
+      This example shows the usage of Input Modules in sitemap attribute expressions.
+    </sample>
+  </group>
+
+</samples>

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/samples.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/samples.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/simple-samples2html.xsl
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/webapp/WEB-INF/blocks/sample/simple-samples2html.xsl?rev=192973&view=auto
==============================================================================
--- cocoon/trunk/src/webapp/WEB-INF/blocks/sample/simple-samples2html.xsl (added)
+++ cocoon/trunk/src/webapp/WEB-INF/blocks/sample/simple-samples2html.xsl Wed Jun 22 11:41:29 2005
@@ -0,0 +1,191 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!--+
+    | Covert samples file to the HTML page. Uses styles/main.css stylesheet.
+    |
+    | Author: Nicola Ken Barozzi "nicolaken@apache.org"
+    | Author: Vadim Gritsenko "vgritsenko@apache.org"
+    | Author: Christian Haul "haul@apache.org"
+    | CVS $Id$
+    +-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink">
+
+  <xsl:template match="/">
+    <html>
+      <head>
+        <title>Apache Cocoon @version@</title>
+        <link rel="SHORTCUT ICON" href="favicon.ico"/>
+        <link href="block:/styles/main.css" type="text/css" rel="stylesheet"/>
+      </head>
+      <body>
+       <table border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
+         <tr>
+           <td width="*">The Apache Software Foundation is proud to present...</td>
+           <td width="40%" align="center"><img border="0" src="block:/images/cocoon.gif"/></td>
+           <td width="30%" align="center">Version: <b>@version@</b></td>
+         </tr>
+       </table>
+
+       <table border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
+         <tr>
+           <td width="75%">
+             <h2><xsl:value-of select="samples/@name"/></h2>
+           </td>
+           <td nowrap="nowrap" align="right">
+             Orthogonal views:
+             <a href="?cocoon-view=content">Content</a>
+             &#160;
+             <a href="?cocoon-view=pretty-content">Pretty content</a>
+             &#160;
+             <a href="?cocoon-view=links">Links</a>
+           </td>
+         </tr>
+       </table>
+
+       <xsl:apply-templates select="samples"/>
+
+       <p class="copyright">
+         Copyright &#169; @year@ <a href="http://www.apache.org/">The Apache Software Foundation</a>.
+         All rights reserved.
+       </p>
+      </body>
+    </html>
+  </xsl:template>
+
+
+  <xsl:template match="samples">
+    <xsl:variable name="gc" select="4"/><!-- group correction -->
+    <xsl:variable name="all-groups" select="$gc * count(group)"/>
+    <xsl:variable name="all-samples" select="count(group/sample)+count(group/note)+$all-groups"/>
+    <xsl:variable name="half-samples" select="round($all-samples div 2)"/>
+    <xsl:variable name="half-possibilities">
+      <xsl:choose>
+        <xsl:when test="count(group) = 1">1 </xsl:when><!-- single group sample.xml -->
+        <xsl:otherwise>
+          <xsl:for-each select="group">
+            <xsl:if test="position() &lt; last() and position() &gt;= 1">
+              <xsl:variable name="group-position" select="position()"/>
+              <xsl:variable name="prev-sample" select="count(../group[position() &lt;= $group-position - 1]/sample) + count(../group[position() &lt;= $group-position - 1]/note) + position() * $gc - $gc"/>
+              <xsl:variable name="curr-sample" select="count(../group[position() &lt;= $group-position]/sample) + count(../group[position() &lt;= $group-position]/note) + position() * $gc"/>
+              <xsl:variable name="next-sample" select="count(../group[position() &lt;= $group-position + 1]/sample) + count(../group[position() &lt;= $group-position + 1]/note) + position() * $gc + $gc"/>
+              <xsl:variable name="prev-deviation">
+                <xsl:choose>
+                  <xsl:when test="$prev-sample &gt; $half-samples">
+                    <xsl:value-of select="$prev-sample - $half-samples"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:value-of select="$half-samples - $prev-sample"/>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:variable>
+              <xsl:variable name="curr-deviation">
+                <xsl:choose>
+                  <xsl:when test="$curr-sample &gt; $half-samples">
+                    <xsl:value-of select="$curr-sample - $half-samples"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:value-of select="$half-samples - $curr-sample"/>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:variable>
+              <xsl:variable name="next-deviation">
+                <xsl:choose>
+                  <xsl:when test="$next-sample &gt; $half-samples">
+                    <xsl:value-of select="$next-sample - $half-samples"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:value-of select="$half-samples - $next-sample"/>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:variable>
+              <xsl:if test="$prev-deviation &gt;= $curr-deviation and $curr-deviation &lt;= $next-deviation">
+                <xsl:value-of select="$group-position"/><xsl:text> </xsl:text>
+              </xsl:if>
+            </xsl:if>
+          </xsl:for-each>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="half">
+      <xsl:value-of select="substring-before($half-possibilities, ' ')"/>
+    </xsl:variable>
+
+    <table width="100%" cellspacing="5">
+      <tr>
+        <td width="50%" valign="top">
+          <xsl:for-each select="group">
+            <xsl:variable name="group-position" select="position()"/>
+            <xsl:choose>
+              <xsl:when test="$group-position &lt;= $half">
+                <h4 class="samplesGroup"><xsl:value-of select="@name"/></h4>
+                <p class="samplesText"><xsl:apply-templates/></p>
+              </xsl:when>
+              <xsl:otherwise></xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </td>
+        <td valign="top">
+          <xsl:for-each select="group">  <!-- [position()<=$half] -->
+            <xsl:variable name="group-position" select="position()"/>
+            <xsl:choose>
+              <xsl:when test="$group-position &gt; $half">
+                <h4 class="samplesGroup"><xsl:value-of select="@name"/></h4>
+                <p class="samplesText"><xsl:apply-templates/></p>
+              </xsl:when>
+              <xsl:otherwise></xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </td>
+      </tr>
+    </table>
+  </xsl:template>
+
+
+  <xsl:template match="sample">
+    <xsl:choose>
+      <xsl:when test="@href">
+        <a href="{@href}"><xsl:value-of select="@name"/></a>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="@name"/>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:text> - </xsl:text>
+    <xsl:copy-of select="*|text()"/>
+    <br/>
+  </xsl:template>
+
+
+  <xsl:template match="note">
+    <p class="samplesNote">
+      <xsl:apply-templates/>
+    </p>
+  </xsl:template>
+
+
+  <xsl:template match="@*|node()" priority="-2">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+  </xsl:template>
+
+  <xsl:template match="text()" priority="-1">
+    <xsl:value-of select="."/>
+  </xsl:template>
+</xsl:stylesheet>

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/simple-samples2html.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/simple-samples2html.xsl
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/webapp/WEB-INF/blocks/sample/sitemap.xmap?rev=192973&view=auto
==============================================================================
--- cocoon/trunk/src/webapp/WEB-INF/blocks/sample/sitemap.xmap (added)
+++ cocoon/trunk/src/webapp/WEB-INF/blocks/sample/sitemap.xmap Wed Jun 22 11:41:29 2005
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- SVN $Id:$ -->
+
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+
+  <map:components>
+    <source-factories>
+      <component-instance class="org.apache.cocoon.components.source.impl.BlockSourceFactory" name="block"/>
+    </source-factories>
+
+    <input-modules>
+      <component-instance name="block"  class="org.apache.cocoon.components.modules.input.BlockPathModule"/>
+      <component-instance logger="core.modules.input" name="request"          class="org.apache.cocoon.components.modules.input.RequestModule"/>
+    </input-modules>
+
+    <map:generators default="file">
+      <map:generator name="file" src="org.apache.cocoon.generation.FileGenerator"/>
+    </map:generators>
+
+    <map:transformers default="xslt">
+      <map:transformer name="xslt" src="org.apache.cocoon.transformation.TraxTransformer"/>
+      <map:transformer name="linkrewriter" src="org.apache.cocoon.transformation.LinkRewriterTransformer">
+	<link-attrs>href src</link-attrs>
+	<schemes>block</schemes>
+      </map:transformer>
+    </map:transformers>
+
+    <map:serializers default="html">
+      <map:serializer mime-type="text/xml" name="xml" src="org.apache.cocoon.serialization.XMLSerializer"/>
+      <map:serializer mime-type="text/html" name="html" src="org.apache.cocoon.serialization.HTMLSerializer">
+        <doctype-public>-//W3C//DTD HTML 4.01 Transitional//EN</doctype-public>
+        <doctype-system>http://www.w3.org/TR/html4/loose.dtd</doctype-system>
+      </map:serializer>
+
+    </map:serializers>
+
+    <map:readers default="resource">
+      <map:reader name="resource" src="org.apache.cocoon.reading.ResourceReader"/>
+    </map:readers>
+
+    <map:matchers default="wildcard">
+      <map:matcher name="wildcard" src="org.apache.cocoon.matching.WildcardURIMatcher"/>
+    </map:matchers>
+
+    <map:pipes default="noncaching">
+      <map:pipe name="noncaching" src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline">
+      </map:pipe>
+    </map:pipes>
+  </map:components>
+
+  <map:pipelines>
+    <map:pipeline>
+
+      <map:match pattern="">
+        <map:generate src="block:/samples.xml"/>
+        <map:transform src="simple-samples2html.xsl">
+          <map:parameter name="contextPath" value="{request:contextPath}"/>
+        </map:transform>
+        <map:transform type="linkrewriter"/>
+        <map:serialize/>
+      </map:match>
+
+      <map:match pattern="samples.xml">
+        <map:generate src="samples.xml"/>
+        <map:serialize type="xml"/>
+      </map:match>
+
+      <map:match pattern="test*">
+        <map:generate src="test.xml"/>
+        <map:serialize type="xml"/>
+      </map:match>
+
+      <!-- images -->
+      <map:match pattern="images/*.gif">
+	<map:read src="resources/images/{1}.gif" mime-type="images/gif"/>
+      </map:match>
+
+      <!-- CSS stylesheets -->
+      <map:match pattern="styles/*.css">
+	<map:read src="resources/styles/{1}.css" mime-type="text/css"/>
+      </map:match>
+
+    </map:pipeline>
+  </map:pipelines>
+</map:sitemap>

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/sitemap.xmap
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/sitemap.xmap
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/test.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/webapp/WEB-INF/blocks/sample/test.xml?rev=192973&view=auto
==============================================================================
--- cocoon/trunk/src/webapp/WEB-INF/blocks/sample/test.xml (added)
+++ cocoon/trunk/src/webapp/WEB-INF/blocks/sample/test.xml Wed Jun 22 11:41:29 2005
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><test/>
\ No newline at end of file

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/test.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/src/webapp/WEB-INF/blocks/sample/test.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/src/webapp/WEB-INF/xconf/cocoon-blocks.xconf
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/webapp/WEB-INF/xconf/cocoon-blocks.xconf?rev=192973&view=auto
==============================================================================
--- cocoon/trunk/src/webapp/WEB-INF/xconf/cocoon-blocks.xconf (added)
+++ cocoon/trunk/src/webapp/WEB-INF/xconf/cocoon-blocks.xconf Wed Jun 22 11:41:29 2005
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2005 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!--+
+    |
+    | SVN $Id$
+    +-->
+<components>
+  <source-factories>
+    <component-instance class="org.apache.cocoon.components.source.impl.BlocksSourceFactory" name="blocks"/>
+  </source-factories>
+
+  <component role="org.apache.cocoon.components.blocks.BlocksManager"
+             class="org.apache.cocoon.components.blocks.BlocksManager"
+             file="wiring.xml"/>
+</components>

Propchange: cocoon/trunk/src/webapp/WEB-INF/xconf/cocoon-blocks.xconf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/src/webapp/WEB-INF/xconf/cocoon-blocks.xconf
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/src/webapp/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/webapp/sitemap.xmap?rev=192973&r1=192972&r2=192973&view=diff
==============================================================================
--- cocoon/trunk/src/webapp/sitemap.xmap (original)
+++ cocoon/trunk/src/webapp/sitemap.xmap Wed Jun 22 11:41:29 2005
@@ -666,6 +666,16 @@
     </map:match>
 
     <!--+
+        | Call blocks deployed in wiring.xml. The blocks protocol
+        | should normally be mounted at root as it has no way to know
+        | where it is mounted. But that would not work in the current
+        | sitemap as it would shadow the samples.
+        +-->
+    <map:match pattern="blocks-test/**">
+      <map:read src="blocks:/blocks-test/{1}"/>
+    </map:match>
+
+    <!--+
         | Mount everything else by calling the sitemap.xmap file located
         | in the requested folder.
         +-->

Added: cocoon/trunk/src/webapp/wiring.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/webapp/wiring.xml?rev=192973&view=auto
==============================================================================
--- cocoon/trunk/src/webapp/wiring.xml (added)
+++ cocoon/trunk/src/webapp/wiring.xml Wed Jun 22 11:41:29 2005
@@ -0,0 +1,32 @@
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. 
+-->
+<wiring xmlns="http://apache.org/cocoon/blocks/wiring/1.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+        xsi:schemaLocation="http://apache.org/cocoon/blocks/wiring/1.0 wiring-schema-1.0.xsd"
+>
+
+  <block id="sampleid" location="WEB-INF/blocks/sample/">
+    <mount path="/blocks-test/sample/"/>
+  </block>
+
+  <block id="mysample" location="WEB-INF/blocks/mysample/">
+    <mount path="/blocks-test/mysample/"/>
+    <connections>
+      <connection name="super" block="sampleid"/>
+    </connections>
+  </block>
+
+</wiring>

Propchange: cocoon/trunk/src/webapp/wiring.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/src/webapp/wiring.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/tools/targets/webapp-build.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/tools/targets/webapp-build.xml?rev=192973&r1=192972&r2=192973&view=diff
==============================================================================
--- cocoon/trunk/tools/targets/webapp-build.xml (original)
+++ cocoon/trunk/tools/targets/webapp-build.xml Wed Jun 22 11:41:29 2005
@@ -29,6 +29,7 @@
     <copy file="${webapp}/welcome.xslt" tofile="${build.webapp}/welcome.xslt" filtering="on"/>
     <copy file="${webapp}/sitemap.xmap" tofile="${build.webapp}/sitemap.xmap"/>
     <copy file="${webapp}/sitemap-additions.xconf" tofile="${build.webapp}/sitemap-additions.xconf"/>
+    <copy file="${webapp}/wiring.xml" tofile="${build.webapp}/wiring.xml" filtering="on"/>
 
     <!-- generate sitemap entries
     <sitemap-components sitemap="${build.webapp}/sitemap.xmap" source="${java}"/>