You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/11/01 11:08:00 UTC

svn commit: r590953 - in /lenya/sandbox/pubs/docu: ./ resources/ resources/shared/ resources/shared/css/ resources/shared/images/ xslt/

Author: andreas
Date: Thu Nov  1 03:07:56 2007
New Revision: 590953

URL: http://svn.apache.org/viewvc?rev=590953&view=rev
Log:
Layout update

Added:
    lenya/sandbox/pubs/docu/resources/
    lenya/sandbox/pubs/docu/resources/shared/
    lenya/sandbox/pubs/docu/resources/shared/css/
    lenya/sandbox/pubs/docu/resources/shared/css/page.css
    lenya/sandbox/pubs/docu/resources/shared/images/
    lenya/sandbox/pubs/docu/resources/shared/images/project-logo-small.png   (with props)
    lenya/sandbox/pubs/docu/resources/shared/images/project-logo.png   (with props)
    lenya/sandbox/pubs/docu/sitemap.xmap
    lenya/sandbox/pubs/docu/xslt/
    lenya/sandbox/pubs/docu/xslt/page2xhtml.xsl

Added: lenya/sandbox/pubs/docu/resources/shared/css/page.css
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/resources/shared/css/page.css?rev=590953&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/resources/shared/css/page.css (added)
+++ lenya/sandbox/pubs/docu/resources/shared/css/page.css Thu Nov  1 03:07:56 2007
@@ -0,0 +1,474 @@
+/*
+* 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.
+*/
+
+/* page */
+
+@import url("news.css");
+
+#page {
+    padding: 0px;
+    margin: 0px;
+}
+
+/* tabs */
+
+#tabs {
+    clear: left;
+    border-bottom: solid 5px #DDBBBB;
+    color: Maroon;
+}
+
+#tabs a {
+    text-decoration: none;
+    color: Maroon;
+}
+
+#tabs table {
+    font-family: Verdana, Arial, Sans-serif;
+    font-size: 80%;
+}
+
+#tabs td {
+    vertical-align: bottom;
+}
+
+#tabs div {
+    white-space: nowrap;
+}
+
+.tab a, .tab-selected a {
+    display: block;
+}
+
+.tab a span, .tab-selected a span {
+    padding: .3em .6em;
+    display: block;
+}
+
+.tab a span {
+    background: url('/modules/svg/tab-topRight-5-FFEEEE-BB9999.png') right top no-repeat;
+    border-bottom: solid 1px #BB9999;
+}
+
+.tab a {
+    background: url('/modules/svg/tab-topLeft-5-FFEEEE-BB9999.png') left top no-repeat;
+}
+
+.tab a:hover span {
+    background: url('/modules/svg/tab-topRight-5-EECCCC-BB9999.png') right top no-repeat;
+    border-bottom: solid 1px #BB9999;
+}
+  
+.tab a:hover {
+    background: url('/modules/svg/tab-topLeft-5-EECCCC-BB9999.png') left top no-repeat;
+}
+  
+.tab-selected a span {
+    background: url('/modules/svg/tab-topRight-5-DDBBBB-BB9999.png') right top no-repeat;
+    border-bottom: solid 1px #DDBBBB;
+}
+
+.tab-selected a {
+    background: url('/modules/svg/tab-topLeft-5-DDBBBB-BB9999.png') left top no-repeat;
+}
+
+.tab-separator {
+    border-bottom: solid 1px #BB9999;
+}
+
+.tab-pre-separator {
+    width: 25px;
+    border-bottom: solid 1px #BB9999;
+}
+
+td.tab-post-separator {
+    width: 100%;
+}
+
+/* menu */
+
+#menu {
+    font-family: Verdana, Arial, Sans-serif;
+    border: solid 1px #BB9999;
+    border-left: none;
+    border-top: none;
+    color: Maroon;
+    padding: 5px 0px 5px 0px;
+  background-color: #FFCCCC;
+}
+
+#menu a {
+    text-decoration: none;
+    color: Maroon;
+}
+
+#menu a:hover {
+    text-decoration: underline;
+}
+
+
+.menublock-1, .menublock-selected-1 {
+    padding: 0px;
+    /*
+    border-top: solid 1px #DDBBBB;
+    background: #FFCCCC;
+    */
+}
+
+.menublock-1 .menublock-2 { display: none; }
+.menublock-2 .menublock-3 { display: none; }
+.menublock-3 .menublock-4 { display: none; }
+.menublock-4 .menublock-5 { display: none; }
+
+.menuitem-1, .menuitem-selected-1,
+.menuitem-2, .menuitem-selected-2,
+.menuitem-3, .menuitem-selected-3,
+.menuitem-4, .menuitem-selected-4,
+.menuitem-5, .menuitem-selected-5 {
+  font-size: 80%;
+}
+  
+.menuitem-1, .menuitem-selected-1 {
+  margin: 10px 0px 0px 0px;
+  padding: 2px 5px 2px 30px;
+  background: url('/default/live/images/bullet.png') 16px .4em no-repeat;
+}
+
+.menuitem-2, .menuitem-selected-2 {
+  padding: 2px 5px 2px 50px;
+  background: url('/default/live/images/bullet.png') 36px .4em no-repeat;
+}
+
+.menuitem-3, .menuitem-selected-3 {
+  padding: 2px 5px 2px 70px;
+  background: url('/default/live/images/bullet.png') 56px .4em no-repeat;
+}
+  
+.menuitem-4, .menuitem-selected-4 {
+  padding: 2px 5px 2px 90px;
+  background: url('/default/live/images/bullet.png') 76px .4em no-repeat;
+}
+  
+.menuitem-5, .menuitem-selected-5 {
+  padding: 2px 5px 2px 110px;
+  background: url('/default/live/images/bullet.png') 96px .4em no-repeat;
+}
+  
+
+.menuitem-selected-1,
+.menuitem-selected-2,
+.menuitem-selected-3,
+.menuitem-selected-4,
+.menuitem-selected-5 {
+  background-color: #FFEEEE;
+/*
+  color: black;
+  background-color: #BB9999;
+  font-weight: bold;
+*/
+}
+  
+/* breadcrumb */
+
+#breadcrumb {
+    padding: 3px 0px 3px 30px;
+    background-color: #FFEEEE;
+    border-top: solid 1px #BB9999;
+    border-bottom: solid 1px #BB9999;
+    font-family: Verdana, Arial, Sans-serif;
+    font-size: 80%;
+}
+
+#breadcrumb a {
+    text-decoration: none;
+    color: Maroon;
+}
+
+#search {
+    font-family: Verdana, Arial, Sans-serif;
+    font-size: 100%;
+    margin-right: 10px;
+    float: right;
+    position:relative;
+    top:-20px
+}
+
+input.searchfield {
+    font-size: 80%;
+    background-color: #ffffff;
+    border: 1px solid #BB9999;
+}
+
+input.searchsubmit {
+    font-size: 80%;
+    color: Maroon;
+    background-color: #FFEEEE;
+    border: 1px solid #BB9999;
+}
+
+input.searchsubmit:hover {
+    background-color: #DDBBBB;
+}
+
+/*
+#search a {
+    text-decoration: none;
+    color: Maroon;
+}
+*/
+
+/* body */
+
+body {
+    font-family: Verdana, Arial, Sans-serif;
+}
+
+#body {
+    border: none;
+    padding: 1em;
+    margin-left: 10px;
+}
+
+#footer {
+    border: none;
+    border-top: 1px solid #BBBB99;
+    padding: 0em 1em;
+    margin-left: 10px;
+    font-style: italic;
+    color: Maroon;
+}
+
+#main {
+/*
+    float: left;
+    width: 80%;
+*/
+}
+
+h1 { font-size: 140%; }
+h2 { font-size: 100%; }
+h3 { font-size: 80%; }
+p { font-size: 80%; }
+li { font-size: 80%; }
+
+.crossheading { font-weight: bold; font-size: 110%; }
+
+table.simple {
+    border-collapse: collapse;
+/*
+    background-color: #909090;
+    border-color: #909090;
+*/
+    width: auto;
+}
+
+div#body td {
+    font-size: small;
+}
+
+td.simple {
+    font-size: 80%;
+    padding: 3px;
+    background-color: White;
+    border: solid 1px Navy;
+    vertical-align: top;
+}
+
+th.vertical {
+  font-size: small;
+  font-weight: normal;
+  text-align: right;
+  padding-right: 1em;
+  color: #666666;
+}
+  
+img.simple {
+}
+
+#publication-title {
+    font-family: verdana, arial, sans-serif;
+    font-weight: bold;
+    font-size: 20px;
+    vertical-align: bottom;
+    padding-left: 25px;
+    padding-bottom: 15px;
+    color: Maroon;
+}
+
+#projectLogo {
+    padding: 15px 0 10px 25px;
+}
+
+#projectLogo img {
+    vertical-align: baseline;
+}
+
+#projectLogo, #tagline {
+    float: left;
+}
+
+#tagline {
+    font-weight: bold;
+    color: Maroon;
+    padding-top: 57px;
+}
+
+.media {
+    text-align: center;
+    padding: 10px;
+}
+
+.caption {
+    padding: 5px;
+    text-align: center;
+    font-style: italic;
+    font-size: 80%;
+}
+
+.abstract {
+    font-weight: bold;
+}
+
+h1 {
+    font-size: 120%;
+    color: Maroon;
+}
+
+h2 {
+    font-size: 100%;
+    color: Maroon;
+    border-bottom: solid 1px #BB9999;
+    margin-top: 30px;
+}
+
+.asset { 
+    display: block;
+    color: #000;
+    margin: 10px 10px 10px 5px;
+    font-size: small;
+}
+
+.asset img {
+    vertical-align: middle;
+}
+
+div.search-box {
+	border: solid 1px #CCCCCC;
+	width: auto;
+	max-width: 100%;
+	font-size: small;
+	margin-bottom: 10px;
+}
+
+div.search-box-title {
+    background-color: #DDDCCF;
+	border-bottom: solid 1px #CCCCCC;
+	color: Black;
+	font-weight: bold;
+	padding: 3px 10px;
+}
+
+div.search-box-body {
+    padding: 10px;
+    background-color: #F5F4E9;
+	color: Black;
+}
+
+table.search-table {
+	color: Black;
+	background-color: White;
+	border-spacing: 0px;
+	border-collapse: collapse;
+}
+
+table.search-table-noborder {
+	border: 0px;
+	border-spacing: 0px;
+}
+
+table.search-table th {
+    background-color: #DDDCCF;
+	border: solid 1px #CCCCCC;
+	color: Black;
+	font-weight: bold;
+	padding: 3px 10px;
+	text-align: left;
+	font-size: small;
+}
+
+table.search-table td {
+    background-color: #F5F4E9;
+	border: solid 1px #CCCCCC;
+	padding: 3px 10px;
+	font-size: small;
+	color: Black;
+}
+
+table.search-table-noborder td {
+	border: 0px;
+	padding: 3px 10px;
+	font-size: small;
+}
+
+table.search-table-noborder-nopadding td {
+	border: 0px;
+	padding: 0px;
+	font-size: small;
+}
+
+table.search-table-noborder-nopadding th {
+	font-size: small;
+}
+
+/* Broken Internal Links in Authoring area */
+a.brokenlink {
+    background-color: yellow;
+    border: 1px dashed #000000;
+    text-decoration: none;
+}
+
+/* Search Results */
+
+.search-results {
+    list-style-type: none;
+    margin: 0;
+    padding: 0;
+} 
+
+.search-result {
+    padding: 0.50em 0;
+}
+
+.search-result-score {
+    font-size: 90%;
+    font-weight: normal;
+}
+
+.search-result-rank {
+    float: left; 
+}
+
+.search-result-title {
+    margin: 0 0 0 30px;
+    padding: 0;
+    font-weight: bold;
+}
+
+.search-result-description {
+    margin-left: 30px;
+    color: #999999;
+}

