You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2005/04/24 07:30:38 UTC
svn commit: r164448 [24/299] - in /lenya/site: ./ 1_2_x/ 1_2_x/components/
1_2_x/components/accesscontrol/ 1_2_x/components/asset-management/
1_2_x/components/authoring/ 1_2_x/components/deployment/
1_2_x/components/editors/ 1_2_x/components/layout/
1_2_x/components/layout/images/ 1_2_x/components/layout/images/live/
1_2_x/components/link-management/ 1_2_x/components/metadata/
1_2_x/components/multilingual/ 1_2_x/components/publication/
1_2_x/components/repository/ 1_2_x/components/resource-types/
1_2_x/components/revisioncontrol/ 1_2_x/components/search/
1_2_x/components/sitemanagement/ 1_2_x/components/tasks/
1_2_x/components/uri-handling/ 1_2_x/components/uri-handling/images/
1_2_x/components/uri-handling/images/live/ 1_2_x/components/workflow/
1_2_x/installation/ 1_2_x/misc/ 1_4/ 1_4/concepts/ 1_4/installation/
1_4/reference/ 1_4/reference/publication-templating/
1_4/reference/usecase-framework/ apidocs/ apidocs/1.2/ apidocs/1.2/org/
apidocs/1.2/org/apache/ apidocs/1.2/org/apache/lenya/
apidocs/1.2/org/apache/lenya/ac/ apidocs/1.2/org/apache/lenya/ac/cache/
apidocs/1.2/org/apache/lenya/ac/file/ apidocs/1.2/org/apache/lenya/ac/impl/
apidocs/1.2/org/apache/lenya/ac/ldap/ apidocs/1.2/org/apache/lenya/cms/
apidocs/1.2/org/apache/lenya/cms/ac/
apidocs/1.2/org/apache/lenya/cms/ac/cocoon/
apidocs/1.2/org/apache/lenya/cms/ac/usecase/
apidocs/1.2/org/apache/lenya/cms/ac/workflow/
apidocs/1.2/org/apache/lenya/cms/ant/
apidocs/1.2/org/apache/lenya/cms/authoring/
apidocs/1.2/org/apache/lenya/cms/cocoon/
apidocs/1.2/org/apache/lenya/cms/cocoon/acting/
apidocs/1.2/org/apache/lenya/cms/cocoon/bean/
apidocs/1.2/org/apache/lenya/cms/cocoon/components/
apidocs/1.2/org/apache/lenya/cms/cocoon/components/modules/
apidocs/1.2/org/apache/lenya/cms/cocoon/components/modules/input/
apidocs/1.2/org/apache/lenya/cms/cocoon/flow/
apidocs/1.2/org/apache/lenya/cms/cocoon/generation/
apidocs/1.2/org/apache/lenya/cms/cocoon/scheduler/
apidocs/1.2/org/apache/lenya/cms/cocoon/source/
apidocs/1.2/org/apache/lenya/cms/cocoon/task/
apidocs/1.2/org/apache/lenya/cms/cocoon/transformation/
apidocs/1.2/org/apache/lenya/cms/cocoon/uriparameterizer/
apidocs/1.2/org/apache/lenya/cms/cocoon/workflow/
apidocs/1.2/org/apache/lenya/cms/mail/
apidocs/1.2/org/apache/lenya/cms/publication/
apidocs/1.2/org/apache/lenya/cms/publication/file/
apidocs/1.2/org/apache/lenya/cms/publication/task/
apidocs/1.2/org/apache/lenya/cms/publication/util/
apidocs/1.2/org/apache/lenya/cms/publication/xsp/
apidocs/1.2/org/apache/lenya/cms/publishing/
apidocs/1.2/org/apache/lenya/cms/rc/
apidocs/1.2/org/apache/lenya/cms/scheduler/
apidocs/1.2/org/apache/lenya/cms/scheduler/xml/
apidocs/1.2/org/apache/lenya/cms/task/
apidocs/1.2/org/apache/lenya/cms/workflow/
apidocs/1.2/org/apache/lenya/defaultpub/
apidocs/1.2/org/apache/lenya/defaultpub/cms/
apidocs/1.2/org/apache/lenya/defaultpub/cms/task/
apidocs/1.2/org/apache/lenya/lucene/
apidocs/1.2/org/apache/lenya/lucene/html/
apidocs/1.2/org/apache/lenya/lucene/index/
apidocs/1.2/org/apache/lenya/lucene/parser/
apidocs/1.2/org/apache/lenya/net/ apidocs/1.2/org/apache/lenya/search/
apidocs/1.2/org/apache/lenya/search/crawler/
apidocs/1.2/org/apache/lenya/util/ apidocs/1.2/org/apache/lenya/workflow/
apidocs/1.2/org/apache/lenya/workflow/impl/
apidocs/1.2/org/apache/lenya/xml/ apidocs/1.2/org/apache/lenya/xml/parser/
apidocs/1.2/org/apache/lenya/xml/xpointer/ apidocs/1.2/resources/
apidocs/1.4/ apidocs/1.4/org/ apidocs/1.4/org/apache/
apidocs/1.4/org/apache/lenya/ apidocs/1.4/org/apache/lenya/ac/
apidocs/1.4/org/apache/lenya/ac/cache/
apidocs/1.4/org/apache/lenya/ac/file/ apidocs/1.4/org/apache/lenya/ac/impl/
apidocs/1.4/org/apache/lenya/ac/ldap/ apidocs/1.4/org/apache/lenya/cms/
apidocs/1.4/org/apache/lenya/cms/ac/
apidocs/1.4/org/apache/lenya/cms/ac/cocoon/
apidocs/1.4/org/apache/lenya/cms/ac/usecase/
apidocs/1.4/org/apache/lenya/cms/ac/usecases/
apidocs/1.4/org/apache/lenya/cms/ac/workflow/
apidocs/1.4/org/apache/lenya/cms/ant/
apidocs/1.4/org/apache/lenya/cms/authoring/
apidocs/1.4/org/apache/lenya/cms/cocoon/
apidocs/1.4/org/apache/lenya/cms/cocoon/acting/
apidocs/1.4/org/apache/lenya/cms/cocoon/bean/
apidocs/1.4/org/apache/lenya/cms/cocoon/components/
apidocs/1.4/org/apache/lenya/cms/cocoon/components/modules/
apidocs/1.4/org/apache/lenya/cms/cocoon/components/modules/input/
apidocs/1.4/org/apache/lenya/cms/cocoon/flow/
apidocs/1.4/org/apache/lenya/cms/cocoon/generation/
apidocs/1.4/org/apache/lenya/cms/cocoon/matching/
apidocs/1.4/org/apache/lenya/cms/cocoon/scheduler/
apidocs/1.4/org/apache/lenya/cms/cocoon/source/
apidocs/1.4/org/apache/lenya/cms/cocoon/task/
apidocs/1.4/org/apache/lenya/cms/cocoon/transformation/
apidocs/1.4/org/apache/lenya/cms/cocoon/uriparameterizer/
apidocs/1.4/org/apache/lenya/cms/cocoon/workflow/
apidocs/1.4/org/apache/lenya/cms/mail/
apidocs/1.4/org/apache/lenya/cms/metadata/
apidocs/1.4/org/apache/lenya/cms/metadata/dublincore/
apidocs/1.4/org/apache/lenya/cms/metadata/usecases/
apidocs/1.4/org/apache/lenya/cms/publication/
apidocs/1.4/org/apache/lenya/cms/publication/file/
apidocs/1.4/org/apache/lenya/cms/publication/task/
apidocs/1.4/org/apache/lenya/cms/publication/templating/
apidocs/1.4/org/apache/lenya/cms/publication/util/
apidocs/1.4/org/apache/lenya/cms/publishing/
apidocs/1.4/org/apache/lenya/cms/rc/
apidocs/1.4/org/apache/lenya/cms/scheduler/
apidocs/1.4/org/apache/lenya/cms/scheduler/xml/
apidocs/1.4/org/apache/lenya/cms/search/
apidocs/1.4/org/apache/lenya/cms/search/usecases/
apidocs/1.4/org/apache/lenya/cms/site/
apidocs/1.4/org/apache/lenya/cms/site/topicmap/
apidocs/1.4/org/apache/lenya/cms/site/tree/
apidocs/1.4/org/apache/lenya/cms/site/usecases/
apidocs/1.4/org/apache/lenya/cms/task/
apidocs/1.4/org/apache/lenya/cms/usecase/
apidocs/1.4/org/apache/lenya/cms/workflow/
apidocs/1.4/org/apache/lenya/cms/workflow/usecases/
apidocs/1.4/org/apache/lenya/defaultpub/
apidocs/1.4/org/apache/lenya/defaultpub/cms/
apidocs/1.4/org/apache/lenya/defaultpub/cms/task/
apidocs/1.4/org/apache/lenya/defaultpub/cms/usecases/
apidocs/1.4/org/apache/lenya/lucene/
apidocs/1.4/org/apache/lenya/lucene/html/
apidocs/1.4/org/apache/lenya/lucene/index/
apidocs/1.4/org/apache/lenya/lucene/parser/
apidocs/1.4/org/apache/lenya/net/ apidocs/1.4/org/apache/lenya/search/
apidocs/1.4/org/apache/lenya/search/crawler/
apidocs/1.4/org/apache/lenya/util/ apidocs/1.4/org/apache/lenya/workflow/
apidocs/1.4/org/apache/lenya/workflow/impl/
apidocs/1.4/org/apache/lenya/xml/ apidocs/1.4/org/apache/lenya/xml/parser/
apidocs/1.4/org/apache/lenya/xml/xpointer/ apidocs/1.4/resources/
community/ images/ images/live/ skin/ skin/css/ skin/images/ skin/scripts/
Added: lenya/site/1_4/reference/lenya-sitemaps.html
URL: http://svn.apache.org/viewcvs/lenya/site/1_4/reference/lenya-sitemaps.html?rev=164448&view=auto
==============================================================================
--- lenya/site/1_4/reference/lenya-sitemaps.html (added)
+++ lenya/site/1_4/reference/lenya-sitemaps.html Sat Apr 23 22:30:06 2005
@@ -0,0 +1,431 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta content="Apache Forrest" name="Generator">
+<meta name="Forrest-version" content="0.6">
+<meta name="Forrest-skin-name" content="pelt">
+<title>Overview of the Lenya Sitemaps</title>
+<link type="text/css" href="../../skin/basic.css" rel="stylesheet">
+<link media="screen" type="text/css" href="../../skin/screen.css" rel="stylesheet">
+<link media="print" type="text/css" href="../../skin/print.css" rel="stylesheet">
+<link type="text/css" href="../../skin/profile.css" rel="stylesheet">
+<script src="../../skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="../../skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="../../skin/fontsize.js" language="javascript" type="text/javascript"></script>
+<link rel="shortcut icon" href="../../favicon.ico">
+</head>
+<body onload="init()">
+<script type="text/javascript">ndeSetTextSize();</script>
+<div id="top">
+<!--+
+ |breadtrail
+ +-->
+<div class="breadtrail">
+<a href="http://www.apache.org/">apache</a> > <a href="http://lenya.apache.org/">lenya</a><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
+</div>
+<!--+
+ |header
+ +-->
+<div class="header">
+<!--+
+ |start group logo
+ +-->
+<div class="grouplogo">
+<a href="http://lenya.apache.org"><img class="logoImage" alt="Lenya" src="../../images/apache-lenya-light.png" title="
+ Apache Lenya is a Java-based Open-Source Content Management System.
+ It is based on open standards such as XML and XSLT.
+ One of its core components is Cocoon from the Apache Software Foundation.
+ "></a>
+</div>
+<!--+
+ |end group logo
+ +-->
+<!--+
+ |start Project Logo
+ +-->
+<div class="projectlogo">
+<a href=""></a>
+</div>
+<!--+
+ |end Project Logo
+ +-->
+<!--+
+ |start Search
+ +-->
+<div class="searchbox">
+<form action="http://www.google.com/search" method="get" class="roundtopsmall">
+<input value="lenya.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with :');" value="Search the site with :" size="25" name="q" id="query" type="text">
+ <input name="Search" value="Search" type="submit">
+</form>
+</div>
+<!--+
+ |end search
+ +-->
+<!--+
+ |start Tabs
+ +-->
+<ul id="tabs">
+<li>
+<a class="base-not-selected" href="../../index.html">Project</a>
+</li>
+<li class="current">
+<a class="base-selected" href="../../1_4/index.html">Version 1.4</a>
+</li>
+<li>
+<a class="base-not-selected" href="../../1_2_x/index.html">Version 1.2</a>
+</li>
+<li>
+<a class="base-not-selected" href="../../community/index.html">Community</a>
+</li>
+</ul>
+<!--+
+ |end Tabs
+ +-->
+</div>
+</div>
+<div id="main">
+<div id="publishedStrip">
+<!--+
+ |start Subtabs
+ +-->
+<div id="level2tabs"></div>
+<!--+
+ |end Endtabs
+ +-->
+<script type="text/javascript" language="JavaScript"><!--
+ document.write("Published: " + document.lastModified);
+ // --></script>
+</div>
+<!--+
+ |breadtrail
+ +-->
+<div class="breadtrail">
+
+
+ </div>
+<!--+
+ |start Menu, mainarea
+ +-->
+<!--+
+ |start Menu
+ +-->
+<div id="menu">
+<div onclick="SwitchMenu('menu_selected_1.1', '../../skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('../../skin/images/chapter_open.gif');">Version 1.4</div>
+<div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a title="" href="../../1_4/index.html">Index</a>
+</div>
+<div onclick="SwitchMenu('menu_1.1.2', '../../skin/')" id="menu_1.1.2Title" class="menutitle">Installation</div>
+<div id="menu_1.1.2" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_4/installation/index.html">Download</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_4/installation/subversion.html">Subversion Access</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_4/installation/source_version.html">Install Instructions</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.3', '../../skin/')" id="menu_1.1.3Title" class="menutitle">Concepts</div>
+<div id="menu_1.1.3" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_4/concepts/wysiwyg.html">WYSIWYG</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_selected_1.1.4', '../../skin/')" id="menu_selected_1.1.4Title" class="menutitle" style="background-image: url('../../skin/images/chapter_open.gif');">Technical Reference</div>
+<div id="menu_selected_1.1.4" class="selectedmenuitemgroup" style="display: block;">
+<div class="menupage">
+<div class="menupagetitle">Overview of Lenya Sitemaps</div>
+<div class="menupageitemgroup">
+<div class="menupageitem">
+<a href="#Introduction">Introduction</a>
+</div>
+<div class="menupageitem">
+<a title="Authoring Area, Live Area, CMS GUI and several Publications" href="#Authoring+Area%2C+Live+Area%2C+CMS+GUI+and+several+Publications">Authoring Area, Liv...</a>
+</div>
+<div class="menupageitem">
+<a title="The Lenya URI space" href="#The+Lenya+URI+space">The Lenya URI space...</a>
+</div>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.4.2', '../../skin/')" id="menu_1.1.4.2Title" class="menutitle">Usecase Framework</div>
+<div id="menu_1.1.4.2" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_4/reference/usecase-framework/index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_4/reference/usecase-framework/abstractusecase.html">AbstractUsecase</a>
+</div>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_4/reference/publication-templating/index.html">Publication Templating</a>
+</div>
+</div>
+<div class="menuitem">
+<a title="" href="../../../apidocs/1.4/index.html">1.4 API (Javadoc)</a>
+</div>
+</div>
+<div id="credit"></div>
+<div id="roundbottom">
+<img style="display: none" class="corner" height="15" width="15" alt="" src="../../skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
+<!--+
+ |alternative credits
+ +-->
+</div>
+<!--+
+ |end Menu
+ +-->
+<!--+
+ |start content
+ +-->
+<div id="content">
+<div id="skinconf-txtlink"></div>
+<div title="Portable Document Format" class="pdflink">
+<a class="dida" href="lenya-sitemaps.pdf"><img alt="PDF -icon" src="../../skin/images/pdfdoc.gif" class="skin"><br>
+ PDF</a>
+</div>
+<h1>Overview of the Lenya Sitemaps</h1>
+
+
+<a name="N1000D"></a><a name="Introduction"></a>
+<h2 class="h3">Introduction</h2>
+<div class="section">
+<p>Lenya is based on Apache Cocoon. To understand how Lenya works, you should have at least some basic
+ Cocoon knowlege. Make sure you know what a Cocoon sitemap is and you understand matchers, generators,
+ transformers and serializers at least.</p>
+<p>Lenya uses some more Cocoon components, but if you can spot the matchers, generators, transformers and
+ serizalizers, you will be able to get a good first overview of the Lenya sitemaps.</p>
+<p>But Lenya is much more than just a collection of sitemaps and some XSLT stylesheets. Lenya builds on
+ the Cocoon foundation and extends the Cocoon framework with custom</p>
+<ul>
+
+<li>Matchers</li>
+
+<li>Actions</li>
+
+</ul>
+<p>Beyond these components, Lenya also defines two proprietary schemes:</p>
+<ul>
+
+<li>lenya:</li>
+
+<li>fallback:</li>
+
+</ul>
+<p>These schemes are linked to a custom input module that comes with Lenya, the</p>
+<ul>
+
+<li>PageEnvelope input module</li>
+
+</ul>
+</div>
+
+
+<a name="N1003B"></a><a name="Authoring+Area%2C+Live+Area%2C+CMS+GUI+and+several+Publications"></a>
+<h2 class="h3">Authoring Area, Live Area, CMS GUI and several Publications</h2>
+<div class="section">
+<p>A Lenya installation aggregates a number of different parts into
+ a single Cocoon application. By default, one instance of Lenya can be used
+ to edit and render an arbitrary number of publications which are entirely
+ independent of each other.</p>
+<p>There are different concepts of what a publication is, but for now,
+ let's assume each publication represents an independent website.</p>
+<p>Inside each publication, there are</p>
+<ul>
+
+<li>The authoring area</li>
+
+<li>The live area</li>
+
+<li>The CMS GUI components (Drop Down Menu, CMS screens, editos, ...)</li>
+
+</ul>
+<p>The URI space is used to organize all this.</p>
+</div>
+
+
+<a name="N1005A"></a><a name="The+Lenya+URI+space"></a>
+<h2 class="h3">The Lenya URI space</h2>
+<div class="section">
+<p>If you run Lenya in built-in Jetty servlet container, the Lenya webapp
+ is the root application of the container. Therefore http://localhost:8888/ will
+ already hit the Lenya root sitemap.</p>
+<p>In case you deployed lenya into a non-root context of any servlet container, the first
+ part of the URI will be handled by the container itself to match the responsible webapp.</p>
+<p>If you deployed lenya.war into Tomcat for example, you will most likely have to use
+ http://localhost:8080/lenya/ to get into the Lenya root sitemap.</p>
+<p>For the rest of this document, we pretend Lenya is the root webapp in your container
+ as this is the case with the built-in Jetty. Let's examine , what Lenya does in order to
+ render the document you see when you enter this URL:
+ <span class="codefrag">http://localhost:8888/default/authoring/tutorial/new_doctype.html</span>
+</p>
+<a name="N1006E"></a><a name="Part+1%3A+The+publication+ID"></a>
+<h3 class="h4">Part 1: The publication ID</h3>
+<p>The first part is the publication id <span class="codefrag">default</span> which selects the <em>Default
+ Publication</em>. There is a difference between the publication ID and the name of the publication.
+ The ID should be compatible to both the filesystem implementation as well as the URI encoding
+ because it will become both the name of the publication directory and a part of the URL. Therefore
+ it is good practice to stick to 7-bit ASCII with no spaces or special characters.</p>
+<p>In contrast, the display name of the publication (which will show up in the list of publications
+ on the main Lenya entry screen) can be longer and it can contain spaces as well as any
+ Unicode characters.</p>
+<p>The publication ID is used to mount the publication specific sitemap.xmap from
+ <span class="codefrag">$LENYA_HOME/pubs/{publication-id}</span>. The <span class="codefrag">map:mount</span> will strip the publication ID
+ from the URL, so the publication sitemap will just see the
+ <span class="codefrag">authoring/tutorial/new_doctype.html</span> portion. Nevertheless a publication has its ID
+ available through the page envelope. More on that later as we're not yet really inside the publication's
+ content.</p>
+<a name="N1008D"></a><a name="Part+2%3A+The+area"></a>
+<h3 class="h4">Part 2: The area</h3>
+<p>There are two possible areas.</p>
+<ul>
+
+<li>Authoring</li>
+
+<li>Live</li>
+
+</ul>
+<p>You can think of areas as of modes, as in "live mode" and "authoring mode". Live mode is
+ the view of the publication as it is supposed to be displayed on the website to the site
+ visitor. The authoring mode is used by editors and reviewers to edit the publication's content.</p>
+<p>Technically speaking, the first major difference between the authoring area and the live area is just
+ that in authoring mode the CMS menus are displayed. Following the WYSIWYG principle of Lenya,
+ the publication content is rendered the same way in authoring mode as it would be in live mode.</p>
+<p>Besides displaying the CMS menus or not, there are different copies of the underlying content
+ repository for the authoring and live areas. This allows the editors to edit a working copy
+ without affecting the live site. When a document is published after it was reviewed, it is
+ just beeing copied over to the live repository.</p>
+<p>If you're using the default filesystem repository of Lenya, you will find the two different
+ repositories under <span class="codefrag">$LENYA_HOME/lenya/pubs/content/authoring</span> and
+ <span class="codefrag">$LENYA_HOME/lenya/pubs/content/live</span>.</p>
+<p>As well as the publication ID the area is also stored in the page envelope. This will make
+ the actual area available to both the sitemap through the page envelope input module as well as
+ to the components in the Java layer of Lenya.</p>
+<p>At this point, Lenya parsed the URL to the point that is knows:</p>
+<ul>
+
+<li>which publication the request belongs to</li>
+
+<li>which repository is to be used, authoring or live</li>
+
+<li>wether to display the CMS menus or not</li>
+
+</ul>
+<a name="N100C3"></a><a name="CMS+Menus%2C+Usecases+and+CMS+screens"></a>
+<h4>CMS Menus, Usecases and CMS screens</h4>
+<p>Prior to finally turning over to the actual publication content, some remarks
+ on the CMS menus and CMS screens.</p>
+<p>Lenya uses so-called usecases to perform actions. There are usecases such as</p>
+<ul>
+
+<li>submit (a document)</li>
+
+<li>publish (a document)</li>
+
+<li>...</li>
+
+</ul>
+<p>The CMS menus are nothing but a convenience mechanism for the CMS user to trigger usecases.
+ As an alternative to choosing the "Workflow"->"Submit" menu option, you could as well append
+ <span class="codefrag">?lenya.usecase=submit</span> to the document URL. As soon as Lenya finds a lenya.usecase
+ request parameter it will branch into the <span class="codefrag">lenya/usecases/usecase.xmap</span> sitemap.</p>
+<p>All usecases start in the Lenya core. The core contains most of the common access control,
+ workflow and editing usecases. A publication can introduce publication specific usecases.</p>
+<p>Some usecases require CMS screens to be displayed. These are rendered through the usecase
+ sitemap portions as well. That way one could for example introduce a new skin for the CMS
+ screens just by means of the Cocoon sitemap.</p>
+<p>For details on usecases, have a look at the Lenya Usecase Framework.</p>
+<a name="N100EF"></a><a name="Part+3%3A+The+document+URL"></a>
+<h3 class="h4">Part 3: The document URL</h3>
+<p>Now it's the publication sitemap's task to take the document URL portion of the
+ original URL (<span class="codefrag">tutorial/new_doctype.html</span> in our example) and generate and
+ render the content page. This sounds easy, but turns out to be quite complex. This
+ portion is actually the heart and soul of every CMS. This is also where differnt
+ CMS have a lot of differences in terms of features and configurability.</p>
+<p>The easiest way to deal with this would be:</p>
+<ul>
+
+<li>Choose the appropriate content repository (authoring or live)</li>
+
+<li>Use the document URL to look for a file with that name and generate it.</li>
+
+<li>If necessary: Apply an XSLT stylesheet and serialize the result.</li>
+
+</ul>
+<p>Lenya can do a lot more here, such as:</p>
+<ul>
+
+<li>Use a publication specific mapper class to map the document URL to a backend
+ repository URL. This will allow you to hide the actual repository structure from
+ the website visitor.</li>
+
+<li>Apply some intelligence to decide what language version of the document to use.
+ For example, it no specific language version is requested, Lenya will choose the
+ default language. If there is a specific language requested, Lenya will apply a mapping
+ to built a back-end respository path to query for the requested language and generate this
+ if it is available. If the document is not available in the requested language, Lenya will
+ fall back to the default language again.</li>
+
+<li>Choose among a selection of different rendering pipelines based on the source document's
+ resource type. A resource type can be XHTML, but also any other XML format such as RSS,
+ SVG, SlideML or whatever.</li>
+
+</ul>
+<p>Most of this logic is implemented in the Java layer. The components are Avalon components
+ which are configured on a per-publication basis. In other words: One could implement and plug
+ in custom versions of these components.</p>
+<p>Only the mapping between input URL and the path used to access the repository in the backend
+ is implemented as an Avalon component in Java. The actual rendering of the document is done
+ by the means of Cocoon sitemaps, thus allowing anyone with Cocoon knowledge to make changes to
+ the rendering pipelines whithout having to write Java code.</p>
+<p>An example of an entirely different mapping between the document URL and the repository
+ is the Lenya Weblog publication that comes as a second sample with the Lenya distribution.</p>
+<a name="N10123"></a><a name="Part+4%3A+The+usecase+and+workflow+parameters+%28optional%29"></a>
+<h3 class="h4">Part 4: The usecase and workflow parameters (optional)</h3>
+<p>Right after the document URL there may be additional paramters, especially</p>
+<ul>
+
+<li>lenya.usecase and mabye</li>
+
+<li>lenya.step</li>
+
+</ul>
+<p>as well as maybe</p>
+<ul>
+
+<li>wf.event</li>
+
+</ul>
+<p>For an explaination of the usecase parameters, see the usecase framework.</p>
+<p>For an explaination of the workflow engine, see the workflow engine (coming soon).</p>
+</div>
+
+
+
+</div>
+<!--+
+ |end content
+ +-->
+<div class="clearboth"> </div>
+</div>
+<div id="footer">
+<!--+
+ |start bottomstrip
+ +-->
+<div class="lastmodified">
+<script type="text/javascript"><!--
+document.write("Last Published: " + document.lastModified);
+// --></script>
+</div>
+<div class="copyright">
+ Copyright © 2002-2005 The Apache Software Foundation.</div>
+<div id="feedback">
+ Send feedback about the website to:
+ <a id="feedbackto" href="mailto:dev@lenya.apache.org?subject=Feedback%C2%A0for%C2%A01_4/reference/lenya-sitemaps.html">dev@lenya.apache.org</a>
+</div>
+<!--+
+ |end bottomstrip
+ +-->
+</div>
+</body>
+</html>
Propchange: lenya/site/1_4/reference/lenya-sitemaps.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lenya/site/1_4/reference/lenya-sitemaps.html
------------------------------------------------------------------------------
svn:mime-type = text/html
Added: lenya/site/1_4/reference/lenya-sitemaps.pdf
URL: http://svn.apache.org/viewcvs/lenya/site/1_4/reference/lenya-sitemaps.pdf?rev=164448&view=auto
==============================================================================
Binary file - no diff available.
Propchange: lenya/site/1_4/reference/lenya-sitemaps.pdf
------------------------------------------------------------------------------
svn:mime-type = application/pdf
Added: lenya/site/1_4/reference/publication-templating/index.html
URL: http://svn.apache.org/viewcvs/lenya/site/1_4/reference/publication-templating/index.html?rev=164448&view=auto
==============================================================================
--- lenya/site/1_4/reference/publication-templating/index.html (added)
+++ lenya/site/1_4/reference/publication-templating/index.html Sat Apr 23 22:30:06 2005
@@ -0,0 +1,482 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta content="Apache Forrest" name="Generator">
+<meta name="Forrest-version" content="0.6">
+<meta name="Forrest-skin-name" content="pelt">
+<title>Publication Templating</title>
+<link type="text/css" href="../../../skin/basic.css" rel="stylesheet">
+<link media="screen" type="text/css" href="../../../skin/screen.css" rel="stylesheet">
+<link media="print" type="text/css" href="../../../skin/print.css" rel="stylesheet">
+<link type="text/css" href="../../../skin/profile.css" rel="stylesheet">
+<script src="../../../skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="../../../skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="../../../skin/fontsize.js" language="javascript" type="text/javascript"></script>
+<link rel="shortcut icon" href="../../../favicon.ico">
+</head>
+<body onload="init()">
+<script type="text/javascript">ndeSetTextSize();</script>
+<div id="top">
+<!--+
+ |breadtrail
+ +-->
+<div class="breadtrail">
+<a href="http://www.apache.org/">apache</a> > <a href="http://lenya.apache.org/">lenya</a><script src="../../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
+</div>
+<!--+
+ |header
+ +-->
+<div class="header">
+<!--+
+ |start group logo
+ +-->
+<div class="grouplogo">
+<a href="http://lenya.apache.org"><img class="logoImage" alt="Lenya" src="../../../images/apache-lenya-light.png" title="
+ Apache Lenya is a Java-based Open-Source Content Management System.
+ It is based on open standards such as XML and XSLT.
+ One of its core components is Cocoon from the Apache Software Foundation.
+ "></a>
+</div>
+<!--+
+ |end group logo
+ +-->
+<!--+
+ |start Project Logo
+ +-->
+<div class="projectlogo">
+<a href=""></a>
+</div>
+<!--+
+ |end Project Logo
+ +-->
+<!--+
+ |start Search
+ +-->
+<div class="searchbox">
+<form action="http://www.google.com/search" method="get" class="roundtopsmall">
+<input value="lenya.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with :');" value="Search the site with :" size="25" name="q" id="query" type="text">
+ <input name="Search" value="Search" type="submit">
+</form>
+</div>
+<!--+
+ |end search
+ +-->
+<!--+
+ |start Tabs
+ +-->
+<ul id="tabs">
+<li>
+<a class="base-not-selected" href="../../../index.html">Project</a>
+</li>
+<li class="current">
+<a class="base-selected" href="../../../1_4/index.html">Version 1.4</a>
+</li>
+<li>
+<a class="base-not-selected" href="../../../1_2_x/index.html">Version 1.2</a>
+</li>
+<li>
+<a class="base-not-selected" href="../../../community/index.html">Community</a>
+</li>
+</ul>
+<!--+
+ |end Tabs
+ +-->
+</div>
+</div>
+<div id="main">
+<div id="publishedStrip">
+<!--+
+ |start Subtabs
+ +-->
+<div id="level2tabs"></div>
+<!--+
+ |end Endtabs
+ +-->
+<script type="text/javascript" language="JavaScript"><!--
+ document.write("Published: " + document.lastModified);
+ // --></script>
+</div>
+<!--+
+ |breadtrail
+ +-->
+<div class="breadtrail">
+
+
+ </div>
+<!--+
+ |start Menu, mainarea
+ +-->
+<!--+
+ |start Menu
+ +-->
+<div id="menu">
+<div onclick="SwitchMenu('menu_selected_1.1', '../../../skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('../../../skin/images/chapter_open.gif');">Version 1.4</div>
+<div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a title="" href="../../../1_4/index.html">Index</a>
+</div>
+<div onclick="SwitchMenu('menu_1.1.2', '../../../skin/')" id="menu_1.1.2Title" class="menutitle">Installation</div>
+<div id="menu_1.1.2" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../../1_4/installation/index.html">Download</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../../1_4/installation/subversion.html">Subversion Access</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../../1_4/installation/source_version.html">Install Instructions</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.3', '../../../skin/')" id="menu_1.1.3Title" class="menutitle">Concepts</div>
+<div id="menu_1.1.3" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../../1_4/concepts/wysiwyg.html">WYSIWYG</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_selected_1.1.4', '../../../skin/')" id="menu_selected_1.1.4Title" class="menutitle" style="background-image: url('../../../skin/images/chapter_open.gif');">Technical Reference</div>
+<div id="menu_selected_1.1.4" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a title="" href="../../../1_4/reference/lenya-sitemaps.html">Overview of Lenya Sitemaps</a>
+</div>
+<div onclick="SwitchMenu('menu_1.1.4.2', '../../../skin/')" id="menu_1.1.4.2Title" class="menutitle">Usecase Framework</div>
+<div id="menu_1.1.4.2" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../../1_4/reference/usecase-framework/index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../../1_4/reference/usecase-framework/abstractusecase.html">AbstractUsecase</a>
+</div>
+</div>
+<div class="menupage">
+<div class="menupagetitle">Publication Templating</div>
+<div class="menupageitemgroup">
+<div class="menupageitem">
+<a title="What is Publication Templating?" href="#What+is+Publication+Templating%3F">What is Publication...</a>
+</div>
+<div class="menupageitem">
+<a title="The Concept of Publication Templating" href="#The+Concept+of+Publication+Templating">The Concept of Publ...</a>
+</div>
+<div class="menupageitem">
+<a title="Declaration of a Template" href="#Declaration+of+a+Template">Declaration of a Te...</a>
+</div>
+<div class="menupageitem">
+<a href="#Usage">Usage</a>
+</div>
+<div class="menupageitem">
+<a title="XSLT Include and Import" href="#XSLT+Include+and+Import">XSLT Include and Im...</a>
+</div>
+<div class="menupageitem">
+<a href="#Sitemaps">Sitemaps</a>
+</div>
+<div class="menupageitem">
+<a href="#Usecases">Usecases</a>
+</div>
+<div class="menupageitem">
+<a title="Setting Up a Publication To Support Templating" href="#Setting+Up+a+Publication+To+Support+Templating">Setting Up a Public...</a>
+</div>
+</div>
+</div>
+</div>
+<div class="menuitem">
+<a title="" href="../../../../apidocs/1.4/index.html">1.4 API (Javadoc)</a>
+</div>
+</div>
+<div id="credit">
+<a href="http://forrest.apache.org/"><img border="0" title="Built with Apache Forrest" alt="Built with Apache Forrest - logo" src="../../../images/built-with-forrest-button.png" style="width: 88px;height: 31px;"></a>
+</div>
+<div id="roundbottom">
+<img style="display: none" class="corner" height="15" width="15" alt="" src="../../../skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
+<!--+
+ |alternative credits
+ +-->
+</div>
+<!--+
+ |end Menu
+ +-->
+<!--+
+ |start content
+ +-->
+<div id="content">
+<div id="skinconf-txtlink"></div>
+<div title="Portable Document Format" class="pdflink">
+<a class="dida" href="index.pdf"><img alt="PDF -icon" src="../../../skin/images/pdfdoc.gif" class="skin"><br>
+ PDF</a>
+</div>
+<h1>Publication Templating</h1>
+
+
+<a name="N1000D"></a><a name="What+is+Publication+Templating%3F"></a>
+<h2 class="h3">What is Publication Templating?</h2>
+<div class="section">
+<p>
+ Imagine you are a company or organisation with some departments which want to edit
+ their content using a Lenya-based CMS. All departments use similar publications,
+ sharing lots of functionality. The layout is based on a common corporate identity,
+ but some departments want to use their own logo or tweak the navigation menu style.
+ </p>
+<p>
+ If all departments develop their own publications, it will be very hard to keep them
+ consistent, to add changes to all publications or to update them to a newer Lenya version.
+ This can be simplified using publication templates. You define a base (template) publication
+ which all others are derived from.
+ </p>
+<pre class="code">
+ +----------------------+
+ | Template Publication |
+ +----------------------+
+ |
+ +-----------------+------+---------------------+
+ | | |
+ +--------------+ +--------------+ +--------------+
+ | Department A | | Department B | ... | Department X |
+ +--------------+ +--------------+ +--------------+
+</pre>
+<p>Multiple layers of templates are supported.</p>
+<pre class="code">
+ +--------------------------------+
+ | University Website Publication |
+ +--------------------------------+
+ |
+ +-----------------+------+------------------------+
+ | | |
+ +------------+ +--------------------+ +-------------+
+ | Uni Zurich | | Harvard University | ... | UC Berkeley |
+ +------------+ +--------------------+ +-------------+
+ |
+ +----------+---+-----------+
+ | | |
+ +----------+ +-----+ +---------+
+ | Business | | Law | ... | Medical |
+ +----------+ +-----+ +---------+
+</pre>
+</div>
+
+
+<a name="N10025"></a><a name="The+Concept+of+Publication+Templating"></a>
+<h2 class="h3">The Concept of Publication Templating</h2>
+<div class="section">
+<ul>
+
+<li>There is a publication <em>my-pub</em>.</li>
+
+<li>It depends on a template which is called <em>template(my-pub)</em>.</li>
+
+<li>When a file is requested using the templating mechanism (<span class="codefrag">fallback://xslt/page2xhtml.xsl</span>),
+ it is searched in a certain traversing order:
+ <ol>
+
+<li>
+<span class="codefrag">context://lenya/pubs/my-pub/xslt/page2xhtml.xsl</span>
+</li>
+
+<li>
+<span class="codefrag">context://lenya/pubs/template(my-pub)/xslt/page2xhtml.xsl</span>
+</li>
+
+<li>
+<span class="codefrag">context://lenya/pubs/template(template(my-pub))/xslt/page2xhtml.xsl</span>
+</li>
+
+<li>...</li>
+
+<li>
+<span class="codefrag">context://xslt/page2xhtml.xsl</span>
+</li>
+
+</ol>
+
+</li>
+
+</ul>
+<p>
+ The publication <em>my-pub</em> is called an <strong>instance</strong> of the publication <em>template(my-pub)</em>.
+ Note that, in contrast to the fallback mechanism in Lenya 1.2, the prefix <span class="codefrag">lenya</span> is not used,
+ but the path is resolved relatively to the <span class="codefrag">context://</span> root.
+ </p>
+</div>
+
+
+<a name="N10069"></a><a name="Declaration+of+a+Template"></a>
+<h2 class="h3">Declaration of a Template</h2>
+<div class="section">
+<p>The template of a publication is declared in <span class="codefrag">my-pub/config/publication.xconf</span>:</p>
+<pre class="code"><publication>
+ ...
+ <templates>
+ <template id="my-template"/>
+ </templates>
+ ...
+</publication></pre>
+</div>
+
+
+<a name="N1007A"></a><a name="Usage"></a>
+<h2 class="h3">Usage</h2>
+<div class="section">
+<p>To invoke publication templating, it is necessary to use the <span class="codefrag">fallback://</span>
+ protocol for all relevant files. For an XSLT stylesheet, the according pipeline looks as follows:</p>
+<pre class="code"><map:transform src="fallback://xslt/doctypes/doctype2xhtml.xsl"></pre>
+</div>
+
+
+<a name="N1008B"></a><a name="XSLT+Include+and+Import"></a>
+<h2 class="h3">XSLT Include and Import</h2>
+<div class="section">
+<p>
+ To leverage the publication templating concept, it is necessary to apply it to included
+ or imported stylesheets as well. Fortunately, we can make use of the <span class="codefrag">fallback://</span>
+ protocol in XSLT stylesheets. At the moment, this only works with Xalan which means you
+ have to use this one as the default transformer.
+ </p>
+<pre class="code"><xsl:include href="fallback://header.xsl"/></pre>
+<p>
+ To simplify overriding of XSLT stylesheets, it would be useful to import the template
+ stylesheet. For this purpose, an additional template source factory could be used, which
+ skips the current publication when resolving the file:
+ </p>
+<pre class="code"><xsl:import href="template://template/xslt/common/header.xsl"/></pre>
+</div>
+
+
+<a name="N100A3"></a><a name="Sitemaps"></a>
+<h2 class="h3">Sitemaps</h2>
+<div class="section">
+<p>
+ If a sitemap is loaded from a template publication, it is very important that the sitemap
+ is completely fallback-enabled. Otherwise, the source resolver will resolve sources relatively
+ to the template sitemap instead of using the overridden ones.
+ </p>
+<p>
+ In <span class="codefrag">lenya/global-sitemap.xmap</span>, all publication sitemaps are mounted
+ using the fallback module, for instance
+ </p>
+<pre class="code"><!-- Enter the actual publication -->
+<map:match pattern="*/**">
+ <map:mount uri-prefix="{1}" src="{fallback:sitemap.xmap}"/>
+</map:match></pre>
+</div>
+
+
+<a name="N100B7"></a><a name="Usecases"></a>
+<h2 class="h3">Usecases</h2>
+<div class="section">
+<p>
+ The <a href="../usecase-framework/index.html">usecase framework</a>
+ supports publication templating by default.
+ </p>
+<p>
+ If you can't (or don't want to) use the usecase framework, you have to implement
+ your own usecase sitemap. The traversing order for usecase sitemaps is
+ </p>
+<ol>
+
+<li>
+<span class="codefrag">context://lenya/pubs/my-pub/usecase.xmap</span>
+</li>
+
+<li>
+<span class="codefrag">context://lenya/pubs/template(my-pub)/usecase.xmap</span>
+</li>
+
+<li>
+<span class="codefrag">context://lenya/pubs/template(template(my-pub))/usecase.xmap</span>
+</li>
+
+<li>...</li>
+
+<li>
+<span class="codefrag">context://lenya/usecase.xmap</span>
+</li>
+
+</ol>
+<p>
+ This behaviour is achieved by the usecase fallback module which is called in <span class="codefrag">global-sitemap.xmap</span>:
+ </p>
+<pre class="code"><map:match type="usecase" pattern="*">
+ <map:mount src="{usecase-fallback:{1}}" uri-prefix=""/>
+</map:match></pre>
+<p>
+ The decision which <span class="codefrag">usecase.xmap</span> to choose is based on the usecase configuration
+ in <span class="codefrag">publication.xconf</span>. To declare a usecase to be implemented by a publication,
+ add the corresponding entry:
+ </p>
+<pre class="code"><publication>
+ ...
+ <usecases>
+ <usecase name="create"/>
+ </usecases>
+ ...
+</publication></pre>
+</div>
+
+
+<a name="N100F5"></a><a name="Setting+Up+a+Publication+To+Support+Templating"></a>
+<h2 class="h3">Setting Up a Publication To Support Templating</h2>
+<div class="section">
+<p>
+ The service <span class="codefrag">org.apache.lenya.cms.publication.templating.Instantiator</span> is responsible for
+ creating instances of publications which support templating. If your publication shall support
+ templating, you have to follow these steps:
+ </p>
+<a name="N10101"></a><a name="Implement+an+"></a>
+<h3 class="h4">Implement an Instantiator Class</h3>
+<pre class="code">package org.myproject.lenya;
+
+public class MyInstantiator extends AbstractLogEnabled implements Instantiator {
+
+ public void instantiate(Publication template, String newPublicationId, String name)
+ throws Exception {
+ ...
+ }
+
+}</pre>
+<a name="N1010F"></a><a name="Add+it+to+"></a>
+<h3 class="h4">Add it to cocoon.xconf Using a Patch File</h3>
+<p>
+ For instance <span class="codefrag">my-pub/config/instantiator.xconf</span>:
+ </p>
+<pre class="code"><xconf xpath="/cocoon/template-instantiators"
+ unless="/cocoon/template-instantiators/component-instance[@name = 'default']">
+
+ <component-instance name="mypub"
+ logger="myproject.publication"
+ class="org.myproject.lenya.MyInstantiator"/>
+
+</xconf></pre>
+<a name="N10123"></a><a name="Declare+the+Instantiator+in+"></a>
+<h3 class="h4">Declare the Instantiator in publication.xconf</h3>
+<pre class="code"><publication>
+ ...
+ <template-instantiator name="mypub"/>
+ ...
+</publication></pre>
+</div>
+
+
+</div>
+<!--+
+ |end content
+ +-->
+<div class="clearboth"> </div>
+</div>
+<div id="footer">
+<!--+
+ |start bottomstrip
+ +-->
+<div class="lastmodified">
+<script type="text/javascript"><!--
+document.write("Last Published: " + document.lastModified);
+// --></script>
+</div>
+<div class="copyright">
+ Copyright © 2002-2005 The Apache Software Foundation.</div>
+<div id="logos"></div>
+<div id="feedback">
+ Send feedback about the website to:
+ <a id="feedbackto" href="mailto:dev@lenya.apache.org?subject=Feedback%C2%A0for%C2%A01_4/reference/publication-templating/index.html">dev@lenya.apache.org</a>
+</div>
+<!--+
+ |end bottomstrip
+ +-->
+</div>
+</body>
+</html>
Propchange: lenya/site/1_4/reference/publication-templating/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lenya/site/1_4/reference/publication-templating/index.html
------------------------------------------------------------------------------
svn:mime-type = text/html
Added: lenya/site/1_4/reference/publication-templating/index.pdf
URL: http://svn.apache.org/viewcvs/lenya/site/1_4/reference/publication-templating/index.pdf?rev=164448&view=auto
==============================================================================
Binary file - no diff available.
Propchange: lenya/site/1_4/reference/publication-templating/index.pdf
------------------------------------------------------------------------------
svn:mime-type = application/pdf
Added: lenya/site/1_4/reference/usecase-framework/abstractusecase.html
URL: http://svn.apache.org/viewcvs/lenya/site/1_4/reference/usecase-framework/abstractusecase.html?rev=164448&view=auto
==============================================================================
--- lenya/site/1_4/reference/usecase-framework/abstractusecase.html (added)
+++ lenya/site/1_4/reference/usecase-framework/abstractusecase.html Sat Apr 23 22:30:06 2005
@@ -0,0 +1,412 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta content="Apache Forrest" name="Generator">
+<meta name="Forrest-version" content="0.6">
+<meta name="Forrest-skin-name" content="pelt">
+<title>The AbstractUsecase Class</title>
+<link type="text/css" href="../../../skin/basic.css" rel="stylesheet">
+<link media="screen" type="text/css" href="../../../skin/screen.css" rel="stylesheet">
+<link media="print" type="text/css" href="../../../skin/print.css" rel="stylesheet">
+<link type="text/css" href="../../../skin/profile.css" rel="stylesheet">
+<script src="../../../skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="../../../skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="../../../skin/fontsize.js" language="javascript" type="text/javascript"></script>
+<link rel="shortcut icon" href="../../../favicon.ico">
+</head>
+<body onload="init()">
+<script type="text/javascript">ndeSetTextSize();</script>
+<div id="top">
+<!--+
+ |breadtrail
+ +-->
+<div class="breadtrail">
+<a href="http://www.apache.org/">apache</a> > <a href="http://lenya.apache.org/">lenya</a><script src="../../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
+</div>
+<!--+
+ |header
+ +-->
+<div class="header">
+<!--+
+ |start group logo
+ +-->
+<div class="grouplogo">
+<a href="http://lenya.apache.org"><img class="logoImage" alt="Lenya" src="../../../images/apache-lenya-light.png" title="
+ Apache Lenya is a Java-based Open-Source Content Management System.
+ It is based on open standards such as XML and XSLT.
+ One of its core components is Cocoon from the Apache Software Foundation.
+ "></a>
+</div>
+<!--+
+ |end group logo
+ +-->
+<!--+
+ |start Project Logo
+ +-->
+<div class="projectlogo">
+<a href=""></a>
+</div>
+<!--+
+ |end Project Logo
+ +-->
+<!--+
+ |start Search
+ +-->
+<div class="searchbox">
+<form action="http://www.google.com/search" method="get" class="roundtopsmall">
+<input value="lenya.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with :');" value="Search the site with :" size="25" name="q" id="query" type="text">
+ <input name="Search" value="Search" type="submit">
+</form>
+</div>
+<!--+
+ |end search
+ +-->
+<!--+
+ |start Tabs
+ +-->
+<ul id="tabs">
+<li>
+<a class="base-not-selected" href="../../../index.html">Project</a>
+</li>
+<li class="current">
+<a class="base-selected" href="../../../1_4/index.html">Version 1.4</a>
+</li>
+<li>
+<a class="base-not-selected" href="../../../1_2_x/index.html">Version 1.2</a>
+</li>
+<li>
+<a class="base-not-selected" href="../../../community/index.html">Community</a>
+</li>
+</ul>
+<!--+
+ |end Tabs
+ +-->
+</div>
+</div>
+<div id="main">
+<div id="publishedStrip">
+<!--+
+ |start Subtabs
+ +-->
+<div id="level2tabs"></div>
+<!--+
+ |end Endtabs
+ +-->
+<script type="text/javascript" language="JavaScript"><!--
+ document.write("Published: " + document.lastModified);
+ // --></script>
+</div>
+<!--+
+ |breadtrail
+ +-->
+<div class="breadtrail">
+
+
+ </div>
+<!--+
+ |start Menu, mainarea
+ +-->
+<!--+
+ |start Menu
+ +-->
+<div id="menu">
+<div onclick="SwitchMenu('menu_selected_1.1', '../../../skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('../../../skin/images/chapter_open.gif');">Version 1.4</div>
+<div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a title="" href="../../../1_4/index.html">Index</a>
+</div>
+<div onclick="SwitchMenu('menu_1.1.2', '../../../skin/')" id="menu_1.1.2Title" class="menutitle">Installation</div>
+<div id="menu_1.1.2" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../../1_4/installation/index.html">Download</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../../1_4/installation/subversion.html">Subversion Access</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../../1_4/installation/source_version.html">Install Instructions</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.3', '../../../skin/')" id="menu_1.1.3Title" class="menutitle">Concepts</div>
+<div id="menu_1.1.3" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../../1_4/concepts/wysiwyg.html">WYSIWYG</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_selected_1.1.4', '../../../skin/')" id="menu_selected_1.1.4Title" class="menutitle" style="background-image: url('../../../skin/images/chapter_open.gif');">Technical Reference</div>
+<div id="menu_selected_1.1.4" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a title="" href="../../../1_4/reference/lenya-sitemaps.html">Overview of Lenya Sitemaps</a>
+</div>
+<div onclick="SwitchMenu('menu_selected_1.1.4.2', '../../../skin/')" id="menu_selected_1.1.4.2Title" class="menutitle" style="background-image: url('../../../skin/images/chapter_open.gif');">Usecase Framework</div>
+<div id="menu_selected_1.1.4.2" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a title="" href="../../../1_4/reference/usecase-framework/index.html">Overview</a>
+</div>
+<div class="menupage">
+<div class="menupagetitle">AbstractUsecase</div>
+<div class="menupageitemgroup">
+<div class="menupageitem">
+<a href="#Introduction">Introduction</a>
+</div>
+<div class="menupageitem">
+<a href="#Configuration">Configuration</a>
+</div>
+<div class="menupageitem">
+<a title="Extending AbstractUsecase" href="#Extending+AbstractUsecase">Extending AbstractU...</a>
+</div>
+</div>
+</div>
+</div>
+<div class="menuitem">
+<a title="" href="../../../1_4/reference/publication-templating/index.html">Publication Templating</a>
+</div>
+</div>
+<div class="menuitem">
+<a title="" href="../../../../apidocs/1.4/index.html">1.4 API (Javadoc)</a>
+</div>
+</div>
+<div id="credit"></div>
+<div id="roundbottom">
+<img style="display: none" class="corner" height="15" width="15" alt="" src="../../../skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
+<!--+
+ |alternative credits
+ +-->
+</div>
+<!--+
+ |end Menu
+ +-->
+<!--+
+ |start content
+ +-->
+<div id="content">
+<div id="skinconf-txtlink"></div>
+<div title="Portable Document Format" class="pdflink">
+<a class="dida" href="abstractusecase.pdf"><img alt="PDF -icon" src="../../../skin/images/pdfdoc.gif" class="skin"><br>
+ PDF</a>
+</div>
+<h1>The AbstractUsecase Class</h1>
+
+
+<a name="N1000D"></a><a name="Introduction"></a>
+<h2 class="h3">Introduction</h2>
+<div class="section">
+<p>
+ When you implement a custom usecase, you're very likely to extend
+ <span class="codefrag">org.apache.lenya.cms.usecase.AbstractUsecase</span>. This class provides a set of
+ functionality to simplify the implementation of usecases.
+ </p>
+</div>
+
+
+<a name="N1001A"></a><a name="Configuration"></a>
+<h2 class="h3">Configuration</h2>
+<div class="section">
+<p>
+ The usecase is configured in <span class="codefrag">cocoon.xconf</span>.
+ A typical configuration looks like this:
+ </p>
+<pre class="code">
+<component-instance name="edit.forms" logger="lenya.publication"
+ class="org.apache.lenya.cms.editors.forms.FormsEditor">
+ <transaction policy="pessimistic"/>
+ <view template="edit/forms/forms" menu="false"/>
+</component-instance>
+</pre>
+<p>
+ The following configuration options are available:
+ </p>
+<ul>
+
+<li>Element <span class="codefrag"><transaction></span> (optional)
+ <ul>
+
+<li>Attribute <span class="codefrag">policy = (optimistic | pessimistic)</span>
+</li>
+
+</ul>
+
+<br>
+
+<p>
+ This element is used to determine the transaction policy of the usecase
+ (<em>optimistic</em> or <em>pessimistic offline lock</em>). It can be omitted,
+ the default is optimistic behaviour.
+ You should only use pessimistic behaviour for complex usecases when the user
+ can't afford to lose all changes.
+ </p>
+
+<br>
+
+</li>
+
+
+<li>Element <span class="codefrag"><view></span> (optional)
+ <ul>
+
+<li>Attribute <span class="codefrag">template</span> (required)</li>
+
+<li>Attribute <span class="codefrag">menu = (true | false)</span> (optional)</li>
+
+</ul>
+
+<br>
+
+<p>
+ This element declares the view of the usecase. The <span class="codefrag">template</span> attribute
+ points to the JX template to use, relatively to the <span class="codefrag">lenya/usecases</span>
+ directory. The suffix <span class="codefrag">.jx</span> is added automatically. The attribute <span class="codefrag">menu</span>
+ determines if the menu should be visible. It can be omitted and defaults to <span class="codefrag">false</span>.
+ </p>
+
+<br>
+
+</li>
+
+</ul>
+</div>
+
+
+<a name="N10077"></a><a name="Extending+AbstractUsecase"></a>
+<h2 class="h3">Extending AbstractUsecase</h2>
+<div class="section">
+<p>
+ The following methods of the <span class="codefrag">AbstractUsecase</span> class are meant to be overridden:
+ </p>
+<ul>
+
+<li>
+
+<span class="codefrag">protected void initParameters()</span>
+
+<p>
+ This method is called to initialize the parameters of the usecase. For instance, if
+ your usecase shall display meta data on the view screen, <span class="codefrag">initParameters()</span>
+ reads the meta data from the document and puts them into the parameter map using
+ <span class="codefrag">setParameter(String, Object)</span> to make them available to the JX template.
+ </p>
+
+<br>
+
+</li>
+
+
+<li>
+
+<span class="codefrag">protected void doCheckPreconditions()</span>
+
+<p>
+ The method <span class="codefrag">checkPreconditions()</span> is a template method which calls this
+ method. For details on <span class="codefrag">checkPreconditions()</span>, see section
+ <a href="index.html">Overview</a>.
+ </p>
+
+<br>
+
+</li>
+
+
+<li>
+
+<span class="codefrag">protected void doCheckExecutionConditions()</span>
+
+<p>
+ The method <span class="codefrag">checkExecutionConditions()</span> is a template method which calls this
+ method. For details on <span class="codefrag">checkExecutionConditions()</span>, see section
+ <a href="index.html">Overview</a>.
+ </p>
+
+<br>
+
+</li>
+
+
+<li>
+
+<span class="codefrag">protected void doCheckPostconditions()</span>
+
+<p>
+ The method <span class="codefrag">checkPostonditions()</span> is a template method which calls this
+ method. For details on <span class="codefrag">checkPostonditions()</span>, see section
+ <a href="index.html">Overview</a>.
+ </p>
+
+<br>
+
+</li>
+
+
+<li>
+
+<span class="codefrag">protected void doExecute()</span>
+
+<p>
+ The method <span class="codefrag">execute()</span> is a template method which calls this
+ method. For details on <span class="codefrag">execute()</span>, see section
+ <a href="index.html">Overview</a>.
+ </p>
+
+<br>
+
+</li>
+
+
+<li>
+
+<span class="codefrag">public void advance()</span>
+
+<p>
+ For details on <span class="codefrag">advance()</span>, see section
+ <a href="index.html">Overview</a>.
+ </p>
+
+<br>
+
+</li>
+
+
+<li>
+
+<span class="codefrag">protected Transactionable[] getObjectsToLock()</span>
+
+<p>
+ This method is supposed to return all objects which should be locked before
+ the usecase is started. If the transaction policy is <em>pessimistic offline lock</em>,
+ these objects are checked out immediately.
+ </p>
+
+<br>
+
+</li>
+
+
+</ul>
+</div>
+
+
+</div>
+<!--+
+ |end content
+ +-->
+<div class="clearboth"> </div>
+</div>
+<div id="footer">
+<!--+
+ |start bottomstrip
+ +-->
+<div class="lastmodified">
+<script type="text/javascript"><!--
+document.write("Last Published: " + document.lastModified);
+// --></script>
+</div>
+<div class="copyright">
+ Copyright © 2002-2005 The Apache Software Foundation.</div>
+<div id="feedback">
+ Send feedback about the website to:
+ <a id="feedbackto" href="mailto:dev@lenya.apache.org?subject=Feedback%C2%A0for%C2%A01_4/reference/usecase-framework/abstractusecase.html">dev@lenya.apache.org</a>
+</div>
+<!--+
+ |end bottomstrip
+ +-->
+</div>
+</body>
+</html>
Propchange: lenya/site/1_4/reference/usecase-framework/abstractusecase.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lenya/site/1_4/reference/usecase-framework/abstractusecase.html
------------------------------------------------------------------------------
svn:mime-type = text/html
Added: lenya/site/1_4/reference/usecase-framework/abstractusecase.pdf
URL: http://svn.apache.org/viewcvs/lenya/site/1_4/reference/usecase-framework/abstractusecase.pdf?rev=164448&view=auto
==============================================================================
Binary file - no diff available.
Propchange: lenya/site/1_4/reference/usecase-framework/abstractusecase.pdf
------------------------------------------------------------------------------
svn:mime-type = application/pdf
Added: lenya/site/1_4/reference/usecase-framework/index.html
URL: http://svn.apache.org/viewcvs/lenya/site/1_4/reference/usecase-framework/index.html?rev=164448&view=auto
==============================================================================
--- lenya/site/1_4/reference/usecase-framework/index.html (added)
+++ lenya/site/1_4/reference/usecase-framework/index.html Sat Apr 23 22:30:06 2005
@@ -0,0 +1,624 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta content="Apache Forrest" name="Generator">
+<meta name="Forrest-version" content="0.6">
+<meta name="Forrest-skin-name" content="pelt">
+<title>The Usecase Framework</title>
+<link type="text/css" href="../../../skin/basic.css" rel="stylesheet">
+<link media="screen" type="text/css" href="../../../skin/screen.css" rel="stylesheet">
+<link media="print" type="text/css" href="../../../skin/print.css" rel="stylesheet">
+<link type="text/css" href="../../../skin/profile.css" rel="stylesheet">
+<script src="../../../skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="../../../skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="../../../skin/fontsize.js" language="javascript" type="text/javascript"></script>
+<link rel="shortcut icon" href="../../../favicon.ico">
+</head>
+<body onload="init()">
+<script type="text/javascript">ndeSetTextSize();</script>
+<div id="top">
+<!--+
+ |breadtrail
+ +-->
+<div class="breadtrail">
+<a href="http://www.apache.org/">apache</a> > <a href="http://lenya.apache.org/">lenya</a><script src="../../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
+</div>
+<!--+
+ |header
+ +-->
+<div class="header">
+<!--+
+ |start group logo
+ +-->
+<div class="grouplogo">
+<a href="http://lenya.apache.org"><img class="logoImage" alt="Lenya" src="../../../images/apache-lenya-light.png" title="
+ Apache Lenya is a Java-based Open-Source Content Management System.
+ It is based on open standards such as XML and XSLT.
+ One of its core components is Cocoon from the Apache Software Foundation.
+ "></a>
+</div>
+<!--+
+ |end group logo
+ +-->
+<!--+
+ |start Project Logo
+ +-->
+<div class="projectlogo">
+<a href=""></a>
+</div>
+<!--+
+ |end Project Logo
+ +-->
+<!--+
+ |start Search
+ +-->
+<div class="searchbox">
+<form action="http://www.google.com/search" method="get" class="roundtopsmall">
+<input value="lenya.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with :');" value="Search the site with :" size="25" name="q" id="query" type="text">
+ <input name="Search" value="Search" type="submit">
+</form>
+</div>
+<!--+
+ |end search
+ +-->
+<!--+
+ |start Tabs
+ +-->
+<ul id="tabs">
+<li>
+<a class="base-not-selected" href="../../../index.html">Project</a>
+</li>
+<li class="current">
+<a class="base-selected" href="../../../1_4/index.html">Version 1.4</a>
+</li>
+<li>
+<a class="base-not-selected" href="../../../1_2_x/index.html">Version 1.2</a>
+</li>
+<li>
+<a class="base-not-selected" href="../../../community/index.html">Community</a>
+</li>
+</ul>
+<!--+
+ |end Tabs
+ +-->
+</div>
+</div>
+<div id="main">
+<div id="publishedStrip">
+<!--+
+ |start Subtabs
+ +-->
+<div id="level2tabs"></div>
+<!--+
+ |end Endtabs
+ +-->
+<script type="text/javascript" language="JavaScript"><!--
+ document.write("Published: " + document.lastModified);
+ // --></script>
+</div>
+<!--+
+ |breadtrail
+ +-->
+<div class="breadtrail">
+
+
+ </div>
+<!--+
+ |start Menu, mainarea
+ +-->
+<!--+
+ |start Menu
+ +-->
+<div id="menu">
+<div onclick="SwitchMenu('menu_selected_1.1', '../../../skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('../../../skin/images/chapter_open.gif');">Version 1.4</div>
+<div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a title="" href="../../../1_4/index.html">Index</a>
+</div>
+<div onclick="SwitchMenu('menu_1.1.2', '../../../skin/')" id="menu_1.1.2Title" class="menutitle">Installation</div>
+<div id="menu_1.1.2" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../../1_4/installation/index.html">Download</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../../1_4/installation/subversion.html">Subversion Access</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../../1_4/installation/source_version.html">Install Instructions</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.3', '../../../skin/')" id="menu_1.1.3Title" class="menutitle">Concepts</div>
+<div id="menu_1.1.3" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../../1_4/concepts/wysiwyg.html">WYSIWYG</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_selected_1.1.4', '../../../skin/')" id="menu_selected_1.1.4Title" class="menutitle" style="background-image: url('../../../skin/images/chapter_open.gif');">Technical Reference</div>
+<div id="menu_selected_1.1.4" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a title="" href="../../../1_4/reference/lenya-sitemaps.html">Overview of Lenya Sitemaps</a>
+</div>
+<div onclick="SwitchMenu('menu_selected_1.1.4.2', '../../../skin/')" id="menu_selected_1.1.4.2Title" class="menutitle" style="background-image: url('../../../skin/images/chapter_open.gif');">Usecase Framework</div>
+<div id="menu_selected_1.1.4.2" class="selectedmenuitemgroup" style="display: block;">
+<div class="menupage">
+<div class="menupagetitle">Overview</div>
+<div class="menupageitemgroup">
+<div class="menupageitem">
+<a href="#Introduction">Introduction</a>
+</div>
+<div class="menupageitem">
+<a title="Directory Structure" href="#Directory+Structure">Directory Structure...</a>
+</div>
+<div class="menupageitem">
+<a href="#Architecture">Architecture</a>
+</div>
+<div class="menupageitem">
+<a title="The Contract Between Flowscript And Usecase Handler" href="#The+Contract+Between+Flowscript+And+Usecase+Handler">The Contract Betwee...</a>
+</div>
+<div class="menupageitem">
+<a title="Implementing a Custom Usecase" href="#Implementing+a+Custom+Usecase">Implementing a Cust...</a>
+</div>
+<div class="menupageitem">
+<a title="Overriding Core Usecases in Publications" href="#Overriding+Core+Usecases+in+Publications">Overriding Core Use...</a>
+</div>
+</div>
+</div>
+<div class="menuitem">
+<a title="" href="../../../1_4/reference/usecase-framework/abstractusecase.html">AbstractUsecase</a>
+</div>
+</div>
+<div class="menuitem">
+<a title="" href="../../../1_4/reference/publication-templating/index.html">Publication Templating</a>
+</div>
+</div>
+<div class="menuitem">
+<a title="" href="../../../../apidocs/1.4/index.html">1.4 API (Javadoc)</a>
+</div>
+</div>
+<div id="credit">
+<a href="http://forrest.apache.org/"><img border="0" title="Built with Apache Forrest" alt="Built with Apache Forrest - logo" src="../../../images/built-with-forrest-button.png" style="width: 88px;height: 31px;"></a>
+</div>
+<div id="roundbottom">
+<img style="display: none" class="corner" height="15" width="15" alt="" src="../../../skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
+<!--+
+ |alternative credits
+ +-->
+</div>
+<!--+
+ |end Menu
+ +-->
+<!--+
+ |start content
+ +-->
+<div id="content">
+<div id="skinconf-txtlink"></div>
+<div title="Portable Document Format" class="pdflink">
+<a class="dida" href="index.pdf"><img alt="PDF -icon" src="../../../skin/images/pdfdoc.gif" class="skin"><br>
+ PDF</a>
+</div>
+<h1>The Usecase Framework</h1>
+
+
+<a name="N1000D"></a><a name="Introduction"></a>
+<h2 class="h3">Introduction</h2>
+<div class="section">
+<p>A usecase in Lenya means a user triggered action. In most cases, a usecase is triggered by a CMS menu option on
+ a specific document of the publication. This document is the object of the usecases' action (such as edit, delete, publish, ...).</p>
+<p>There are usecases which are independent of a specific document, such as the <span class="codefrag">ac.logout</span> usecase. In that case it does
+ not matter on what document the usecase is triggered. The part of the request which specifies the document is simply ignored
+ by usecases that are document independent.</p>
+<p>The CMS menus trigger usecases by setting the <span class="codefrag">lenya.usecase</span> request parameter on the current document. If for example
+ the user selects the <em>Publish</em> option from the <em>Workflow</em> menu, a request will be triggered such as:
+
+<span class="codefrag">
+ GET http://www.server.com/lenya/default/authoring/tutorial.html?&lenya.usecase=publish
+</span>
+</p>
+<p>The Lenya <span class="codefrag">global-sitemap.xmap</span> will redirect requests with a <span class="codefrag">lenya.usecase</span> request parameter to the
+ <span class="codefrag">$LENYA_WEBAPP/lenya/usecase.xmap</span>
+ sub-sitemap. From version 1.4 on, the following pipeline in this sitemap is used to recognonize usecases which are implemented
+ in Java using the new 1.4 usecase framework:</p>
+<pre class="code">
+<map:pipeline>
+ <map:match type="registered-usecase">
+ <map:mount src="usecases/usecase.xmap" uri-prefix="" check-reload="yes" reload-method="synchron"/>
+ </map:match>
+</map:pipeline>
+</pre>
+<p>The <span class="codefrag">registered-usecase</span> matcher's default implementation
+ (<span class="codefrag">org.apache.lenya.cms.cocoon.matching.UsecaseRegistrationMatcher</span>) will use the Avalon
+ component resolver mechanism to resolve the name of the usecase to a an Avalon component. In case it cannot
+ resolve the usecase to an Avalon component, sitemap processing will continue and the usecase is treated in the
+ traditional way using the <span class="codefrag">usecase</span> and <span class="codefrag">step</span> matchers
+ (<span class="codefrag">org.apache.cocoon.matching.WildcardRequestParameterMatcher</span>). In order for this to work
+ correctly, there should be a <span class="codefrag">lenya.step</span> parameter in the request.</p>
+<p>If the usecase could be resolved successfully into an Avalon component, processing will continue in the
+ <span class="codefrag">$LENYA_WEBAPP/lenya/usecases/usecase.xmap</span> (as opposed to <span class="codefrag">$LENYA_WEBAPP/lenya/usecase.xmap</span>) with
+ the new JX and Java based 1.4 usecase framework.</p>
+<p>
+ The <em>usecase framework</em> in Lenya 1.4 is a simple framework to implement usecases using JX templates and Java.
+ This approach is an "85% solution". It enables the user to implement a big range of common usecases.
+ </p>
+<div class="frame note">
+<div class="label">Note</div>
+<div class="content">
+ Some special complex usecases might require a custom flowscript, in this case you can't use this framework.
+ </div>
+</div>
+</div>
+
+
+<a name="N10062"></a><a name="Directory+Structure"></a>
+<h2 class="h3">Directory Structure</h2>
+<div class="section">
+<a name="N10068"></a><a name="The+Lenya+Core"></a>
+<h3 class="h4">The Lenya Core</h3>
+<pre class="code">
+$LENYA_WEBAPP
+ /lenya/usecases usecase-related files
+ /usecase.xmap usecase dispatching sitemap
+ /usecases.js flowscript for usecase control flow
+ /admin Lenya admin usecases
+ /addUser.jx JX templates for usecase views
+ ... more Lenya core usecases
+</pre>
+<a name="N10073"></a><a name="Your+Publication"></a>
+<h3 class="h4">Your Publication</h3>
+<pre class="code">
+$PUB_HOME
+ /lenya/usecases usecase-related files
+ /editHeadline.jx JX templates for usecase views
+ /java/src/... usecase handler classes
+</pre>
+</div>
+
+
+
+<a name="N1007F"></a><a name="Architecture"></a>
+<h2 class="h3">Architecture</h2>
+<div class="section">
+<p>
+ A usecase request - denoted by the request parameter <span class="codefrag">lenya.usecase</span> - is dispatched by <span class="codefrag">$LENYA_WEBAPP/lenya/usecases/usecase.xmap</span>.
+ All usecases are handled by a single flowscript <span class="codefrag">$LENYA_WEBAPP/lenya/usecases/usecases.js</span>. This keeps javascript maintenance costs at a minimum.
+ </p>
+<p>
+ The flowscript <span class="codefrag">usecases.js</span> determines the usecase handler class using the <span class="codefrag">org.apache.lenya.cms.usecase.UsecaseResolver</span>.
+ All business code operations are delegated to the usecase handler class.
+ </p>
+<div style="text-align: center;">
+<img class="figure" alt="Usecase framework architecture" src="../../../images/live/usecase-framework-architecture.png"></div>
+</div>
+
+
+<a name="N1009F"></a><a name="The+Contract+Between+Flowscript+And+Usecase+Handler"></a>
+<h2 class="h3">The Contract Between Flowscript And Usecase Handler</h2>
+<div class="section">
+<p>
+ The usecase handler class has to implement the interface <span class="codefrag">org.apache.lenya.cms.usecase.Usecase</span>.
+ The methods of this interface are called in a certain order when the usecase is invoked:
+ </p>
+<ol>
+
+<li>
+<span class="codefrag">setSourceURL(String sourceUrl)</span>
+
+<br>
+
+<span class="codefrag">setName(String)</span>
+
+<p>Initialize the handler.</p>
+
+<br>
+
+</li>
+
+<li>
+<span class="codefrag">checkPreconditions()</span>
+
+<p>
+ This method is called to check the pre-conditions of the usecase. The pre-conditions
+ are checked before the usecase is started, i.e., before the first screen is presented
+ to the user. To denote that a condition does not comply, add an appropriate error message
+ using <span class="codefrag">addErrorMessage(String)</span>. If an error message was added, the usecase
+ is not started. Alternatively, you can provide information to the user using
+ <span class="codefrag">addInfoMessage(String)</span>. This doesn't prevent the usecase from being executed.
+ </p>
+
+<br>
+
+</li>
+
+<li>
+<span class="codefrag">lockInvolvedObjects()</span>
+
+<p>
+ This method is called to lock all objects which could be changed during the usecase.
+ </p>
+
+<br>
+
+</li>
+
+</ol>
+<p>
+ The following methods are called in a loop while the user interacts with the usecase,
+ until a request parameter with the name <span class="codefrag">submit</span> was sent.
+ </p>
+<ol>
+
+<li>
+<span class="codefrag">getView()</span>
+
+<p>
+ Requests the next view to be displayed. The view may be <span class="codefrag">null</span> if no
+ screen should be presented to the user.
+ </p>
+
+<br>
+
+</li>
+
+<li>
+<span class="codefrag">advance()</span>
+
+<p>
+ This method is called to advance the usecase after the a user interaction.
+ In contrast to <span class="codefrag">execute()</span>, this method is not called when the
+ <span class="codefrag"><input type="submit" name="submit"></span> was pressed, but for every
+ other submitting of the form. A typical usecase is the <em>multiple forms editor</em> where
+ <span class="codefrag">advance()</span> is used to update the document when the user switched to
+ another element.
+ </p>
+
+<br>
+
+</li>
+
+</ol>
+<p>
+ When the form is submitted using the <span class="codefrag"><input type="submit" name="submit"></span>
+ button, the usecase is finished:
+ </p>
+<ol>
+
+<li>
+<span class="codefrag">checkExecutionConditions()</span>
+
+<p>
+ This method is called before the usecase is actually executed. A typical example
+ is the validation of form data.
+ </p>
+
+<br>
+
+</li>
+
+<li>
+<span class="codefrag">execute()</span>
+
+<p>
+ This method actually executes the final step of the usecase.
+ </p>
+
+<br>
+
+</li>
+
+</ol>
+<p>
+ When the form is submitted using the <span class="codefrag"><input type="submit" name="cancel"></span>
+ button, the usecase is cancelled:
+ </p>
+<ol>
+
+<li>
+<span class="codefrag">cancel()</span>
+
+<p>
+ This method cancels the usecase. The transaction is rolled back.
+ </p>
+
+<br>
+
+</li>
+
+</ol>
+</div>
+
+
+<a name="N10134"></a><a name="Implementing+a+Custom+Usecase"></a>
+<h2 class="h3">Implementing a Custom Usecase</h2>
+<div class="section">
+<a name="N1013A"></a><a name="Prerequisites"></a>
+<h3 class="h4">Prerequisites</h3>
+<ol>
+
+<li>Choose a name to identify the usecase, e.g. editHeadline. It is possible to group usecases
+ using "." as delimiter, for instance <span class="codefrag">article.editHeadline</span>.
+ </li>
+
+</ol>
+<a name="N1014A"></a><a name="Add+a+Menu+Item"></a>
+<h3 class="h4">Add a Menu Item</h3>
+<div class="frame note">
+<div class="label">Note</div>
+<div class="content">
+ This step is necessary if you want to call the usecase from the Lenya menubar.
+ </div>
+</div>
+<ol>
+
+<li>Add the corresponding menu item:
+ <pre class="code"><item uc:usecase="article.editHeadline">Edit Headline</item></pre>
+
+</li>
+
+</ol>
+<a name="N1015E"></a><a name="Implement+the+Usecase+Handler+Class"></a>
+<h3 class="h4">Implement the Usecase Handler Class</h3>
+<ol>
+
+<li>Choose a name for your business logic class, e.g. <span class="codefrag">org.myproject.lenya.usecases.EditHeadline</span>.</li>
+
+<li>The class must implement the interface <span class="codefrag">org.apache.lenya.cms.usecase.Usecase</span>.</li>
+
+<li>
+ To simplify development, you can extend one of the following classes:
+ <ul>
+
+<li>
+<span class="codefrag">org.apache.lenya.cms.usecase.AbstractUsecase</span>
+</li>
+
+<li>
+<span class="codefrag">org.apache.lenya.cms.usecase.DocumentUsecase</span> (only for usecases invoked on document pages)</li>
+
+<li>
+<span class="codefrag">org.apache.lenya.cms.usecase.SiteUsecase</span>
+</li>
+
+</ul>
+ They have built-in support for the unit-of-work pattern (which will evolve into
+ an ACID transaction someday) as well as functionality specific to the area they are
+ supposed to be used with, e.g. the site area.
+ </li>
+
+<li>
+ Add the usecase handler class declaration to an XPatch file, e.g. <span class="codefrag">$PUB_HOME/config/usecases.xconf</span>:
+<pre class="code"><xconf xpath="/cocoon/usecases"
+ unless="/cocoon/usecases/component-instance[@name = 'article.editHeadline']">
+ <component-instance name="article.editHeadline"
+ logger="lenya.usecases.editHeadline"
+ class="org.myproject.lenya.usecases.EditHeadline"/>
+</xconf></pre>
+
+</li>
+
+</ol>
+<a name="N10191"></a><a name="Implement+the+View"></a>
+<h3 class="h4">Implement the View</h3>
+<p>
+ The view of a usecase is optional. If you omit the view declaration, no screen is presented
+ to the user. The view is declared in the usecase configuration:
+ </p>
+<pre class="code"> <component-instance ...>
+ <view template="article/editHeadline" menu="false">
+ <parameter name="title" value="Edit Headline"/>
+ <parameter name="..." value="..."/>
+ </view>
+ </component-instance></pre>
+<p>
+ The <span class="codefrag"><view></span> element takes an optional <span class="codefrag">menu</span> attribute
+ which denotes if the menubar should be visible when the usecase screen is presented.
+ If omitted, it defaults to <span class="codefrag">false</span>.
+ </p>
+<p>
+ The <span class="codefrag"><view></span> element can contain an arbitrary number of <span class="codefrag"><parameter></span>
+ elements, each containing a <span class="codefrag">name</span> and <span class="codefrag">value</span> attribute. These
+ parameters can be accessed in the JX template using
+ <span class="codefrag">${usecase.getView().getParameter('...')}</span>.
+ </p>
+<p>
+ The view for a usecase is implemented using a JX template. The location of the
+ JX template is defined using the <span class="codefrag"><view></span> element's <span class="codefrag">template</span>
+ attribute (relatively to the <span class="codefrag">usecases</span> directory, the suffix <span class="codefrag">.jx</span>
+ is appended). The output of the view has to be a Lenya page:
+ </p>
+<pre class="code"><page:page
+ xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
+ xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ >
+
+ <page:title>
+ <i18n:text><jx:out value="${usecase.getView().getParameter('title')}"/></i18n:text>
+ </page:title>
+ <page:body>
+
+ <form>
+ <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
+ <input type="hidden" name="lenya.usecase" value="${usecase.getName()}"/>
+
+ ...
+
+ </form>
+
+ </page:body>
+</page:page></pre>
+<p>
+ Take care of adding the hidden <span class="codefrag">lenya.usecase</span> and <span class="codefrag">lenya.continuation</span> fields as shown above.
+ </p>
+</div>
+
+
+<a name="N101DA"></a><a name="Overriding+Core+Usecases+in+Publications"></a>
+<h2 class="h3">Overriding Core Usecases in Publications</h2>
+<div class="section">
+<a name="N101E0"></a><a name="Overriding+Usecase+Handler+Classes"></a>
+<h3 class="h4">Overriding Usecase Handler Classes</h3>
+<p>
+ The usecase resolver, which is responsible for obtaining the handler class for a usecase,
+ looks first if the current publication overrides the core usecase handler.
+ This can be done by declaring a usecase called <span class="codefrag"><pub-id>/<usecase-name></span>,
+ for instance <span class="codefrag">mypub/admin.addUser</span>. To implement a core usecase using a custom
+ handler class, you need to
+ </p>
+<ol>
+
+<li>Implement the handler class and put it in <span class="codefrag">$PUB_HOME/java/src</span>.
+ In most cases, you will extend the core usecase handler class to inherit the basic functionality.</li>
+
+<li>
+ Declare it in an <em>xpatch</em> file, for instance <span class="codefrag">$PUB_HOME/config/usecases.xconf</span>:
+<pre class="code"><xconf xpath="/cocoon/usecases" unless="/cocoon/usecases/component-instance[@name = 'mypub/admin.addUser']">
+ <component-instance name="mypub/admin.addUser"
+ logger="lenya.usecases.editHeadline"
+ class="org.myproject.lenya.usecases.AddUser"/>
+</xconf></pre>
+
+</li>
+
+</ol>
+<p>
+ Now, when the usecase is invoked from inside the publication mypub, the custom
+ handler class will be used.
+ </p>
+<a name="N10209"></a><a name="Overriding+JX+Templates"></a>
+<h3 class="h4">Overriding JX Templates</h3>
+<p>
+ Overriding the JX template of a usecase follows the
+ <a href="../publication-templating/index.html">publication templating</a> principle.
+ You just have to put a JX template with the same name in <span class="codefrag">$PUB_HOME/lenya/usecases</span>,
+ for instance <span class="codefrag">$PUB_HOME/lenya/usecases/admin/addUser.jx</span>.
+ </p>
+</div>
+
+
+</div>
+<!--+
+ |end content
+ +-->
+<div class="clearboth"> </div>
+</div>
+<div id="footer">
+<!--+
+ |start bottomstrip
+ +-->
+<div class="lastmodified">
+<script type="text/javascript"><!--
+document.write("Last Published: " + document.lastModified);
+// --></script>
+</div>
+<div class="copyright">
+ Copyright © 2002-2005 The Apache Software Foundation.</div>
+<div id="logos"></div>
+<div id="feedback">
+ Send feedback about the website to:
+ <a id="feedbackto" href="mailto:dev@lenya.apache.org?subject=Feedback%C2%A0for%C2%A01_4/reference/usecase-framework/index.html">dev@lenya.apache.org</a>
+</div>
+<!--+
+ |end bottomstrip
+ +-->
+</div>
+</body>
+</html>
Propchange: lenya/site/1_4/reference/usecase-framework/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lenya/site/1_4/reference/usecase-framework/index.html
------------------------------------------------------------------------------
svn:mime-type = text/html
Added: lenya/site/1_4/reference/usecase-framework/index.pdf
URL: http://svn.apache.org/viewcvs/lenya/site/1_4/reference/usecase-framework/index.pdf?rev=164448&view=auto
==============================================================================
Binary file - no diff available.
Propchange: lenya/site/1_4/reference/usecase-framework/index.pdf
------------------------------------------------------------------------------
svn:mime-type = application/pdf
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org