Author: thorsten
Date: Tue May 6 04:28:53 2008
New Revision: 653747
URL: http://svn.apache.org/viewvc?rev=653747&view=rev
Log:
Adding javadoc.
Modified:
forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java
forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/ResourceTypeAction.java
Modified:
forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java
URL:
http://svn.apache.org/viewvc/forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java?rev=653747&r1=653746&r2=653747&view=diff
==============================================================================
---
forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java
(original)
+++
forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java
Tue May 6 04:28:53 2008
@@ -32,35 +32,32 @@
import org.apache.excalibur.source.SourceResolver;
/**
- * 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 {
Modified:
forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/ResourceTypeAction.java
URL:
http://svn.apache.org/viewvc/forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/ResourceTypeAction.java?rev=653747&r1=653746&r2=653747&view=diff
==============================================================================
---
forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/ResourceTypeAction.java
(original)
+++
forrest/trunk/whiteboard/cocoon-2.2-blocks/dispatcher/src/main/java/org/apache/forrest/dispatcher/acting/ResourceTypeAction.java
Tue May 6 04:28:53 2008
@@ -17,22 +17,23 @@
package org.apache.forrest.dispatcher.acting;
/**
* Looks up a meta data file to determine which resource type should be
returned.
- */
-/**
- * component declaration (lm and sitemap)
+ * Will parse the document and looks for the {$resourceTypeElement}.
+ * If found the action returns {$resourceTypeBase}{$resourceTypeElement}.
+ * <p>
+ * component declaration (lm and sitemap):<br>
* <action name="resourceTypeAction"
* src="org.apache.forrest.dispatcher.acting.ResourceTypeAction"/>
- *
- *pipline usage lm
-* <act type="resourceTypeAction">
-* <parameter value="{1}" name="request"/>
-* <parameter value="{project:content.xdocs}" name="projectDir"/>
-* <parameter value="lm://dispatcher.structurer.resourceType."
name="resourceTypeBase"/>
-* <parameter value=".xml.meta" name="metaExtension"/>
-* <parameter value="resourceType" name="resourceTypeElement"/>
-* <parameter value="http://apache.org/cocoon/lenya/page-envelope/1.0"
name="resourceTypeElementNS"/>
-* <!-- Meta data based -->
-* <location src="{uri}" />
+ *<p>
+ *pipline usage lm<br>
+* <act type="resourceTypeAction"><br>
+* <parameter value="{1}" name="request"/><br>
+* <parameter value="{project:content.xdocs}" name="projectDir"/><br>
+* <parameter value="lm://dispatcher.structurer.resourceType."
name="resourceTypeBase"/><br>
+* <parameter value=".xml.meta" name="metaExtension"/><br>
+* <parameter value="resourceType" name="resourceTypeElement"/><br>
+* <parameter value="http://apache.org/cocoon/lenya/page-envelope/1.0"
name="resourceTypeElementNS"/><br>
+* <!-- Meta data based --><br>
+* <location src="{uri}" /><br>
* </act>
*/
import java.io.IOException;