You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by th...@apache.org on 2006/03/19 04:22:58 UTC

svn commit: r386919 - in /lenya/sandbox/doco: .settings/ config/ lenya/ lenya/modules/ lenya/modules/bxe/ lenya/modules/bxe/resources/ lenya/modules/bxe/resources/misc/ modules/xdocs/ modules/xdocs/config/ modules/xdocs/config/cocoon-xconf/ modules/xdo...

Author: thorsten
Date: Sat Mar 18 19:22:55 2006
New Revision: 386919

URL: http://svn.apache.org/viewcvs?rev=386919&view=rev
Log:
Adding xdocs module. The bxe editing is not working, need to fix this.

Added:
    lenya/sandbox/doco/lenya/
    lenya/sandbox/doco/lenya/modules/
    lenya/sandbox/doco/lenya/modules/bxe/
    lenya/sandbox/doco/lenya/modules/bxe/resources/
    lenya/sandbox/doco/lenya/modules/bxe/resources/misc/
    lenya/sandbox/doco/lenya/modules/bxe/resources/misc/content-namespaces.xml
      - copied, changed from r386692, lenya/trunk/src/modules/bxe/resources/misc/content-namespaces.xml
    lenya/sandbox/doco/modules/xdocs/
    lenya/sandbox/doco/modules/xdocs/config/
    lenya/sandbox/doco/modules/xdocs/config/cocoon-xconf/
    lenya/sandbox/doco/modules/xdocs/config/cocoon-xconf/module.xconf   (with props)
    lenya/sandbox/doco/modules/xdocs/config/menus/
    lenya/sandbox/doco/modules/xdocs/config/menus/xdocs.xsp   (with props)
    lenya/sandbox/doco/modules/xdocs/menus.xmap   (with props)
    lenya/sandbox/doco/modules/xdocs/module.xml   (with props)
    lenya/sandbox/doco/modules/xdocs/resources/
    lenya/sandbox/doco/modules/xdocs/resources/schemas/
    lenya/sandbox/doco/modules/xdocs/resources/schemas/document-v20.mod.rng
      - copied unchanged from r386153, forrest/trunk/main/webapp/resources/schema/relaxng/document-v20.mod.rng
    lenya/sandbox/doco/modules/xdocs/resources/schemas/xdocs.rng
      - copied, changed from r386153, forrest/trunk/main/webapp/resources/schema/relaxng/document-v20.rng
    lenya/sandbox/doco/modules/xdocs/samples/
    lenya/sandbox/doco/modules/xdocs/samples/xdocs.xml
      - copied unchanged from r386153, forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples/sample.xml
    lenya/sandbox/doco/modules/xdocs/sitemap.xmap   (with props)
    lenya/sandbox/doco/modules/xdocs/xslt/
    lenya/sandbox/doco/modules/xdocs/xslt/xdocs2xhtml.xsl   (with props)
    lenya/sandbox/doco/xslt/page2xhtml-xdocs.xsl   (with props)
Modified:
    lenya/sandbox/doco/.settings/org.eclipse.core.resources.prefs
    lenya/sandbox/doco/config/publication.xconf

Modified: lenya/sandbox/doco/.settings/org.eclipse.core.resources.prefs
URL: http://svn.apache.org/viewcvs/lenya/sandbox/doco/.settings/org.eclipse.core.resources.prefs?rev=386919&r1=386918&r2=386919&view=diff
==============================================================================
--- lenya/sandbox/doco/.settings/org.eclipse.core.resources.prefs (original)
+++ lenya/sandbox/doco/.settings/org.eclipse.core.resources.prefs Sat Mar 18 19:22:55 2006
@@ -1,4 +1,4 @@
-#Tue Mar 14 02:31:13 CET 2006
+#Fri Mar 17 19:34:51 CET 2006
 eclipse.preferences.version=1
 encoding//config/ac/ac.xconf=UTF-8
 encoding//config/publication.xconf=UTF-8

Modified: lenya/sandbox/doco/config/publication.xconf
URL: http://svn.apache.org/viewcvs/lenya/sandbox/doco/config/publication.xconf?rev=386919&r1=386918&r2=386919&view=diff
==============================================================================
--- lenya/sandbox/doco/config/publication.xconf (original)
+++ lenya/sandbox/doco/config/publication.xconf Sat Mar 18 19:22:55 2006
@@ -22,6 +22,7 @@
   <module name="links"/>
   <module name="opendocument"/>
   <module name="cforms"/>
