org.openi.menu
Class MenuBuilder

java.lang.Object
  extended by org.openi.menu.MenuBuilder

public class MenuBuilder
extends java.lang.Object

Version:
$Revision: 1.8.6.2 $ $Date: 2007/01/24 14:18:21 $ 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, java.io.FileFilter fileFilter, ProjectContext ctx)
          [May-30-2006] - updated by dp to add filter support!!! Generates menu tree by recursing a list of directories.
 Menu build(java.lang.String baseDirName, java.util.List menuSubDirs, ProjectContext ctx)
           
static java.lang.String constructDisplayName(java.io.File file, ProjectContext ctx)
          Constructs display name for Directory/file
static java.lang.String constructDisplayName(java.lang.String filename, ProjectContext ctx)
          Overloaded to just take a string, parse out the directory name.
 
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,
                  java.io.FileFilter fileFilter,
                  ProjectContext ctx)
           throws java.io.IOException
[May-30-2006] - updated by dp to add filter support!!! 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?)

Parameters:
baseDirName -
menuSubDirs -
fileFilter - filter that applied to the file/folder. filter is not applied if it is null. Also not applied to the top level module folder(s)
Returns:
Menu tree structure
Throws:
java.io.IOException - for a bad base directory

build

public Menu build(java.lang.String baseDirName,
                  java.util.List menuSubDirs,
                  ProjectContext ctx)
           throws java.io.IOException
Returns:
Menu tree structure
Throws:
java.io.IOException - for a bad base directory

constructDisplayName

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

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

constructDisplayName

public static java.lang.String constructDisplayName(java.lang.String filename,
                                                    ProjectContext ctx)
                                             throws java.io.IOException
Overloaded to just take a string, parse out the directory name. Initial usage for constructing display names for missing analysis.

Parameters:
filename -
Returns:
Throws:
java.io.IOException