svn commit: r591298 [23/37] - in /lenya/sandbox/pubs/docu/content/authoring: 0033e320-8731-11dc-ae46-9e7b5d14892d/ 003a4bc0-8731-11dc-ae46-9e7b5d14892d/ 018a9980-8731-11dc-ae46-9e7b5d14892d/ 02f9e0f0-8731-11dc-ae46-9e7b5d14892d/ 043dd2a0-8731-11dc-ae46...

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Added: lenya/sandbox/pubs/docu/content/authoring/910f47f0-8730-11dc-ae46-9e7b5d14892d/en.1193910775893.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/910f47f0-8730-11dc-ae46-9e7b5d14892d/en.1193910775893.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/910f47f0-8730-11dc-ae46-9e7b5d14892d/en.1193910775893.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/910f47f0-8730-11dc-ae46-9e7b5d14892d/en.1193910775893.bak Fri Nov  2 03:57:25 2007
@@ -0,0 +1,129 @@
+<?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>Running Lenya Behind Apache with mod_proxy</title>
+  </header>
+  <body>
+    
+    <section>
+      <title>Configuring the Apache Web Server</title>
+      <p>
+        First we'll declare the virtual hosts for the Apache web server. This is done in
+        a file called <code>httpd-vhosts.conf</code>. On Mac OS X, it is located in the directory
+        <code>/opt/local/apache2/conf/extra</code>. If you're using Jetty on port 8888, the
+        contents of the file should look like this:
+      </p>
+      <source xml:space="preserve"><![CDATA[NameVirtualHost *:80
+NameVirtualHost *:443
+
+# This is the non-SSL host for the authoring environment.
+<VirtualHost *:80>
+    ServerAdmin [email protected]
+    ServerName cms.example.com
+    ServerAlias cms
+    
+    # Turn proxy requests off for security reasons
+    ProxyRequests Off
+    
+    RewriteEngine On
+    RewriteLog /home/john/src/www/logs/cms.example.com-rewrite_log
+    RewriteLogLevel 4
+    
+    # First we match everything which is not mapped to /default/{area}
+    RewriteRule ^/lenya/(.*) http://cms.example.com:8888/lenya/$1 [P,L]
+    RewriteRule ^/modules/(.*) http://cms.example.com.com:8888/modules/$1 [P,L]
+    RewriteRule ^/default/modules/(.*) http://cms.example.com:8888/default/modules/$1 [P,L]
+    
+    # Redirect the login usecase to https
+    RewriteCond %{QUERY_STRING} (.*)lenya\.usecase=ac\.login(.*)
+    RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
+
+    # Forward the areas to the proxy
+    RewriteRule ^/(.*) http://cms.example.com:8888/default/$1 [P,L]
+    ProxyPassReverse / http://cms.example.com:8888/default/
+    
+    ErrorLog /home/john/src/www/logs/cms.example.com-error_log
+    CustomLog /home/john/src/www/logs/cms.example.com-access_log common
+</VirtualHost>
+
+# This is the SSL host for the authoring environment.
+<VirtualHost *:443>
+    ServerAdmin [email protected]
+    ServerName cms.example.com
+    ServerAlias cms
+
+    SSLEngine On
+    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
+    SSLCertificateFile /home/john/pki/server.crt
+    SSLCertificateKeyFile /home/john/pki/server.key
+
+    ProxyRequests Off
+    RewriteEngine On
+    RewriteLog /home/john/src/www/logs/cms.example.com-rewrite_log
+    RewriteLogLevel 4
+
+    RewriteRule ^/lenya/(.*) http://cms.example.com:8888/lenya/$1 [P,L]
+    RewriteRule ^/modules/(.*) http://cms.example.com.com:8888/modules/$1 [P,L]
+    RewriteRule ^/default/modules/(.*) http://cms.example.com:8888/default/modules/$1 [P,L]
+
+    RewriteRule ^/(.*) http://cms.example.com:8888/default/$1 [P,L]
+    ProxyPassReverse / http://cms.example.com:8888/default/
+    
+    ErrorLog /home/john/src/www/logs/cms.example.com-error_log
+    CustomLog /home/john/src/www/logs/cms.example.com-access_log common
+</VirtualHost>
+
+# This is the non-SSL host for the live area.
+<VirtualHost *:80>
+    ServerAdmin [email protected]
+    ServerName www.example.com
+    ServerAlias lenya
+    
+    ProxyRequests Off
+    RewriteEngine On
+    RewriteLog /Users/john/src/www/logs/www.example.com-rewrite_log
+    RewriteLogLevel 4
+    
+    RewriteRule ^/([^/\.]+)$ $1/ [R]
+    RewriteRule ^/(.*) http://www.example.com:8888/default/live/$1 [P,L]
+    ProxyPassReverse / http://www.example.com:8888/default/live/
+    
+    ErrorLog /Users/john/src/www/logs/www.example.com-error_log
+    CustomLog /Users/john/src/www/logs/www.example.com-access_log common
+</VirtualHost>]]></source>
+
+      <p>
+        If you're using Tomcat on port 8080 with Lenya in the context path <em>lenya14</em>,
+        you have to change the port and add the context path accordingly: 
+      </p>
+      <source xml:space="preserve"><![CDATA[    RewriteRule ^/(.*) http://cms.example.com:8080/lenya14/default/authoring/$1 [P,L]
+    ProxyPassReverse / http://cms.example.com:8080/lenya14/default/authoring/]]></source>
+      <note>
+        With this setup, your browser might show error messages like "You have requested an
+        encrypted page that contains some unencrypted information" when accessing a page
+        with the <code>https</code> protocol. This is because Apache always connects to Lenya
+        with the <code>http</code> protocol, so Lenya doesn't know that it should use <code>https</code>
+        links to include images etc. on this page. This problem won't occur if you use the
+        <a href="lenya-document:923ca460-8730-11dc-ae46-9e7b5d14892d">mod_proxy_ajp</a> approach.
+      </note>
+    </section>
+        
+  </body>
+</document>

Modified: lenya/sandbox/pubs/docu/content/authoring/910f47f0-8730-11dc-ae46-9e7b5d14892d/en.meta
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/910f47f0-8730-11dc-ae46-9e7b5d14892d/en.meta?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/910f47f0-8730-11dc-ae46-9e7b5d14892d/en.meta (original)
+++ lenya/sandbox/pubs/docu/content/authoring/910f47f0-8730-11dc-ae46-9e7b5d14892d/en.meta Fri Nov  2 03:57:25 2007
@@ -1,11 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <metadata xmlns="http://apache.org/lenya/metadata/1.0">
-<element-set namespace="http://apache.org/lenya/metadata/document/1.0">
-<element key="mimeType">
-<value>application/xml</value>
+<element-set namespace="http://purl.org/dc/elements/1.1/">
+<element key="title">
+<value>mod_proxy</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>

Added: lenya/sandbox/pubs/docu/content/authoring/910f47f0-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910775893.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/910f47f0-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910775893.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/910f47f0-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910775893.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/910f47f0-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910775893.bak Fri Nov  2 03:57:25 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>mod_proxy</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/910f47f0-8730-11dc-ae46-9e7b5d14892d/en.rcml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/910f47f0-8730-11dc-ae46-9e7b5d14892d/en.rcml?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/910f47f0-8730-11dc-ae46-9e7b5d14892d/en.rcml (original)
+++ lenya/sandbox/pubs/docu/content/authoring/910f47f0-8730-11dc-ae46-9e7b5d14892d/en.rcml Fri Nov  2 03:57:25 2007
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XPSRevisionControl xmlns="">
+<CheckIn backup="true" identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910775893" version="2"/>
+<CheckOut identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910761640"/>
 <CheckIn backup="true" identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781628116" version="1"/>
 <CheckOut identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781607532"/>
 </XPSRevisionControl>

Added: lenya/sandbox/pubs/docu/content/authoring/923ca460-8730-11dc-ae46-9e7b5d14892d/en.1193910794126.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/923ca460-8730-11dc-ae46-9e7b5d14892d/en.1193910794126.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/923ca460-8730-11dc-ae46-9e7b5d14892d/en.1193910794126.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/923ca460-8730-11dc-ae46-9e7b5d14892d/en.1193910794126.bak Fri Nov  2 03:57:25 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>Running Lenya Behind Apache with mod_proxy_ajp</title>
+  </header>
+  <body>
+
+    <section>
+      <title>Configuring the AJP Connector in Tomcat</title>
+      <p>
+        The file <code>$TOMCAT_HOME/conf/server.xml</code> contains an AJP 1.3 connector on
+        port 8009 by default:
+      </p>
+      <source xml:space="preserve"><![CDATA[<Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3"/>]]></source>
+      <p>
+        If the connector is not present, you have to add it.
+      </p>
+    </section>
+    
+    <section>
+      <title>Configuring the Apache Web Server</title>
+      <p>
+        Now we'll declare the virtual hosts for the Apache web server. This is done in
+        a file called <code>httpd-vhosts.conf</code>. On Mac OS X, it is located in the directory
+        <code>/opt/local/apache2/conf/extra</code>. The contents of the file should
+        look like this:
+      </p>
+      <source xml:space="preserve"><![CDATA[NameVirtualHost *:80
+NameVirtualHost *:443
+
+# This is the non-SSL host for the authoring environment.
+<VirtualHost *:80>
+    ServerAdmin [email protected]
+    ServerName cms.example.com
+    ServerAlias cms
+
+    ProxyRequests Off
+
+    RewriteEngine On
+    RewriteLog /home/john/src/www/logs/cms.example.com-rewrite_log
+    RewriteLogLevel 4
+    
+    # Redirect the login usecase to https
+    RewriteCond %{QUERY_STRING} (.*)lenya\.usecase=ac\.login(.*)
+    RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
+
+    <Location /lenya/>
+      ProxyPass ajp://localhost:8009/lenya/
+      ProxyPassReverse http://cms.example.com/lenya/
+    </Location>
+
+    <Location /modules/>
+      ProxyPass ajp://localhost:8009/modules/
+      ProxyPassReverse http://cms.example.com/modules/
+    </Location>
+
+    <Location /default/modules/>
+      ProxyPass ajp://localhost:8009/default/modules/
+      ProxyPassReverse http://cms.example.com/default/modules/
+    </Location>
+
+    <Location />
+      ProxyPass ajp://localhost:8009/default/
+      ProxyPassReverse http://cms.example.com/default/
+    </Location>
+
+    ErrorLog /home/john/src/www/logs/cms.example.com-error_log
+    CustomLog /home/john/src/www/logs/cms.example.com-access_log common
+</VirtualHost>
+
+# This is the SSL host for the authoring environment.
+<VirtualHost *:443>
+    ServerName cms.example.com
+    ServerAlias cms
+
+    ProxyRequests Off
+
+    SSLEngine On
+    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
+    SSLCertificateFile /home/john/pki/server.crt
+    SSLCertificateKeyFile /home/john/pki/server.key
+
+    <Location /lenya/>
+      ProxyPass ajp://localhost:8009/lenya/
+      ProxyPassReverse https://cms.example.com/lenya/
+    </Location> 
+
+    <Location /modules/>
+      ProxyPass ajp://localhost:8009/modules/
+      ProxyPassReverse https://cms.example.com/modules/
+    </Location>
+
+    <Location /default/modules/>
+      ProxyPass ajp://localhost:8009/default/modules/
+      ProxyPassReverse https://cms.example.com/default/modules/
+    </Location>
+    
+    <Location />
+      ProxyPass ajp://localhost:8009/default/
+      ProxyPassReverse https://cms.example.com/default/
+    </Location>
+
+    ErrorLog /home/john/src/www/logs/ssl.cms.example.com-error_log
+    CustomLog /home/john/src/www/logs/ssl.cms.example.com-access_log common
+
+</VirtualHost>
+
+# This is the non-SSL host for the live area.
+<VirtualHost *:80>
+    ServerAdmin [email protected]
+    ServerName www.example.com
+    ServerAlias www
+
+    ProxyRequests Off
+
+    <Location />
+      ProxyPass ajp://localhost:8009/default/live/
+      ProxyPassReverse http://www.example.com/default/live/
+    </Location>
+
+    ErrorLog /home/john/src/www/logs/www.example.com-error_log
+    CustomLog /home/john/src/www/logs/www.example.com-access_log common
+</VirtualHost>]]></source>
+    </section>
+    
+  </body>
+</document>

Modified: lenya/sandbox/pubs/docu/content/authoring/923ca460-8730-11dc-ae46-9e7b5d14892d/en.meta
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/923ca460-8730-11dc-ae46-9e7b5d14892d/en.meta?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/923ca460-8730-11dc-ae46-9e7b5d14892d/en.meta (original)
+++ lenya/sandbox/pubs/docu/content/authoring/923ca460-8730-11dc-ae46-9e7b5d14892d/en.meta Fri Nov  2 03:57:25 2007
@@ -1,11 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <metadata xmlns="http://apache.org/lenya/metadata/1.0">
-<element-set namespace="http://apache.org/lenya/metadata/document/1.0">
-<element key="mimeType">
-<value>application/xml</value>
+<element-set namespace="http://purl.org/dc/elements/1.1/">
+<element key="title">
+<value>mod_proxy_ajp</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>

Added: lenya/sandbox/pubs/docu/content/authoring/923ca460-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910794126.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/923ca460-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910794126.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/923ca460-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910794126.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/923ca460-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910794126.bak Fri Nov  2 03:57:25 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>mod_proxy_ajp</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/923ca460-8730-11dc-ae46-9e7b5d14892d/en.rcml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/923ca460-8730-11dc-ae46-9e7b5d14892d/en.rcml?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/923ca460-8730-11dc-ae46-9e7b5d14892d/en.rcml (original)
+++ lenya/sandbox/pubs/docu/content/authoring/923ca460-8730-11dc-ae46-9e7b5d14892d/en.rcml Fri Nov  2 03:57:25 2007
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XPSRevisionControl xmlns="">
+<CheckIn backup="true" identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910794126" version="2"/>
+<CheckOut identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910766438"/>
 <CheckIn backup="true" identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781621793" version="1"/>
 <CheckOut identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781610553"/>
 </XPSRevisionControl>

Added: lenya/sandbox/pubs/docu/content/authoring/93780a90-8730-11dc-ae46-9e7b5d14892d/en.1193910788122.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/93780a90-8730-11dc-ae46-9e7b5d14892d/en.1193910788122.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/93780a90-8730-11dc-ae46-9e7b5d14892d/en.1193910788122.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/93780a90-8730-11dc-ae46-9e7b5d14892d/en.1193910788122.bak Fri Nov  2 03:57:25 2007
@@ -0,0 +1,113 @@
+<?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>Best Practises when Developing with Lenya 2.0</title>
+  </header>
+  <body>
+    <section>
+      <title>Speeding Up Development</title>
+      <p>
+        Following these tips can increase your development productivity:
+      </p>
+      <ul>
+        <li>
+          Set up your development environment correctly. The time you invest in this will
+          pay off very quickly.
+        </li>
+        <li>
+          Practise <a href="http://en.wikipedia.org/wiki/Test_driven_development">test-driven
+          development</a>. Since you can execute the tests with a single click in Eclipse,
+          you don't need to build and restart the application to check if something works.
+        </li>
+        <li>
+          During development, set <code>modules.copy=false</code> in <code>local.build.properties</code>.
+          This way, you don't have to execute the build process when you change something in a module
+          (except Java files and patches for <code>cocoon.xconf</code>).
+        </li>
+        <li>
+          Put all your non-Java files - XSLTs, CSS files, JX templates and complex sitemaps - in modules.
+          This allows you to change them without rebuilding (see preceding tip).
+          Using modules for anything which is not specific for a publication is a
+          good practise anyway - it encourages generic design and reuse.
+        </li>
+      </ul>
+    </section>
+    <section>
+      <title>Building Maintainable Applications</title>
+      <p>
+        To ensure the simplicity and maintainability of your Lenya-based applications,
+        try the following tips:
+      </p>
+      <ul>
+        <li>
+          Use resource types sparingly. A new resource type adds complexity to your
+          application. It requires to patch <code>cocoon.xconf</code> and is therefore
+          a static element of your application. Most differences between pages can be
+          implemented by using different XSLTs or templates in the presentation layer,
+          or even using distinct samples to provide a starting point for a certain type of
+          page.
+        </li>
+        <li>
+          Make extensive use of resource type formats. This way, you create orthogonality -
+          if you implement a certain format in each of your resource types, it is very
+          easy to include arbitrary resources in different locations. Typical examples
+          of formats are print views, teasers, summaries, icons, and RSS feeds.
+        </li>
+        <li>
+          Modularize your application. You can put each resource type in a separate
+          module. Service implementations are good module candidates as well - by
+          adding or removing them from your build path you can easily switch between
+          several implementions. A complex application is likely to feature a
+          <code>shared</code> module which contains utility XSLTs and other resources
+          which are used across multiple modules.
+        </li>
+        <li>
+          Use templates instead of XSLTs for layout purposes. This is an example of the
+          <a href="http://en.wikipedia.org/wiki/Separation_of_concerns">Separation of Concerns</a>
+          paradigm. XHTML templates can be edited without XSLT skills and without influencing
+          your presentation logic. For more information, check out the article
+          <a href="http://www.cocooncenter.org/articles/stylefree.html">Style-free Stylesheets with Cocoon</a>
+          on cocooncenter.org.
+        </li>
+        <li>
+          Keep your sitemaps simple. It is very hard to write tests for sitemaps, and complex ones
+          are difficult to read. Instead of building huge nested pipelines (e.g. for error handling),
+          it often makes sense to implement a specific selector or action to handle the
+          complicated aspects of the page flow. As soon as the functionality is implemented
+          in Java, it can be tested using unit tests and refactored using your favorite IDE.
+        </li>
+        <li>
+          Don't overload your usecase handler classes with view-specific details. The handler
+          is occupied with business logic, it shouldn't have to deal with the view as well.
+          If the JX templates become too complex, consider writing utility classes and
+          call them from the template. Modularizing JX templates is another promising approach
+          to reduce their complexity.
+        </li>
+        <li>
+          Document wrapper classes have proven useful to encapsulate the functionality of
+          objects which store their properties in Lenya documents, typically as XML. The wrapper
+          class exposes only business-level functionality. You can use an advanced object-to-XML
+          binding framework to persist the data, or you can just use the helper classes in the
+          <code>org.apache.lenya.xml</code> package. 
+        </li>
+      </ul>
+    </section>
+  </body>
+</document>

Modified: lenya/sandbox/pubs/docu/content/authoring/93780a90-8730-11dc-ae46-9e7b5d14892d/en.meta
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/93780a90-8730-11dc-ae46-9e7b5d14892d/en.meta?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/93780a90-8730-11dc-ae46-9e7b5d14892d/en.meta (original)
+++ lenya/sandbox/pubs/docu/content/authoring/93780a90-8730-11dc-ae46-9e7b5d14892d/en.meta Fri Nov  2 03:57:25 2007
@@ -1,11 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <metadata xmlns="http://apache.org/lenya/metadata/1.0">
-<element-set namespace="http://apache.org/lenya/metadata/document/1.0">
-<element key="mimeType">
-<value>application/xml</value>
+<element-set namespace="http://purl.org/dc/elements/1.1/">
+<element key="title">
+<value>Best Practises</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>

Added: lenya/sandbox/pubs/docu/content/authoring/93780a90-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910788122.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/93780a90-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910788122.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/93780a90-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910788122.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/93780a90-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910788122.bak Fri Nov  2 03:57:25 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>Best Practises</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/93780a90-8730-11dc-ae46-9e7b5d14892d/en.rcml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/93780a90-8730-11dc-ae46-9e7b5d14892d/en.rcml?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/93780a90-8730-11dc-ae46-9e7b5d14892d/en.rcml (original)
+++ lenya/sandbox/pubs/docu/content/authoring/93780a90-8730-11dc-ae46-9e7b5d14892d/en.rcml Fri Nov  2 03:57:25 2007
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XPSRevisionControl xmlns="">
+<CheckIn backup="true" identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910788122" version="2"/>
+<CheckOut identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910771875"/>
 <CheckIn backup="true" identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781620183" version="1"/>
 <CheckOut identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781608416"/>
 </XPSRevisionControl>

Added: lenya/sandbox/pubs/docu/content/authoring/94bd82e0-8730-11dc-ae46-9e7b5d14892d/en.1193910780410.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/94bd82e0-8730-11dc-ae46-9e7b5d14892d/en.1193910780410.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/94bd82e0-8730-11dc-ae46-9e7b5d14892d/en.1193910780410.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/94bd82e0-8730-11dc-ae46-9e7b5d14892d/en.1193910780410.bak Fri Nov  2 03:57:25 2007
@@ -0,0 +1,253 @@
+<?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>Production Checklist</title>
+  </header>
+  <body>
+    
+    <p>
+      Here's a list of points you should take care of when running Lenya
+      in a production environment. It covers only the most obvious aspects,
+      but it might prevent you from falling in the biggest traps in
+      first real-world project.
+    </p>
+    
+    <section>
+      <title>General Deployment Recommendations</title>
+      <ul>
+        <li>
+          Seperate your web application from your data. This applies to
+          the content, access control, and work data (search index, cache).
+        </li>
+        <li>
+          When creating backups of your data, make sure you'll still know
+          which version of the application they're compatible with when you
+          need them again.
+        </li>
+        <li>
+          Always have two instances of Lenya ready, and make sure you can
+          switch between them immediately (e.g., by changing a symlink to
+          a proxy configuration file).
+        </li>
+        <li>
+          Consider using vendor branches for Lenya, Cocoon etc. This helps you to
+          stay flexible when you're faced with bugs, endorsed library issues etc.
+        </li>
+        <li>
+          When you deploy a version of your application, <strong>always</strong> create
+          a branch in your code versioning system. This way, you can merge essential
+          bugfixes from the trunk and re-deploy the application. <strong>Never</strong>
+          deploy an un-tagged development version.
+        </li>
+      </ul>
+    </section>
+    
+    <section>
+      <title>During Development</title>
+      <ul>
+        <li>
+          Run sophisticated and thorough load tests early and often.
+        </li>
+        <li>
+          Run search engine crawlers on your site. Observe the performance behaviour
+          and session handling.
+        </li>
+        <li>
+          Test the site in various browsers, using various settings (disabling
+          JavaScript etc.), and preferrably using different bandwidths.
+        </li>
+        <li>
+          Make sure you don't create weak points for DoS attacks (e.g. by
+          expensive dynamic generation of non-cached pages based on request
+          parameters). 
+        </li>
+      </ul>
+    </section>
+    
+    <section>
+      <title>Preparation (Internal Pilot Phase)</title>
+      <p>
+        Set the log level to <em>ERROR</em> in
+        <code>externals/cocoon_2_1_x/src/webapp/WEB-INF/log4j.xconf</code> 
+        (source, needs rebuild to become active) or 
+        <code>build/lenya/webapp/WEB-INF/log4j.xconf</code> (deployed file):
+      </p>
+      <source xml:space="preserve"><![CDATA[
+        <root>
+          <priority value="error" />
+          <appender-ref ref="COCOON_DEFAULT" />
+        </root>
+]]></source>
+      <p>
+        Make sure that the logs stay clean. If exceptions occur, mercilessly
+        track them down and eliminate their causes. Even if you consider some
+        exceptions "normal" behaviour - they aren't.
+      </p>
+      <p>
+        At a later point in your testing process, disable the "DEBUG" setting for the Java compiler in
+        <code>src/targets/properties-build</code> to speed up your bytecode:
+      </p>
+      <source xml:space="preserve"><![CDATA[
+        <property name="debug" value="off"/>
+]]></source>
+      
+    </section>
+    
+    <section>
+      <title>Caching in Cocoon</title>
+      <p>
+        There's a <a href="http://wiki.apache.org/cocoon-data/attachments/GT2006Notes/attachments/10-caching.pdf">great
+        presentation</a> (PDF) about caching in Cocoon, held at the Cocoon Get-Together 2006.
+      </p>
+      <p>
+        Cocoon's default store implementation is an in-memory store backed by a disk
+        store (based on EHCache). You can configure this store using a file called
+        <code>ehcache.xml</code> which is located in <code>org/apache/cocoon/components/store/impl/ehcache.xml</code>.
+        The default entries of the <code>defaultCache</code> are as follows:
+      </p>
+      <source xml:space="preserve"><![CDATA[<defaultCache
+    maxElementsInMemory="10000"
+    eternal="true"
+    timeToIdleSeconds="0"
+    timeToLiveSeconds="0"
+    overflowToDisk="true"
+    diskPersistent="true"
+    diskExpiryThreadIntervalSeconds="120"
+    />]]></source>
+      <p>
+        So, when <code>overflow-to-disk</code> is set to true, <code>eternal</code> to true and
+        <code>timeToIdleSeconds=0</code>, then once a cachekey is in memory/disk, it will never
+        be removed which might lead to a cache file becoming very large
+        (see also thread: <a href="http://java2.5341.com/msg/170235.html">http://java2.5341.com/msg/170235.html</a>).
+      </p>
+      <p>
+        For production use these setting should be changed. A possible configuration might look like:
+      </p>
+      <source xml:space="preserve"><![CDATA[<defaultCache
+    maxElementsInMemory="10000"
+    eternal="false"
+    timeToIdleSeconds="1800"
+    timeToLiveSeconds="3600"
+    overflowToDisk="true"
+    diskPersistent="true"
+    diskExpiryThreadIntervalSeconds="120"
+    />]]></source>
+      <p>
+        This cache contains a maximum in memory of 10000 elements, and will expire an element
+        if it is idle for more than 30 minutes and lives for more than 60 minutes. If there are
+        more than 10000 elements it will overflow to the disk cache.
+      </p>
+    </section>
+    
+    <section>
+      <title>Performance Tuning</title>
+      <p>
+        The following hints can be considered to improve the performance of your application:
+      </p>
+      <ul>
+        <li>Set XSLT caching (use-store) to true in <code>cocoon.xconf</code>.</li>
+        <li>Turn off reloading of sub-sitemaps.</li>
+        <li>
+          Enable client-side caching by changing the <code>pipeline-expiration</code> parameter
+          in <code>global-sitemap.xmap</code>, for instance:
+          <source xml:space="preserve"><![CDATA[<global-variables>
+  <pipeline-expiration>access plus 2 hours</pipeline-expiration>
+</global-variables>]]></source>
+        </li>
+        <li>
+          Configure the expiration time of your resource types. For more information, consult the
+          <a href="lenya-document:2d466e50-8731-11dc-ae46-9e7b5d14892d">resource types reference</a>.
+        </li>
+        <li>Tips about Cocoon performance tuning: <a href="http://wiki.apache.org/cocoon/CocoonPerformance">http://wiki.apache.org/cocoon/CocoonPerformance</a>
+</li>
+        <li>Tips about Tomcat performance tuning: <a href="http://marc.theaimsgroup.com/?t=103598885300001&amp;r=1&amp;w=2">http://marc.theaimsgroup.com/?t=103598885300001&amp;r=1&amp;w=2</a>
+</li>
+      </ul>
+      <p>
+        Doug Chestnut recommends to adapt the garbage collector to make use of all available CPU cores.
+        This can be done by adding the following to your JAVA options (for a machine with 4 cores):
+      </p>
+      <source xml:space="preserve">-XX:+UseParallelGC -XX:ParallelGCThreads=4</source>
+      <p>   
+        You can also increase stack and heap size to make better use of available memory
+        (be careful not to starve other processes on the same machine, though):
+      </p>
+      <source xml:space="preserve">-Xms512m -Xmx1024m</source>
+      <p>
+        Lenya does XML prettyprinting by default, which comes with a performance penalty.
+        You might want to disable the transformation for maximum speed:
+      </p>
+      <source xml:space="preserve"><![CDATA[<map:transform src="fallback://lenya/modules/prettyprinting/xslt/xml2nicexml.xsl"/>]]></source>
+    </section>
+    
+    <section>
+      <title>General Measures for Production</title>
+      <ul>
+        <li>
+          Double-check your access control settings.
+        </li>
+        <li>
+          Remove the example publications (default and blog). If you use them as templates,
+          don't forget to remove the example users or change their passwords.
+        </li>
+        <li>
+          Set the log level to <em>FATAL</em> or at least <em>ERROR</em>. This makes the code
+          faster and prevents the log files from growing very large while keeping them comprehensible.
+          The log level can be configured in <code>$COCOON_HOME/src/webapp/WEB-INF/log4j.xconf</code> or ultimately
+          in <code>$LENYA_HOME/build/lenya/webapp/WEB-INF/log4j.xconf</code>.
+        </li>
+        <li>
+          Set the <em>debug</em> property in <code>src/targets/properties-build.xml</code> to <em>off</em>.
+          This way, the generated byte code will run faster.
+        </li>
+        <li>
+          Disable all modules which accept request to dynamically generate images
+          to prevent DoS attacks.
+        </li>
+        <li>
+          Consider disabling image upload.
+        </li>
+        <li>
+          Set the session expiration time to the least acceptable value.
+        </li>
+        <li>
+          Prepare for maintenance (updates etc.), either by switching
+          the application or by showing a friendly information page.
+        </li>
+        <li>
+          Prepare for a worst-case scenario. For instance, have a statically
+          exported version of the site ready.
+        </li>
+      </ul>
+    </section>
+
+    <section>
+      <title>Cosmetics</title>
+      <p>
+        In order to hide the default publication from the welcome page
+        (if you're not going to delete it anyway), change <code>src/pubs/default/publication.xml</code> as follows:
+      </p>
+      <source xml:space="preserve"><![CDATA[--- lenya/      (revision 452350)
+         <publication xmlns="http://apache.org/cocoon/lenya/publication/1.1" lenya:show="false">
+]]></source>
+    </section>
+
+  </body>
+</document>

Modified: lenya/sandbox/pubs/docu/content/authoring/94bd82e0-8730-11dc-ae46-9e7b5d14892d/en.meta
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/94bd82e0-8730-11dc-ae46-9e7b5d14892d/en.meta?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/94bd82e0-8730-11dc-ae46-9e7b5d14892d/en.meta (original)
+++ lenya/sandbox/pubs/docu/content/authoring/94bd82e0-8730-11dc-ae46-9e7b5d14892d/en.meta Fri Nov  2 03:57:25 2007
@@ -1,11 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <metadata xmlns="http://apache.org/lenya/metadata/1.0">
-<element-set namespace="http://apache.org/lenya/metadata/document/1.0">
-<element key="mimeType">
-<value>application/xml</value>
+<element-set namespace="http://purl.org/dc/elements/1.1/">
+<element key="title">
+<value>Production Checklist</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>

Added: lenya/sandbox/pubs/docu/content/authoring/94bd82e0-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910780410.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/94bd82e0-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910780410.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/94bd82e0-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910780410.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/94bd82e0-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910780410.bak Fri Nov  2 03:57:25 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>Production Checklist</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/94bd82e0-8730-11dc-ae46-9e7b5d14892d/en.rcml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/94bd82e0-8730-11dc-ae46-9e7b5d14892d/en.rcml?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/94bd82e0-8730-11dc-ae46-9e7b5d14892d/en.rcml (original)
+++ lenya/sandbox/pubs/docu/content/authoring/94bd82e0-8730-11dc-ae46-9e7b5d14892d/en.rcml Fri Nov  2 03:57:25 2007
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XPSRevisionControl xmlns="">
+<CheckIn backup="true" identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910780410" version="2"/>
+<CheckOut identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910765855"/>
 <CheckIn backup="true" identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781618268" version="1"/>
 <CheckOut identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781605824"/>
 </XPSRevisionControl>

Added: lenya/sandbox/pubs/docu/content/authoring/95fa2190-8730-11dc-ae46-9e7b5d14892d/en.1193910794331.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/95fa2190-8730-11dc-ae46-9e7b5d14892d/en.1193910794331.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/95fa2190-8730-11dc-ae46-9e7b5d14892d/en.1193910794331.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/95fa2190-8730-11dc-ae46-9e7b5d14892d/en.1193910794331.bak Fri Nov  2 03:57:25 2007
@@ -0,0 +1,224 @@
+<?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>Writing Tests</title>
+  </header>
+  <body>
+    
+    <section>
+      <title>Introduction</title>
+
+      <p>To get an overview of the benefits and principles of unit testing, we recommend the following resources:</p>
+      <ul>
+        <li>
+<a href="http://www.junit.org">JUnit homepage</a>
+</li>
+        <li>
+<a href="http://junit.sourceforge.net/doc/cookbook/cookbook.htm">JUnit Cookbook</a> (Eric Gamma, Kent Beck)</li>
+        <li>
+<a href="http://junit.sourceforge.net/doc/cookstour/cookstour.htm">JUnit: A Cook's Tour</a> (Eric Gamma, Kent Beck)</li>
+        <li>
+<a href="http://junit.sourceforge.net/doc/testinfected/testing.htm">JUnitTest Infected: Programmers Love Writing Tests</a>
+</li>
+      </ul>
+      
+    </section>
+    
+    <section>
+      <title>Running the Tests</title>
+      <ul>
+        <li>
+<p>To run all tests:</p>
+          <code>./build.sh test</code>
+          <br/>
+<br/>
+        </li>
+        <li>
+<p>To run all module tests:</p>
+          <code>./build.sh modules.test</code>
+          <br/>
+<br/>
+        </li>
+        <li>
+<p>To run the tests of a single module:</p>
+          <code>./build.sh module.test -Dmodule=org.myproject.lenya.modules.MyModule</code>
+          <br/>
+<br/>
+        </li>
+        <li>
+          <p>To run a test in the Eclipse debugger:</p>
+          <ul>
+            <li>You have to run the tests once on the command line to generate the
+              <code>LenyaTestCase.xtest</code> configuration file.</li>
+            <li>To debug a single test, right-click on the test class in the package explorer and select <em>Debug as -&gt; JUnit test</em>.</li>
+          </ul>
+          <note>Make sure you added all classes and libs from the build dir (
+            <code>build/lenya/webapp/WEB-INF/lib/</code>) to the junit classpath in
+            the eclipse debugger, otherwise you propably get a file not found exception.
+            Further if you are looking into a way to debug htmlunit test then see the article on
+            the <a href="http://www.baccoubonneville.com/blogs/index.php/eclipse/2005/12/04/htmlunit-tests-with-eclipse-and-ant">
+              Eclipse Blog - HtmlUnit tests with Eclipse and Ant</a> </note>
+        </li>
+      </ul>
+    </section>
+    
+    <section>
+      <title>Adding Tests to Modules</title>
+      <p>
+        Adding unit tests to a module is very simple - you just have to put
+        a Java file in the <code>{yourmodule}/java/test</code>. The most
+        convenient way to get started is to extend <code>AbstractAccessControlTest</code>.
+        This class provides the infrastructure to create a session and invoke
+        operations on documents.
+      </p>
+      <p>
+        Here's an example:
+      </p>
+      
+      <source xml:space="preserve"><![CDATA[mymodule/java/test/MyModuleTest.java]]></source>
+      
+      <p>The source code:</p>
+      
+      <source xml:space="preserve"><![CDATA[package org.myproject.lenya;
+
+import org.apache.lenya.ac.impl.AbstractAccessControlTest;
+import org.apache.lenya.cms.publication.Document;
+import org.apache.lenya.cms.publication.DocumentFactory;
+import org.apache.lenya.cms.publication.DocumentUtil;
+import org.apache.lenya.cms.publication.Publication;
+import org.apache.lenya.cms.publication.PublicationUtil;
+import org.apache.lenya.cms.repository.RepositoryUtil;
+import org.apache.lenya.cms.repository.Session;
+
+public class MetaDataTest extends AbstractAccessControlTest {
+
+    /**
+     * Tests my module.
+     */
+    public void testMyModule() throws Exception {
+        Session session = RepositoryUtil.getSession(getManager(), getRequest());
+        DocumentFactory factory = DocumentUtil.createDocumentIdentityMap(getManager(), session);
+
+        Publication publication = PublicationUtil.getPublication(getManager(), "test");
+        Document doc = factory.get(publication, Publication.AUTHORING_AREA, "/index", "en");
+
+        assertNotNull(doc);
+        ...        
+    }
+}]]></source>
+      
+    </section>
+    
+    <section>
+      <title>Testing Usecases</title>
+      <p>To implement a unit test for a usecase, you can extend the class
+        <code>AbstractUsecaseTest</code> and override the following methods:
+      </p>
+      <ul>
+        <li>
+<code>String getUsecaseName()</code> - return the name of the usecase to test</li>
+        <li>
+<code>void prepareUsecase()</code> - setup the initial envorionment</li>
+        <li>
+<code>Map getParameters()</code> - return a map containing the usecase parameters</li>
+        <li>
+<code>void checkPostconditions()</code> - check the post conditions after the usecase was executed</li>
+      </ul>
+      <p>  
+        Here's an example:
+      </p>
+      <source xml:space="preserve"><![CDATA[package org.apache.lenya.cms.ac.usecases;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.cocoon.environment.Session;
+import org.apache.lenya.ac.AccessControlException;
+import org.apache.lenya.ac.Identity;
+import org.apache.lenya.ac.User;
+import org.apache.lenya.cms.usecase.AbstractUsecaseTest;
+
+/**
+ * Login test.
+ */
+public class LoginTest extends AbstractUsecaseTest {
+
+    protected static final String USER_ID = "lenya";
+    protected static final String PASSWORD = "levi";
+
+    protected Map getRequestParameters() {
+        return getParameters();
+    }
+    
+    protected Map getParameters() {
+        Map params = new HashMap();
+        params.put(Login.USERNAME, USER_ID);
+        params.put(Login.PASSWORD, PASSWORD);
+        return params;
+    }
+
+    protected String getUsecaseName() {
+        return "ac.login";
+    }
+
+    protected void checkPostconditions() {
+        Session session = getRequest().getSession();
+        Identity identity = (Identity) session.getAttribute(Identity.class.getName());
+        User user = identity.getUser();
+        assertNotNull(user);
+        assertEquals(user.getId(), USER_ID);
+    }
+    
+    protected void login() throws AccessControlException {
+        getAccessController().setupIdentity(getRequest());
+    }
+
+}]]></source>
+    </section>
+    
+    <section>
+      <title>Canoo WebTests</title>
+      
+      <p>
+        <a href="http://webtest.canoo.com/webtest/manual/WebTestHome.html">Canoo WebTest</a>
+        is an open source tool for automated testing of web applications.
+        You can add web test files to modules. To run the web tests, follow these steps: 
+      </p>
+      
+      <ol>
+        <li>Download the Canoo WebTest binary distribution from their
+          <a href="http://webtest.canoo.com/webtest/manual/Downloads.html">download page</a>.</li>
+        <li>Configure your Canoo WebTest home directory in <code>local.build.properties</code>:
+<source xml:space="preserve"><![CDATA[
+#------------------------------------------------------------------------------------
+# Home directory of Canoo WebTest installation
+
+webtest.home=/usr/local/canoo-webtest
+]]></source>
+          </li>
+          <li>Run the tests:
+            <source xml:space="preserve"><![CDATA[> ./build.sh modules.test.canoo]]></source>
+          </li>
+      </ol>
+      
+    </section>
+    
+  </body>
+</document>

Modified: lenya/sandbox/pubs/docu/content/authoring/95fa2190-8730-11dc-ae46-9e7b5d14892d/en.meta
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/95fa2190-8730-11dc-ae46-9e7b5d14892d/en.meta?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/95fa2190-8730-11dc-ae46-9e7b5d14892d/en.meta (original)
+++ lenya/sandbox/pubs/docu/content/authoring/95fa2190-8730-11dc-ae46-9e7b5d14892d/en.meta Fri Nov  2 03:57:25 2007
@@ -1,11 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <metadata xmlns="http://apache.org/lenya/metadata/1.0">
-<element-set namespace="http://apache.org/lenya/metadata/document/1.0">
-<element key="mimeType">
-<value>application/xml</value>
+<element-set namespace="http://purl.org/dc/elements/1.1/">
+<element key="title">
+<value>Writing Tests</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>

Added: lenya/sandbox/pubs/docu/content/authoring/95fa2190-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910794331.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/95fa2190-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910794331.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/95fa2190-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910794331.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/95fa2190-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910794331.bak Fri Nov  2 03:57:25 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>Writing Tests</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/95fa2190-8730-11dc-ae46-9e7b5d14892d/en.rcml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/95fa2190-8730-11dc-ae46-9e7b5d14892d/en.rcml?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/95fa2190-8730-11dc-ae46-9e7b5d14892d/en.rcml (original)
+++ lenya/sandbox/pubs/docu/content/authoring/95fa2190-8730-11dc-ae46-9e7b5d14892d/en.rcml Fri Nov  2 03:57:25 2007
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XPSRevisionControl xmlns="">
+<CheckIn backup="true" identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910794331" version="2"/>
+<CheckOut identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910766538"/>
 <CheckIn backup="true" identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781617202" version="1"/>
 <CheckOut identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781604467"/>
 </XPSRevisionControl>

Added: lenya/sandbox/pubs/docu/content/authoring/95ff9fd0-8730-11dc-ae46-9e7b5d14892d/en.1193910794312.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/95ff9fd0-8730-11dc-ae46-9e7b5d14892d/en.1193910794312.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/95ff9fd0-8730-11dc-ae46-9e7b5d14892d/en.1193910794312.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/95ff9fd0-8730-11dc-ae46-9e7b5d14892d/en.1193910794312.bak Fri Nov  2 03:57:25 2007
@@ -0,0 +1,28 @@
+<?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>Apache Lenya Documentation</title>
+  </header>
+  <body>
+    <p>
+      This is a Forrest Document 2.0 sample.
+    </p>
+  </body>
+</document>

Modified: lenya/sandbox/pubs/docu/content/authoring/95ff9fd0-8730-11dc-ae46-9e7b5d14892d/en.meta
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/95ff9fd0-8730-11dc-ae46-9e7b5d14892d/en.meta?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/95ff9fd0-8730-11dc-ae46-9e7b5d14892d/en.meta (original)
+++ lenya/sandbox/pubs/docu/content/authoring/95ff9fd0-8730-11dc-ae46-9e7b5d14892d/en.meta Fri Nov  2 03:57:25 2007
@@ -1,11 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <metadata xmlns="http://apache.org/lenya/metadata/1.0">
-<element-set namespace="http://apache.org/lenya/metadata/document/1.0">
-<element key="mimeType">
-<value>application/xml</value>
+<element-set namespace="http://purl.org/dc/elements/1.1/">
+<element key="title">
+<value>Concepts</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>

Added: lenya/sandbox/pubs/docu/content/authoring/95ff9fd0-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910794312.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/95ff9fd0-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910794312.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/95ff9fd0-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910794312.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/95ff9fd0-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910794312.bak Fri Nov  2 03:57:25 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>Concepts</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/95ff9fd0-8730-11dc-ae46-9e7b5d14892d/en.rcml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/95ff9fd0-8730-11dc-ae46-9e7b5d14892d/en.rcml?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/95ff9fd0-8730-11dc-ae46-9e7b5d14892d/en.rcml (original)
+++ lenya/sandbox/pubs/docu/content/authoring/95ff9fd0-8730-11dc-ae46-9e7b5d14892d/en.rcml Fri Nov  2 03:57:25 2007
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XPSRevisionControl xmlns="">
+<CheckIn backup="true" identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910794312" version="2"/>
+<CheckOut identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910766505"/>
 <CheckIn backup="true" identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781618980" version="1"/>
 <CheckOut identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781606830"/>
 </XPSRevisionControl>

Added: lenya/sandbox/pubs/docu/content/authoring/97525e90-8730-11dc-ae46-9e7b5d14892d/en.1193910797633.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/97525e90-8730-11dc-ae46-9e7b5d14892d/en.1193910797633.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/97525e90-8730-11dc-ae46-9e7b5d14892d/en.1193910797633.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/97525e90-8730-11dc-ae46-9e7b5d14892d/en.1193910797633.bak Fri Nov  2 03:57:25 2007
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2002-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.
+--><!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+
+<document>
+	<header>
+		<title>A Publication in Lenya</title>
+	</header>
+	<body>
+
+		<section>
+			<title>What is a publication?</title>
+			
+			<p>Though it's not entirely accurate, you can think of a Lenya publication as a website that
+			you are building, editing and maybe also serving through Lenya.</p>
+			<p>A publication typically consists of at least:</p>
+			<ul>
+			<li>Some original content (usually XML files and other resources such as images). The XML files
+			may be XHTML files, but they might be any other XML format as well.</li>
+			<li>One more more XSLT files.</li>
+			<li>A Cocoon sitemap that glues the pieces together and controls how the site will be rendered in Live mode</li>
+			</ul>
+		</section>
+			
+	</body>
+</document>

Modified: lenya/sandbox/pubs/docu/content/authoring/97525e90-8730-11dc-ae46-9e7b5d14892d/en.meta
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/97525e90-8730-11dc-ae46-9e7b5d14892d/en.meta?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/97525e90-8730-11dc-ae46-9e7b5d14892d/en.meta (original)
+++ lenya/sandbox/pubs/docu/content/authoring/97525e90-8730-11dc-ae46-9e7b5d14892d/en.meta Fri Nov  2 03:57:25 2007
@@ -1,11 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <metadata xmlns="http://apache.org/lenya/metadata/1.0">
-<element-set namespace="http://apache.org/lenya/metadata/document/1.0">
-<element key="mimeType">
-<value>application/xml</value>
+<element-set namespace="http://purl.org/dc/elements/1.1/">
+<element key="title">
+<value>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>

Added: lenya/sandbox/pubs/docu/content/authoring/97525e90-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910797633.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/97525e90-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910797633.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/97525e90-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910797633.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/97525e90-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910797633.bak Fri Nov  2 03:57:25 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>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/97525e90-8730-11dc-ae46-9e7b5d14892d/en.rcml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/97525e90-8730-11dc-ae46-9e7b5d14892d/en.rcml?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/97525e90-8730-11dc-ae46-9e7b5d14892d/en.rcml (original)
+++ lenya/sandbox/pubs/docu/content/authoring/97525e90-8730-11dc-ae46-9e7b5d14892d/en.rcml Fri Nov  2 03:57:25 2007
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XPSRevisionControl xmlns="">
+<CheckIn backup="true" identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910797633" version="2"/>
+<CheckOut identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910769014"/>
 <CheckIn backup="true" identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781626811" version="1"/>
 <CheckOut identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781605927"/>
 </XPSRevisionControl>

Added: lenya/sandbox/pubs/docu/content/authoring/988cb350-8730-11dc-ae46-9e7b5d14892d/en.1193910794458.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/988cb350-8730-11dc-ae46-9e7b5d14892d/en.1193910794458.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/988cb350-8730-11dc-ae46-9e7b5d14892d/en.1193910794458.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/988cb350-8730-11dc-ae46-9e7b5d14892d/en.1193910794458.bak Fri Nov  2 03:57:25 2007
@@ -0,0 +1,112 @@
+<?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>Working with Documents</title>
+  </header>
+  <body>
+    
+    <p>
+      This document shows some simple scenarios to access the Lenya repository.
+      For more information, refer to the <a href="lenya-document:35e35370-8731-11dc-ae46-9e7b5d14892d">repository documentation</a>.
+    </p>
+    
+    <section>
+      <title>The Session</title>
+      <p>
+        An <code>o.a.l.cms.repository.Session</code> is a temporary container for
+        repository nodes which you want to work with. If you want to change or remove
+        nodes - for instance in a usecase handler - you have to start a transaction.
+        To avoid overriding or losing someone else's changes, you should lock any nodes
+        which are potentially affected or read during your transaction.
+      </p>
+      <p>
+        A convenient way to get the session which is attached to the current request
+        is provided by the <code>RepositoryUtil</code>:
+      </p>
+      <source xml:space="preserve">Session session = RepositoryUtil.getSession(this.manager, request);</source>
+    </section>
+    
+    <section>
+      <title>The Document Factory</title>
+      <p>
+        The <code>o.a.l.cms.publication.DocumentFactory</code> is the main entry point to the content
+        repository. It is tied to a session. You get the document factory which is
+        attached to the current session this way:
+      </p>
+      <source xml:space="preserve">DocumentFactory factory = DocumentUtil.getDocumentFactory(this.manager, request);</source>
+    </section>
+    
+    <section>
+      <title>Browsing Content and Site Structure</title>
+      <p>
+        From the document factory, you can access a publication:
+      </p>
+      <source xml:space="preserve">
+String webappUrl = ServletHelper.getWebappUrl(request);
+URLInformation info = new URLInformation(webappUrl);
+Publication pub = factory.getPublication(info.getPublicationId());
+</source>
+
+      <p>
+        The publication provides access to all areas (pun intended).
+        An area object enables you to obtain documents by their UUID.
+      </p>
+      <source xml:space="preserve">
+Area authoring = pub.getArea("authoring");
+Document[] docs = authoring.getDocuments();
+Document doc = authoring.getDocument(uuid, language);
+</source>
+      
+      <p>
+        If you want to obtain a document by its path in the site structure,
+        get the site structure from the area:
+      </p>
+      <source xml:space="preserve">
+SiteStructure site = authoring.getSite();
+SiteNode node = site.getNode("/tutorial");
+String[] languages = node.getLanguages();
+Link link = node.getLink(language);
+Document doc = link.getDocument();
+</source>
+      
+      <p>You can also browse the document structure in a bottom-up way:</p>
+      <source xml:space="preserve">
+Document doc = ...;
+doc.area().getPublication();
+String area = doc.getLink().getNode().getStructure().getArea();
+</source>
+
+      <p>
+        The Document class allows to access different language and area versions
+        of the document:
+      </p>
+      <source xml:space="preserve">
+if (doc.existsTranslation("en")) {
+    englishVersion = doc.getTranslation("en");
+}
+if (doc.existsVersion("live", doc.getLanguage()) {
+    addInfoMessage("Live version exists!");
+    liveVersion = doc.getVersion("live", doc.getLanguage());
+}
+</source>
+    </section>
+    
+  </body>
+</document>

Modified: lenya/sandbox/pubs/docu/content/authoring/988cb350-8730-11dc-ae46-9e7b5d14892d/en.meta
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/988cb350-8730-11dc-ae46-9e7b5d14892d/en.meta?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/988cb350-8730-11dc-ae46-9e7b5d14892d/en.meta (original)
+++ lenya/sandbox/pubs/docu/content/authoring/988cb350-8730-11dc-ae46-9e7b5d14892d/en.meta Fri Nov  2 03:57:25 2007
@@ -1,11 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <metadata xmlns="http://apache.org/lenya/metadata/1.0">
-<element-set namespace="http://apache.org/lenya/metadata/document/1.0">
-<element key="mimeType">
-<value>application/xml</value>
+<element-set namespace="http://purl.org/dc/elements/1.1/">
+<element key="title">
+<value>Working with Documents</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>

Added: lenya/sandbox/pubs/docu/content/authoring/988cb350-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910794458.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/988cb350-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910794458.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/988cb350-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910794458.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/988cb350-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910794458.bak Fri Nov  2 03:57:25 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>Working with Documents</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/988cb350-8730-11dc-ae46-9e7b5d14892d/en.rcml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/988cb350-8730-11dc-ae46-9e7b5d14892d/en.rcml?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/988cb350-8730-11dc-ae46-9e7b5d14892d/en.rcml (original)
+++ lenya/sandbox/pubs/docu/content/authoring/988cb350-8730-11dc-ae46-9e7b5d14892d/en.rcml Fri Nov  2 03:57:25 2007
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XPSRevisionControl xmlns="">
+<CheckIn backup="true" identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910794458" version="2"/>
+<CheckOut identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910766600"/>
 <CheckIn backup="true" identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781626788" version="1"/>
 <CheckOut identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781605850"/>
 </XPSRevisionControl>

Added: lenya/sandbox/pubs/docu/content/authoring/99b1f970-8730-11dc-ae46-9e7b5d14892d/en.1193910792322.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/99b1f970-8730-11dc-ae46-9e7b5d14892d/en.1193910792322.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/99b1f970-8730-11dc-ae46-9e7b5d14892d/en.1193910792322.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/99b1f970-8730-11dc-ae46-9e7b5d14892d/en.1193910792322.bak Fri Nov  2 03:57:25 2007
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2002-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.
+--><!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+
+<document>
+	<header>
+		<title>Authoring and Live Mode</title>
+	</header>
+	<body>
+
+		<section>
+			<title>Introduction</title>
+			
+			<p>Lenya has two modes it can run in:</p>
+			<ul>
+			<li>In Authoring mode it is a web application enabling editors
+			to interactively manipulate the structure as well as the content of a publication.</li>
+			<li>In Live mode it will render a publication as a website.</li>
+			</ul>
+			
+			<section>
+			
+				<title>Authoring Mode</title>
+				
+				<p>Authoring a publication involves a number of different tasks:</p>
+				<ul>
+				<li>Creating new documents</li>
+				<li>Moving documents around in the sitetree</li>
+				<li>Editing a document's content</li>
+				<li>Editing a document's metadata</li>
+				</ul>
+				
+				<p>but also:</p>
+				
+				<ul>
+				<li>Editing a publication's metadata</li>
+				<li>Managing the resource types and editors available</li>
+				<li>Maintaining access control policies both for editing and for the live publication</li>
+				</ul>
+				
+				<p>Transactions that manipulate the publication are implemented through usecases, using the
+				Usecase Framework. There are for example usecases that:</p>
+				
+				<ul>
+				<li>Create a new document</li>
+				<li>Delete a document</li>
+				<li>Edit a document's metadata</li>
+				<li>Call an editor to edit the document's content</li>
+				</ul>
+
+			</section>
+
+			<section>
+				
+				<title>Live Mode</title>
+				
+				<p>The Live Mode is all about presenting a publication to the viewer.</p>
+				<p>HTTP requests are passed through a Cocoon sitemap which will then
+				use the appropriate generators, transformers and serializers which will
+				return a page to the browser in reply to the request.</p>
+				
+				<section>
+					<title>Serving a Lenya publication with plain Cocoon only?</title>
+					<p>The fact that Live Mode is all about serving pages controlled by
+					a sitemap often raises the question if it was possible to serve a 
+					publication that has been edited with Lenya from a plain Cocoon instance.</p>
+					<p>Sometimes this might be a requirement if the production site offers Cocoon
+					hosting but not Lenya hosting for example. Also some architects feel better
+					if the editor portion is not at all installed on an outside facing prodction
+					server.</p>
+					<p>While it would theoretically be possible, at the time of writing a Lenya
+					publication will need Lenya even for Live mode. The reason is that the sitemaps
+					use some custom Cocoon components that are part of Lenya, such as the PageEnvelope
+					input module for example.</p>
+					<p>Again, it would be possible to extract these components from Lenya and package
+					them with a plain instance of Cocoon to achive to goal of having a "Live mode only"
+					version of Lenya that will not allow any editing. Yet this work has not yet been done.</p>
+				</section>
+				
+			</section>
+			
+		</section>	
+		
+	</body>
+</document>

Modified: lenya/sandbox/pubs/docu/content/authoring/99b1f970-8730-11dc-ae46-9e7b5d14892d/en.meta
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/99b1f970-8730-11dc-ae46-9e7b5d14892d/en.meta?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/99b1f970-8730-11dc-ae46-9e7b5d14892d/en.meta (original)
+++ lenya/sandbox/pubs/docu/content/authoring/99b1f970-8730-11dc-ae46-9e7b5d14892d/en.meta Fri Nov  2 03:57:25 2007
@@ -1,11 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <metadata xmlns="http://apache.org/lenya/metadata/1.0">
-<element-set namespace="http://apache.org/lenya/metadata/document/1.0">
-<element key="mimeType">
-<value>application/xml</value>
+<element-set namespace="http://purl.org/dc/elements/1.1/">
+<element key="title">
+<value>Authoring and Live mode</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>

Added: lenya/sandbox/pubs/docu/content/authoring/99b1f970-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910792322.bak
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/99b1f970-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910792322.bak?rev=591298&view=auto
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/99b1f970-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910792322.bak (added)
+++ lenya/sandbox/pubs/docu/content/authoring/99b1f970-8730-11dc-ae46-9e7b5d14892d/en.meta.1193910792322.bak Fri Nov  2 03:57:25 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>Authoring and Live mode</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/99b1f970-8730-11dc-ae46-9e7b5d14892d/en.rcml
URL: http://svn.apache.org/viewvc/lenya/sandbox/pubs/docu/content/authoring/99b1f970-8730-11dc-ae46-9e7b5d14892d/en.rcml?rev=591298&r1=591297&r2=591298&view=diff
==============================================================================
--- lenya/sandbox/pubs/docu/content/authoring/99b1f970-8730-11dc-ae46-9e7b5d14892d/en.rcml (original)
+++ lenya/sandbox/pubs/docu/content/authoring/99b1f970-8730-11dc-ae46-9e7b5d14892d/en.rcml Fri Nov  2 03:57:25 2007
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XPSRevisionControl xmlns="">
+<CheckIn backup="true" identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910792322" version="2"/>
+<CheckOut identity="lenya" session="1f12dc80-8860-11dc-ba66-cfbbb816bd0d" time="1193910765397"/>
 <CheckIn backup="true" identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781618688" version="1"/>
 <CheckOut identity="lenya" session="60798970-8730-11dc-ae46-9e7b5d14892d" time="1193781606445"/>
 </XPSRevisionControl>
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.