+  <module name="xdocs"/>
   <module name="homepage"/>
   <link-attribute 
     xpath="//*[namespace-uri() = 'http://www.w3.org/1999/xhtml']/@href"/>

Copied: lenya/sandbox/doco/lenya/modules/bxe/resources/misc/content-namespaces.xml (from r386692, lenya/trunk/src/modules/bxe/resources/misc/content-namespaces.xml)
URL: http://svn.apache.org/viewcvs/lenya/sandbox/doco/lenya/modules/bxe/resources/misc/content-namespaces.xml?p2=lenya/sandbox/doco/lenya/modules/bxe/resources/misc/content-namespaces.xml&p1=lenya/trunk/src/modules/bxe/resources/misc/content-namespaces.xml&r1=386692&r2=386919&rev=386919&view=diff
==============================================================================
--- lenya/trunk/src/modules/bxe/resources/misc/content-namespaces.xml (original)
+++ lenya/sandbox/doco/lenya/modules/bxe/resources/misc/content-namespaces.xml Sat Mar 18 19:22:55 2006
@@ -22,4 +22,5 @@
   <xmlns>lenya=http://apache.org/cocoon/lenya/page-envelope/1.0</xmlns>
   <xmlns>dc=http://purl.org/dc/elements/1.1/</xmlns>
   <xmlns>dcterms=http://purl.org/dc/terms/</xmlns>
+  <xmlns>forrest=http://forrest.apache.org/dtd/document-v20/</xmlns>
 </namespaces>

Added: lenya/sandbox/doco/modules/xdocs/config/cocoon-xconf/module.xconf
URL: http://svn.apache.org/viewcvs/lenya/sandbox/doco/modules/xdocs/config/cocoon-xconf/module.xconf?rev=386919&view=auto
==============================================================================
--- lenya/sandbox/doco/modules/xdocs/config/cocoon-xconf/module.xconf (added)
+++ lenya/sandbox/doco/modules/xdocs/config/cocoon-xconf/module.xconf Sat Mar 18 19:22:55 2006
@@ -0,0 +1,33 @@
+<?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.
+-->
+
+<!-- $Id:$ -->
+
+<xconf xpath="/cocoon/resource-types" unless="/cocoon/resource-types/component-instance[@name = 'xdocs']">
+
+  <component-instance name="xdocs"
+                      logger="lenya.resourcetypes.xdocs"
+                      class="org.apache.lenya.cms.publication.ResourceTypeImpl">
+    <schema src="fallback://lenya/modules/xdocs/resources/schemas/xdocs.rng" language="http://relaxng.org/ns/structure/0.9"/>
+    <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator">
+      <sample-name>fallback://lenya/modules/xdocs/samples/xdocs.xml</sample-name>
+    </creator>
+    <link-attribute xpath="//*[namespace-uri() = 'http://www.w3.org/1999/xhtml']/@href"/>
+    <format name="xhtml" uri="cocoon://modules/xdocs/xhtml.xml"/>
+  </component-instance>
+
+</xconf>

