svn commit: r620026 - in /lenya/sandbox/pubs/example: ./ config/ config/access-control/ templates/ xslt/

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Fri Feb  8 15:06:30 2008
New Revision: 620026

URL: http://svn.apache.org/viewvc?rev=620026&view=rev
Log:
Adding first working draft of example publication.

Added:
    lenya/sandbox/pubs/example/
    lenya/sandbox/pubs/example/config/
    lenya/sandbox/pubs/example/config/access-control/
    lenya/sandbox/pubs/example/config/access-control/access-control.xml
    lenya/sandbox/pubs/example/config/publication.xml
    lenya/sandbox/pubs/example/sitemap.xmap
    lenya/sandbox/pubs/example/templates/
    lenya/sandbox/pubs/example/templates/page.xml
    lenya/sandbox/pubs/example/xslt/
    lenya/sandbox/pubs/example/xslt/addNavIncludes.xsl
    lenya/sandbox/pubs/example/xslt/addPathPrefixes.xsl
    lenya/sandbox/pubs/example/xslt/tagsAfterCaching.xsl
    lenya/sandbox/pubs/example/xslt/tagsBeforeCaching.xsl

Added: lenya/sandbox/pubs/example/config/access-control/access-control.xml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/example/config/access-control/access-control.xml?rev=620026&view=auto
==============================================================================
--- lenya/sandbox/pubs/example/config/access-control/access-control.xml (added)
+++ lenya/sandbox/pubs/example/config/access-control/access-control.xml Fri Feb  8 15:06:30 2008
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: access-control.xml 564543 2007-08-10 10:53:48Z andreas $ -->
+
+<access-controller type="bypassable">
+  
+  <accreditable-manager type="file">
+    <parameter name="directory" value="context:///lenya/pubs/default/config/access-control/passwd"/>
+    
+    <user-manager>
+      <user-type class="org.apache.lenya.ac.file.FileUser" create-use-case="admin.addUser">Local User</user-type>
+      <!-- uncomment the following line if you want LDAP support -->
+      <!-- <user-type class="org.apache.lenya.ac.ldap.LDAPUser" create-use-case="admin.addUser">LDAP User</user-type> -->
+    </user-manager>
+  </accreditable-manager>
+  
+  <policy-manager type="document">
+    <policy-manager type="file">
+      <parameter name="directory" value="context:///lenya/pubs/default/config/access-control/policies"/>
+    </policy-manager>
+  </policy-manager>
+  
+  <authorizer type="usecase">
+    <parameter name="configuration" value="aggregate-fallback://config/access-control/usecase-policies.xml"/>
+  </authorizer>
+  
+</access-controller>