Added: lenya/sandbox/pubs/docu/resources/shared/images/project-logo-small.png
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/resources/shared/images/project-logo-small.png?rev=590953&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/sandbox/pubs/docu/resources/shared/images/project-logo-small.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/sandbox/pubs/docu/resources/shared/images/project-logo.png
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/resources/shared/images/project-logo.png?rev=590953&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/sandbox/pubs/docu/resources/shared/images/project-logo.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/sandbox/pubs/docu/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/sitemap.xmap?rev=590953&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/sitemap.xmap (added)
+++ lenya/sandbox/pubs/docu/sitemap.xmap Thu Nov  1 03:07:56 2007
@@ -0,0 +1,495 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: sitemap.xmap 590726 2007-10-31 15:55:12Z nettings $ -->
+
+
+<!-- ============ cruft removal project: ================
+
+   lenyabody-**  is only used internally in this sitemap and could be refactored without side effects.
+   currently we use lenyabody-raw-[edit|view], lenyabody-[edit|view], and now also document-content.
+   i'm sure this can be simplified.
+
+-->
+
+
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+
+  <map:components>
+    <map:transformers default="xslt">
+      <map:transformer name="metaData" logger="lenya.sitemap.transformer.metaData" src="org.apache.lenya.cms.cocoon.transformation.MetaDataTransformer"/>
+    </map:transformers>
+    <map:serializers default="xhtml">
+      <map:serializer logger="sitemap.serializer.links" name="links" src="org.apache.lenya.cms.cocoon.serialization.LinkSerializer"/>
+    </map:serializers>
+  </map:components>
+
+  <map:views>
+<!-- ============ cruft removal project: ================
+
+this view's from-label does not exist.
+
+    <map:view from-label="aggregation" name="aggregation">
+      <map:serialize type="xml"/>
+    </map:view>
+
+-->
+    <map:view from-position="last" name="links">
+      <map:serialize type="links" />
+    </map:view>
+  </map:views>
+
+<!-- =========================== Resources ================================= -->
+
+  <map:resources>
+    <map:resource name="style-cms-page">
+      <map:transform type="i18n">      
+        <map:parameter name="locale" value="{request:locale}"/>
+      </map:transform>    
+      <map:transform src="fallback://lenya/xslt/util/page2xhtml.xsl"/>
+      <map:transform src="context://lenya/xslt/util/strip_namespaces.xsl"/>
+      <map:transform type="proxy"/>
+    </map:resource>
+  </map:resources>
+  
+  <map:pipelines>
+
+    <!-- FIXME: the location of Lenya's cache should either be a global convention 
+         or a per-publication configuration option in publication.xml. -->
+    <map:component-configurations>
+      <global-variables>
+        <cache-dir>work/cache</cache-dir>
+      </global-variables>
+    </map:component-configurations>
+
+
+
+
+    <!-- This pipeline handles helper requests and metadata, not the actual publication documents -->
+    <map:pipeline>
+
+      <!-- Neutron introspection
+           The location of the introspection file is defined in <link rel="neutron-introspection"/>
+           (see xslt/page2xhtml.xsl).
+      -->
+      <map:match pattern="*/**/introspection.xml">
+        <map:select type="resource-exists">
+          <map:when test="fallback://lenya/modules/neutron/sitemap.xmap">
+            <!-- NB: there are problems with the fallback:// source factory when mounting sitemaps, 
+                 that's why the corresponding input module {fallback:} is used. -->
+            <map:mount 
+              uri-prefix="" 
+              src="{fallback:lenya/modules/neutron/sitemap.xmap}" 
+              check-reload="true" 
+              reload-method="synchron"
+            />
+          </map:when>
+          <map:otherwise>
+            <map:generate src="context:/lenya/content/util/empty.xml"/>
+            <map:serialize type="xml"/>
+          </map:otherwise>
+        </map:select>
+      </map:match>
+ 
+<!--
+   FIXME: the whole webdav shebang should be handled by the webdav module sitemap.
+-->
+     <!-- catch webdav GET requests. -->
+        <map:match pattern="*/webdav**">
+          <map:mount uri-prefix="{1}/" src="{fallback:lenya/modules/webdav/sitemap.xmap}" check-reload="true" reload-method="synchron"/>    
+        </map:match>
+
+        <!-- catch PUT requests (used by webdav clients) -->
+        <map:select type="request-method">
+          <!-- many client editors like to PUT changes -->
+          <map:when test="PUT">
+            <map:mount uri-prefix="" src="{fallback:lenya/modules/webdav/sitemap.xmap}" check-reload="true" reload-method="synchron"/>
+          </map:when>
+        </map:select>
+      
+      <!-- FIXME: this should be merged with the getDoctypeXSLT/* matcher below. currently, it is necessary
+           so that "getDoctypeXSLT/" requests do not get eaten by the **/ matcher below. 
+           Plus it should be moved to an internal-only pipeline.
+      -->
+      <map:match pattern="getDoctypeXSLT/">
+        <map:generate src="fallback://xslt/page2xhtml.xsl"/>
+        <map:serialize type="xml"/>
+      </map:match>
+      
+      <!-- Requests ending in a slash are redirected to the corresponding index.html page to mimic
+           standard web browser behaviour. -->
+      <!-- FIXME: this will trigger a HTTP redirect. Maybe it's more effective to do an internal redirect using
+           a cocoon:/ URI? An apache httpd server will not send a HTTP redirect when a directory is requested, but
+           serve the index.html file implicitly IIRC. -->
+      <map:match pattern="**/">
+        <map:redirect-to uri="index.html"/>
+      </map:match>
+
+    </map:pipeline>
+    
+
+    <map:pipeline type="caching">
+
+      <!-- RSS formatting. 
+           FIXME: this should be handled by an RSS feed module!
+      -->
+      <map:match pattern="**.rss">
+        <map:generate src="{resource-type:format-rss}"/>
+        <map:serialize type="xml"/>
+      </map:match>
+      
+      <!-- FIXME: either this should be moved into a metadata module, or at least we need to establish
+           some standard for magic extra suffixes and stick to it.
+           Here we use .html.meta, bxe uses .bxe.html.
+      -->
+      <map:match pattern="*/**.html.meta">
+        <map:generate type="lenyaMetaData" src="lenya-document:{page-envelope:document-uuid},area={1}"/>
+        <map:serialize type="xml"/>
+      </map:match>
+      <map:match pattern="**meta">
+        <map:generate type="lenyaMetaData" src="lenya-document:{request-param:uuid},lang={request-param:lang},pubid={request-param:pubid},area={request-param:area}"/>
+        <map:serialize type="xml"/>
+      </map:match>
+      
+      <!-- {1:rendertype}/{2:pub}/{3:area}/{4:path} -->
+      <map:match pattern="document-content/*/*/*/**">
+        <map:act type="language-exists">
+          <map:generate src="{resource-type:format-xhtml}?rendertype={../1}"/>
+          <map:serialize type="xml"/>
+        </map:act>
+        <!-- if the action fails (i.e. the document does not exist), create a nice error page. -->
+        <map:generate type="serverpages" src="fallback://lenya/content/exception/document-does-not-exist.xsp"/>
+        <map:transform src="fallback://lenya/xslt/exception/document-does-not-exist.xsl">
+          <map:parameter name="requestUrl" value="{request:requestURI}"/>
+          <map:parameter name="contextPath" value="{request:contextPath}"/>
+          <map:parameter name="pub" value="{2}"/>
+          <map:parameter name="path" value="/{4}"/>
+          <map:parameter name="area" value="{3}"/>
+        </map:transform>
+        <map:transform type="i18n">
+          <map:parameter name="locale" value="{page-envelope:language}"/>
+        </map:transform>
+        <map:serialize type="xml"/>
+      </map:match>
+      
+      <!-- 
+         This matcher aggregates the Lenya page: breadcrumbs, tabs, menu etc. and the actual document content.
+         /lenyabody-raw-{1:rendertype}/{2:publication-id}/{3:area}/{4:doctype}/{5:default-language}/{6:language}/{7:path} 
+      -->
+      <map:match pattern="lenyabody-raw-*/*/*/*/*/*/**">
+        <map:aggregate element="cmsbody">
+          <map:part src="cocoon://modules/sitetree/breadcrumb/{2}/{3}/{5}/{6}/{7}.xml"/>
+          <map:part src="cocoon://modules/sitetree/tabs/{2}/{3}/{5}/{6}/{7}.xml"/>
+          <map:part src="cocoon://modules/sitetree/menu/{2}/{3}/{5}/{6}/{7}.xml"/>
+          <map:part src="cocoon://modules/sitetree/search/{2}/{3}/{5}/{6}/{7}.xml"/>
+          <map:part src="cocoon:/document-content/{1}/{2}/{3}/{7}"/>
+        </map:aggregate>
+        <map:serialize type="xml"/>
+      </map:match>
+
+      <!--
+        This match provides the XSLT to render a given doctype to XHTML
+        It checks for the existence of a doctype-specific one, and if none
+        exists, falls back to the default one.
+        /getDoctypeXSLT/{1:doctype}
+      -->
+      <map:match pattern="getDoctypeXSLT/*">
+        <map:select type="resource-exists">
+          <map:parameter name="prefix" value="fallback://"/>
+          <map:when test="xslt/page2xhtml-{1}.xsl">
+            <map:generate src="fallback://xslt/page2xhtml-{1}.xsl"/>
+          </map:when>
+          <map:otherwise>
+            <map:generate src="fallback://xslt/page2xhtml.xsl"/>
+          </map:otherwise>
+        </map:select>
+        <map:serialize type="xml"/>
+      </map:match>
+
+    </map:pipeline>
+        
+    <!-- This is the pipeline that ultimately builds the page. -->
+    <map:pipeline type="noncaching">
+
+      <!-- 
+         This matcher takes the raw aggregated page content and applies SVG rendering and a doctype-specific
+         XSL transformation. It makes some meta information available to the XSLT, and demonstrates the use
+         of the LenyaMetaDataTransformer (see below).
+         /lenyabody-{1:rendertype}/{2:publication-id}/{3:area}/{4:doctype}/{5:path} 
+      -->
+      <map:match pattern="lenyabody-*/*/*/*/**">
+        <map:generate src="cocoon:/lenyabody-raw-{1}/{2}/{3}/{4}/{page-envelope:default-language}/{page-envelope:document-language}/{5}"/>
+        <map:transform src="fallback://lenya/modules/svg/xslt/image2svg.xsl"/>
+        <map:transform src="cocoon:/getDoctypeXSLT/{4}">
+          <map:parameter name="root" value="/{2}/{3}"/>
+          <map:parameter name="publication-id" value="{2}"/>
+          <map:parameter name="area" value="{3}"/>
+          <map:parameter name="url" value="{page-envelope:document-url}"/>
+          <map:parameter name="document-path" value="{page-envelope:document-path}"/>
+          <map:parameter name="document-type" value="{4}"/>
+          <map:parameter name="language" value="{page-envelope:document-language}"/>
+          <map:parameter name="contextprefix" value="{request:contextPath}"/>
+          <map:parameter name="lastPublishedUser" value="{access-control:user-name:{workflow:lastUser.publish}}"/>
+          <map:parameter name="lastPublishedDate" value="{workflow:lastDate.publish}"/>
+          <!-- Following is a show off to explain lenya.properties.xml -->
+          <map:parameter name="author" value="{properties:pubs.default.author}"/>
+          <map:parameter name="nodeName" value="{page-envelope:document-name}"/>
+        </map:transform>
+        
+       <!-- FIXME: why is the title handling inside a language-exists action? please document! -->  
+        <map:act type="language-exists">
+          <map:transform src="fallback://xslt/addXhtmlTitle.xsl">
+            <map:parameter name="title" value="{dublincore:title}"/>
+          </map:transform>
+        </map:act>
+
+        <!-- This is a demonstration of the generic meta data transformer
+          described in bug 39891.
+          
+          1) define the ns: xmlns:meta="http://apache.org/lenya/meta/1.0/"
+          2) use it in above xsl like e.g.
+          <meta:value ns="http://purl.org/dc/elements/1.1/" element="date" uuid="{@uuid}"/>
+          
+          Where @ns is the namespace for which you want to retrieve the @element for.
+          If there is more then one element registered then the transformer returns:
+          <value xmlns="http://apache.org/lenya/meta/1.0/" value="2005-09-11 12:44:05" element="date" />
+          <value xmlns="http://apache.org/lenya/meta/1.0/" value="2006-09-11 12:44:05" element="date" />
+          
+          Otherwise it will return the value as characters.
+        -->
+        <map:transform type="metaData">
+          <map:parameter name='pubid' value='{page-envelope:publication-id}'/>
+          <map:parameter name='area' value='{page-envelope:area}'/>
+        </map:transform>
+        <map:transform type="i18n">      
+          <map:parameter name="locale" value="{page-envelope:language}"/>
+        </map:transform>
+        <map:transform type="uuid2url"/>
+        <map:serialize type="xml"/>
+      </map:match>
+
+    </map:pipeline>
+    
+    <!-- This is the main entry point into the publication. This
+    pipeline uses the uriparametrizer to determine the doctype of this
+    request. It then aggregates the lenya menu (for the given area) and
+    the lenya body, the actual document. -->
+    <map:pipeline>
+      
+      <!-- 
+         FIXME: this is a BXE-specific hack that should be handled by BXE's module sitemap. The publication 
+         should not be concerned with BXE-specific pre-processing of documents.
+      -->
+      <map:match pattern="**.bxe.html">
+        <map:generate src="cocoon:/lenyabody-edit/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/>
+        <map:transform type="proxy"/>
+        <map:serialize type="xml"/>
+      </map:match>
+      
+      <!-- 
+        Finally: this matcher handles requests for publication documents. 
+        /{1:area}/{2:document-path}.html
+      -->
+      <map:match pattern="*/**.html">
+        
+        <!-- 
+          The default publication does not have content by default. This check provides the user with a dialog
+          to import example content. It's not needed for production systems.
+        --> 
+        <map:select type="resource-exists">
+          <map:when test="lenya://lenya/pubs/{page-envelope:publication-id}/content/authoring/sitetree.xml"/>
+          <map:otherwise>
+            <map:redirect-to uri="{request:requestUri}?lenya.usecase=export.importExampleContent"/>
+          </map:otherwise>
+        </map:select>
+      
+        <!-- If the requested language version of the document exists, we set a last-modified header. -->
+        <map:act type="language-exists">
+          <map:act type="set-header">
+            <map:parameter name="Last-Modified" value="{date-iso8601-rfc822:{page-envelope:document-lastmodified}}" />
+          </map:act>
+        </map:act>
+            
+        <!-- 
+          HEAD requests shouldn't have all the xslt overhead, all the user wants is the HTTP header information.
+          So the actual content generation is bypassed.
+        -->
+        <map:select type="request-method">
+          <map:when test="HEAD">
+            <map:generate src="context://lenya/content/util/empty.xml" />
+            <map:serialize type="xhtml"/>
+          </map:when>
+        </map:select>          
+      
+        <!--
+           Lenya provides its own caching mechanism. There is a source writing transformer that will store rendered pages
+           in {global:cache-dir}. Hence we should first check for every request if a cached version already exists, before
+           starting the actual rendering process.
+           NOTE: the cache is disabled by default. That means it has seen very little testing. And it does not do proper cache
+           invalidation, so it's probably only useful as a quick performance hack on a mostly static site.
+        -->
+        <!-- do we have this request in the cache? -->
+        <map:select type="resource-exists">
+          <map:when test="context:/lenya/pubs/{page-envelope:publication-id}/{global:cache-dir}/{1}/{2}.htmlDISABLED">
+            <!-- YES. Just read it from the cache and be done: -->
+            <map:read src="context:/lenya/pubs/{page-envelope:publication-id}/{global:cache-dir}/{1}/{2}.html" mime-type="text/html"/>
+          </map:when>
+          <!-- No. Generate the page and write it to the cache. -->
+          <map:otherwise>
+            <!-- 
+               FIXME: the "rendertype" parameter is a hack for BXE and should be handled by the bxe module. 
+               Moreover, it doesn't make much sense to cache documents in the authoring area that are about to be edited anyway.
+            -->
+            <map:select type="parameter">
+              <map:parameter name="parameter-selector-test" value="{request-param:rendertype}"/>
+              <map:when test="edit">
+                <!-- put the bxe_xpath attribute into the page -->
+                <map:generate src="cocoon:/lenyabody-edit/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/>
+              </map:when>
+              <map:otherwise>
+                <!-- sane page w/o hacks -->
+                <map:generate src="cocoon:/lenyabody-view/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/>
+              </map:otherwise>
+            </map:select>
+
+                <!-- Menu generation -->
+                <map:select type="parameter">
+                  <!-- you remember that {1} is the area, right? -->
+                  <map:parameter name="parameter-selector-test" value="{1}"/>
+                  <map:when test="live">
+                    <!-- do nothing for live -->
+                  </map:when>
+                  <map:otherwise>
+                    <!-- for all other areas, we want a GUI menu (handled by global-sitemap.xmap -->
+                    <!-- FIXME: the ?doctype parameter doesn't seem to be used (see global-sitemap.xmap). -->
+                    <map:transform src="cocoon://lenya-page/{page-envelope:publication-id}/{1}/{2}.xml?doctype={page-envelope:document-type}"/>
+                    <!-- 
+                       external broken link reporting (pretty much untested) 
+                       TODO: External Links checking should be optional on a document by document basis.
+                    -->
+                    <!--
+                    <map:transform src="fallback://lenya/xslt/authoring/addJavaScript.xsl">
+                      <map:parameter name="scriptSRC" value="/modules/linkcheck/linkreporter.js"/>
+                    </map:transform>
+                    -->
+                  </map:otherwise>
+                </map:select>
+
+                <!-- 
+                   strip xhtml namespace prefix to ensure compatibility with non-XML conformant browsers
+                   workaround to avoid empty script, style and textarea tags (firefox chokes on those)
+                -->
+                <map:transform src="fallback://lenya/xslt/util/strip_namespaces.xsl"/>
+
+
+                <!-- Cache writing -->
+                <map:select type="parameter">
+                  <map:parameter name="parameter-selector-test" value="{1}"/>
+                  <!-- for live area: -->
+                  <map:when test="live">
+                    <!-- prepare content for source writing transformer -->
+                    <map:transform src="fallback://lenya/xslt/authoring/edit/addSourceTags.xsl">
+                      <map:parameter name="source" value="context:/lenya/pubs/{page-envelope:publication-id}/{global:cache-dir}/{1}/{2}.html"/>
+                    </map:transform>
+                    <map:transform type="write-source">
+                      <map:parameter name="serializer" value="xhtml"/>
+                    </map:transform>
+                    <!-- remove the source writing transformer cruft again before serving the page -->
+                    <map:transform src="fallback://lenya/xslt/authoring/edit/removeSourceTags.xsl"/>
+                    <!-- set cache expiration header according to resource type configuration (<expires/>) -->
+                    <map:act type="set-header">
+                      <map:parameter name="Expires" value="{date-iso8601-rfc822:{doc-info:{page-envelope:publication-id}:{page-envelope:area}:{page-envelope:document-uuid}:{page-envelope:document-language}:expires}}"/>
+                    </map:act>
+                  </map:when>
+                  <!-- for other areas -->
+                  <map:otherwise>
+                    <!-- tell the browser not to cache stuff so that the user always sees up-to-date content -->
+                    <map:act type="set-header">
+                      <map:parameter name="Cache-Control" value="no-cache" />
+                      <map:parameter name="Pragma" value="no-cache"/>
+                    </map:act>
+                  </map:otherwise> 
+                </map:select>
+
+                <!-- pretty-print output for easier debugging and for the benefit of new users 
+                     NOTE: you may want to disable this in production for performance reasons,
+                     but it's on by default in the default publication to make the generated code 
+                     easier to work with for new users. -->
+                <map:transform src="fallback://lenya/modules/prettyprinting/xslt/xml2nicexml.xsl"/>
+
+                <!-- the proxy transformer handles proxy-related URL rewriting -->
+                <map:transform type="proxy"/>
+
+            <map:act type="language-exists">
+              <map:serialize type="xhtml"/>
+            </map:act>
+            <!-- 
+               When the requested document does not exist, we generate a nice error page.
+               Still, it's not what the user wants, so make sure we send a 404 "not found".
+            -->
+            <map:serialize type="xhtml" status-code="404"/>
+          </map:otherwise>
+        </map:select>
+
+      </map:match>
+      
+    </map:pipeline>
+      
+    <!--
+       This pipeline handles all requests that do *not* end in ".html".
+    -->
+    <map:pipeline>
+      <map:match pattern="*/**">
+        <map:act type="language-exists">
+          <!--
+             A workaround for a byte-range issue with PDFs,
+             see http://marc.theaimsgroup.com/?l=xml-cocoon-dev&amp;m=112496255207733&amp;w=2 .
+             FIXME: still necessary?
+          -->
+          <map:match type="regexp" pattern="(.*\.)(pdf|PDF|Pdf)$"> 
+            <map:read src="lenya-document:{page-envelope:document-uuid},lang={page-envelope:document-language}{link:rev}" mime-type="application/pdf">
+              <map:parameter name="byte-ranges" value="false"/>
+            </map:read>
+          </map:match>      
+          <!-- Documents other than *.html are served as-is and do not require processing: -->
+          <map:read src="lenya-document:{page-envelope:document-uuid},lang={page-envelope:document-language}{link:rev}"/>
+        </map:act>
+
+        <!-- 
+          If the action above fails (e.g. the document does not exist), call into the lenyabody pipeline.
+          It will generate a nice document-does-not-exist page for us.
+        -->
+        <map:generate src="cocoon:/lenyabody-view/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/>
+        <map:select type="parameter">
+          <map:parameter name="parameter-selector-test" value="{1}"/>
+          <map:when test="live"/>
+          <map:otherwise>
+            <map:transform src="cocoon://lenya-page/{page-envelope:publication-id}/{1}/{2}?doctype={page-envelope:document-type}"/>
+          </map:otherwise>
+        </map:select>
+        <map:transform src="fallback://lenya/xslt/util/strip_namespaces.xsl"/>
+        <map:transform type="proxy"/>
+        <map:serialize type="xhtml" status-code="404"/>
+
+      </map:match>
+
+    </map:pipeline>
+
+
+  </map:pipelines>
+</map:sitemap>

Added: lenya/sandbox/pubs/docu/xslt/page2xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/xslt/page2xhtml.xsl?rev=590953&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/xslt/page2xhtml.xsl (added)
+++ lenya/sandbox/pubs/docu/xslt/page2xhtml.xsl Thu Nov  1 03:07:56 2007
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: page2xhtml.xsl 589770 2007-10-29 17:46:58Z andreas $ -->
+
+<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/"
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+  exclude-result-prefixes="page xhtml dc lenya"
+  >
+  
+  <!-- {context-prefix}/{publication-id}/{area} -->
+  <xsl:param name="root"/>
+  <xsl:param name="context-prefix"/>
+  
+  <!-- i.e. doctypes/xhtml-document -->
+  <xsl:param name="document-type"/>
+  
+  <xsl:param name="document-path"/>
+  
+  <!-- The request url i.e. /lenya/doctypes/xhtml-document_en.html -->
+  <xsl:param name="url"/>
+  <xsl:param name="language"/>
+  
+  <xsl:param name="lastPublishedUser"/>
+  <xsl:param name="lastPublishedDate"/>
+  
+  <!--Following is a show off to explain lenya.properties.xml -->
+  <xsl:param name="author"/>
+  
+  <xsl:template match="cmsbody">
+    <html>
+      <head>
+        <!-- 
+        <link rel="neutron-introspection" type="application/neutron+xml" href="{$root}{$document-path}/introspection.xml"/>
+         -->
+        <link rel="neutron-introspection" type="application/neutron+xml"
+          href="{$root}{$document-path}.xml?lenya.module=neutron&amp;lenya.action=introspect"/>
+        <link rel="stylesheet" href="{$root}/css/page.css" type="text/css"/>
+        <!-- Load doctype-specific CSS -->
+        <xsl:choose>
+          <xsl:when test="$document-type">
+            <!-- Looking into the pub e.g. {$yourPub}/resources/shared/css/{$document-type}.css -->
+            <link rel="stylesheet" href="{$root}/css/{$document-type}.css" type="text/css"/>
+            <xsl:copy-of select="xhtml:html/xhtml:head/*"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <!-- do nothing -->
+          </xsl:otherwise>
+        </xsl:choose>
+        <meta content="Apache Lenya" name="generator"/>
+        
+        <!-- The title will be overwritten by addXhtmlTitle.xsl if the document exists. -->
+        <title><i18n:text>error-404</i18n:text></title>
+        
+        <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
+      </head>
+      <body>
+        <div id="page">
+          <div id="projectLogo">
+            <img src="{$root}/images/project-logo-small.png" alt="project logo"/>
+          </div>
+          <div id="tagline">Open Source Content Management</div>
+          <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="xhtml:div[@id = 'body']"/>
+                  <xsl:if test="xhtml:html">
+                    <xsl:apply-templates select="xhtml:html/xhtml:body/*"/>
+                  </xsl:if>
+                  <xsl:call-template name="footer"/>
+                </div>
+              </td>
+            </tr>
+          </table>
+        </div>
+      </body>
+    </html>
+  </xsl:template>
+  
+  
+  <xsl:template match="xhtml:div[@id = 'breadcrumb']">
+    <xsl:if test="*">
+      <xsl:copy>
+        <xsl:apply-templates select="@*|node()"/>
+      </xsl:copy>
+    </xsl:if>
+  </xsl:template>
+  
+  
+  <xsl:template name="footer">
+    <div id="footer">
+      <p>
+        <xsl:choose>
+          <xsl:when test="$lastPublishedUser != ''">
+            <i18n:translate>
+              <i18n:text>last-published</i18n:text>
+              <i18n:param><i18n:date-time src-pattern="yyyy-MM-dd HH:mm:ss"><xsl:value-of select="$lastPublishedDate"/></i18n:date-time></i18n:param>
+              <i18n:param><xsl:value-of select="$lastPublishedUser"/></i18n:param>
+            </i18n:translate>
+          </xsl:when>
+          <xsl:otherwise>
+            <i18n:text>never-published</i18n:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </p>
+    </div>
+  </xsl:template>
+  
+  
+  <xsl:template match="@*|node()" priority="-1">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+  </xsl:template>
+  
+  
+</xsl:stylesheet> 



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