cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r332553 - in /cocoon: blocks/portal-sample/trunk/samples/coplets/docs/ blocks/portal-sample/trunk/samples/coplets/docs/styles/ trunk/src/java/org/apache/cocoon/transformation/
Date Fri, 11 Nov 2005 13:53:28 GMT
Author: cziegeler
Date: Fri Nov 11 05:53:19 2005
New Revision: 332553

URL: http://svn.apache.org/viewcvs?rev=332553&view=rev
Log:
Fix html creation (no s1 tag anymore)
cinclude transformer now removes it's namespace declarations

Modified:
    cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-bottom.xml
    cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-demo.xml
    cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-intro.xml
    cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-left.xml
    cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-right.xml
    cocoon/blocks/portal-sample/trunk/samples/coplets/docs/static-info.xml
    cocoon/blocks/portal-sample/trunk/samples/coplets/docs/styles/document2html.xsl
    cocoon/trunk/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java

Modified: cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-bottom.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-bottom.xml?rev=332553&r1=332552&r2=332553&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-bottom.xml (original)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-bottom.xml Fri Nov 11 05:53:19
2005
@@ -22,10 +22,10 @@
 	 <type>Overview document</type> 
   </header> 
   <body> 
-	 <s1 title="Further Information"> 
+	 <section title="Further Information"> 
 		<p>For further information have a look at the Cocoon documentation
               and at the other portal demos available using the tab above.</p>
-   </s1> 
+   </section> 
 
   </body>
 </document>

Modified: cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-demo.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-demo.xml?rev=332553&r1=332552&r2=332553&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-demo.xml (original)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-demo.xml Fri Nov 11 05:53:19
2005
@@ -22,7 +22,7 @@
 	 <type>Overview document</type> 
   </header> 
   <body> 
-	 <s1 title="The Apache Cocoon Portal"> 
+	 <section title="The Apache Cocoon Portal"> 
 		<p>This is a demo of the Cocoon Portal Engine.</p>
         <p>The Cocoon portal page you currently view displays some so called
           <em>Coplets</em> (= Cocoon Portlets). Each coplet displays
@@ -43,8 +43,8 @@
           feature might have an impact on the performance.
         </p>
         <p>For more information <fork href="http://cocoon.apache.org">visit the
Cocoon Homepage</fork>.</p>
-     </s1> 
-     <s1 title="The JSR 168">
+     </section> 
+     <section title="The JSR 168">
         <p>The Cocoon portal supports portlets conforming to the JSR 168. The JSR 168
tab contains 
            a sample using the testsuite from the <fork href="http://portals.apache.org/pluto">Pluto
project</fork>.</p>
         <p>These samples only work if you follow these installation instructions:</p>
@@ -59,8 +59,8 @@
         <p>The current implementation searches for portlets in all directories that
are next to
          the Cocoon webapp directory. So, if you put Cocoon into the webapps directory of
Tomcat,
          you should put your portlets there as well.</p>
-     </s1>
-     <s1 title="WSRP">
+     </section>
+     <section title="WSRP">
         <p>The Cocoon portal supports portlets conforming to the WSRP. The WSRP tab
contains 
            a sample using the testsuite from the <fork href="http://ws.apache.org/wsrp4j">WSRP4J
project</fork>.</p>
         <p>These samples only work if you follow these installation instructions:</p>
@@ -68,6 +68,6 @@
          <li>Get the WSRP4J project and install it into Tomcat (Test WSRP using the
SwingConsumer now).</li>
          <li>Start up Tomcat (with the WSRP producer) and Cocoon (using Jetty) and
run the Cocoon portal demo. You should see the WSRP portlets now.</li>
         </ul>
-     </s1>
+     </section>
   </body>
 </document>

Modified: cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-intro.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-intro.xml?rev=332553&r1=332552&r2=332553&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-intro.xml (original)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-intro.xml Fri Nov 11 05:53:19
2005
@@ -22,7 +22,7 @@
 	 <type>Overview document</type> 
   </header> 
   <body> 
-	 <s1 title="The Apache Cocoon Portal"> 
+	 <section title="The Apache Cocoon Portal"> 
 		<p>This is a demo of the Cocoon Portal Engine.</p>
         <p>The Cocoon portal page you currently view displays some so called
           <em>Coplets</em> (= Cocoon Portlets). Each coplet displays
