za.org.coefficient.modules.category
Class CategoryBrowse

java.lang.Object
  extended by za.org.coefficient.modules.BaseModule
      extended by za.org.coefficient.modules.category.CategoryBrowse
All Implemented Interfaces:
CoefficientEventPublisher, ModuleLocal

public class CategoryBrowse
extends BaseModule

Author:
Laurie Butgerite

Field Summary
 java.lang.String ACTION
           
 java.lang.String ALL
           
 java.lang.String BROWSE
           
 java.lang.String BROWSEPAGE
           
 java.lang.String CATDISP
           
 java.lang.String CATEGORY
           
 java.lang.String CATEGORY_BROWSE_PAGER
           
 java.lang.String CATEGORY_ID
           
 java.lang.String CHILDID
           
 java.lang.String CLOSE
           
 java.lang.String DESCRIPTION
           
 java.lang.String ERROR
           
 java.lang.String ID
           
 java.lang.String LIST
           
 java.lang.String MODULE
           
 java.lang.String MSG
           
 java.lang.String NAME
           
 java.lang.String NEXT
           
 java.lang.String OP
           
 java.lang.String OPEN
           
 java.lang.String PAGE
           
 java.lang.String PAGER
           
 java.lang.String PARENT
           
 java.lang.String PATH
           
 java.lang.String PREVIOUS
           
 java.lang.String PROJECTS
           
 java.lang.String ROOT
           
 java.lang.String SESSION_ID
           
 
Constructor Summary
CategoryBrowse()
           
 
Method Summary
private  int anyProjectsCount(Category cat)
          return the count of projects with this category
 java.lang.String canExecuteForRole(CoefficientContext ctx, java.lang.String methodName, Role usersHighestRole)
          This is a base implementation that will allow all methods to be invoked without regard to roles
private  void closeCategory(CoefficientContext ctx)
           
private  Category getCategory(java.lang.String id)
           
 java.lang.String getMainMethod()
          This method is used to determine which method should be invoked when the module is requested without an operation.
 java.lang.String getModuleDescription()
          This method is used to find the description of the module
 java.lang.String getModuleDisplayName()
          This method is used to find the display name of the module
private  Category getRoot()
          see if the root category is there and if it isn't create it
private  java.util.List getSubCategories(java.lang.String id)
           
private  java.util.List getSubCategoriesForDisplay(java.lang.String id, java.util.List openList)
           
 void interpretOp(CoefficientContext ctx)
           
private  void listProjects(CoefficientContext ctx)
           
private  void openCategory(CoefficientContext ctx, java.lang.String msg)
           
private  CoefficientContext viewCategoryTree(CoefficientContext ctx, java.lang.String msg)
           
 
Methods inherited from class za.org.coefficient.modules.BaseModule
createRSSItem, displayUsersData, getCoefficientContext, getModuleName, isProjectRequired, publishEvent, setCoefficientContext, showHelp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION

public final java.lang.String ACTION
See Also:
Constant Field Values

ALL

public final java.lang.String ALL
See Also:
Constant Field Values

BROWSE

public final java.lang.String BROWSE
See Also:
Constant Field Values

BROWSEPAGE

public final java.lang.String BROWSEPAGE
See Also:
Constant Field Values

CATDISP

public final java.lang.String CATDISP
See Also:
Constant Field Values

CATEGORY

public final java.lang.String CATEGORY
See Also:
Constant Field Values

CATEGORY_BROWSE_PAGER

public final java.lang.String CATEGORY_BROWSE_PAGER
See Also:
Constant Field Values

CATEGORY_ID

public final java.lang.String CATEGORY_ID
See Also:
Constant Field Values

CHILDID

public final java.lang.String CHILDID
See Also:
Constant Field Values

CLOSE

public final java.lang.String CLOSE
See Also:
Constant Field Values

DESCRIPTION

public final java.lang.String DESCRIPTION
See Also:
Constant Field Values

ERROR

public final java.lang.String ERROR
See Also:
Constant Field Values

ID

public final java.lang.String ID
See Also:
Constant Field Values

LIST

public final java.lang.String LIST
See Also:
Constant Field Values

MODULE

public final java.lang.String MODULE
See Also:
Constant Field Values

MSG

public final java.lang.String MSG
See Also:
Constant Field Values

NAME

public final java.lang.String NAME
See Also:
Constant Field Values

NEXT

public final java.lang.String NEXT
See Also:
Constant Field Values

OP

public final java.lang.String OP
See Also:
Constant Field Values

OPEN

public final java.lang.String OPEN
See Also:
Constant Field Values

PAGE

public final java.lang.String PAGE
See Also:
Constant Field Values

PAGER

public final java.lang.String PAGER
See Also:
Constant Field Values

PARENT

public final java.lang.String PARENT
See Also:
Constant Field Values

PATH

public final java.lang.String PATH
See Also:
Constant Field Values

PREVIOUS

public final java.lang.String PREVIOUS
See Also:
Constant Field Values

PROJECTS

public final java.lang.String PROJECTS
See Also:
Constant Field Values

ROOT

public final java.lang.String ROOT
See Also:
Constant Field Values

SESSION_ID

public final java.lang.String SESSION_ID
See Also:
Constant Field Values
Constructor Detail

CategoryBrowse

public CategoryBrowse()
Method Detail

getMainMethod

public java.lang.String getMainMethod()
Description copied from interface: ModuleLocal
This method is used to determine which method should be invoked when the module is requested without an operation.

Specified by:
getMainMethod in interface ModuleLocal
Specified by:
getMainMethod in class BaseModule
Returns:
name of the method that should be invoked

getModuleDescription

public java.lang.String getModuleDescription()
Description copied from interface: ModuleLocal
This method is used to find the description of the module

Specified by:
getModuleDescription in interface ModuleLocal
Specified by:
getModuleDescription in class BaseModule
Returns:
the description of the module

getModuleDisplayName

public java.lang.String getModuleDisplayName()
Description copied from interface: ModuleLocal
This method is used to find the display name of the module

Specified by:
getModuleDisplayName in interface ModuleLocal
Specified by:
getModuleDisplayName in class BaseModule
Returns:
the display name of the module

canExecuteForRole

public java.lang.String canExecuteForRole(CoefficientContext ctx,
                                          java.lang.String methodName,
                                          Role usersHighestRole)
Description copied from class: BaseModule
This is a base implementation that will allow all methods to be invoked without regard to roles

Specified by:
canExecuteForRole in interface ModuleLocal
Overrides:
canExecuteForRole in class BaseModule
Returns:
null if we can execute the method an error message if not

closeCategory

private void closeCategory(CoefficientContext ctx)

interpretOp

public void interpretOp(CoefficientContext ctx)

listProjects

private void listProjects(CoefficientContext ctx)

openCategory

private void openCategory(CoefficientContext ctx,
                          java.lang.String msg)

viewCategoryTree

private CoefficientContext viewCategoryTree(CoefficientContext ctx,
                                            java.lang.String msg)

getCategory

private Category getCategory(java.lang.String id)

getRoot

private Category getRoot()
see if the root category is there and if it isn't create it


getSubCategories

private java.util.List getSubCategories(java.lang.String id)

getSubCategoriesForDisplay

private java.util.List getSubCategoriesForDisplay(java.lang.String id,
                                                  java.util.List openList)

anyProjectsCount

private int anyProjectsCount(Category cat)
return the count of projects with this category



Copyright CSIR. All Rights Reserved.