org.openi.menu
Class MenuBuilder

java.lang.Object
  extended byorg.openi.menu.MenuBuilder

public class MenuBuilder
extends java.lang.Object

Version:
$Revision: 1.3 $ $Date: 2005/07/26 07:34:30 $ Generates menu tree by recursing a list of directories. It is the responsibility of the caller to properly pass in the list of directories. MenuBuilder does not do this, it only builds menu's. Web layer should not make calls to this class.
Author:
plucas

Constructor Summary
MenuBuilder()
           
 
Method Summary
 Menu build(java.lang.String baseDirName, java.util.List menuSubDirs)
          Generates menu tree by recursing a list of directories.
static java.lang.String constructDisplayName(java.io.File file)
          Constructs display name for Directory/file
 java.lang.String getAnalysisJspName()
           
 java.lang.String getProjectContentJspName()
           
 void setAnalysisJspName(java.lang.String analysisJspName)
           
 void setProjectContentJspName(java.lang.String projectContentJspName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuBuilder

public MenuBuilder()
Method Detail

build

public Menu build(java.lang.String baseDirName,
                  java.util.List menuSubDirs)
           throws java.io.IOException
Generates menu tree by recursing a list of directories. It is the responsibility of the caller to properly pass in the list of directories. This list of directories is relative to the baseDirName. The baseDirName and the relative subDirName are needed to create the url. When the menu is generated, the top level directories will remain in the list order. All subdirectories will be in the order they are found in the file system. (TODO: configure order? Pass in a sorter param?)

Returns:
Menu tree structure
Throws:
java.io.IOException - for a bad base directory

constructDisplayName

public static java.lang.String constructDisplayName(java.io.File file)
                                             throws java.io.IOException
Constructs display name for Directory/file

Parameters:
file - File
Returns:
String
Throws:
java.io.IOException

getAnalysisJspName

public java.lang.String getAnalysisJspName()
Returns:
Returns the analysisJspName.

getProjectContentJspName

public java.lang.String getProjectContentJspName()

setAnalysisJspName

public void setAnalysisJspName(java.lang.String analysisJspName)
Parameters:
analysisJspName - The analysisJspName to set.

setProjectContentJspName

public void setProjectContentJspName(java.lang.String projectContentJspName)