forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r603570 - in /forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/resources/COB-INF/demo: welcome.xml welcome.xslt
Date Wed, 12 Dec 2007 11:28:08 GMT
Author: thorsten
Date: Wed Dec 12 03:28:06 2007
New Revision: 603570

Adding basic instructions how to use the block and what the dispatcher is.


Modified: forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/resources/COB-INF/demo/welcome.xml
--- forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/resources/COB-INF/demo/welcome.xml
+++ forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/resources/COB-INF/demo/welcome.xml
Wed Dec 12 03:28:06 2007
@@ -7,7 +7,7 @@
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,92 @@
   limitations under the License.
-  <h1>Apache Cocoon: Welcome</h1>
-  <p>This block <strong>org.apache.forrest:dispatcher</strong> was created
by the Cocoon block archetype.</p>
+  <h1>Apache Forrest Dispatcher: Welcome</h1>
+  <p>This block
+    <strong>org.apache.forrest:dispatcher</strong> was created by the Cocoon
+    archetype.</p>
-  <p><a href="spring-bean">Link</a> to the output of a simple Flowscript
that accesses a Spring bean.</p>
+  <h2>About the dispatcher</h2>
+  <p>This block provides the basic infrastructure to work with the dispatcher which
has been
+    ported from Apache Forrest.</p>
+  <p>The aim of the "dispatcher" concept is to provide a flexible framework for creating
+    and page specific layout in different formats from different content through an advanced
+    seperation of concerns. </p>
+  <p> The dispatcher is a filter that limits the data-model to a minimum by only requesting
+    the structurer (e.g. common-html.panel.xml) need. This leads to a different URL
+    handling focus - away from document centric. A document can (but does not have to) be
+    a certain URL. Like said a structurer can request any given data as input not only a
+    and the core contracts (like navigation). It may be the main enhancement in comparison
+    skins (classical aggregation approach) that this concept lets you easily extend the
+    default data models provided by forrest/cocoon. </p>
+  <p> Since the dispatcher has implemented a fallback concept it makes maintenance
of custom
+    themes which are based on the dispatcher core components very easy and less time consuming.
+    principal is to override or extend only certain parts (contracts) of the core. This is
+    based on the observation that normally only a small percentage of core skin contracts
+    been changed.</p>
+  <h2>How to install the dispatcher in your project?</h2>
+  <!--<p>Since the dispatcher is not yet official part of cocoon, you need to install
+    the patch from <a href="">COCOON-2145</a></p>
+  <p>On Linux you apply the patch, once donwloaded into the parent cocoon directory,
executing:<pre>patch -p0 &lt; COCOON-2145.patch</pre></p>-->
+  <p>1.) The dispatcher has some dependencies to other forrest components
+    (propertiesGenerator and locationmap). You will need to install this two blocks as well.
Define in your pom.xml:<pre>
+  <groupId>org.apache.forrest</groupId>
+  <artifactId>dispatcher</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <groupId>org.apache.forrest</groupId>
+  <artifactId>locationmap</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <groupId>org.apache.forrest</groupId>
+  <artifactId>propertiesGenerator</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <p>2.) In your applicationContext.xml (spring configuration) add the following to
+    <em>org.apache.cocoon.sitemap.SitemapServlet</em> configuration block:</p>
+  <pre><![CDATA[<servlet:connections>
+  <entry key="propertiesGenerator" value-ref="org.apache.forrest.propertiesGenerator.block"/>
+  <entry key="dispatcher" value-ref="org.apache.forrest.dispatcher.block"/>
+  <p>3.) Create a file called locationmap.xml in the same directory where your sitemap.xmap
resist and paste the following into this file:</p>
+  <pre><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<locationmap xmlns="">
+  <components>
+    <matchers default="lm">
+      <matcher 
+        name="lm" 
+        src="org.apache.forrest.locationmap.WildcardLocationMapHintMatcher"/>
+    </matchers>
+    <selectors default="exists">
+      <selector name="exists" logger="sitemap.selector.exists"  
+                    src="org.apache.forrest.sourceexists.SourceExistsSelector" />
+    </selectors>
+  </components>
+  <locator>
+<!-- ================================== -->
+<!-- Project specific matches           -->
+<!-- ================================== -->
+    <match pattern="project.themer">
+      <location src="context://themer"/>
+    </match>
+<!-- ================================== -->
+<!-- Mount dispatcher specific locationmap -->
+<!-- project files                      -->
+<!-- ================================== -->
+    <select>
+      <mount src="{block-filepath:dispatcher/}/locationmap.xml"/>
+    </select>
+  </locator>
+  <p>4.) Finally in your webapp sitemap.xmap add a mount to the dispatcher like:</p>
+  <pre><![CDATA[<map:mount src="blockcontext:/dispatcher/sitemap.xmap"  uri-prefix=""/>]]></pre>
+  <p>Further you need to implement the match for the loctionmap that we created in
step 3:</p>
+  <pre><![CDATA[<map:match pattern="locationmap.xml">
+  <map:generate src="locationmap.xml"/>
+  <map:serialize type="xhtml"/>

Modified: forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/resources/COB-INF/demo/welcome.xslt
--- forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/resources/COB-INF/demo/welcome.xslt
+++ forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/resources/COB-INF/demo/welcome.xslt
Wed Dec 12 03:28:06 2007
@@ -20,7 +20,7 @@
   <xsl:template match="/">
-        <title>Apache Cocoon: Welcome!</title>
+        <title>Apache Forrest Dispatcher Block: Welcome!</title>
         <xsl:copy-of select="content/*"/>

View raw message