@@ -35,7 +35,7 @@
           feature might have an impact on the performance.
         </p>
         <p>For more information <fork href="http://cocoon.apache.org">visit the
Cocoon Homepage</fork>.</p>
-     </s1> 
+     </section> 
 
   </body>
 </document>

Modified: cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-left.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-left.xml?rev=332553&r1=332552&r2=332553&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-left.xml (original)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-left.xml Fri Nov 11 05:53:19
2005
@@ -22,14 +22,14 @@
 	 <type>Overview document</type> 
   </header> 
   <body> 
-	 <s1 title="Flexible Layout"> 
+	 <section title="Flexible Layout"> 
        <p>You are absolutly free in defining the portal layout. You can combine
          the usual layout elements, like rows and columns, in any order and
          even can nest them.</p>
        <p>By this you can create coplets, like the sample above and below, that span
          more than one column etc.</p>
        <p>Even more complex elements, like tabs are possible.</p>
-   </s1> 
+   </section> 
 
   </body>
 </document>

Modified: cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-right.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-right.xml?rev=332553&r1=332552&r2=332553&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-right.xml (original)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/docs/portal-right.xml Fri Nov 11 05:53:19
2005
@@ -22,11 +22,11 @@
 	 <type>Overview document</type> 
   </header> 
   <body> 
-<s1 title="Customization"> 
+  <section title="Customization"> 
 <p>The whole portal engine is built up by a set of (Avalon) components.
   You can customize (change/enhance) every aspect of the portal by
   using a different component for the same task.</p>
-   </s1> 
+   </section> 
 
   </body>
 </document>

Modified: cocoon/blocks/portal-sample/trunk/samples/coplets/docs/static-info.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/docs/static-info.xml?rev=332553&r1=332552&r2=332553&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/docs/static-info.xml (original)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/docs/static-info.xml Fri Nov 11 05:53:19
2005
@@ -22,7 +22,7 @@
     <type>Overview document</type> 
   </header> 
   <body> 
-    <s1 title="Static Parts">
+    <section title="Static Parts">
       <p>
         This is a static coplet that is always visible. Even if other coplets are maximized
this
         coplet is still visible.
@@ -31,6 +31,6 @@
         You can display important information or news or a navigation etc. here. Have a look
at
         the layout definition for this user for more information how this can be done.
       </p>
-    </s1>
+    </section>
   </body>
 </document>

Modified: cocoon/blocks/portal-sample/trunk/samples/coplets/docs/styles/document2html.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/docs/styles/document2html.xsl?rev=332553&r1=332552&r2=332553&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/docs/styles/document2html.xsl (original)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/docs/styles/document2html.xsl Fri Nov
11 05:53:19 2005
@@ -18,8 +18,6 @@
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:param name="isfaq"/>
   <xsl:template match="document">
-  	<!-- Allready done by portal!
-    <td colspan="2" valign="top" class="content"-->
       <xsl:if test="normalize-space(header/title)!=''">
         <h1>
           <xsl:value-of select="header/title"/>
@@ -44,31 +42,8 @@
         </p>
       </xsl:if>
       <xsl:apply-templates select="body"/>
-    <!--/td  see above!-->
   </xsl:template>
   <xsl:template match="body">
-    <xsl:if test="section and not($isfaq='true')">
-      <ul class="minitoc">
-        <xsl:for-each select="section">
-          <li>
-            <a href="#{generate-id()}">
-              <xsl:value-of select="title"/>
-            </a>
-            <xsl:if test="section">
-              <ul class="minitoc">
-                <xsl:for-each select="section">
-                  <li>
-                    <a href="#{generate-id()}">
-                      <xsl:value-of select="title"/>
-                    </a>
-                  </li>
-                </xsl:for-each>
-              </ul>
-            </xsl:if>
-          </li>
-        </xsl:for-each>
-      </ul>
-    </xsl:if>
     <xsl:apply-templates/>
   </xsl:template>
 <!--  section handling
@@ -78,13 +53,11 @@
     nesting depth
 -->
   <xsl:template match="section">