Added: lenya/sandbox/pubs/example/config/publication.xml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/example/config/publication.xml?rev=620026&view=auto
==============================================================================
--- lenya/sandbox/pubs/example/config/publication.xml (added)
+++ lenya/sandbox/pubs/example/config/publication.xml Fri Feb  8 15:06:30 2008
@@ -0,0 +1,65 @@
+<?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: publication.xml 618771 2008-02-05 20:45:50Z rfrovarp $ -->
+
+<publication xmlns="http://apache.org/cocoon/lenya/publication/1.1" >
+
+  <name>Example</name>
+  <description>This publication is a best practice, getting started publication.</description>
+  <!-- the @...@ macros are evaluated by ant at build time -->
+  <version>2.0.2-dev</version>
+  <lenya-version>2.0.2-dev</lenya-version>
+  <lenya-revision>xxx</lenya-revision>
+  <cocoon-version>2.1.10-dev</cocoon-version>
+
+  <!-- The various languages need to be listed for verification and widget building -->
+  <languages>
+    <language default="true">en</language>
+    <language>de</language>
+    <language>he</language>
+    <language>es</language>
+    <language>fr</language>
+  </languages>
+  <template id="default"/>
+  <!-- A publication can inherit from another publication. "id" corresponds to the publication id 
+       of that template (and thus to the name of the directory it's stored in) -->
+  <!--
+     <template id="some-pub-id"/>
+  -->
+  <path-mapper>org.apache.lenya.cms.publication.DefaultDocumentIdToPathMapper</path-mapper>
+  <document-builder name="default"/>
+  <breadcrumb-prefix/>
+  <site-manager name="tree"/>
+  <resource-types/>
+  <modules/>
+  
+  <proxies>
+<!--
+    <proxy area="live" ssl="true" url="https://www.example.com/lenya/customer/live"/>
+    <proxy area="live" ssl="false" url="http://customer.example.com"/>
+    <proxy area="authoring" ssl="true" url="https://www.example.com/lenya/customer/authoring"/>
+    <proxy area="authoring" ssl="false" url="http://www.example.com/lenya/customer/authoring"/>
+    <proxy area="archive" ssl="true" url="https://www.example.com/lenya/customer/archive"/>
+    <proxy area="archive" ssl="false" url="http://www.example.com/lenya/customer/archive"/>
+    <proxy area="trash" ssl="true" url="https://www.example.com/lenya/customer/trash"/>
+    <proxy area="trash" ssl="false" url="http://www.example.com/lenya/customer/trash"/>
+-->
+  </proxies>
+  
+</publication>

Added: lenya/sandbox/pubs/example/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/example/sitemap.xmap?rev=620026&view=auto
==============================================================================
--- lenya/sandbox/pubs/example/sitemap.xmap (added)
+++ lenya/sandbox/pubs/example/sitemap.xmap Fri Feb  8 15:06:30 2008
@@ -0,0 +1,372 @@
+<?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.
+-->
+
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+
+  <map:components>
+    <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:pipelines>
+
+    <!-- This pipeline handles helper requests and metadata, not the actual publication documents -->
+    <map:pipeline>
+
+      <!-- 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="{proxy:/{page-envelope:publication-id}/{1}/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>
+
+      <!-- {1:pub}/{2:area}/{3:uuid}/{4:lang}/{5:resourceType}/{6:rendertype}/{7:path} -->
+      <map:match pattern="document-content/*/*/*/*/*/*/**">
+        <map:select type="resource-exists">
+          <map:when test="lenya-document:{3},pub={1},area={2},lang={4}">
+            <map:generate src="cocoon://modules/{5}/xhtml.xml/{1}/{2}/{3}/{4}?rendertype={6}"/>
+          </map:when>
+          <map:otherwise>
+            <map:generate src="fallback://lenya/content/exception/document-does-not-exist.xml"/>
+            <map:transform src="fallback://lenya/xslt/exception/document-does-not-exist.xsl">
+              <map:parameter name="pub" value="{1}"/>
+              <map:parameter name="area" value="{2}"/>
+              <map:parameter name="path" value="/{7}"/>
+            </map:transform>
+          </map:otherwise>
+        </map:select>
+        <map:serialize type="xml"/>
+      </map:match>
+      
+    </map:pipeline>
+    
+    <map:pipeline>
+
+      <!--
+        This match provides the page context 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.
+        /pageContext-{1:pub}/{2:area}/{3:resourceType}/{4:defaultLang}/{5:lang}/{6:uuid}/{7:path}
+      -->
+      <map:match pattern="pageContext/*/*/*/*/*/*/**">
+        <map:select type="resource-exists">
+          <map:parameter name="prefix" value="fallback://"/>
+          <map:when test="templates/{2}.xml">
+            <map:generate src="fallback://templates/{2}.xml"/>
+          </map:when>
+          <map:otherwise>
+            <map:generate src="fallback://templates/page.xml"/>
+          </map:otherwise>
+        </map:select>
+        <map:transform src="fallback://xslt/tagsBeforeCaching.xsl">
+          <map:parameter name="pub" value="{1}"/>
+          <map:parameter name="area" value="{2}"/>
+          <map:parameter name="path" value="/{7}"/>
+          <map:parameter name="lang" value="{5}"/>
+          <map:parameter name="uuid" value="{6}"/>
+          <map:parameter name="resourceType" value="{3}"/>
+          <map:parameter name="renderType" value="view"/>
+        </map:transform>
+        <map:transform src="fallback://xslt/addNavIncludes.xsl">
+          <map:parameter name="params" value="{1}/{2}/{4}/{5}/{7}"/>
+        </map:transform>
+        <map:transform src="fallback://xslt/addPathPrefixes.xsl">
+          <map:parameter name="prefix" value="/{1}/{2}"/>
+        </map:transform>
+        <map:transform type="include"/>
+        <map:transform src="fallback://lenya/modules/prettyprinting/xslt/xml2nicexml.xsl"/>
+        <map:serialize type="xml"/>
+      </map:match>
+      
+    </map:pipeline>
+    
+    <map:pipeline type="noncaching">
+      
+      <map:match pattern="*/**.html">
+        <map:generate src="cocoon:/pageContext/{page-envelope:publication-id}/{1}/{page-envelope:document-type}/{page-envelope:default-language}/{page-envelope:language}/{page-envelope:document-uuid}{page-envelope:document-path}"/>
+        <map:transform src="fallback://xslt/tagsAfterCaching.xsl">
+          <map:parameter name="uuid" value="{page-envelope:document-uuid}"/>
+          <map:parameter name="lang" value="{page-envelope:document-language}"/>
+          <map:parameter name="author" value="{properties:pubs.default.author}"/>
+          <map:parameter name="lastPublishedUser" value="{access-control:user-name:{workflow:lastUser.publish}}"/>
+          <map:parameter name="lastPublishedDate" value="{workflow:lastDate.publish}"/>
+        </map:transform>
+        <map:transform type="i18n">      
+          <map:parameter name="locale" value="{page-envelope:language}"/>
+        </map:transform>
+        <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="uuid2url"/>
+        <map:transform type="proxy"/>
+        <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:/document-content/{1}/{2}/{3}/{5}"/>
+        <map:transform src="fallback://lenya/modules/svg/xslt/image2svg.xsl"/>
+        <map:transform src="cocoon:/getDoctypeXSLT-{4}">
+          <map:parameter name="publication-id" value="{2}"/>
+          <map:parameter name="area" value="{3}"/>
+          <map:parameter name="uuid" value="{page-envelope:document-uuid}"/>
+          <map:parameter name="language" value="{page-envelope:document-language}"/>
+          <map:parameter name="document-path" value="{page-envelope:document-path}"/>
+          <map:parameter name="document-type" value="{4}"/>
+          <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>
+        <map:transform type="include"/>
+        <map:transform type="i18n">      
+          <map:parameter name="locale" value="{page-envelope:language}"/>
+        </map:transform>
+        
+        <!-- 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="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 should be removed in 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="{proxy:/{page-envelope:publication-id}/{1}/{2}.html}?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>          
+
+        <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 -->
+            <map:transform src="cocoon://lenya-page/{page-envelope:publication-id}/{1}/{2}.xml"/>
+            <!-- 
+                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"/>
+
+        <!-- client cache expiration settings -->
+        <map:select type="parameter">
+          <map:parameter name="parameter-selector-test" value="{1}"/>
+          <!-- for live area: -->
+          <map:when test="live">
+            <!-- set cache expiration header according to resource type configuration (<expires/>) -->
+            <map:act type="language-exists">
+              <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: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: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/example/templates/page.xml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/example/templates/page.xml?rev=620026&view=auto
==============================================================================
--- lenya/sandbox/pubs/example/templates/page.xml (added)
+++ lenya/sandbox/pubs/example/templates/page.xml Fri Feb  8 15:06:30 2008
@@ -0,0 +1,69 @@
+<?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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
+  <head>
+    <lenya:introspectionLink/>
+    <link rel="stylesheet" href="/css/page.css" type="text/css"/>
+    <link rel="SHORTCUT ICON" type="image/ico" href="/lenya/images/lenya.ico"/>
+    <meta content="Apache Lenya" name="generator"/>
+    
+    <title><lenya:pageTitle/></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">
+            <i18n:translate>
+              <i18n:text>publication-title</i18n:text>
+              <i18n:param><lenya:author/></i18n:param>
+            </i18n:translate>
+          </td>
+          <td id="project-logo"><img src="/images/project-logo.png" alt="project logo"/></td>
+        </tr>
+      </table>
+      <lenya:navElement name="tabs"/>
+      <table width="100%" border="0" cellpadding="0" cellspacing="0">
+        <tr>
+          <td valign="top" style="width: 230px">
+            <lenya:navElement name="menu"/>
+            <lenya:languageSelector/>
+          </td>
+          <td valign="top">
+            <div id="main">
+              <lenya:navElement name="breadCrumb"/>
+              <lenya:navElement name="search"/>
+              <lenya:document/>
+              
+              <div id="footer">
+                <p>
+                  <lenya:lastPublished/>
+                </p>
+              </div>
+            </div>
+            
+          </td>
+        </tr>
+      </table>
+    </div>
+  </body>
+</html>

Added: lenya/sandbox/pubs/example/xslt/addNavIncludes.xsl
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/example/xslt/addNavIncludes.xsl?rev=620026&view=auto
==============================================================================
--- lenya/sandbox/pubs/example/xslt/addNavIncludes.xsl (added)
+++ lenya/sandbox/pubs/example/xslt/addNavIncludes.xsl Fri Feb  8 15:06:30 2008
@@ -0,0 +1,35 @@
+<?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.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+  xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
+  xmlns:i="http://apache.org/cocoon/include/1.0"
+  exclude-result-prefixes="lenya">
+  
+  <xsl:param name="params"/>
+  
+  <xsl:template match="lenya:navElement">
+    <i:include src="cocoon://modules/sitetree/{@name}/{$params}.xml"/>
+  </xsl:template>
+  
+  <xsl:template match="@*|node()|comment()" priority="-1">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()|comment()"></xsl:apply-templates>
+    </xsl:copy>
+  </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Added: lenya/sandbox/pubs/example/xslt/addPathPrefixes.xsl
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/example/xslt/addPathPrefixes.xsl?rev=620026&view=auto
==============================================================================
--- lenya/sandbox/pubs/example/xslt/addPathPrefixes.xsl (added)
+++ lenya/sandbox/pubs/example/xslt/addPathPrefixes.xsl Fri Feb  8 15:06:30 2008
@@ -0,0 +1,36 @@
+<?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.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+  xmlns:xhtml="http://www.w3.org/1999/xhtml">
+  
+  <!-- /{pub}/{area} -->
+  <xsl:param name="prefix"/>
+  
+  <xsl:template match="xhtml:link/@href | xhtml:a/@href | xhtml:img/@src">
+    <xsl:attribute name="{local-name()}">
+      <xsl:value-of select="$prefix"/><xsl:value-of select="."/>
+    </xsl:attribute>
+  </xsl:template>
+  
+  <xsl:template match="@*|node()|comment()" priority="-1">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()|comment()"></xsl:apply-templates>
+    </xsl:copy>
+  </xsl:template>
+  
+</xsl:stylesheet>
\ No newline at end of file

Added: lenya/sandbox/pubs/example/xslt/tagsAfterCaching.xsl
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/example/xslt/tagsAfterCaching.xsl?rev=620026&view=auto
==============================================================================
--- lenya/sandbox/pubs/example/xslt/tagsAfterCaching.xsl (added)
+++ lenya/sandbox/pubs/example/xslt/tagsAfterCaching.xsl Fri Feb  8 15:06:30 2008
@@ -0,0 +1,64 @@
+<?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.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+  xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
+  xmlns:meta="http://apache.org/lenya/meta/1.0/"
+  xmlns:i="http://apache.org/cocoon/include/1.0"
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
+  
+  <xsl:param name="uuid"/>
+  <xsl:param name="lang"/>
+  <xsl:param name="author"/>
+  <xsl:param name="lastPublishedUser"/>
+  <xsl:param name="lastPublishedDate"/>
+  
+  
+  <xsl:template match="lenya:pageTitle">
+    <meta:value element="title" ns="http://purl.org/dc/elements/1.1/" default="error-404"
+      i18n:attr="default" uuid="{$uuid}" lang="{$lang}"/>
+  </xsl:template>
+  
+  
+  <xsl:template match="lenya:author">
+    <xsl:value-of select="$author"/>
+  </xsl:template>
+  
+  
+  <xsl:template match="lenya:lastPublished">
+    <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>
+  </xsl:template>
+  
+  
+  <xsl:template match="@*|node()|comment()" priority="-1">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()|comment()"/>
+    </xsl:copy>
+  </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Added: lenya/sandbox/pubs/example/xslt/tagsBeforeCaching.xsl
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/example/xslt/tagsBeforeCaching.xsl?rev=620026&view=auto
==============================================================================
--- lenya/sandbox/pubs/example/xslt/tagsBeforeCaching.xsl (added)
+++ lenya/sandbox/pubs/example/xslt/tagsBeforeCaching.xsl Fri Feb  8 15:06:30 2008
@@ -0,0 +1,56 @@
+<?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.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+  xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
+  xmlns:i="http://apache.org/cocoon/include/1.0"
+  xmlns:meta="http://apache.org/lenya/meta/1.0/">
+  
+  <xsl:param name="pub"/>
+  <xsl:param name="area"/>
+  <xsl:param name="path"/>
+  <xsl:param name="uuid"/>
+  <xsl:param name="lang"/>
+  <xsl:param name="defaultLang"/>
+  <xsl:param name="resourceType"/>
+  <xsl:param name="renderType"/>
+  
+  <xsl:variable name="langSuffix">
+    <xsl:if test="$lang != $defaultLang">
+      <xsl:text>_</xsl:text><xsl:value-of select="$lang"/>
+    </xsl:if>
+  </xsl:variable>
+  
+  
+  <xsl:template match="lenya:introspectionLink">
+    <i:include src="cocoon://modules/neutron/{$pub}/{$area}{$path}{$langSuffix}.html.introspectionLink.xml"/>
+  </xsl:template>
+  
+  
+  <xsl:template match="lenya:document">
+    <i:include src="cocoon:/document-content/{$pub}/{$area}/{$uuid}/{$lang}/{$resourceType}/{$renderType}{$path}"/>
+  </xsl:template>
+  
+  
+  <xsl:template match="@*|node()|comment()" priority="-1">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()|comment()"/>
+    </xsl:copy>
+  </xsl:template>
+  
+
+</xsl:stylesheet>
\ No newline at end of file
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.