Propchange: lenya/sandbox/doco/modules/xdocs/config/cocoon-xconf/module.xconf
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/sandbox/doco/modules/xdocs/config/menus/xdocs.xsp
URL: http://svn.apache.org/viewcvs/lenya/sandbox/doco/modules/xdocs/config/menus/xdocs.xsp?rev=386919&view=auto
==============================================================================
--- lenya/sandbox/doco/modules/xdocs/config/menus/xdocs.xsp (added)
+++ lenya/sandbox/doco/modules/xdocs/config/menus/xdocs.xsp Sat Mar 18 19:22:55 2006
@@ -0,0 +1,58 @@
+<?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.
+-->
+
+<!-- $Id:$ -->
+
+<xsp:page 
+    language="java" 
+    xmlns:xsp="http://apache.org/xsp"
+    xmlns:xsp-request="http://apache.org/xsp/request/2.0"
+    xmlns:input="http://apache.org/cocoon/xsp/input/1.0"
+    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"    
+    xmlns:wf="http://apache.org/cocoon/lenya/workflow/1.0"
+    xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0"
+    xmlns="http://apache.org/cocoon/lenya/menubar/1.0"
+>
+
+  <xsp:structure>
+    <xsp:include>org.apache.lenya.cms.publication.Document</xsp:include>
+    <xsp:include>org.apache.lenya.cms.publication.Publication</xsp:include>
+  </xsp:structure>
+  
+  <menu>
+
+    <menus>
+      <menu i18n:attr="name" name="File">
+        <block admin="false">
+          <item uc:usecase="site.create" href="?doctype=xdocs"><i18n:text>New xdocs page</i18n:text></item>
+        </block>
+      </menu>
+      <menu i18n:attr="name" name="Edit">
+          <xsp:logic>
+            String doctype = <input:get-attribute module="page-envelope" as="string" name="document-type"/>;
+            if ("xdocs".equals(doctype)) {
+                <block info="false">
+                  <item wf:event="edit" uc:usecase="edit.bxe" href="?"><i18n:text>With BXE</i18n:text></item>
+                </block>
+            }
+          </xsp:logic>
+      </menu>
+      
+    </menus>
+    
+  </menu>
+</xsp:page>

Propchange: lenya/sandbox/doco/modules/xdocs/config/menus/xdocs.xsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/sandbox/doco/modules/xdocs/menus.xmap
URL: http://svn.apache.org/viewcvs/lenya/sandbox/doco/modules/xdocs/menus.xmap?rev=386919&view=auto
==============================================================================
--- lenya/sandbox/doco/modules/xdocs/menus.xmap (added)
+++ lenya/sandbox/doco/modules/xdocs/menus.xmap Sat Mar 18 19:22:55 2006
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<!-- $Id:$ -->
+
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+  
+  <map:pipelines>
+    
+    <map:pipeline>
+      
+      <map:match pattern="**">
+        <map:generate type="serverpages" src="config/menus/xdocs.xsp"/>
+        <map:serialize type="xml"/>
+      </map:match>
+      
+    </map:pipeline>
+    
+  </map:pipelines>
+</map:sitemap>
\ No newline at end of file

Propchange: lenya/sandbox/doco/modules/xdocs/menus.xmap
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/sandbox/doco/modules/xdocs/module.xml
URL: http://svn.apache.org/viewcvs/lenya/sandbox/doco/modules/xdocs/module.xml?rev=386919&view=auto
==============================================================================
--- lenya/sandbox/doco/modules/xdocs/module.xml (added)
+++ lenya/sandbox/doco/modules/xdocs/module.xml Sat Mar 18 19:22:55 2006
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id: publication.xml 374687 2006-02-03 15:24:55Z michi $ -->
+
+<lenya:module xmlns:lenya="http://apache.org/lenya/module/1.0">
+  <lenya:id>org.wyona.lenya.modules.xdocs</lenya:id>
+  <lenya:package>org.wyona.lenya.modules</lenya:package>
+  <lenya:version>0.1-dev</lenya:version>
+  <lenya:name>Template/Blank Module</lenya:name>
+  <lenya:lenya-version>@lenya.version@</lenya:lenya-version>
+  <lenya:description>A template module to help create new modules from scratch</lenya:description>
+</lenya:module>

Propchange: lenya/sandbox/doco/modules/xdocs/module.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: lenya/sandbox/doco/modules/xdocs/resources/schemas/xdocs.rng (from r386153, forrest/trunk/main/webapp/resources/schema/relaxng/document-v20.rng)
URL: http://svn.apache.org/viewcvs/lenya/sandbox/doco/modules/xdocs/resources/schemas/xdocs.rng?p2=lenya/sandbox/doco/modules/xdocs/resources/schemas/xdocs.rng&p1=forrest/trunk/main/webapp/resources/schema/relaxng/document-v20.rng&r1=386153&r2=386919&rev=386919&view=diff
==============================================================================
--- forrest/trunk/main/webapp/resources/schema/relaxng/document-v20.rng (original)
+++ lenya/sandbox/doco/modules/xdocs/resources/schemas/xdocs.rng Sat Mar 18 19:22:55 2006
@@ -96,7 +96,7 @@
 <!-- Document -->
 <!-- =============================================================== -->
 <grammar xmlns="http://relaxng.org/ns/structure/1.0">
