cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r588509 - in /cocoon/trunk/blocks: cocoon-core-sample/cocoon-core-additional-sample/src/main/resources/COB-INF/ cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/ cocoon-welcome/src/main/resources/COB-INF/resource/extern...
Date Fri, 26 Oct 2007 04:12:30 GMT
Author: vgritsenko
Date: Thu Oct 25 21:12:29 2007
New Revision: 588509

URL: http://svn.apache.org/viewvc?rev=588509&view=rev
Log:
step towards better organized samples page

Added:
    cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/resource/external/images/h1-image.gif
  (with props)
    cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/merge-samples.xsl
  (contents, props changed)
      - copied, changed from r588473, cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/group2samples.xsl
    cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/prepare-samples.xsl
  (with props)
Removed:
    cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/group2samples.xsl
Modified:
    cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-additional-sample/src/main/resources/COB-INF/core-samples-additional.xsamples
    cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/core-samples-main.xsamples
    cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/resource/external/styles/main.css
  (contents, props changed)
    cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/sitemap.xmap   (contents,
props changed)
    cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/stylesheets/simple-samples2html.xsl
  (contents, props changed)

Modified: cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-additional-sample/src/main/resources/COB-INF/core-samples-additional.xsamples
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-additional-sample/src/main/resources/COB-INF/core-samples-additional.xsamples?rev=588509&r1=588508&r2=588509&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-additional-sample/src/main/resources/COB-INF/core-samples-additional.xsamples
(original)
+++ cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-additional-sample/src/main/resources/COB-INF/core-samples-additional.xsamples
Thu Oct 25 21:12:29 2007
@@ -16,11 +16,14 @@
   limitations under the License.
 -->
 
-<xsamples xpath="/samples" unless="group[@name='Additional core samples']">
+<!--
+  - $Id$
+  -->
+<xsamples>
 
-  <group name="Additional core samples">
+  <group priority="100" name="Core samples">
     <sample name="Additional Core Samples" href="/cocoon-core-additional-sample/">
-      Additional samples of core components 
+      Samples of additional core functionality and components 
       (the main samples are in the core-samples-main block).
     </sample>
   </group>

Modified: cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/core-samples-main.xsamples
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/core-samples-main.xsamples?rev=588509&r1=588508&r2=588509&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/core-samples-main.xsamples
(original)
+++ cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/core-samples-main.xsamples
Thu Oct 25 21:12:29 2007
@@ -16,11 +16,14 @@
   limitations under the License.
 -->
 
+<!--
+  - $Id$
+  -->
 <xsamples xpath="/samples" unless="group[@name='Main core samples']">
 
-  <group name="Main core samples">
-    <sample name="Core samples (main group)" href="/cocoon-core-samples-main/">
-      Samples of the most important core components.
+  <group priority="100" name="Core samples">
+    <sample priority="100" name="Core Samples" href="/cocoon-core-samples-main/">
+      Samples of the most important core concepts and components.
     </sample>
   </group>
 

Added: cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/resource/external/images/h1-image.gif
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/resource/external/images/h1-image.gif?rev=588509&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/resource/external/images/h1-image.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Modified: cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/resource/external/styles/main.css
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/resource/external/styles/main.css?rev=588509&r1=588508&r2=588509&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/resource/external/styles/main.css
(original)
+++ cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/resource/external/styles/main.css
Thu Oct 25 21:12:29 2007
@@ -1,27 +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.
-*/
+ * 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.
+ */
 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; }
