forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r687694 - /forrest/branches/update_cocoon_2.1.12-dev/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java
Date Thu, 21 Aug 2008 10:27:53 GMT
Author: thorsten
Date: Thu Aug 21 03:27:47 2008
New Revision: 687694

URL: http://svn.apache.org/viewvc?rev=687694&view=rev
Log:
Adding more docu

Modified:
    forrest/branches/update_cocoon_2.1.12-dev/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java

Modified: forrest/branches/update_cocoon_2.1.12-dev/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java
URL: http://svn.apache.org/viewvc/forrest/branches/update_cocoon_2.1.12-dev/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java?rev=687694&r1=687693&r2=687694&view=diff
==============================================================================
--- forrest/branches/update_cocoon_2.1.12-dev/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java
(original)
+++ forrest/branches/update_cocoon_2.1.12-dev/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java
Thu Aug 21 03:27:47 2008
@@ -33,35 +33,32 @@
 import org.apache.forrest.dispatcher.DispatcherException;
 
 /**
- * Selects the first of a set of Sources that exists in the context.
+ * Calculates which location to return for a given directory.
+ * Here we are traversing the tree till we reach its root. 
  * <p>
- * For example, we could define a SourceExistsSelector with:
- * 
- * <pre>
- * 
- *  &lt;map:selector name=&quot;exists&quot;
- *                logger=&quot;sitemap.selector.source-exists&quot;
- *                src=&quot;org.apache.cocoon.selection.SourceExistsSelector&quot;
/&gt;
- *  
- * </pre>
- * 
- * And use it to build a PDF from XSL:FO or a higher-level XML format with:
- * 
- * <pre>
+ * We are looking first in the request string and then using a 
+ * fallback algorithm to find alternative fallbacks.
+ * <p> 
+ * e.g. the request is "sample/index". First choice is to find: 
+ * {$projectDir}sample/index{$projectExtension}<br>
+ * If the file does not exist we will try with the fallback file
+ * {$projectDir}sample/{$projectFallback}{$projectExtension}<br>
+ * The last file we will try in our example is 
+ * {$projectDir}{$projectFallback}{$projectExtension}.<br>
+ * With this we have reached the root directory and we cannot find the
+ * requested file the action will return null.
+ * <p>
+ * &lt;map:act type="RecursiveDirectoryTraversalAction"&gt;<br>
+ *   &lt;map:parameter value="{../1}{1}" name="request"/&gt;<br>
+ *   &lt;map:parameter value="{properties:dispatcher.theme}" name="projectFallback"/&gt;<br>
+ *   &lt;map:parameter value="{properties:dispatcher.theme-ext}" 
+ *                     name="projectExtension"/&gt;<br>
+ *   &lt;map:parameter value="{properties:resources}structurer/url/" 
+ *                     name="projectDir"/&gt;<br>
+ * &lt;!--  url project-based theme-based = directory-based / parent-directory based
(recursively) --&gt;<br>
+ *         &lt;map:location src="{uri}" /&gt;<br>
+ *  &lt;/map:act&gt;
  * 
- *   &lt;map:match pattern=&quot;**.pdf&quot;&gt;
- *     &lt;map:select type=&quot;exists&quot;&gt;
- *        &lt;map:when test=&quot;context/xdocs/{1}.fo&quot;&gt;
- *           &lt;map:generate src=&quot;content/xdocs/{1}.fo&quot; /&gt;
- *        &lt;/map:when&gt;
- *        &lt;map:otherwise&gt;
- *          &lt;map:generate src=&quot;content/xdocs/{1}.xml&quot; /&gt;
- *          &lt;map:transform src=&quot;stylesheets/document2fo.xsl&quot; /&gt;
- *        &lt;/map:otherwise&gt;
- *     &lt;/map:select&gt;
- *     &lt;map:serialize type=&quot;fo2pdf&quot; /&gt;
- *  
- * </pre>
  */
 public class RecursiveDirectoryTraversalAction extends ServiceableAction
         implements ThreadSafe, Serviceable {



Mime
View raw message