-  <include href="document-v20.mod.rng"/>
+  <include href="fallback://lenya/modules/xdocs/resources/schemas/document-v20.mod.rng"/>
   <start>
     <choice>
       <ref name="document"/>

Added: lenya/sandbox/doco/modules/xdocs/sitemap.xmap
URL: http://svn.apache.org/viewcvs/lenya/sandbox/doco/modules/xdocs/sitemap.xmap?rev=386919&view=auto
==============================================================================
--- lenya/sandbox/doco/modules/xdocs/sitemap.xmap (added)
+++ lenya/sandbox/doco/modules/xdocs/sitemap.xmap Sat Mar 18 19:22:55 2006
@@ -0,0 +1,55 @@
+<?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.
+-->
+
+<!-- $Id: doctypes.xmap 179488 2005-06-02 02:29:39Z gregor $ -->
+
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+
+  <map:pipelines>
+
+    <map:pipeline>
+      <!-- View Revision? -->
+      <map:match pattern="*.xml">
+        <map:match type="step" pattern="view-revision">
+          <map:generate type="serverpages" src="fallback://lenya/content/rc/view.xsp">
+          </map:generate>
+          <map:transform src="fallback://lenya/xslt/rc/toDoc.xsl"/>
+          <map:transform src="fallback://lenya/modules/xdocs/xslt/xdocs2xhtml.xsl">
+            <map:parameter name="rendertype" value="{1}"/>
+            <map:parameter name="nodeid" value="{page-envelope:document-name}"/>
+            <map:parameter name="language" value="{page-envelope:document-language}"/>
+          </map:transform>
+          <map:serialize type="xml"/>
+        </map:match>
+      </map:match>
+
+      <!-- parametrized doctype matcher -->
+      <!-- pattern="{rendertype}" -->
+      <map:match pattern="*.xml">
+        <map:generate src="lenyadoc:/{page-envelope:document-language}/{page-envelope:document-id}"/>
+        <map:transform src="fallback://lenya/modules/xdocs/xslt/xdocs2xhtml.xsl">
+          <map:parameter name="rendertype" value="{1}"/>
+          <map:parameter name="nodeid" value="{page-envelope:document-name}"/>
+          <map:parameter name="language" value="{page-envelope:document-language}"/>
+        </map:transform>
+        <map:serialize type="xml"/>
+      </map:match>
+
+    </map:pipeline>
+    
+  </map:pipelines>
+</map:sitemap>

