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

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: thorsten
Date: Thu Aug 23 02:11:45 2007
New Revision: 568899

URL: http://svn.apache.org/viewvc?rev=568899&view=rev
Log:
Adding some documentation about the properties module

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

Modified: lenya/docu/src/documentation/content/xdocs/docs/modules/properties/index.xml
URL: http://svn.apache.org/viewvc/lenya/docu/src/documentation/content/xdocs/docs/modules/properties/index.xml?rev=568899&r1=568898&r2=568899&view=diff
==============================================================================
--- lenya/docu/src/documentation/content/xdocs/docs/modules/properties/index.xml (original)
+++ lenya/docu/src/documentation/content/xdocs/docs/modules/properties/index.xml Thu Aug 23 02:11:45 2007
@@ -28,9 +28,55 @@
       <title>Introduction</title>
       <p>
         The <code>properties</code> module provides a service to configure
-        publications using properties.
+        publications using properties. The idea is to have a fallback of properties.
       </p>
     </section>
-    
+    <section>
+      <title>Order of precedence</title>
+      <note>The first values set get precedence, as in AntProperties</note>
+      <ol>
+        <li>Publication (lazy loaded in loadPublicationPropertiesIfNotDone()) </li>
+        <li>Lenya local</li>
+        <li>Modules (all modules, not only the ones referenced in the publication)</li>
+        <li>Lenya</li>
+      </ol>
+    </section>
+    <section>
+      <title>Locations</title>
+      <ol>
+        <li>{pubDir}/lenya.properties.xml</li>
+        <li>$LENYA_HOME/src/webapp/local.lenya.properties.xml</li>
+        <li>{module}/lenya.properties.xml</li>
+        <li>$LENYA_HOME/src/webapp/lenya.properties.xml</li>
+      </ol>
+    </section>
+    <section>
+      <title>Usage</title>
+      <section>
+        <title>sitemap.xmap</title>
+        <p>Since the properties module is a cocoon input module, you can use it as any other
+          input module.</p>
+        <source><![CDATA[...
+<map:transform src="cocoon:/getDoctypeXSLT/{4}">
+  <map:parameter name="author" value="{properties:pubs.default.author}"/>
+  ...
+</map:transform>]]>
+        </source>
+      </section>
+      <section>
+        <title>java</title>
+        <p>In your custom cocoon components use like follows.</p>
+        <source> InputModule inputModule = null;
+ ServiceSelector selector = null;
+ String propKey = "pubs.default.author";
+   try {
+     selector = (ServiceSelector) m_manager.lookup(InputModule.ROLE + "Selector");
+     inputModule = (InputModule) selector.select("properties");   
+     String propValue = (String) inputModule.getAttribute(propKey, null,
+                    objectModel)
+...
+        </source>
+      </section>
+    </section>
   </body>
 </document>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.