You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/05/29 09:27:49 UTC

svn commit: r542443 - /lenya/docu/src/documentation/content/xdocs/docs/modules/sitetree/index.xml

Author: andreas
Date: Tue May 29 00:27:48 2007
New Revision: 542443

URL: http://svn.apache.org/viewvc?view=rev&rev=542443
Log:
Added docs about navigation widgets to sitetree module docs

Modified:
    lenya/docu/src/documentation/content/xdocs/docs/modules/sitetree/index.xml

Modified: lenya/docu/src/documentation/content/xdocs/docs/modules/sitetree/index.xml
URL: http://svn.apache.org/viewvc/lenya/docu/src/documentation/content/xdocs/docs/modules/sitetree/index.xml?view=diff&rev=542443&r1=542442&r2=542443
==============================================================================
--- lenya/docu/src/documentation/content/xdocs/docs/modules/sitetree/index.xml (original)
+++ lenya/docu/src/documentation/content/xdocs/docs/modules/sitetree/index.xml Tue May 29 00:27:48 2007
@@ -30,5 +30,145 @@
         The <code>sitetree</code> module provides a tree-based site manager.
       </p>
     </section>
+    
+    <section>
+      <title>Generating Navigation Elements</title>
+      <p>
+        One purpose of the sitetree module is to simplify and standardize the generation of navigation
+        widgets like menubars, tabs, and breadcrumb paths. It allows to
+      </p>
+      <ul>
+        <li>
+          use pre-defined XHTML navigation components and present them
+          with a custom CSS,
+        </li>
+        <li>
+          override these components in a publication whereby the logic
+          can be reused, and
+        </li>
+        <li>
+          create and integrate new publication-specific navigation components
+          using the same scheme.
+        </li>
+      </ul>
+    </section>
+    
+    <section>
+      <title>Architecture</title>
+      
+      <p>
+        The navigation element mechanism consists of the following components:
+      </p>
+      
+      <dl>
+        <dt><code>modules/sitetree/sitemap.xmap</code></dt>
+        <dd>The sitemap where the navigation components are generated.<br/><br/></dd>
+        <dt><code>modules/sitetree/xslt/navigation/*.xsl</code></dt>
+        <dd>The default navigation components that are shipped with the sitetree module.<br/><br/></dd>
+        <dt><code>{your-publication}/lenya/modules/sitetree/xslt/navigation/*.xsl</code></dt>
+        <dd>Custom navigation components of the publication.<br/><br/></dd>
+      </dl>
+      
+    </section>
+    
+    <section>
+      <title>Loading a Navigation Widget</title>
+      
+      <p>
+        You can load a navigation widget from the following URI:
+      </p>
+      <source><![CDATA[cocoon://modules/sitetree/{widget}/{pub-id}/{area}/{default-lang}/{lang}{path}.xml]]></source>
+      
+      <p>
+        The URI steps are:
+      </p>
+      <dl>
+        <dt><code>&lt;widget&gt;</code></dt>
+        <dd>
+          The type of navigation widget to load (tabs, menu, etc.).
+          This will be the name of the XSLT which generates the widget.
+        </dd>
+        <dt><code>&lt;pub-id&gt;</code></dt>
+        <dd>
+          The publicaton ID of the current documen.
+        </dd>
+        <dt><code>&lt;area&gt;</code></dt>
+        <dd>
+          The area of the current document.
+        </dd>
+        <dt><code>&lt;default-lang&gt;</code></dt>
+        <dd>
+          The default language of the publication. We pass this value instead of determining
+          it in the module sitemap so that the generated widget doesn't contain any dynamics
+          which are not coded in the URL and therefore can be cached in the publication. 
+        </dd>
+        <dt><code>&lt;lang&gt;</code></dt>
+        <dd>
+          The language of the document.
+        </dd>
+        <dt><code>&lt;path&gt;</code></dt>
+        <dd>
+          The path of the current document in the site structure, starting with a slash.
+        </dd>
+      </dl>
+      <p>
+        Here's an example navigation widget URL:
+      </p>
+      <source><![CDATA[cocoon://modules/sitetree/tabs/mypub/authoring/en/de/foo/bar.xml]]></source>
+      
+    </section>
+      
+      <section><title>Aggregating the Navigation Widgets</title>
+        
+        <p>
+          In the publication sitemap (<code>{pub-id}/sitemap.xmap</code>)
+          the navigation widgets are aggregated. Here you decide which components
+          you want to use:
+        </p>
+        <source><![CDATA[<!-- navigation/{1:widget}/{2:pub-id}/{3:area}/{4:def-lang}/{5:lang}/{6:path} -->
+<map:match pattern="navigation-element/*/*/*/*/*/**">
+  <map:generate src="cocoon://modules/sitetree/{1}/{2}/{3}/{4}/{5}/{6}.xml"/>
+  <map:serialize type="xml"/>
+</map:match>
+
+<!-- /lenyabody-{1:rendertype}/{2:pub-id}/{3:area}/{4:doctype}/{5:def-lang}/{6:lang}/{7:path} -->
+<map:match pattern="lenyabody-raw-*/*/*/*/*/*/**">
+  <map:aggregate element="cmsbody">
+    <map:part src="cocoon:/navigation-element/breadcrumb/{2}/{3}/{5}/{6}/{7}"/>
+    <map:part src="cocoon:/navigation-element/tabs/{2}/{3}/{5}/{6}/{7}"/>
+    <map:part src="cocoon:/navigation-element/menu/{2}/{3}/{5}/{6}/{7}"/>
+    <map:part src="cocoon:/navigation-element/search/{2}/{3}/{5}/{6}/{7}"/>
+    ...
+    <map:part src="{resource-type:format-xhtml}?rendertype={1}"/>
+  </map:aggregate>
+  <map:serialize type="xml"/>
+</map:match>]]></source>
+        
+      </section>
+      
+    <section>
+      <title>Developing Navigation Widgets</title>
+      
+      <p>
+        The following contracts define the development of navigation components:
+      </p>
+      <ul>
+        <li>A navigation widget is generated by an XSLT stylesheet which is located at<br/><br/>
+          <dl>
+            <dt><code>modules/sitetree/xslt/navigation/{widget}.xsl</code></dt>
+            <dd>for default components and<br/><br/></dd>
+            <dt><code>lenya/pubs/&lt;publication-id&gt;/lenya/modules/sitetree/xslt/navigation/{widget}.xsl</code></dt>
+            <dd>for publication-specific components, including the ones that override
+            the default components.<br/><br/></dd>
+          </dl>
+        </li>
+        <li>
+          The default widgets produce an XHTML fragment with the
+          top level element <![CDATA[<div class="{widget}"/>]]>.
+        </li>
+      </ul>
+      
+    </section>
+    
   </body>
 </document>



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