Propchange: lenya/sandbox/doco/modules/xdocs/sitemap.xmap
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/sandbox/doco/modules/xdocs/xslt/xdocs2xhtml.xsl
URL: http://svn.apache.org/viewcvs/lenya/sandbox/doco/modules/xdocs/xslt/xdocs2xhtml.xsl?rev=386919&view=auto
==============================================================================
--- lenya/sandbox/doco/modules/xdocs/xslt/xdocs2xhtml.xsl (added)
+++ lenya/sandbox/doco/modules/xdocs/xslt/xdocs2xhtml.xsl Sat Mar 18 19:22:55 2006
@@ -0,0 +1,298 @@
+<?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.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
+  <xsl:template match="document">
+    <div id="forrest-doc">
+      <div id="forrest-doc-header">
+        <xsl:if test="normalize-space(header/title)!=''">
+          <h1>
+            <xsl:value-of select="header/title"/>
+          </h1>
+        </xsl:if>
+      </div>
+      <xsl:apply-templates select="header/type"/>
+      <xsl:apply-templates select="header/notice"/>
+      <xsl:apply-templates select="header/abstract"/>
+      <xsl:apply-templates select="body"/>
+      <div class="attribution">
+        <xsl:apply-templates select="header/authors"/>
+        <xsl:if test="header/authors and header/version">
+          <xsl:text>; </xsl:text>
+        </xsl:if>
+        <xsl:apply-templates select="header/version"/>
+      </div>
+    </div>
+  </xsl:template>
+    <xsl:template match="body">
+      <xsl:apply-templates/>
+    </xsl:template>
+  <xsl:template match="@id">
+    <xsl:if test="normalize-space(.)!=''">
+      <a name="{.}"/>
+    </xsl:if>
+  </xsl:template>
+  <xsl:template match="section">
+    <!-- count the number of section in the ancestor-or-self axis to compute
+         the title element name later on -->
+    <xsl:variable name="sectiondepth" 
+      select="count(ancestor-or-self::section)"/>
+    <a name="{generate-id()}"/>
+    <xsl:apply-templates select="@id"/>
+    <div id="{@id} ">
+      <xsl:apply-templates select="*[not(self::title)]"/>
+    </div>
+  </xsl:template>
+  <xsl:template match="note | warning | fixme">
+    <xsl:apply-templates select="@id"/>
+    <div>
+      <xsl:call-template name="add.class">
+        <xsl:with-param name="class">
+          <xsl:value-of select="local-name()"/>
+        </xsl:with-param>
+      </xsl:call-template>
+      <div class="label">
+        <xsl:choose>
+          <!-- FIXME: i18n Transformer here -->
+          <xsl:when test="@label">
+            <xsl:value-of select="@label"/>
+          </xsl:when>
+          <xsl:when test="local-name() = 'note'">Note</xsl:when>
+          <xsl:when test="local-name() = 'warning'">Warning</xsl:when>
+          <xsl:otherwise>Fixme (<xsl:value-of 
+            select="@author"/>)</xsl:otherwise>
+        </xsl:choose>
+      </div>
+      <div class="content">
+        <xsl:apply-templates/>
+      </div>
+    </div>
+  </xsl:template>
+  <xsl:template match="notice">
+    <div class="notice">
+    <!-- FIXME: i18n Transformer here -->
+    <xsl:text>Notice: </xsl:text>
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="link">
+    <xsl:apply-templates select="@id"/>
+    <a>
+      <xsl:if test="@class='jump'">
+        <xsl:attribute name="target">_top</xsl:attribute>
+      </xsl:if>
+      <xsl:if test="@class='fork'">
+        <xsl:attribute name="target">_blank</xsl:attribute>
+      </xsl:if>
+      <xsl:copy-of select="@*"/>
+      <xsl:apply-templates/>
+    </a>
+  </xsl:template>
+
+  <xsl:template match="jump">
+    <xsl:apply-templates select="@id"/>
+    <a href="{@href}" target="_top">
+      <xsl:apply-templates/>
+    </a>
+  </xsl:template>
+
+  <xsl:template match="fork">
+    <xsl:apply-templates select="@id"/>
+    <a href="{@href}" target="_blank">
+      <xsl:apply-templates/>
+    </a>
+  </xsl:template>
+   <xsl:template match="p[@xml:space='preserve']">
+    <xsl:apply-templates select="@id"/>
+    <div class="pre">
+      <xsl:copy-of select="@id"/>
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  <xsl:template match="source">
+    <xsl:apply-templates select="@id"/>
+    <pre class="code">
+<!-- Temporarily removed long-line-splitter ... gives out-of-memory problems -->
+      <xsl:copy-of select="@id"/>
+      <xsl:apply-templates/>
+    </pre>
+  </xsl:template>
+
+  <xsl:template match="anchor">
+    <a name="{@id}">
+      <xsl:copy-of select="@id"/>
+    </a>
+  </xsl:template>
+  <xsl:template match="icon">
+    <xsl:apply-templates select="@id"/>
+    <img class="icon">
+      <xsl:copy-of select="@height | @width | @src | @alt | @id"/>
+    </img>
+  </xsl:template>
+
+  <xsl:template match="code">
+    <xsl:apply-templates select="@id"/>
+    <span>
+      <xsl:call-template name="add.class">
+        <xsl:with-param name="class">codefrag</xsl:with-param>
+      </xsl:call-template>
+      <xsl:copy-of select="@id"/>
+      <xsl:value-of select="."/>
+    </span>
+  </xsl:template>
+
+  <xsl:template match="figure">
+    <xsl:apply-templates select="@id"/>
+    
+    <div align="center">
+      <xsl:copy-of select="@id"/>
+      <img class="figure">
+        <xsl:copy-of select="@height | @width | @src | @alt | @id"/>
+      </img>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="table">
+    <xsl:apply-templates select="@id"/>
+    <xsl:choose>
+      <!-- Limit Forrest specific processing to tables without class -->
+      <xsl:when test="not(@class) or @class=''">
+        <table cellpadding="4" cellspacing="1" class="ForrestTable">
+          <xsl:copy-of select="@cellspacing | @cellpadding | @border | @class | @bgcolor |@id"/>
+          <xsl:apply-templates/>
+        </table>    
+      </xsl:when>
+      <xsl:otherwise>
+        <!-- Tables with class are passed without change -->
+        <xsl:copy>
+          <xsl:copy-of select="@*"/>
+          <xsl:apply-templates/>
+        </xsl:copy>    
+        
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:if test="@class = ''">
+      
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="acronym/@title">
+    <xsl:attribute name="title">
+      <xsl:value-of select="normalize-space(.)"/>
+    </xsl:attribute>
+  </xsl:template>
+
+  <xsl:template match="header/authors">
+    <xsl:for-each select="person">
+      <xsl:choose>
+        <xsl:when test="position()=1">by</xsl:when>
+        <xsl:otherwise>,</xsl:otherwise>
+      </xsl:choose>
+      <xsl:text> </xsl:text>
+      <xsl:value-of select="@name"/>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template match="version">
+    <span class="version">
+      <xsl:apply-templates select="@major"/>
+      <xsl:apply-templates select="@minor"/>
+      <xsl:apply-templates select="@fix"/>
+      <xsl:apply-templates select="@tag"/>
+      <xsl:choose>
+        <xsl:when test="starts-with(., '$Revision: ')">
+          version <xsl:value-of select="substring(., 12, string-length(.) -11-2)"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="."/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </span>
+  </xsl:template>
+
+  <xsl:template match="@major">
+     v<xsl:value-of select="."/>
+  </xsl:template>
+
+  <xsl:template match="@minor | @fix">
+     <xsl:value-of select="concat('.',.)"/>
+  </xsl:template>
+
+  <xsl:template match="@tag">
+     <xsl:value-of select="concat('-',.)"/>
+  </xsl:template>
+
+  <xsl:template match="type">
+    <p class="type">
+    <!-- FIXME: i18n Transformer here -->
+    <xsl:text>Type: </xsl:text>
+    <xsl:value-of select="."/>
+    </p>
+  </xsl:template>
+
+  <xsl:template match="abstract">
+    <p>
+      <xsl:apply-templates/>
+    </p>
+  </xsl:template>
+
+  <xsl:template name="email">
+    <a>
+      <xsl:attribute name="href">
+        <xsl:value-of select="concat('mailto:',@email)"/>
+      </xsl:attribute>
+       <xsl:value-of select="@name"/>
+    </a>
+  </xsl:template>
+
+  <xsl:template name="generate-id">
+    <xsl:choose>
+      <xsl:when test="@id">
+        <xsl:value-of select="@id"/>
+      </xsl:when>
+      <xsl:when test="@title">
+        <xsl:value-of select="@title"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="generate-id(.)"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  <xsl:template name="add.class">
+    <!-- use the parameter to set class attribute -->
+    <!-- if there are already classes set, adds to them -->
+    <xsl:param name="class"/> 
+    <xsl:attribute name="class">
+      <xsl:choose>
+        <xsl:when test="@class">
+          <xsl:value-of select="$class"/>
+          <xsl:text> </xsl:text>
+          <xsl:value-of select="@class"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$class"/>
+        </xsl:otherwise>
+      </xsl:choose> 
+    </xsl:attribute>
+  </xsl:template>
+  <xsl:template match="@*|node()" priority="-1">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+  </xsl:template>
+</xsl:stylesheet>

