org.mmbase.bridge.jsp.taglib.pageflow
Class TreeHelper

java.lang.Object
  extended by org.mmbase.bridge.jsp.taglib.pageflow.TreeHelper

public class TreeHelper
extends Object

This helper-class has all Tree- and Leaf-related functionality. The algorithms that find the page to include in the directory structure are implemented here. The 'TreeInclude', 'LeafInclude', 'TreeFile' and 'LeafFile' all use this helper class. See their documentation for more information about the algorithms.

Version:
$Id: TreeHelper.java 35335 2009-05-21 08:14:41Z michiel $
Author:
Johannes Verelst, Rob Vermeulen (VPRO)
To Do:
MM: This class is not actually related to Taglib. I propose to move it to org.mmbase.util, or org.mmbase.bridge.util

Constructor Summary
TreeHelper()
           
 
Method Summary
 void doFinally()
           
protected  String findLeafFile(String includePage, String objectlist, HttpSession session)
          Method to find the file to 'LeafInclude' given a list of objectnumbers
 String findTreeFile(String includePage, String objectlist, HttpSession session)
          Method to find the file to 'TreeInclude' given a list of objectnumbers
protected  String getLeafFile(String prefix, String objectlist, String includePage, boolean maySmartpath, HttpSession session)
          Return the path to the include file.
 void setBackwardsCompatible(boolean b)
           
 void setCloud(Cloud cl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeHelper

public TreeHelper()
Method Detail

setCloud

public void setCloud(Cloud cl)

setBackwardsCompatible

public void setBackwardsCompatible(boolean b)

findLeafFile

protected String findLeafFile(String includePage,
                              String objectlist,
                              HttpSession session)
                       throws JspTagException,
                              IOException
Method to find the file to 'LeafInclude' given a list of objectnumbers

Parameters:
includePage - The page to include (relative path, may include URL parameters)
objectlist - The list of objectnumbers (comma-seperated) that is used to find the correct file to include
session - The session context can contain version information (used in getVerion).
Throws:
JspTagException
IOException

getLeafFile

protected String getLeafFile(String prefix,
                             String objectlist,
                             String includePage,
                             boolean maySmartpath,
                             HttpSession session)
                      throws JspTagException,
                             IOException
Return the path to the include file. This path will start with the given prefix, appended by data calculated using the objectlist. If mayStartpath is true, then smartpath() will be called on objects in the objectlist, otherwise only their buildernames will be used.

Parameters:
includePage - The page to include (relative path, may include URL parameters)
objectlist - The list of objectnumbers (comma-seperated) that is used to find the correct file to include
session - The session context can contain version information (used in getVerion).
maySmartpath - Boolean indicating whether or not getLeafFile may call a 'getSmartpath' on the given objects
prefix - The path that was already established by previous calls to getLeafFile, deeper in the recursion tree.
Throws:
JspTagException
IOException

findTreeFile

public String findTreeFile(String includePage,
                           String objectlist,
                           HttpSession session)
                    throws JspTagException,
                           IOException
Method to find the file to 'TreeInclude' given a list of objectnumbers

Parameters:
includePage - The page to include (relative path, may include URL parameters)
objectlist - The list of objectnumbers (comma-seperated) that is used to find the correct file to include
session - The session context can contain version information (used in getVerion). TODO: add support for 'intermediate paths' as LeafInclude has.
Throws:
JspTagException
IOException

doFinally

public void doFinally()


MMBase 2.0-SNAPSHOT - null