+h1 { color: #0086b3; text-align: center; font-size: 3em; padding-bottom: 10px; margin: 0px;
}
+h2 { color: #0086b3; }
+h3 { color: #0086b3; }
+h4 { color: #0086b3; }
 
-a:link { color: #336699; }
+a:link { color: #0086b3; }
 a:visited { color: #800080; }
 a:hover { color: #800080; background-color: #ffff80; }
 a:active { color: #006666; }
@@ -29,36 +29,26 @@
 img { border: 0; }
 .figure { text-align: center; }
 
-span.year { color: #336699; }
+span.year { color: #0086b3; }
 
-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.copyright { text-align: center; padding-top: 10px; border-width: 1px 0 0 0; border-style:
solid; border-color: #0086b3; }
+p.author { color: #0086b3; padding-bottom: 10px; }
 p.block { text-align: center; }
 
-hr { height: 0px; color: #336699; }
+hr { height: 0; color: #336699; }
 
-span.description { color: #336699; font-weight: bold; }
+span.description { color: #0086b3; 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;
+    margin: 15px 0 10px 0;
+    padding: 0 0 5px 17px;
+    background: url(/images/h1-image.gif) no-repeat left 4px;
+    font-size: 120%;
+    color: #0086b3;
+    border-bottom: 1px solid #0086b3;
 }
 
 .samplesNote {
@@ -84,7 +74,6 @@
 div.resources {
     text-align: right;
 }
-
 div.resources a {
     margin: 5px;
 }

Propchange: cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/resource/external/styles/main.css
------------------------------------------------------------------------------
    svn:keywords = Id Revision Author Date

Copied: cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/merge-samples.xsl
(from r588473, cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/group2samples.xsl)
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/merge-samples.xsl?p2=cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/merge-samples.xsl&p1=cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/group2samples.xsl&r1=588473&r2=588509&rev=588509&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/group2samples.xsl
(original)
+++ cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/merge-samples.xsl
Thu Oct 25 21:12:29 2007
@@ -17,37 +17,30 @@
 -->
 
 <!--
-  - Convert the output of the directory generator into a samples file.
+  - Merge groups with same name.
   -
   - $Id$
   -->
 <xsl:stylesheet version="1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:dir="http://apache.org/cocoon/directory/2.0">
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
-  <xsl:template match="/">
-    <samples name="Cocoon Blocks">
-      <xsl:apply-templates select="//group">
-        <xsl:sort select="@name"/>
-      </xsl:apply-templates>
-    </samples>    
-  </xsl:template>
-  
   <xsl:template match="group">
+    <xsl:if test="not(preceding-sibling::group[@name = current()/@name])">
+      <xsl:copy>
+        <xsl:copy-of select="@name"/>
+        <xsl:apply-templates select="*|following-sibling::group[@name = current()/@name]/*"/>
+      </xsl:copy>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="*">
     <xsl:copy>
-      <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
-      <xsl:apply-templates/>
+      <xsl:apply-templates select="@*|*|text()"/>
     </xsl:copy>
   </xsl:template>
-  
-  <xsl:template match="sample">
-    <sample href="../{../../../../@name}/" name="{@name}">
-      <xsl:copy-of select="*|text()"/>
-    </sample>
-  </xsl:template>
-  
-  <xsl:template match="*|@*|node()" priority="-2">
-     <xsl:apply-templates select="@*|node()"/>
+
+  <xsl:template match="@*|text()">
+    <xsl:copy/>
   </xsl:template>
-  
+
 </xsl:stylesheet>

Propchange: cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/merge-samples.xsl
------------------------------------------------------------------------------
    eol:style = 'native'

Propchange: cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/merge-samples.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/merge-samples.xsl
------------------------------------------------------------------------------
    svn:keywords = Id Revision Author Date

Added: cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/prepare-samples.xsl
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/prepare-samples.xsl?rev=588509&view=auto
==============================================================================
--- cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/prepare-samples.xsl
(added)
+++ cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/prepare-samples.xsl
Thu Oct 25 21:12:29 2007
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+
+<!--
+  - Convert the output of the directory generator into a samples file.
+  -
+  - $Id$
+  -->
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <xsl:template match="/">
+    <samples name="Cocoon Blocks">
+      <xsl:apply-templates select="//group">
+        <xsl:sort select="@priority" data-type="number" order="descending"/>
+        <xsl:sort select="@name"/>
+      </xsl:apply-templates>
+    </samples>
+  </xsl:template>
+
+  <xsl:template match="group">
+    <xsl:copy>
+      <xsl:copy-of select="@name"/>
+      <xsl:apply-templates>
+        <xsl:sort select="@priority" data-type="number" order="descending"/>
+      </xsl:apply-templates>
+    </xsl:copy>
+  </xsl:template>
+
+  <xsl:template match="sample">
+    <!--
+      - Document structure is:
+      - /collection[@name]/collection/resource/group[@name]/sample[@name]
+      -->
+    <sample href="../{../../../../@name}/" name="{@name}">
+      <xsl:copy-of select="*|text()"/>
+    </sample>
+  </xsl:template>
+
+  <xsl:template match="note">
+    <xsl:copy>
+      <xsl:copy-of select="*|text()"/>
+    </xsl:copy>
+  </xsl:template>
+
+</xsl:stylesheet>

Propchange: cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/prepare-samples.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/prepare-samples.xsl
------------------------------------------------------------------------------
    svn:keywords = Id Revision Author Date

Modified: cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/sitemap.xmap?rev=588509&r1=588508&r2=588509&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/sitemap.xmap (original)
+++ cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/sitemap.xmap Thu
Oct 25 21:12:29 2007
@@ -51,7 +51,8 @@
           <map:parameter name="depth" value="2"/>
           <map:parameter name="xmlFiles" value="\.xsamples$"/>
         </map:generate>
-        <map:transform src="group2samples.xsl" label="content"/>
+        <map:transform src="prepare-samples.xsl"/>
+        <map:transform src="merge-samples.xsl" label="content"/>
         <map:transform src="../stylesheets/simple-samples2html.xsl">
           <map:parameter name="contextPath" value="{request:contextPath}"/>
         </map:transform>

Propchange: cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/samples/sitemap.xmap
------------------------------------------------------------------------------
    svn:keywords = Id Revision Author Date

Modified: cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/stylesheets/simple-samples2html.xsl
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/stylesheets/simple-samples2html.xsl?rev=588509&r1=588508&r2=588509&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/stylesheets/simple-samples2html.xsl
(original)
+++ cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/stylesheets/simple-samples2html.xsl
Thu Oct 25 21:12:29 2007
@@ -16,18 +16,20 @@
   limitations under the License.
 -->
 
-<!--+
-    | Covert samples file to the HTML page. Uses styles/main.css stylesheet.
-    |
-    | $Id: simple-samples2html.xsl 448464 2006-09-21 05:29:11Z crossley $
-    +-->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink">
+<!--
+  - Convert samples file to the HTML page. Uses styles/main.css stylesheet.
+  -
+  - $Id$
+  -->
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
   <xsl:param name="contextPath"/>
+
   <xsl:variable name="stdLinks" select="samples/links/link[not(@role)]"/>
   <xsl:variable name="seeAlsoLinks" select="samples/links/link[@role='see-also']"/>
 
+  
   <xsl:template match="/">
     <html>
       <head>
@@ -57,12 +59,12 @@
            <td nowrap="nowrap" align="right">
 	           <xsl:apply-templates select="$stdLinks"/>
 	           <xsl:if test="not(samples/@add-view-links='false')">
-		             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>
+               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>
 	           </xsl:if>
            </td>
          </tr>
@@ -142,25 +144,19 @@
         <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:if test="$group-position &lt;= $half">
+              <h4 class="samplesGroup"><xsl:value-of select="@name"/></h4>
+              <xsl:apply-templates/>
+            </xsl:if>
           </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:if test="$group-position &gt; $half">
+              <h4 class="samplesGroup"><xsl:value-of select="@name"/></h4>
+              <xsl:apply-templates/>
+            </xsl:if>
           </xsl:for-each>
         </td>
       </tr>
@@ -180,17 +176,19 @@
       </xsl:choose>
     </xsl:variable>
 
-    <xsl:choose>
-      <xsl:when test="string-length($link) &gt; 0">
-        <a href="{$link}"><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/>
+    <p class="samplesText">
+      <xsl:choose>
+        <xsl:when test="string-length($link) &gt; 0">
+          <a href="{$link}"><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/>
+    </p>
   </xsl:template>
 
 

Propchange: cocoon/trunk/blocks/cocoon-welcome/src/main/resources/COB-INF/stylesheets/simple-samples2html.xsl
------------------------------------------------------------------------------
    svn:keywords = Id Revision Author Date



Mime
View raw message