Propchange: lenya/sandbox/doco/modules/xdocs/xslt/xdocs2xhtml.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/sandbox/doco/xslt/page2xhtml-xdocs.xsl
URL: http://svn.apache.org/viewcvs/lenya/sandbox/doco/xslt/page2xhtml-xdocs.xsl?rev=386919&view=auto
==============================================================================
--- lenya/sandbox/doco/xslt/page2xhtml-xdocs.xsl (added)
+++ lenya/sandbox/doco/xslt/page2xhtml-xdocs.xsl Sat Mar 18 19:22:55 2006
@@ -0,0 +1,121 @@
+<?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.
+-->
+
+<!-- $Id: page2xhtml.xsl 386695 2006-03-17 19:21:59Z thorsten $ -->
+
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:xhtml="http://www.w3.org/1999/xhtml"
+    xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
+    xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" 
+    xmlns:dc="http://purl.org/dc/elements/1.1/"
+    exclude-result-prefixes="page xhtml dc lenya"
+    >
+     
+    
+<!-- {context-prefix}/{publication-id}/{area} -->
+<xsl:param name="root"/>
+
+<!-- i.e. doctypes/xhtml-document -->
+<xsl:param name="document-type"/>
+
+<xsl:param name="document-id"/>
+
+<!-- The request url i.e. /lenya/doctypes/xhtml-document_en.html -->
+<xsl:param name="url"/>
+<xsl:param name="language"/>
+<xsl:param name="title"/>
+
+<xsl:template match="cmsbody">
+  <html>
+    <head>
+      <link rel="stylesheet" href="{$root}/css/page.css" type="text/css"/>
+      <!-- Load doctype-specific CSS -->
+      <xsl:choose>
+        <xsl:when test="$document-type">
+            <link rel="stylesheet" href="{$root}/css/{$document-type}.css" type="text/css"/>
+        </xsl:when>
+        <xsl:otherwise>
+            <!-- do nothing -->
+        </xsl:otherwise>
+      </xsl:choose>
+      <meta content="Apache Lenya" name="generator"/>
+      <title><xsl:value-of select="$title"/></title>
+      <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
+    </head>	
+    <body>
+      <div id="page">
+      <table width="100%" cellpadding="0" cellspacing="0" border="0">
+        <tr>
+          <td id="publication-title">
+            <xsl:choose>
+              <xsl:when test="$language = 'de'">
+                Willkommen zur DOCO Publikation!
+              </xsl:when>
+              <xsl:otherwise>
+                Welcome to the DOCO Publication!
+              </xsl:otherwise>
+            </xsl:choose>
+          </td>
+          <td id="project-logo"><img src="{$root}/images/project-logo.png" alt="project logo"/></td>
+        </tr>
+      </table>
+      <xsl:apply-templates select="xhtml:div[@id = 'tabs']"/>
+      <table width="100%" border="0" cellpadding="0" cellspacing="0">
+        <tr>
+          <td valign="top" style="width: 230px">
+            <xsl:apply-templates select="xhtml:div[@id = 'menu']"/>
+          </td>
+          <td valign="top">
+            <div id="main">
+              <xsl:apply-templates select="xhtml:div[@id = 'breadcrumb']"/>
+              <xsl:apply-templates select="xhtml:div[@id = 'search']"/>
+              <xsl:apply-templates select="*[@id = 'forrest-doc']"/>
+              <!--<xsl:copy-of select="//*[local-name()='document']"/>-->
+              <!--<xsl:apply-templates select="//*[local-name()='document']"/>-->
+            </div>
+          </td>
+        </tr>
+      </table>
+      </div>
+    </body>
+  </html>
+</xsl:template>
+  <!--<xsl:template match="*[local-name()='document']">
+    <div>
+      <xsl:attribute name="bxe_xpath">//*[local-name()='document']</xsl:attribute>
+      <xsl:copy-of select="@*"/>
+      <xsl:copy-of select="./*|text()"/>
+    </div>
+  </xsl:template>-->
+  <xsl:template match="*[@id = 'forrest-doc']">
+    <div>
+      <xsl:attribute name="bxe_xpath">//*[local-name()='document']</xsl:attribute>
+      <!--<xsl:copy-of select="@*"/>-->
+       <xsl:apply-templates/>
+      <!--<xsl:copy-of select="./*|text()"/>-->
+    </div>
+  </xsl:template>
+<xsl:template match="@*|node()" priority="-1">
+  <xsl:copy>
+    <xsl:apply-templates select="@*|node()"/>
+  </xsl:copy>
+</xsl:template>
+
+
+</xsl:stylesheet> 

