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> - * - * <map:selector name="exists" - * logger="sitemap.selector.source-exists" - * src="org.apache.cocoon.selection.SourceExistsSelector" /> - * - * </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> + * <map:act type="RecursiveDirectoryTraversalAction"><br> + * <map:parameter value="{../1}{1}" name="request"/><br> + * <map:parameter value="{properties:dispatcher.theme}" name="projectFallback"/><br> + * <map:parameter value="{properties:dispatcher.theme-ext}" + * name="projectExtension"/><br> + * <map:parameter value="{properties:resources}structurer/url/" + * name="projectDir"/><br> + * <!-- url project-based theme-based = directory-based / parent-directory based (recursively) --><br> + * <map:location src="{uri}" /><br> + * </map:act> * - * <map:match pattern="**.pdf"> - * <map:select type="exists"> - * <map:when test="context/xdocs/{1}.fo"> - * <map:generate src="content/xdocs/{1}.fo" /> - * </map:when> - * <map:otherwise> - * <map:generate src="content/xdocs/{1}.xml" /> - * <map:transform src="stylesheets/document2fo.xsl" /> - * </map:otherwise> - * </map:select> - * <map:serialize type="fo2pdf" /> - * - * </pre> */ public class RecursiveDirectoryTraversalAction extends ServiceableAction implements ThreadSafe, Serviceable {