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/16 16:12:50 UTC

svn commit: r595691 [16/28] - in /lenya/sandbox/pubs/docu: config/ content/authoring/ content/authoring/0033e320-8731-11dc-ae46-9e7b5d14892d/ content/authoring/018a9980-8731-11dc-ae46-9e7b5d14892d/ content/authoring/02f9e0f0-8731-11dc-ae46-9e7b5d14892d...

Added: lenya/sandbox/pubs/docu/content/authoring/82081520-8730-11dc-ae46-9e7b5d14892d/en.1195221893953.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/82081520-8730-11dc-ae46-9e7b5d14892d/en.1195221893953.bak?rev=595691&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/82081520-8730-11dc-ae46-9e7b5d14892d/en.1195221893953.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/82081520-8730-11dc-ae46-9e7b5d14892d/en.1195221893953.bak Fri Nov 16 07:11:58 2007
@@ -0,0 +1,447 @@
+<?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: source_version.xml 55543 2004-10-26 00:14:59Z gregor $ --><!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+
+<document>
+  <header>
+    <title>Apache Lenya 2.0 install instructions</title>
+  </header>
+
+  <body>
+  	<section id="introduction">
+  		<title>Introduction</title>
+  	
+          <warning>
+            Apache Lenya 2.0 is still under heavy development and should not be used for production yet.
+          </warning>
+  		<p>
+  			This document explains how to install Lenya 2.0 from source.
+  			There are different ways to install and run Lenya:
+  			<br/>
+  			Choose between
+  		</p>
+        <ol>
+            <li>running Lenya standalone using the built-in Jetty servlet container</li>
+            <li>using Tomcat and have the build process taking care of deploying Lenya in Tomcat</li>
+        </ol>
+
+  		<p>
+  			Please note that you can use other servlet
+        	containers as well, but Jetty and Tomcat are the tested ones.
+        </p>
+        
+        <p>
+  			In all cases, you will need to meet the following prerequisites,
+  			that describe the setup that is tested and recommended. 
+  		</p>
+  	
+  	</section>
+    <section id="prerequisites">
+      <title>Prerequisites</title>
+
+      <ul>
+      	      	
+        <li>
+          <p>
+            <strong>Java 2 Platform, Standard Edition</strong>
+            <br/>
+            version 1.4.2 or newer, <a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=32923">1.6.x works with limitations</a>.
+            <br/>
+            Get it from <a href="http://java.sun.com/j2se/1.4.2/download.html">http://java.sun.com/j2se/1.4.2/download.html</a>
+          </p>
+        </li>
+        
+        <li>
+      		<p>
+      		<strong>Recommended: Create a directory</strong> to better organise the various source files
+      		<br/>
+      		In this document, we will assume the name <code>src/</code> for that directory.
+      		This directory will contain the Lenya distribution as well as Cocoon.
+      		</p>
+      		
+      		<p>
+      		After expanding the	downloaded archives or after a <a href="http://subversion.tigris.org/">svn checkout</a>,
+      		the directory structure should look like this:
+      		</p>
+      		
+      		<source xml:space="preserve">
+            your_home/ (or c:\ on Windows, NOT My Documents)
+              `-- src/
+                   |-- lenya-2.0.x/            $LENYA_HOME
+                     `-- externals/
+                       `-- cocoon_2_1_x/       $COCOON_HOME
+                         `-- build/
+                           `-- webapp/         $COCOON_WEBAPP
+     		</source>
+     		
+     		<p>
+     		The directories inside cocoon_2_1_x/ will be created when you build Cocoon, cocoon will be built when you build lenya. 
+     		The variables will later be used in the local.build.properties file that configures the Lenya build process.
+      		</p>
+      		
+      	</li>
+      	
+      	<li>
+          <p>
+            <strong>Get Apache Lenya</strong>
+            <br/>
+            (see <a href="lenya-document:7f2fa0c0-8730-11dc-ae46-9e7b5d14892d">Download Lenya</a>)
+            <br/>
+            Using <a href="lenya-document:80a5ed10-8730-11dc-ae46-9e7b5d14892d">Subversion</a>, checkout Lenya inside the
+            <code>src/</code> directory. 
+          </p>
+        </li>
+      </ul>
+      
+      
+    </section>
+
+
+    <section>
+      <title>1: Standalone Installation (using the built-in Jetty)</title>
+
+      <ol>
+
+        <li>
+          <p>
+            <strong>Configure Lenya</strong>
+          </p>
+
+          <p>
+            You need to edit your build properties and write
+            local.build.properties. To do this execute configure.sh 
+            or configure.bat.
+          </p>
+          <note>Cocoon 2.1.x is now placed in Lenya as a svn:external
+            you'll find cocoon in $LENYA_HOME/externals/cocoon_2_1_x.
+            If you want to use cocoon from another location you can change
+            the $COCOON_HOME point to your cocoon src directory.
+            </note>
+          <p>
+              Copy $LENYA_HOME/src/cocoon/local.blocks.properties and 
+              local.build.properties to $COCOON_HOME.
+          </p>
+       </li>
+
+        <li>
+          <p>
+            <strong>Build Lenya</strong>
+          </p>
+
+          <p>
+            Execute <code>build.bat</code> or <code>build.sh</code> in
+            your Lenya source directory, depending on your platform.
+          </p>
+          <note>Cocoon will be built when you build lenya. You can manually build or clean
+          cocoon in $COCOON_HOME with ./build.sh or ./build.sh clean</note>
+
+          <p>
+            <strong>MS Windows</strong>
+          </p>
+
+          <source xml:space="preserve">
+            $LENYA_HOME &gt; build.bat
+          </source>
+
+          <p>
+            <strong>Unix</strong>
+          </p>
+
+          <source xml:space="preserve">
+            $LENYA_HOME &gt; ./build.sh
+          </source>
+          <p>
+             <br/>
+<br/>
+             If your build fails, because it cant delete cocoon.xconf.ant_patch try:
+             in $LENYA_HOME/src/targets/webapp-build.xml LINE 69 add
+             verbose="true" failonerror="false" to the delete tag.
+             In $LENYA_HOME/src/targets/publets-build.xml LINE 53 add
+             verbose="true" failonerror="false" to the delete tag.
+          </p>
+        </li>
+
+        <li>
+          <p>
+            <strong>Start Lenya</strong>
+          </p>
+
+          <p>
+            Execute <code>lenya.bat</code> or <code>lenya.sh
+            servlet</code> in your Lenya source directory, depending on
+            your platform.  Make sure that you have the environment
+            variable <code>JAVA_HOME</code> defined to point to the
+            location of the Java SDK you installed (see <a href="#prerequisites">Prerequisites</a>).
+          </p>
+
+          <p>
+            <strong>MS Windows</strong>
+          </p>
+
+          <source xml:space="preserve">
+            $LENYA_HOME &gt; lenya.bat
+          </source>
+
+          <p>
+            <strong>Unix</strong>
+          </p>
+
+          <source xml:space="preserve">
+            $LENYA_HOME &gt; ./lenya.sh servlet
+          </source>
+        </li>
+
+        <li>
+          <p>
+            <strong>Test the installation</strong>
+          </p>
+
+          <p>
+            <a href="http://localhost:8888">http://localhost:8888/</a>
+          </p>
+        </li>
+      </ol>
+    </section>
+
+    <section>
+      <title>2: Installation with Apache Tomcat</title>
+      <warning label="Warning: Tomcat and spaces">The installation path may not contain spaces, otherwise you may get a
+        <code>java.net.URISyntaxException</code> error.</warning>
+
+      <ol>
+
+		<li>
+          <p>
+            <strong>Get Apache Tomcat</strong> for JDK 1.4
+            <br/>
+Lenya is developed and tested with Tomcat 5.0.28; it is assumed in the following instructions, and we highly recommend it. Tomcat 4.0.0+, 4.1.24+, 5.0.18+ and 5.5.0+ should work too.            <br/>
+            <br/>
+            Get it from  <a href="http://jakarta.apache.org/site/binindex.cgi#tomcat-5.0">http://jakarta.apache.org/site/binindex.cgi#tomcat-5.0</a>
+          </p>
+
+        </li>
+        
+        <li>
+          <p>
+            <strong>Install Apache Tomcat</strong>
+          </p>
+
+          <p>
+            See <a href="http://jakarta.apache.org/tomcat/tomcat-5.0-doc/setup.html">Tomcat 5.0 Setup</a>
+          </p>
+
+          <p>
+            <strong>MS Windows:</strong>
+
+            <br/>
+
+            Basically you only need to set the <code>JAVA_HOME</code>
+            environment variable and run the Tomcat
+            installer. Decide to run Tomcat as a Windows
+            NT/2000/XP-Service.
+          </p>
+        </li>
+
+        <li>
+          <p>
+            <strong>Configure Lenya</strong>
+          </p>
+
+          <p>
+            To install Lenya with Tomcat, you need to edit your build
+            properties. To do this, copy
+            <code>$LENYA_HOME/build.properties</code> to
+            <code>$LENYA_HOME/local.build.properties</code>.
+          </p>
+          <note>You can use the configure.sh or configure.bat to configure your local.build.properties.</note>
+
+          <p>
+            Edit <code>local.build.properties</code>. For the described
+            configuration the following settings will work (<strong>MS
+            Windows:</strong> Don't use backslashes "<code>\</code>" for
+            directory separation.) It is important that
+            <code>tomcat.home.dir</code> is an absolute path. Replace
+            <code>$TOMCAT_HOME</code> by your Tomcat installation
+            directory.  If your Cocoon source directory is not at
+            <code>../cocoon_2_1_x</code> relative to Lenya, then change
+            the <code>cocoon.webapp.dir</code>, <code>web.app.server</code> and
+            <code>cocoon.src.dir</code> properties.
+          </p>
+
+          <ul>
+            <li>
+<code>web.app.server=Tomcat</code>
+</li>
+            <li>
+<code>cocoon.src.dir=$COCOON_HOME</code>
+</li>
+            <li>
+<code>tomcat.home.dir=$TOMCAT_HOME</code>
+</li>
+          </ul>
+        </li>
+
+        <li>
+          <p>
+            <strong>Build Lenya</strong>
+          </p>
+
+          <p>
+            Execute <code>build</code> in your Lenya source directory.
+          </p>
+        </li>
+
+      <li>
+        <p>
+          <strong>Checked versions of endorsed libraries</strong>
+        </p>
+    
+        <p>
+          Lenya and Tomcat will inter-operate correctly only if the proper
+          versions of the Xalan and Xerces libraries are used consistently
+          throughout the deployment.  Unfortunately this can be difficult
+          to get to work correctly since both of these libraries are
+          shipped with Java 2 SDK, Tomcat, Cocoon and Lenya.
+        </p>
+    
+        <p>
+          The following libraries must be placed in the endorsed library
+          directory for your deployment.
+        </p>
+    
+        <ul>
+          <li>
+<code>jakarta-bcel-20040329.jar</code>
+</li>
+          <li>
+<code>jakarta-regexp-1.3.jar</code>
+</li>
+          <li>
+<code>xalan-2.6.0.jar</code>
+</li>
+          <li>
+<code>xercesImpl-2.6.2.jar</code>
+</li>
+          <li>
+<code>xml-apis.jar</code>
+</li>
+        </ul>
+    
+        <p>
+          They are placed by the build process in the directory specified
+          by <code>tomcat.endorsed.dir</code> in
+          <code>build.properties</code>.  You should validate that these
+          files are indeed in the proper location for your deployment.
+          You must then validate that no other instances of these
+          libraries exist in any of the following directories:
+        </p>
+    
+        <ul>
+          <li>
+            The Java 2 SDK endorsed standards directories.  This is
+            usually <code>${JAVA_HOME}/lib/endorsed/</code>.
+          </li>
+    
+          <li>
+            Any other location in your Tomcat deployment.  Specifically,
+            check <code>shared/lib/</code>, <code>common/lib/</code> and
+            <code>server/lib/</code>.
+          </li>
+    
+          <li>
+            Any other location in your Lenya deployment.  Specifically,
+            check <code>webapps/lenya/WEB-INF/lib/</code>.
+          </li>
+        </ul>
+    
+        <p>
+          A common symptom of incorrect library version are blank pages
+          after starting Lenya.  Try carefully checking the location and
+          version numbers of each of the libraries.
+        </p>
+    
+        <p>
+          References:
+        </p>
+    
+        <ul>
+          <li>
+            <a href="http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.html">
+              Tomcat Class Loader HOWTO (http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.html)
+            </a>
+          </li>
+    
+          <li>
+            <a href="http://java.sun.com/j2se/1.4.2/docs/guide/standards/index.html">
+              Java 2 Endorsed Standards Override Mechanism
+              (http://java.sun.com/j2se/1.4.2/docs/guide/standards/index.html)
+            </a>
+          </li>
+        </ul>
+      </li>
+         <li>
+           <p>
+            <strong>Clear Tomcat work directory</strong>
+          </p>
+
+          <p>
+            Tomcat's work cache may not be consistent with your newly installed
+            Lenya.  This can lead to any number of errors and exceptions.  To
+            prevent this, clear the work directory by executing
+            <code>build.bat</code> or <code>build.sh</code> in your Lenya source
+            directory, depending on your platform.
+          </p>
+
+          <p>
+            <strong>MS Windows</strong>
+          </p>
+
+          <source xml:space="preserve">
+            $LENYA_HOME &gt; build.bat clean 
+          </source>
+
+          <p>
+            <strong>Unix</strong>
+          </p>
+
+          <source xml:space="preserve">
+            $LENYA_HOME &gt; ./build.sh clean
+          </source>
+        </li>
+        <li>
+          <p>
+            <strong>Restart Tomcat</strong>
+          </p>
+
+          <p>
+            Restart Tomcat to load the Lenya webapp.
+          </p>
+        </li>
+
+        <li>
+          <p>
+            <strong>Test the installation</strong>
+          </p>
+
+          <p>
+            <a href="http://localhost:8080/lenya">http://localhost:8080/lenya/</a>
+          </p>
+        </li>
+      </ol>
+    </section>
+  </body>
+</document>

Added: lenya/sandbox/pubs/docu/content/authoring/82081520-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221893953.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/82081520-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221893953.bak?rev=595691&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/82081520-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221893953.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/82081520-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221893953.bak Fri Nov 16 07:11:58 2007
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata xmlns="http://apache.org/lenya/metadata/1.0">
+<element-set namespace="http://purl.org/dc/elements/1.1/">
+<element key="title">
+<value>Install Instructions</value>
+</element>
+</element-set>
+<element-set namespace="http://apache.org/lenya/metadata/document/1.0">
+<element key="extension">
+<value>xml</value>
+</element>
+<element key="mimeType">
+<value>application/xml</value>
+</element>
+<element key="resourceType">
+<value>forrestDocument20</value>
+</element>
+<element key="contentType">
+<value>xml</value>
+</element>
+</element-set>
+</metadata>

Modified: lenya/sandbox/pubs/docu/content/authoring/82081520-8730-11dc-ae46-9e7b5d14892d/en.rcml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/82081520-8730-11dc-ae46-9e7b5d14892d/en.rcml?rev=595691&r1=595690&r2=595691&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/82081520-8730-11dc-ae46-9e7b5d14892d/en.rcml (original)
+++ lenya/sandbox/pubs/docu/content/authoring/82081520-8730-11dc-ae46-9e7b5d14892d/en.rcml Fri Nov 16 07:11:58 2007
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XPSRevisionControl xmlns="">
+<CheckIn backup="true" identity="lenya" session="fde084c0-944b-11dc-8f2e-e6c0ff9903ab" time="1195221893953" version="3"/>
+<CheckOut identity="lenya" session="fde084c0-944b-11dc-8f2e-e6c0ff9903ab" time="1195221880596"/>
 <CheckIn backup="true" identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910778538" version="2"/>
 <CheckOut identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910764672"/>
 <CheckIn backup="true" identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781626375" version="1"/>

Added: lenya/sandbox/pubs/docu/content/authoring/83890fd0-8730-11dc-ae46-9e7b5d14892d/en.1195221897269.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/83890fd0-8730-11dc-ae46-9e7b5d14892d/en.1195221897269.bak?rev=595691&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/83890fd0-8730-11dc-ae46-9e7b5d14892d/en.1195221897269.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/83890fd0-8730-11dc-ae46-9e7b5d14892d/en.1195221897269.bak Fri Nov 16 07:11:58 2007
@@ -0,0 +1,333 @@
+<?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: index.xml 55543 2004-10-26 00:14:59Z gregor $ --><!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+
+<document>
+  <header>
+    <title>Creating a New Publication</title>
+  </header>
+  <body>
+    
+    <section>
+      <title>Introduction</title>
+      <p>
+        In this tutorial, we guide you through the first steps on the
+        way to your own publication. We assume that the publication is
+        based on Lenya's default publication, at least until your standing
+        firmly on your own feet.
+      </p>
+    </section>
+    
+    <section>
+      <title>Prerequisites</title>
+      <p>
+        We'll use the following directory layout:
+      </p>
+      <source xml:space="preserve">$HOME/
+  apache/
+    lenya-2.0/             The Lenya installation directory, we'll call it $LENYA_HOME.
+  src/
+    lenya/                 The home directory of your Lenya-related sources.
+      pubs/                Your publications.
+        $MYPUB/            Your first publication. We'll call this directory $MYPUB_HOME.
+      modules/             Your modules.
+      data/                Here you'll store your data:
+        content/           Content (documents, images, ...)
+        access-control/    Access control data
+          passwd/          Users, groups, etc.
+          policies/        Policies (page permissions)</source>
+      
+      <p>
+        By telling Lenya to store the data in your source tree and not in the
+        web application context, you can more easily sync it with your source code repository. 
+      </p>
+      
+      <p>
+        To speed up your development, we recommend to serve the contents of
+        modules directly from their sources. Edit your <code>$LENYA_HOME/local.build.properties</code>
+        and update the <code>modules.copy</code> setting:
+      </p>
+      <source xml:space="preserve">modules.copy=false</source>
+      
+      <p>
+        If you're using Eclipse, you can add a Java project with the <code>src</code>
+        directory as home directory. We recommend to <a href="lenya-document:8e678080-8730-11dc-ae46-9e7b5d14892d">add the Lenya project</a>
+        to Eclipse as well so you can easily use it's API. 
+      </p>
+      
+    </section>
+    
+    <section>
+      <title>Telling Lenya about Your Publication</title>
+      <p>
+        First, we have to tell Lenya that you want to deploy your publication.
+        This is done in <code>$LENYA_HOME/local.build.properties</code>. Add the path
+        to the directory where you store your publications to <code>pubs.root.dirs</code>:
+      </p>
+      <source xml:space="preserve">pubs.root.dirs=src/pubs:/home/john/src/lenya/pubs</source>
+      <p>
+        If you add multiple publications to this directory, Lenya will detect them
+        automatically.
+      </p>
+    </section>
+    
+    <section>
+      <title>Basic Configuration</title>
+      <p>
+        Now it's time to add the main configuration file of your publication,
+        <code>$MYPUB_HOME/config/publication.xml</code>. The language settings depend
+        on your requirements, you can add whatever languages you need. But make sure
+        to use the official ISO 639-1 language codes. The entry
+        <code><![CDATA[<template id="default"/>]]></code> tells Lenya that your
+        publication is based on the default publication.
+      </p>
+      <p>
+        Here's an example how your <code>publication.xml</code> file might look like:
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<publication xmlns="http://apache.org/cocoon/lenya/publication/1.1">
+  
+  <name>My First Publication</name>
+  <version>2.0-dev</version>
+  <lenya-version>2.0-dev</lenya-version>
+  <cocoon-version>2.1.10</cocoon-version>
+  
+  <languages>
+    <language default="true">en</language>
+    <language>de</language>
+  </languages>
+  
+  <template-instantiator name="default"/>
+  <path-mapper>org.apache.lenya.cms.publication.DefaultDocumentIdToPathMapper</path-mapper>
+  <document-builder name="default"/>
+  <site-manager name="tree"/>
+  
+  <template id="default"/>
+  
+  <content-dir src="/home/john/src/lenya/data/content"/>
+  
+  <resource-types/>
+  <modules/>
+  
+</publication>]]></source>
+    </section>
+    
+    <section>
+      <title>Access Control Configuration</title>
+      <p>
+        The access control options are configured in
+        <code>$MYPUB_HOME/config/access-control/access-control.xml</code>.
+        We'll change the paths where access control data are stored: 
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<access-controller type="bypassable">
+  
+  <accreditable-manager type="file">
+    <parameter name="directory"
+               value="/home/john/src/lenya/data/access-control/passwd"/>
+    <user-manager>
+      <user-type class="org.apache.lenya.ac.file.FileUser">Local User</user-type>
+    </user-manager>
+  </accreditable-manager>
+  
+  <policy-manager type="document">
+    <policy-manager type="file">
+      <parameter name="directory"
+                 value="/home/john/src/lenya/data/access-control/policies"/>
+    </policy-manager>
+  </policy-manager>
+  
+  <authorizer type="policy"/>
+  
+  <authorizer type="usecase">
+    <parameter name="configuration"
+      value="aggregate-fallback://config/access-control/usecase-policies.xml"/>
+  </authorizer>
+  
+</access-controller>]]></source>
+      <p>
+        Now we copy the role files (<code>*.rml</code>, where "rml" means "role markup language")
+        from the default publication to our <code>data/access-control/passwd</code> directory:
+      </p>
+      <source xml:space="preserve">$HOME/src/lenya/data/access-control/passwd/
+  admin.rml
+  edit.rml
+  review.rml
+  visit.rml</source>
+      <p>
+        To be able to log in for the first time, we'll create a superuser account.
+        Add the file <code>data/access-control/passwd/admin.iml</code> ("iml" means
+        "identity markup language"):
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<identity id="admin" class="org.apache.lenya.ac.file.FileUser">
+  <name>Administrator</name>
+  <description></description>
+  <email>admin@yourcompany.com</email>
+  <password type="md5">8e07dafd13495561db9063ebe4db4b27</password>
+  <groups>
+    <group>administrators</group>
+  </groups>
+</identity>]]></source>
+      <p>
+        The encrypted password is copied from the default publication's <code>lenya</code>
+        user, the cleartext is <code>levi</code>.
+      </p>
+      <p>
+        We want to do it properly, so we add an <code>administrators</code> group
+        (<code>passwd/administrators.gml</code>):
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<group class="org.apache.lenya.ac.file.FileGroup" id="administrators"/>]]></source>
+      <p>
+        Each publication has an introduction page (<code>introduction.html</code>).
+        We'll add a policy allowing everyone to visit the page. The file is located
+        at <code>data/access-control/policies/introduction.html/subtree-policy.acml</code>:
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<policy xmlns="http://apache.org/cocoon/lenya/ac/1.0">
+  <world>
+    <role id="visit"  method="grant"/>
+  </world>
+</policy>]]></source>
+      <p>
+        Finally, we have to add a policy for the authoring environment
+        (<code>data/access-control/policies/authoring/subtree-policy.acml</code>),
+        granting all roles to the <code>administrators</code> group:
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<policy xmlns="http://apache.org/cocoon/lenya/ac/1.0">
+  <group id="administrators">
+    <role id="edit"  method="grant"/>
+    <role id="review"  method="grant"/>
+    <role id="admin"  method="grant"/>
+  </group>
+</policy>]]></source>
+    </section>
+    
+    <section>
+      <title>Configuring the Search Index</title>
+      <p>
+        It is necessary to configure the search indexes for each publication.
+        Add the file
+        <code>$MYPUB_HOME/config/search/lucene_index.xml</code>. Here is an
+        example - be sure to replace $MYPUB with the name of your
+        publication everywhere!
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<indexes>
+  <index id="$MYPUB-live" analyzer="stopword_en"
+    directory="lenya/pubs/$MYPUB/work/lucene/index/live/index">
+    <structure>
+      <field id="url" type="keyword" />
+      <field id="title" type="text" storetext="true"/>
+      <field id="description" type="text" storetext="true"/>
+      <field id="subject" type="keyword" storetext="true" />
+      <field id="body" type="text" storetext="true"/>
+    </structure>
+  </index>
+  <index id="$MYPUB-authoring" analyzer="stopword_en"
+    directory="lenya/pubs/$MYPUB/work/lucene/index/authoring/index">
+    <structure>
+      <field id="url" type="keyword" />
+      <field id="title" type="text" storetext="true"/>
+      <field id="description" type="text" storetext="true"/>
+      <field id="subject" type="keyword" storetext="true" />
+      <field id="body" type="text" storetext="true"/>
+    </structure>
+  </index>
+  <index id="$MYPUB-trash" analyzer="stopword_en"
+    directory="lenya/pubs/$MYPUB/work/lucene/index/trash/index">
+    <structure>
+      <field id="url" type="keyword" />
+      <field id="title" type="text" storetext="true"/>
+      <field id="description" type="text" storetext="true"/>
+      <field id="subject" type="keyword" storetext="true" />
+      <field id="body" type="text" storetext="true"/>
+    </structure>
+  </index>
+  <index id="$MYPUB-archive" analyzer="stopword_en"
+    directory="lenya/pubs/$MYPUB/work/lucene/index/archive/index">
+    <structure>
+      <field id="url" type="keyword" />
+      <field id="title" type="text" storetext="true"/>
+      <field id="description" type="text" storetext="true"/>
+      <field id="subject" type="keyword" storetext="true" />
+      <field id="body" type="text" storetext="true"/>
+    </structure>
+  </index>
+</indexes>]]></source>
+    </section>
+    
+    
+    <section>
+      <title>Deploying Your Publication</title>
+      <p>
+        To deploy your publication, open a shell, go to the directory <code>$LENYA_HOME</code>
+        and execute the build process:
+      </p>
+      <source xml:space="preserve"><![CDATA[$ cd ~/apache/lenya-2.0
+$ ./build.sh]]></source>
+      <p>
+        Wait until the build process is finished, and start the Jetty server using the command
+      </p>
+      <source xml:space="preserve">$ ./lenya.sh</source>
+      <p>
+        To check if Lenya found and deployed our publication correctly,
+        open your browser and go to the URL <a href="http://localhost:8888">http://localhost:8888</a>.
+        In the list at the left-hand side of the page you should see the entry
+        "My First Publication". If not, Lenya didn't find your publication. Double-check
+        the path in <code>local.build.properties</code>.
+      </p>
+      <p>
+        Click on the "My First Publication" link. The introduction page of your publication appears.
+        Click on the link "Login as Editor". Login with the username <code>admin</code>
+        and the password <code>levi</code>.
+      </p>
+      <p>
+        Now a page with the title "First Steps" should appear, asking you to either import the
+        example content of the default publication, or start with your own homepage.
+        We'll do the latter.
+      </p>
+      <p>
+        Click on the button <em>Start with own page</em>. You'll be asked to fill in
+        a form. Enter "Home" as the page title, and select <code>homepage</code> as the
+        resource type. Click the <em>Create</em> button. Congratulations, you've created
+        your first page!
+      </p>
+      <p>
+        To make sure your content directory is configured properly, take a look at the
+        <code>data/content</code> directory. Lenya should have created an <code>authoring</code>
+        directory with some content in it.
+      </p>
+    </section>
+    
+    <section>
+      <title>Next Steps</title>
+      <p>
+        Now you can go on with customizing your publication:
+      </p>
+      <ul>
+        <li>Add groups, users, and policies</li>
+        <li>Customize the layout by overriding the default publication XSLTs</li>
+        <li>Add more content</li>
+        <li>...</li>
+      </ul>
+    </section>
+    
+  </body>
+</document>

Added: lenya/sandbox/pubs/docu/content/authoring/83890fd0-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221897269.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/83890fd0-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221897269.bak?rev=595691&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/83890fd0-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221897269.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/83890fd0-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221897269.bak Fri Nov 16 07:11:58 2007
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata xmlns="http://apache.org/lenya/metadata/1.0">
+<element-set namespace="http://purl.org/dc/elements/1.1/">
+<element key="title">
+<value>Create a Publication</value>
+</element>
+</element-set>
+<element-set namespace="http://apache.org/lenya/metadata/document/1.0">
+<element key="extension">
+<value>xml</value>
+</element>
+<element key="mimeType">
+<value>application/xml</value>
+</element>
+<element key="resourceType">
+<value>forrestDocument20</value>
+</element>
+<element key="contentType">
+<value>xml</value>
+</element>
+</element-set>
+</metadata>

Modified: lenya/sandbox/pubs/docu/content/authoring/83890fd0-8730-11dc-ae46-9e7b5d14892d/en.rcml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/83890fd0-8730-11dc-ae46-9e7b5d14892d/en.rcml?rev=595691&r1=595690&r2=595691&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/83890fd0-8730-11dc-ae46-9e7b5d14892d/en.rcml (original)
+++ lenya/sandbox/pubs/docu/content/authoring/83890fd0-8730-11dc-ae46-9e7b5d14892d/en.rcml Fri Nov 16 07:11:58 2007
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XPSRevisionControl xmlns="">
+<CheckIn backup="true" identity="lenya" session="fde084c0-944b-11dc-8f2e-e6c0ff9903ab" time="1195221897269" version="3"/>
+<CheckOut identity="lenya" session="fde084c0-944b-11dc-8f2e-e6c0ff9903ab" time="1195221885332"/>
 <CheckIn backup="true" identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910797090" version="2"/>
 <CheckOut identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910768391"/>
 <CheckIn backup="true" identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781622644" version="1"/>

Added: lenya/sandbox/pubs/docu/content/authoring/852cadb0-8730-11dc-ae46-9e7b5d14892d/en.1195221904945.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/852cadb0-8730-11dc-ae46-9e7b5d14892d/en.1195221904945.bak?rev=595691&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/852cadb0-8730-11dc-ae46-9e7b5d14892d/en.1195221904945.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/852cadb0-8730-11dc-ae46-9e7b5d14892d/en.1195221904945.bak Fri Nov 16 07:11:58 2007
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2006 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: metadata.xml 55543 2004-10-26 00:14:59Z gregor $ --><!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+
+<document>
+  <header>
+    <title>Creating a Resource Type, Part 1: Prerequisites and Declaration</title>
+  </header>
+  <body>
+    <p>
+      This section explains how to create a new resource type. For more information
+      on resource types, refer to the <a href="lenya-document:2d466e50-8731-11dc-ae46-9e7b5d14892d">resource types reference</a>.
+      For the sake of simplicity, we'll test the resource type with the default publication.
+    </p>
+    <p>
+      Our resource type will support storing details (name, address, etc.) of people.
+      We'll call it <em>person</em>. Since we're too lazy (and too smart) to invent our
+      own XML schema, we'll just use the one provided by the
+      <a href="http://www.foaf-project.org/">
+<acronym title="Friend of a Friend">FoaF</acronym>
+</a>
+      project.
+    </p>
+    <p>
+      You can checkout the source code of this example from the Subversion repository at the URL
+      <code>http://svn.apache.org/repos/asf/lenya/sandbox/modules/person</code>.
+    </p>
+    
+    <section>
+      <title>Prerequisites</title>
+      <p>
+        We'll use the following directory layout:
+      </p>
+      <source xml:space="preserve">$HOME/
+  apache/
+    lenya-2.0/             The Lenya installation directory, we'll call it $LENYA_HOME.
+  src/
+    lenya/                 The home directory of your Lenya-related sources.
+      modules/             Our modules.
+        person/            Our "person" resource type module ($MODULE_HOME).</source>
+      
+    </section>
+    
+    <section>
+      <title>Adding a Module</title>
+      <p>
+        We'll add a module which will contain the resource type. This makes it
+        self-contained, and it will be very easy to re-use our resource type
+        in different publications. Create the <em>person</em> directory (see section
+        <em>Prerequisites</em>) with the following directory layout:
+      </p>
+      
+      <source xml:space="preserve">person/
+  config/                        Configuration of the module.
+    menu.xsp                     The resource type menu items.
+    module.xml                   Module descriptor.
+    cocoon-xconf/                Patch files for cocoon.xconf.
+      resourcetype-person.xconf  The declaration of our resource type.
+  resources/
+    i18n/                        The internationalization catalogues.
+    icons/
+      person.gif                 The icon for the sitetree.
+  samples/                       Samples to create person documents.
+    foaf.xml                     The default sample document.
+  xslt/
+    foaf2xhtml.xml               Transform FoaF documents to XHTML.
+  menus.xmap                     The sitemap generating the menu.</source>
+    
+      <p>
+        Each module needs a module descriptor file <code>$MODULE_HOME/config/module.xml</code>.
+        In our case it looks like this (replace <code>org.yourproject</code> with your
+        own package name):
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<module xmlns="http://apache.org/lenya/module/1.0">
+  <id>org.yourproject.lenya.modules.person</id>
+  <package>org.yourproject.lenya.modules</package>
+  <version>0.1-dev</version>
+  <name>person</name>
+  <lenya-version>@lenya.version@</lenya-version>
+  <description>Resource type to store person details</description>
+</module>]]></source>
+      <p>
+        Now we have to let Lenya know that we've added a new module. Edit the
+        file <code>$LENYA_HOME/local.build.properties</code> and add the path
+        to your <code>modules</code> directory (the parent of <code>$MODULE_HOME</code>)
+        at the end of the <code>modules.root.dirs</code> declaration:
+      </p>
+      <source xml:space="preserve">modules.root.dirs=...:/home/john/src/lenya/modules</source>
+      <p>
+        Finally, we'll have to declare the module in the publications which use it
+        (in our case, the default publication). Edit <code>$PUB_HOME/config/publication.xml</code>
+        and add the entry
+      </p>
+      <source xml:space="preserve"><![CDATA[<module name="person"/>]]></source>
+      <p>
+        to the <code><![CDATA[<modules/>]]></code> section. Additionally, you can assign a workflow
+        to the resource type in the <code><![CDATA[<resource-types>]]></code> section of
+        <code>publication.xml</code>:
+      </p>
+      <source xml:space="preserve"><![CDATA[<resource-type name="person" workflow="fallback://config/workflow/workflow.xml"/>]]></source>
+    </section>
+    
+    <section>
+      <title>Declaring the Resource Type</title>
+      <p>
+        To let Lenya know that a new resource type exists, we'll add the
+        resource type declaration file <code>resourcetype-person.xconf</code>.
+        This is a patch for the <code>cocoon.xconf</code> file and therefore
+        located in <code>$MODULE_HOME/config/cocoon-xconf</code>.
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0"?>
+<xconf xpath="/cocoon/resource-types"
+       unless="/cocoon/resource-types/component-instance[@name = 'person']">
+  
+  <component-instance name="person" logger="lenya.resourcetypes"
+    class="org.apache.lenya.cms.publication.ResourceTypeImpl">
+    
+    <schema 
+       namespace="http://relaxng.org/ns/structure/0.9"
+       uri="fallback://lenya/modules/person/resources/schemas/foaf.rng"
+    />
+    
+    <!-- Default time cache time in seconds for this resource type -->  
+    <expires seconds="3600" />
+    
+    <sample
+       name="Basic FOAF sample"
+       mime-type="application/rdf+xml"
+       uri="fallback://lenya/modules/person/samples/foaf.xml"
+    />
+    
+    <format name="xhtml" uri="cocoon://modules/person/xhtml.xml"/>
+    <format name="xhtml-include" uri="cocoon://modules/person/xhtml-include.xml"/>
+    <format name="icon" uri="cocoon://modules/person/icon"/>
+    
+  </component-instance>
+  
+</xconf>]]></source>
+      <p>
+        According to this declaration, the Lenya web application creates a new
+        <code>ResourceTypeImpl</code> service on startup which makes the resource
+        type details available to other objects.
+      </p>
+      <p>
+        In the <a href="lenya-document:868b2c40-8730-11dc-ae46-9e7b5d14892d">next section</a> we'll setup the creation of person documents.
+      </p>
+    </section>
+    
+    <section>
+      <title>Adding I18n Messages for the Resource Type Name</title>
+      <p>
+        Now we'll provide <acronym title="Internationalization">i18n</acronym> messages for each
+        language to show the resource type name in a human-readable form. There is a convention
+        that the message key <em>resourceType-{name}</em> is used.
+      </p>
+      <p>
+        Create the file <code>$MODULE_HOME/resources/i18n/cmsui.xml</code> with the following content:
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<catalogue xml:lang="en" xmlns:xhtml="http://www.w3.org/1999/xhtml">
+  <message key="resourceType-person">Person</message>
+</catalogue>]]></source>
+      <p>
+        For other languages, use the language code as suffix (<code>cmsui_de.xhml</code> etc.) and
+        don't forget to set the <em>xml:lang</em> attribute of the <code><![CDATA[<catalogue>]]></code>
+        element.
+      </p>
+    </section>
+    
+  </body>
+</document>

Added: lenya/sandbox/pubs/docu/content/authoring/852cadb0-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221904945.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/852cadb0-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221904945.bak?rev=595691&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/852cadb0-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221904945.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/852cadb0-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221904945.bak Fri Nov 16 07:11:58 2007
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata xmlns="http://apache.org/lenya/metadata/1.0">
+<element-set namespace="http://purl.org/dc/elements/1.1/">
+<element key="title">
+<value>Declaration</value>
+</element>
+</element-set>
+<element-set namespace="http://apache.org/lenya/metadata/document/1.0">
+<element key="extension">
+<value>xml</value>
+</element>
+<element key="mimeType">
+<value>application/xml</value>
+</element>
+<element key="resourceType">
+<value>forrestDocument20</value>
+</element>
+<element key="contentType">
+<value>xml</value>
+</element>
+</element-set>
+</metadata>

Modified: lenya/sandbox/pubs/docu/content/authoring/852cadb0-8730-11dc-ae46-9e7b5d14892d/en.rcml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/852cadb0-8730-11dc-ae46-9e7b5d14892d/en.rcml?rev=595691&r1=595690&r2=595691&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/852cadb0-8730-11dc-ae46-9e7b5d14892d/en.rcml (original)
+++ lenya/sandbox/pubs/docu/content/authoring/852cadb0-8730-11dc-ae46-9e7b5d14892d/en.rcml Fri Nov 16 07:11:58 2007
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XPSRevisionControl xmlns="">
+<CheckIn backup="true" identity="lenya" session="fde084c0-944b-11dc-8f2e-e6c0ff9903ab" time="1195221904945" version="3"/>
+<CheckOut identity="lenya" session="fde084c0-944b-11dc-8f2e-e6c0ff9903ab" time="1195221884178"/>
 <CheckIn backup="true" identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910778126" version="2"/>
 <CheckOut identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910764125"/>
 <CheckIn backup="true" identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781616593" version="1"/>

Added: lenya/sandbox/pubs/docu/content/authoring/868b2c40-8730-11dc-ae46-9e7b5d14892d/en.1195221907096.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/868b2c40-8730-11dc-ae46-9e7b5d14892d/en.1195221907096.bak?rev=595691&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/868b2c40-8730-11dc-ae46-9e7b5d14892d/en.1195221907096.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/868b2c40-8730-11dc-ae46-9e7b5d14892d/en.1195221907096.bak Fri Nov 16 07:11:58 2007
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2006 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: metadata.xml 55543 2004-10-26 00:14:59Z gregor $ --><!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+
+<document>
+  <header>
+    <title>Creating a Resource Type, Part 2: Creating Documents</title>
+  </header>
+  
+  <body>
+
+    <section>
+      <title>Adding the Menu</title>
+      <p>
+        Now we'll add the menu for our module. The first item we need will trigger
+        the usecase to create new person documents. We have to add a sitemap which
+        serves as an entry point for the menu (<code>$MODULE_HOME/menus.xmap)</code>:
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0"?>
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+  <map:pipelines>
+    <map:pipeline>
+      <map:match pattern="**">
+        <map:generate type="serverpages"
+          src="fallback://lenya/modules/person/config/menu.xsp"/>
+        <map:serialize type="xml"/>
+      </map:match>
+    </map:pipeline>
+  </map:pipelines>
+</map:sitemap>]]></source>
+      <p>
+        According to this sitemap, the menu XSP is located at
+        <code>$MODULE_HOME/config/menu.xsp</code>. Note that we're using the i18n
+        message for the resource type label which we added in the previous section:
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0"?>
+<xsp:page 
+    language="java" 
+    xmlns:xsp="http://apache.org/xsp"
+    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"    
+    xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0"
+    xmlns="http://apache.org/cocoon/lenya/menubar/1.0">
+  <menu>
+    <menus>
+      <menu i18n:attr="name" name="File">
+        <block areas="site authoring">
+          <item uc:usecase="sitemanagement.create" href="?doctype=person">
+            <i18n:translate>
+              <i18n:text>New ... Document</i18n:text>
+              <i18n:param><i18n:text>resourceType-person</i18n:text></i18n:param>
+            </i18n:translate>
+          </item>
+        </block>
+      </menu>
+    </menus>
+  </menu>
+</xsp:page>]]></source>
+      <p>
+        The menu contains an item which triggers the <code>sitemanagement.create</code>
+        usecase with the <code>doctype=person</code> parameter.
+      </p>
+    </section>
+    <section>
+      <title>Providing the Sample</title>
+      <p>
+        To create a document, the <code>sitemanagement.create</code> usecase needs a sample
+        XML. We've already specified the sample location in our resource type declaration
+        (see above). Now we have to add the corresponding FoaF person file
+        (<code>$MODULE_HOME/samples/foaf.xml</code>):
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<rdf:RDF
+  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+  xmlns:foaf="http://xmlns.com/foaf/0.1/">
+  <foaf:Person rdf:ID="me">
+    <foaf:title>Mr</foaf:title>
+    <foaf:givenname>Homer</foaf:givenname>
+    <foaf:family_name>Simpson</foaf:family_name>
+    <foaf:mbox rdf:resource="mailto:chunkylover53@aol.com"/>
+    <foaf:phone rdf:resource="tel:555-555-555"/>
+    <foaf:workplaceHomepage rdf:resource="http://powerplantspringfield.com"/>
+  </foaf:Person>
+</rdf:RDF>]]></source>
+
+      <p>
+        In the <a href="lenya-document:87e36940-8730-11dc-ae46-9e7b5d14892d">next section</a> we'll render our
+        newly created document as an XHTML web page.
+      </p>
+    </section>
+    
+  </body>
+</document>

Added: lenya/sandbox/pubs/docu/content/authoring/868b2c40-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221907096.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/868b2c40-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221907096.bak?rev=595691&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/868b2c40-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221907096.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/868b2c40-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221907096.bak Fri Nov 16 07:11:58 2007
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata xmlns="http://apache.org/lenya/metadata/1.0">
+<element-set namespace="http://purl.org/dc/elements/1.1/">
+<element key="title">
+<value>Creation</value>
+</element>
+</element-set>
+<element-set namespace="http://apache.org/lenya/metadata/document/1.0">
+<element key="extension">
+<value>xml</value>
+</element>
+<element key="mimeType">
+<value>application/xml</value>
+</element>
+<element key="resourceType">
+<value>forrestDocument20</value>
+</element>
+<element key="contentType">
+<value>xml</value>
+</element>
+</element-set>
+</metadata>

Modified: lenya/sandbox/pubs/docu/content/authoring/868b2c40-8730-11dc-ae46-9e7b5d14892d/en.rcml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/868b2c40-8730-11dc-ae46-9e7b5d14892d/en.rcml?rev=595691&r1=595690&r2=595691&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/868b2c40-8730-11dc-ae46-9e7b5d14892d/en.rcml (original)
+++ lenya/sandbox/pubs/docu/content/authoring/868b2c40-8730-11dc-ae46-9e7b5d14892d/en.rcml Fri Nov 16 07:11:58 2007
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XPSRevisionControl xmlns="">
+<CheckIn backup="true" identity="lenya" session="fde084c0-944b-11dc-8f2e-e6c0ff9903ab" time="1195221907096" version="3"/>
+<CheckOut identity="lenya" session="fde084c0-944b-11dc-8f2e-e6c0ff9903ab" time="1195221886514"/>
 <CheckIn backup="true" identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910778614" version="2"/>
 <CheckOut identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910764750"/>
 <CheckIn backup="true" identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781626461" version="1"/>

Added: lenya/sandbox/pubs/docu/content/authoring/87e36940-8730-11dc-ae46-9e7b5d14892d/en.1195221911250.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/87e36940-8730-11dc-ae46-9e7b5d14892d/en.1195221911250.bak?rev=595691&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/87e36940-8730-11dc-ae46-9e7b5d14892d/en.1195221911250.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/87e36940-8730-11dc-ae46-9e7b5d14892d/en.1195221911250.bak Fri Nov 16 07:11:58 2007
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2006 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: metadata.xml 55543 2004-10-26 00:14:59Z gregor $ --><!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+
+<document>
+  <header>
+    <title>Creating a Resource Type, Part 3: Presentation</title>
+  </header>
+  <body>
+
+    <section>
+      <title>A Basic Presentation Pipeline</title>
+      <p>
+        Now the Lenya web application can create new person documents, but
+        it won't be able to render them as HTML pages (or anything else) yet.
+        In our resource type declaration we specified the format <em>xhtml</em>.
+        According to this specification, we'll setup a basic presentation pipeline
+        which converts our FoaF XML document to XHTML.
+      </p>
+      <p>
+        First we'll add the sitemap (<code>$MODULE_HOME/sitemap.xmap</code>).
+        Note that some lines have been wrapped (marked with backslashes):
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+  <map:pipelines>
+    <map:pipeline>
+
+      <!-- {format}.xml -->
+      <map:match pattern="*.xml">
+        <map:generate src="cocoon:/{1}.xml/{page-envelope:publication-id}/ \
+          {page-envelope:area}/{page-envelope:document-uuid}/ \
+          {page-envelope:document-language}"/>
+        <map:serialize type="xml"/>
+      </map:match>
+      
+      <!-- {format}.xml/{pubId}/{area}/{uuid}/{language} -->
+      <map:match pattern="*.xml/*/*/*/*">
+        <map:generate src="lenya-document:{4},lang={5}{link:rev}"/>
+        <map:transform src="fallback://lenya/modules/person/xslt/foaf2xhtml.xsl"/>
+        <map:serialize type="xml"/>
+      </map:match>
+
+      <!-- The icon for person nodes in the sitetree. -->
+      <map:match pattern="icon/*/*/*/*">
+        <map:read src="fallback://lenya/modules/person/resources/icons/person.gif"/>
+      </map:match>
+      
+    </map:pipeline>
+  </map:pipelines>
+</map:sitemap>
+      ]]></source>
+      <p>
+        The sitemap uses an XSLT stylesheet <code>$MODULE_HOME/xslt/foaf2xhtml.xsl</code>
+        to render the XHTML view of the FoaF file:
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+  xmlns:foaf="http://xmlns.com/foaf/0.1/"
+  xmlns="http://www.w3.org/1999/xhtml">
+  
+  <xsl:template match="rdf:RDF">
+    <html>
+      <body>
+        <div id="body">
+          <xsl:apply-templates select="foaf:Person"/>
+        </div>
+      </body>
+    </html>
+  </xsl:template>
+  
+  <xsl:template match="foaf:Person">
+    <h2>Person Details</h2>
+    <table class="person">
+      <tr>
+        <th>Title:</th>
+        <td><xsl:value-of select="foaf:title"/></td>
+      </tr>
+      <tr>
+        <th>Given name:</th>
+        <td><xsl:value-of select="foaf:givenname"/></td>
+      </tr>
+      <tr>
+        <th>Family name:</th>
+        <td><xsl:value-of select="foaf:family_name"/></td>
+      </tr>
+      <tr>
+        <th>E-Mail:</th>
+        <td>
+          <xsl:variable name="mbox" select="foaf:mbox/@rdf:resource"/>
+          <a href="{$mbox}">
+            <xsl:value-of select="substring-after($mbox, 'mailto:')"/>
+          </a>
+        </td>
+      </tr>
+      <tr>
+        <th>Phone:</th>
+        <td>
+          <xsl:variable name="phone" select="foaf:phone/@rdf:resource"/>
+          <xsl:value-of select="substring-after($phone, 'tel:')"/>
+        </td>
+      </tr>
+      <tr>
+        <th>Homepage:</th>
+        <td>
+          <xsl:variable name="homepage" select="foaf:workplaceHomepage/@rdf:resource"/>
+          <a href="{$homepage}"><xsl:value-of select="$homepage"/></a>
+        </td>
+      </tr>
+    </table>
+  </xsl:template>
+
+</xsl:stylesheet>]]></source>
+    </section>
+    
+    <section>
+      <title>Adding the CSS</title>
+      <p>
+        The default publication allows to add custom CSS files for each resource type.
+        We want to style our table headers a bit, so we add the file
+        <code>pubs/default/resources/shared/css/person.css</code> with the following content:
+      </p>
+      <source xml:space="preserve"><![CDATA[table.person { font-size: small; }
+table.person th {
+  font-weight: normal;
+  color: #999999;
+  text-align: left;
+  padding-right: 1em;
+}]]></source>
+    </section>
+    
+    <section>
+      <title>Creating our First Person Document</title>
+      <p>
+        Now it's time to check out if everything works as expected. First, we build the
+        Lenya web application to deploy our new resource type. If Lenya is running, shut it down.
+        Go to <code>$LENYA_HOME</code> and execute
+      </p>
+      <source xml:space="preserve">./build.sh</source>
+      <p>
+        When the build has finished, start the Jetty server:
+      </p>
+      <source xml:space="preserve">./lenya.sh</source>
+      <p>
+        Now go to <a href="http://localhost:8888/default/authoring/index.html">http://localhost:8888/default/authoring/index.html</a>
+        and log in as user "lenya". The <em>File</em> menu should now contain an
+        item <em>New Person Document</em>. But before creating person documents,
+        we'll add a new top level XHTML document <em>People</em>: 
+      </p>
+      <ul>
+        <li>File -&gt; New XHTML Document</li>
+        <li>Node Name: people</li>
+        <li>Navigation Title: People</li>
+      </ul>
+      <p>
+        You end up on the <em>People</em> page. Now you can create a new person document
+        as a child of this document by selecting the <em>New Person Document</em> menu item:
+      </p>
+      <figure alt="Create a person document" src="lenya-document:6858ce70-8731-11dc-ae46-9e7b5d14892d"/>
+      <p>
+        After hitting OK, you're redirected to the newly created person document:
+      </p>
+      <figure alt="Person document" src="lenya-document:685ffa60-8731-11dc-ae46-9e7b5d14892d"/>
+      <p>
+        In the <a href="lenya-document:8913abe0-8730-11dc-ae46-9e7b5d14892d">next section</a> we'll make our
+        person documents editable.
+      </p>
+    </section>
+    
+  </body>
+</document>

Added: lenya/sandbox/pubs/docu/content/authoring/87e36940-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221911250.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/87e36940-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221911250.bak?rev=595691&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/87e36940-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221911250.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/87e36940-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221911250.bak Fri Nov 16 07:11:58 2007
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata xmlns="http://apache.org/lenya/metadata/1.0">
+<element-set namespace="http://purl.org/dc/elements/1.1/">
+<element key="title">
+<value>Presentation</value>
+</element>
+</element-set>
+<element-set namespace="http://apache.org/lenya/metadata/document/1.0">
+<element key="extension">
+<value>xml</value>
+</element>
+<element key="mimeType">
+<value>application/xml</value>
+</element>
+<element key="resourceType">
+<value>forrestDocument20</value>
+</element>
+<element key="contentType">
+<value>xml</value>
+</element>
+</element-set>
+</metadata>

Modified: lenya/sandbox/pubs/docu/content/authoring/87e36940-8730-11dc-ae46-9e7b5d14892d/en.rcml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/87e36940-8730-11dc-ae46-9e7b5d14892d/en.rcml?rev=595691&r1=595690&r2=595691&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/87e36940-8730-11dc-ae46-9e7b5d14892d/en.rcml (original)
+++ lenya/sandbox/pubs/docu/content/authoring/87e36940-8730-11dc-ae46-9e7b5d14892d/en.rcml Fri Nov 16 07:11:58 2007
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XPSRevisionControl xmlns="">
+<CheckIn backup="true" identity="lenya" session="fde084c0-944b-11dc-8f2e-e6c0ff9903ab" time="1195221911250" version="3"/>
+<CheckOut identity="lenya" session="fde084c0-944b-11dc-8f2e-e6c0ff9903ab" time="1195221891049"/>
 <CheckIn backup="true" identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910778308" version="2"/>
 <CheckOut identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910764208"/>
 <CheckIn backup="true" identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781621393" version="1"/>

Added: lenya/sandbox/pubs/docu/content/authoring/8913abe0-8730-11dc-ae46-9e7b5d14892d/en.1195221906676.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/8913abe0-8730-11dc-ae46-9e7b5d14892d/en.1195221906676.bak?rev=595691&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/8913abe0-8730-11dc-ae46-9e7b5d14892d/en.1195221906676.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/8913abe0-8730-11dc-ae46-9e7b5d14892d/en.1195221906676.bak Fri Nov 16 07:11:58 2007
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2006 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: metadata.xml 55543 2004-10-26 00:14:59Z gregor $ --><!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+
+<document>
+  <header>
+    <title>Creating a Resource Type, Part 4: Editing</title>
+  </header>
+  <body>
+    
+    <p>
+      In this section we make our person documents editable.
+    </p>
+    
+    <section>
+      <title>Adding the Relax NG Schema</title>
+      <p>
+        When we allow to edit documents, we have to make sure that the resulting
+        XML conforms to the FoaF specification. For this purpose we provide a
+        <a href="http://relaxng.org">Relax NG</a> schema for the FoaF person XML format.
+        Here's a simple schema, created with <a href="http://www.thaiopensource.com/relaxng/trang.html">Trang</a>,
+        which - according to the resource type declaration - has to be located at
+        <code>$MODULE_HOME/resources/schemas/foaf.rng</code>:
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+  xmlns:foaf="http://xmlns.com/foaf/0.1/"
+  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+  datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+  <start>
+    <element name="rdf:RDF">
+      <element name="foaf:Person">
+        <attribute name="rdf:ID"><data type="NCName"/></attribute>
+        <element name="foaf:title"><text/></element>
+        <element name="foaf:givenname"><text/></element>
+        <element name="foaf:family_name"><text/></element>
+        <element name="foaf:mbox">
+          <attribute name="rdf:resource">
+            <data type="anyURI"/>
+          </attribute>
+        </element>
+        <element name="foaf:phone">
+          <attribute name="rdf:resource">
+            <data type="NMTOKEN"/>
+          </attribute>
+        </element>
+        <element name="foaf:workplaceHomepage">
+          <attribute name="rdf:resource">
+            <data type="anyURI"/>
+          </attribute>
+        </element>
+      </element>
+    </element>
+  </start>
+</grammar>
+      ]]></source>
+    </section>
+
+    <section>
+      <title>Enabling the One-Form Editor</title>
+      
+      <p>
+        In the first step we don't want to invest much time, so we just
+        enable the one-form editor. We have to add the corresponding menu item
+        to our <code>menu.xsp</code> file. But since we want to enable it only
+        for person documents, we have to test if the currently displayed document
+        has the <em>person</em> resource type. Here's the extended <code>menu.xsp</code>
+        file - note that a new namespace declaration (<code>xmlns:input</code>)
+        has been added:
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0"?>
+<xsp:page 
+    language="java" 
+    xmlns:xsp="http://apache.org/xsp"
+    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"    
+    xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0"
+    xmlns:input="http://apache.org/cocoon/xsp/input/1.0"
+    xmlns="http://apache.org/cocoon/lenya/menubar/1.0">
+
+  <xsp:structure>
+    <xsp:include>org.apache.lenya.cms.publication.Document</xsp:include>
+  </xsp:structure>
+  
+  <menu>
+    <menus>
+      <menu i18n:attr="name" name="File">
+        <block areas="site authoring">
+          <item uc:usecase="sitemanagement.create" href="?doctype=person">
+            <i18n:translate>
+              <i18n:text>New ... Document</i18n:text>
+              <i18n:param>Person</i18n:param>
+            </i18n:translate>
+          </item>
+        </block>
+      </menu>
+      
+      <menu i18n:attr="name" name="Edit">
+        <xsp:logic>
+          try {
+              Object doc = <input:get-attribute module="page-envelope"
+                  as="object" name="document"/>;
+              if (doc instanceof Document &amp;&amp; ((Document) doc).exists()) {
+                  String doctype = <input:get-attribute module="page-envelope"
+                      as="string" name="document-type"/>;
+                  if ("person".equals(doctype)) {
+                      <block areas="authoring">
+                        <item uc:usecase="editors.oneform" href="?">
+                          <i18n:text>With one Form</i18n:text>
+                        </item>
+                      </block>
+                  }
+              }
+          }
+          catch (Exception e) {
+              throw new ProcessingException("Error during menu generation: ", e);
+          }
+        </xsp:logic>
+      </menu>
+      
+    </menus>
+  </menu>
+</xsp:page>
+      ]]></source>
+      
+      <p>
+        Now you should be able to edit your person document with the one-form editor.
+      </p>
+      <p>
+        In the <a href="lenya-document:8a8eb320-8730-11dc-ae46-9e7b5d14892d">next section</a> we explain how
+        to make person documents editable with the BXE WYSIWYG editor.
+      </p>
+      
+    </section>    
+  </body>
+</document>

Added: lenya/sandbox/pubs/docu/content/authoring/8913abe0-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221906676.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/8913abe0-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221906676.bak?rev=595691&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/8913abe0-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221906676.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/8913abe0-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221906676.bak Fri Nov 16 07:11:58 2007
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata xmlns="http://apache.org/lenya/metadata/1.0">
+<element-set namespace="http://purl.org/dc/elements/1.1/">
+<element key="title">
+<value>Editing (One-Form)</value>
+</element>
+</element-set>
+<element-set namespace="http://apache.org/lenya/metadata/document/1.0">
+<element key="extension">
+<value>xml</value>
+</element>
+<element key="mimeType">
+<value>application/xml</value>
+</element>
+<element key="resourceType">
+<value>forrestDocument20</value>
+</element>
+<element key="contentType">
+<value>xml</value>
+</element>
+</element-set>
+</metadata>

Modified: lenya/sandbox/pubs/docu/content/authoring/8913abe0-8730-11dc-ae46-9e7b5d14892d/en.rcml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/8913abe0-8730-11dc-ae46-9e7b5d14892d/en.rcml?rev=595691&r1=595690&r2=595691&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/8913abe0-8730-11dc-ae46-9e7b5d14892d/en.rcml (original)
+++ lenya/sandbox/pubs/docu/content/authoring/8913abe0-8730-11dc-ae46-9e7b5d14892d/en.rcml Fri Nov 16 07:11:58 2007
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XPSRevisionControl xmlns="">
+<CheckIn backup="true" identity="lenya" session="fde084c0-944b-11dc-8f2e-e6c0ff9903ab" time="1195221906676" version="3"/>
+<CheckOut identity="lenya" session="fde084c0-944b-11dc-8f2e-e6c0ff9903ab" time="1195221885881"/>
 <CheckIn backup="true" identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910790516" version="2"/>
 <CheckOut identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910763941"/>
 <CheckIn backup="true" identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781634245" version="1"/>

Added: lenya/sandbox/pubs/docu/content/authoring/8a8eb320-8730-11dc-ae46-9e7b5d14892d/en.1195221903149.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/8a8eb320-8730-11dc-ae46-9e7b5d14892d/en.1195221903149.bak?rev=595691&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/8a8eb320-8730-11dc-ae46-9e7b5d14892d/en.1195221903149.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/8a8eb320-8730-11dc-ae46-9e7b5d14892d/en.1195221903149.bak Fri Nov 16 07:11:58 2007
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2006 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: metadata.xml 55543 2004-10-26 00:14:59Z gregor $ --><!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+
+<document>
+  <header>
+    <title>Creating a Resource Type, Part 5: WYSIWYG Editing with BXE</title>
+  </header>
+  <body>
+    
+    <p>
+      In this section we make our person documents editable with the BXE WYSIWYG editor.
+    </p>
+    
+    <section>
+      <title>Adding the Menu Item</title>
+      <p>
+        First, we add the BXE menu item to <code>$MODULE_HOME/config/menu.xsp</code>,
+        right above the one-form editor item:
+      </p>
+      <source xml:space="preserve"><![CDATA[<item uc:usecase="bxe.edit" href="?"><i18n:text>With BXE</i18n:text></item>]]></source>
+    </section>
+    
+    <section>
+      <title>Adding the webdavGET format</title>
+      <p>
+        The BXE editor uses the <acronym title="Web-based Distributed Authoring and Versioning">WebDAV</acronym>
+        protocol to load the document source. To provide this functionality, we have to
+        add the <em>webdavGET</em> format to our resource type declaration: 
+      </p>
+      <source xml:space="preserve"><![CDATA[<component-instance name="person"
+  ...
+  <format name="webdavGET" uri="cocoon://modules/person/davget.xml"/>
+</component-instance>]]></source>
+      <p>
+        When you re-deploy the module, make sure that <code>cocoon.xconf</code> is properly updated
+        - either by deleting the file from the web application, or by adding the new line manually.
+      </p>
+      <p>
+        The format is served by the following pipeline in <code>$MODULE_HOME/sitemap.xmap</code>:
+      </p>
+      <source xml:space="preserve"><![CDATA[<!-- webdav GET matcher -->
+<map:match pattern="davget.xml">
+  <map:act type="set-header">
+    <map:parameter name="Last-Modified" value="{date-iso8601-rfc822:{page-envelope:document-lastmodified}}" />
+    <map:generate src="lenya-document:{page-envelope:document-uuid}"/>
+    <map:transform type="uuid2url">
+      <map:parameter name="urls" value="absolute"/>
+    </map:transform>
+    <map:serialize type="xml"/>
+  </map:act>
+</map:match>]]></source>
+    </section>
+
+    <section>
+      <title>Adding BXE Support to the XSLT</title>
+      <p>
+        Now we have to add specific <code>bxe_xpath</code> attributes to the XHTML elements
+        of our page so that BXE knows what can be edited. We update our stylesheet
+        <code>$MODULE_HOME/xslt/foaf2xhtml.xsl</code> and add the attributes when the
+        parameter <code>rendertype</code> equals <code>edit</code>:
+      </p>
+      <source xml:space="preserve"><![CDATA[  <xsl:param name="rendertype"/>
+  
+  ...
+      
+  <xsl:template name="bxeAttribute">
+    <xsl:param name="element"/>
+    <xsl:if test="$rendertype = 'edit'">
+      <xsl:attribute name="bxe_xpath">
+        /rdf:RDF/foaf:Person/foaf:<xsl:value-of select="$element"/>
+      </xsl:attribute>
+    </xsl:if>
+  </xsl:template>
+  
+  <xsl:template match="foaf:Person">
+    <h2>Person Details</h2>
+    <table class="person">
+      <tr>
+        <th>Title:</th>
+        <td>
+          <xsl:call-template name="bxeAttribute">
+            <xsl:with-param name="element">title</xsl:with-param>
+          </xsl:call-template>
+          <xsl:value-of select="foaf:title"/>
+        </td>
+      </tr>
+      <tr>
+        <th>Given name:</th>
+        <td>
+          <xsl:call-template name="bxeAttribute">
+            <xsl:with-param name="element">givenname</xsl:with-param>
+          </xsl:call-template>
+          <xsl:value-of select="foaf:givenname"/>
+        </td>
+      </tr>
+      <tr>
+        <th>Family name:</th>
+        <td>
+          <xsl:call-template name="bxeAttribute">
+            <xsl:with-param name="element">family_name</xsl:with-param>
+          </xsl:call-template>
+          <xsl:value-of select="foaf:family_name"/>
+        </td>
+      </tr>
+      ...
+  </xsl:template>]]></source>
+      <p>
+        Now we're faced with a limitation of BXE: It is not possible to edit attributes in WYSIWYG mode.
+        We'd have to change our XML structure to allow this. For this little tutorial, we'll
+        just edit the element values - <code>foaf:title</code>, <code>foaf:givenname</code>,
+        and <code>foaf:family_name</code>.
+      </p>
+      <p>
+        The <code>rendertype</code> parameter is passed to the stylesheet in
+        <code>$MODULE_HOME/sitemap.xmap</code>:
+      </p>
+      <source xml:space="preserve"><![CDATA[<map:transform src="fallback://lenya/modules/person/xslt/foaf2xhtml.xsl">
+  <map:parameter name="rendertype" value="{request-param:rendertype}"/>
+</map:transform>]]></source>
+    </section>
+    <section>
+      <title>Start Editing</title>
+      <p>
+        Now you should be able to edit your person documents with BXE:
+      </p>
+      <figure alt="Editing with BXE" src="lenya-document:68666300-8731-11dc-ae46-9e7b5d14892d"/>
+    </section>
+  </body>
+</document>

Added: lenya/sandbox/pubs/docu/content/authoring/8a8eb320-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221903149.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/8a8eb320-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221903149.bak?rev=595691&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/8a8eb320-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221903149.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/8a8eb320-8730-11dc-ae46-9e7b5d14892d/en.meta.1195221903149.bak Fri Nov 16 07:11:58 2007
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata xmlns="http://apache.org/lenya/metadata/1.0">
+<element-set namespace="http://purl.org/dc/elements/1.1/">
+<element key="title">
+<value>Editing (BXE)</value>
+</element>
+</element-set>
+<element-set namespace="http://apache.org/lenya/metadata/document/1.0">
+<element key="extension">
+<value>xml</value>
+</element>
+<element key="mimeType">
+<value>application/xml</value>
+</element>
+<element key="resourceType">
+<value>forrestDocument20</value>
+</element>
+<element key="contentType">
+<value>xml</value>
+</element>
+</element-set>
+</metadata>

Modified: lenya/sandbox/pubs/docu/content/authoring/8a8eb320-8730-11dc-ae46-9e7b5d14892d/en.rcml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/8a8eb320-8730-11dc-ae46-9e7b5d14892d/en.rcml?rev=595691&r1=595690&r2=595691&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/8a8eb320-8730-11dc-ae46-9e7b5d14892d/en.rcml (original)
+++ lenya/sandbox/pubs/docu/content/authoring/8a8eb320-8730-11dc-ae46-9e7b5d14892d/en.rcml Fri Nov 16 07:11:58 2007
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XPSRevisionControl xmlns="">
+<CheckIn backup="true" identity="lenya" session="fde084c0-944b-11dc-8f2e-e6c0ff9903ab" time="1195221903149" version="3"/>
+<CheckOut identity="lenya" session="fde084c0-944b-11dc-8f2e-e6c0ff9903ab" time="1195221882165"/>
 <CheckIn backup="true" identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910794352" version="2"/>
 <CheckOut identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910766571"/>
 <CheckIn backup="true" identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781619865" version="1"/>

Added: lenya/sandbox/pubs/docu/content/authoring/8be409f0-8730-11dc-ae46-9e7b5d14892d/en.1195221900626.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/8be409f0-8730-11dc-ae46-9e7b5d14892d/en.1195221900626.bak?rev=595691&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/8be409f0-8730-11dc-ae46-9e7b5d14892d/en.1195221900626.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/8be409f0-8730-11dc-ae46-9e7b5d14892d/en.1195221900626.bak Fri Nov 16 07:11:58 2007
@@ -0,0 +1,207 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2006 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: metadata.xml 55543 2004-10-26 00:14:59Z gregor $ --><!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+
+<document>
+  <header>
+    <title>Implementing a Usecase, Part 1: Prerequisites</title>
+  </header>
+  <body>
+    
+    <section>
+      <title>Introduction</title>
+      <p>
+        In this tutorial we'll implement a simple user interaction scenario using
+        the <a href="lenya-document:9ffa4030-8730-11dc-ae46-9e7b5d14892d">usecase framework</a>.
+        The implementation will be based on the <em>person</em> resource type module described
+        in the tutorial <a href="lenya-document:852cadb0-8730-11dc-ae46-9e7b5d14892d">Creating a Resource Type</a>.
+        We'll extend the resource type to include "knows" relationships. Our usecase will
+        allow the connect a person to other people.
+      </p>
+      <p>
+        To accomplish this task, we will
+      </p>
+      <ul>
+        <li>Extend the person schema to support <code><![CDATA[<foaf:knows/>]]></code> elements,</li>
+        <li>Implement a wrapper class to manage person documents,</li>
+        <li>Add a usecase handler class to provide the functionality to connect people,</li>
+        <li>
+          Add a <a href="http://cocoon.apache.org/2.1/userdocs/flow/jxtemplate.html">JX template</a>
+          which acts as the view for the usecase,
+        </li>
+        <li>Add a menu item to trigger the usecase, and</li>
+        <li>Specify who is allowed to invoke the usecase.</li>
+      </ul>
+    </section>
+    
+    <section>
+      <title>Add the "Knows" Relation to the Person Resource Type</title>
+      <p>
+        First, we'll add support for the <code><![CDATA[<foaf:knows/>]]></code> element to the
+        Relax NG schema, which is located at <code>$MODULE_HOME/resources/schemas/foaf.rng</code>.
+        We allow to specify the known person using an <code>rdf:resource</code> attribute, which
+        can hold an internal <code>lenya-document:</code> URI.
+      </p>
+      <source xml:space="preserve"><![CDATA[<grammar ...>
+  <start>
+    <element name="rdf:RDF">
+      <element name="foaf:Person">
+        ...
+        
+        <zeroOrMore>
+          <element name="foaf:knows">
+            <attribute name="rdf:resource">
+              <data type="anyURI"/>
+            </attribute>
+          </element>
+        </zeroOrMore>
+        
+      </element>
+    </element>
+  </start>
+</grammar>]]></source>
+      
+      <p>
+        Now we need to extend our presentation layer to consider the "knows" relations.
+        We use CInclude to lookup the person's name based on the <code>foaf:knows</code>
+        element. This requires two steps: an XSLT preprocessing to add the CInclude element to
+        the <code>foaf:knows</code> element, and the actual CInclude transformation.
+        In the module sitemap, which is located at <code>$MODULE_HOME/sitemap.xmap</code>,
+        add these steps to the presentation pipeline:
+      </p>
+      <source xml:space="preserve"><![CDATA[<!-- {format}.xml/{pubId}/{area}/{uuid}/{language} -->
+<map:match pattern="*.*/*/*/*/*">
+  <map:generate src="lenya-document:{5},lang={6}{link:rev}"/>
+  <map:transform src="fallback://lenya/modules/person/xslt/knows2include.xsl"/>
+  <map:transform type="cinclude"/>
+  <map:transform src="fallback://lenya/modules/person/xslt/foaf2{1}.xsl">
+  ...
+</map:match>]]></source>
+      <p>
+        Now we add the XSLT which adds the CInclude statements. It is located at
+        <code>$MODULE_HOME/xslt/knows2include.xsl</code>. The <code>src</code>
+        attribute of the <code><![CDATA[<ci:include/>]]></code> element is set to the
+        <code>rdf:resource</code> attribute, which holds a <code>lenya-document:</code> URI. 
+      </p>
+      <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+  xmlns:foaf="http://xmlns.com/foaf/0.1/"
+  xmlns:ci="http://apache.org/cocoon/include/1.0"
+  >
+  
+  <xsl:template match="foaf:knows">
+    <xsl:copy>
+      <xsl:copy-of select="@*"/>
+      <ci:include src="{@rdf:resource}"/>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="@*|node()" priority="-1">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+  </xsl:template>
+  
+</xsl:stylesheet>]]></source>
+      
+      <p>
+        Finally, we have to include the known people in the output. We add a table row to
+        the <code>$MODULE_HOME/xslt/foaf2xhtml.xsl</code> stylesheet:
+      </p>
+      <source xml:space="preserve"><![CDATA[<tr>
+  <th>Knows:</th>
+  <td>
+    <xsl:for-each select="foaf:knows">
+      <a href="{@rdf:resource}">
+        <xsl:value-of select="rdf:RDF/foaf:Person/foaf:givenname"/>
+        <xsl:text> </xsl:text>
+        <xsl:value-of select="rdf:RDF/foaf:Person/foaf:family_name"/>
+      </a>
+      <br/>
+    </xsl:for-each>
+  </td>
+</tr>]]></source>
+      <p>
+        To test this functionality, you can add two person documents to your
+        publication, edit one of them using the one-form editor, and add the
+        <code><![CDATA[<foaf:knows/>]]></code> element, pointing to the other
+        person document, e.g.:
+      </p>
+      <source xml:space="preserve"><![CDATA[<foaf:knows rdf:resource="lenya-document:5e13b150-6855-11dc-8b37-f5f12a4217db"/>]]></source>
+    </section>
+    
+    <section>
+      <title>Implement the Person Document Wrapper</title>
+      <p>
+        In Lenya projects, the wrapper pattern (also known as adapter pattern) has proven
+        useful to simplify the handling of XML documents. A wrapper object provides
+        access to a certain object, in our case a Lenya document, to client objects. It can
+        be used to add a layer of abstraction. In our case we use the wrapper to abstract
+        from the XML content and provide the functionality of adding "knows" relations
+        between person documents.
+      </p>
+      <p>
+        The following code snippet contains some methods to illustrate the functionality
+        of the Person class. For the full source code, check out the person module from the
+        Subversion repository.
+      </p>
+      <p>
+        We pass an <code>org.apache.lenya.cms.publication.Document</code>
+        object to the constructor which stores the XML content describing the person.
+        The <code>getName()</code> function returns the full name, i.e. the concatenation
+        of the given name and the family name. This method will be used to show the person's
+        name on the usecase view page. The <code>load()</code> and <code>save()</code> methods
+        act as the persistence facilities of the person object.
+      </p>
+      <source xml:space="preserve"><![CDATA[public class Person extends AbstractLogEnabled {
+        
+    ...
+
+    public Person(Document doc) {
+        ...
+    }
+
+    public Person[] getKnownPeople() {
+        load();
+        Collection persons = this.knownPersons.values();
+        return (Person[]) persons.toArray(new Person[persons.size()]);
+    }
+
+    public void addKnownPerson(Person person) {
+        load();
+        this.knownPersons.put(person.getDocument().getUUID(), person);
+        save();
+    }
+    
+    public String getName() {
+        load();
+        return this.givenName + " " + this.familyName;
+    }
+
+    ...
+
+}]]></source>
+      
+      <p>
+        Now we can go on with the <a href="lenya-document:8d27d490-8730-11dc-ae46-9e7b5d14892d">actual usecase</a>.
+      </p>
+    </section>
+    
+  </body>
+</document>



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