Propchange: lenya/sandbox/doco/xslt/page2xhtml-xdocs.xsl
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org


BXE and xdocs in doco (was Re: svn commit: r386919)

Posted by Thorsten Scherler <th...@apache.org>.
El dom, 19-03-2006 a las 03:22 +0000, thorsten@apache.org escribió:
> Author: thorsten
> Date: Sat Mar 18 19:22:55 2006
> New Revision: 386919
> 
> URL: http://svn.apache.org/viewcvs?rev=386919&view=rev
> Log:
> Adding xdocs module. The bxe editing is not working, need to fix this.

Hi all,
I added a xdocs module to doco. Since forrest did not yet switched to
xhtml2 as internal format, I thought that I write a lenya module which
makes it possible to edit forrest xdocs. ;)

Now everthing is nice when displaying and creating the xdocs, as well
the oneform editor is working fine. :) So it is now possible to create
and edit Apache Forrest xdocs with Apache Lenya. :)

...but editing with BXE is not working. :( 

As soon as I request 
http://localhost:9999/doco/authoring/index/xdoc.html?&lenya.usecase=edit.bxe
BXE starts up without complains, but then the select box on the top left
has no values and the status on left bottom displays "<document>" the
root name of the xdoc.

Then I click in the editing area near "Apache Forrest xdocs" and the
status changes to <document><body><note>. Then I click on <note> and get
(the actual message is longer but I cannot copy it, the following is
from the FF javaScript console):
Error: this.ownerDocument.vdom.firstChild has no properties
Archivo de origen:
http://localhost:9999/modules/bxe/bxe/relaxng/NodeVAL.js
Línea: 254

If I click on debug-xml I can see the original xml and as well debug-rng
is showing the relaxng schema.

Can it be that I need to define as well a
{$LENYA_HOME}/src/modules/bxe/resources/misc/contextmenu.xml? 

If so, can I re-use the rng and how?

Or is the problem in the xdocs sample where we define 
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN"
"http://forrest.apache.org/dtd/document-v20.dtd"> which got not copied
to the "new xdocs document"?

Can somebody can give me advice?

The module is here:
http://svn.apache.org/viewcvs.cgi/lenya/sandbox/doco/modules/xdocs/?rev=386919

TIA

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


BXE and xdocs in doco (was Re: svn commit: r386919)

Posted by Thorsten Scherler <th...@apache.org>.
El dom, 19-03-2006 a las 03:22 +0000, thorsten@apache.org escribió:
> Author: thorsten
> Date: Sat Mar 18 19:22:55 2006
> New Revision: 386919
> 
> URL: http://svn.apache.org/viewcvs?rev=386919&view=rev
> Log:
> Adding xdocs module. The bxe editing is not working, need to fix this.

Hi all,
I added a xdocs module to doco. Since forrest did not yet switched to
xhtml2 as internal format, I thought that I write a lenya module which
makes it possible to edit forrest xdocs. ;)