-    <a name="{generate-id()}"/>
-    <xsl:if test="normalize-space(@id)!=''">
-      <a name="{@id}"/>
+    <xsl:if test="title">
+      <h3>
+        <xsl:value-of select="title"/>
+      </h3>
     </xsl:if>
-    <h3>
-      <xsl:value-of select="title"/>
-    </h3>
     <xsl:apply-templates select="*[not(self::title)]"/>
   </xsl:template>
   <xsl:template match="section/section">

Modified: cocoon/trunk/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java?rev=332553&r1=332552&r2=332553&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java Fri Nov
11 05:53:19 2005
@@ -29,8 +29,10 @@
 import org.apache.cocoon.transformation.helpers.IncludeCacheManager;
 import org.apache.cocoon.transformation.helpers.IncludeCacheManagerSession;
 import org.apache.cocoon.xml.IncludeXMLConsumer;
+import org.apache.cocoon.xml.NamespacesTable;
 import org.apache.cocoon.xml.XMLConsumer;
 import org.apache.cocoon.xml.XMLUtils;
+import org.apache.cocoon.xml.NamespacesTable.Declaration;
 
 import org.apache.commons.lang.BooleanUtils;
 import org.apache.commons.lang.StringUtils;
@@ -178,7 +180,10 @@
     /** Remember the start time of the request for profiling */
     protected long startTime;
 
-   /**
+    /** A {@link NamespacesTable} used to filter namespace declarations. */
+    protected NamespacesTable namespaces;
+
+    /**
      * Constructor
      * Set the namespace
      */
@@ -203,6 +208,7 @@
             getLogger().debug("Starting, session " + this.cachingSession);
             this.startTime = System.currentTimeMillis();
         }
+        this.namespaces = new NamespacesTable();
     }
 
     /**
@@ -250,10 +256,14 @@
             this.startTime = 0;
         }
         this.filter = null;
+        this.namespaces = null;
 
         super.recycle();
     }
 
+    /**
+     * @see org.apache.cocoon.transformation.AbstractSAXTransformer#startTransformingElement(java.lang.String,
java.lang.String, java.lang.String, org.xml.sax.Attributes)
+     */
     public void startTransformingElement(String uri, String name, String raw, Attributes
attr)
     throws ProcessingException ,IOException, SAXException {
         // Element: include
@@ -335,6 +345,9 @@
         }
     }
 
+    /**
+     * @see org.apache.cocoon.transformation.AbstractSAXTransformer#endTransformingElement(java.lang.String,
java.lang.String, java.lang.String)
+     */
     public void endTransformingElement(String uri, String name, String raw)
     throws ProcessingException, IOException, SAXException {
         if (name.equals(CINCLUDE_INCLUDE_ELEMENT)) {
@@ -650,6 +663,41 @@
             }
         }
         super.endDocument();
+    }
+
+    /**
+     * <p>Receive notification of the start of a prefix mapping.</p>
+     *
+     * <p>This transformer will remove all prefix mapping declarations for those
+     * prefixes associated with the <code>http://apache.org/cocoon/include/1.0</code>
+     * namespace.</p>
+     *
+     * @see org.xml.sax.ContentHandler#startPrefixMapping(String, String)
+     */
+    public void startPrefixMapping(String prefix, String nsuri)
+    throws SAXException {
+        // Skipping mapping for our namespace
+        this.namespaces.addDeclaration(prefix, nsuri);
+        if (!CINCLUDE_NAMESPACE_URI.equals(nsuri)) {
+            super.startPrefixMapping(prefix, nsuri);
+        }
+    }
+
+    /**
+     * <p>Receive notification of the end of a prefix mapping.</p>
+     *
+     * <p>This transformer will remove all prefix mapping declarations for those
+     * prefixes associated with the <code>http://apache.org/cocoon/include/1.0</code>
+     * namespace.</p>
+     *
+     * @see org.xml.sax.ContentHandler#endPrefixMapping(java.lang.String)
+     */
+    public void endPrefixMapping(String prefix)
+    throws SAXException {
+        Declaration d = this.namespaces.removeDeclaration(prefix);
+        if ( d == null || !CINCLUDE_INCLUDE_ELEMENT.equals(d.getUri()) ) {
+            super.endPrefixMapping(prefix);
+        }
     }
 
     /**



Mime
View raw message