Now everthing is nice when displaying and creating the xdocs, as well
the oneform editor is working fine. :) So it is now possible to create
and edit Apache Forrest xdocs with Apache Lenya. :)

...but editing with BXE is not working. :( 

As soon as I request 
http://localhost:9999/doco/authoring/index/xdoc.html?&lenya.usecase=edit.bxe
BXE starts up without complains, but then the select box on the top left
has no values and the status on left bottom displays "<document>" the
root name of the xdoc.

Then I click in the editing area near "Apache Forrest xdocs" and the
status changes to <document><body><note>. Then I click on <note> and get
(the actual message is longer but I cannot copy it, the following is
from the FF javaScript console):
Error: this.ownerDocument.vdom.firstChild has no properties
Archivo de origen:
http://localhost:9999/modules/bxe/bxe/relaxng/NodeVAL.js
Línea: 254

If I click on debug-xml I can see the original xml and as well debug-rng
is showing the relaxng schema.

Can it be that I need to define as well a
{$LENYA_HOME}/src/modules/bxe/resources/misc/contextmenu.xml? 

If so, can I re-use the rng and how?

Or is the problem in the xdocs sample where we define 
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN"
"http://forrest.apache.org/dtd/document-v20.dtd"> which got not copied
to the "new xdocs document"?

Can somebody can give me advice?

The module is here:
http://svn.apache.org/viewcvs.cgi/lenya/sandbox/doco/modules/xdocs/?rev=386919

TIA

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)