BEA Systems, Inc.

com.beasys.commerce.user.jsp.beans
Class HierarchyManagementBean

java.lang.Object
  |
  +--com.beasys.commerce.user.jsp.beans.HierarchyManagementBean

public class HierarchyManagementBean
extends java.lang.Object

Jsp Bean to manage the state of group hierarchies so that they can be rendered correctly.


Field Summary
static java.lang.String COLLAPSE
          for collapse tree action
static java.lang.String CREATE
          Constant used to help determine if the bean is used in the create group page
static java.lang.String DELETE
          for deleting tree item action
static java.lang.String EDIT
          Constant used to help determine if the bean is used in the edit group page
static java.lang.String EXPAND
          for expand tree action
static java.lang.String SEARCH
          Constant used to help determine if the bean is used in the search group page
 
Constructor Summary
HierarchyManagementBean()
           
 
Method Summary
 void addGroupAsExpanded(java.lang.String group)
          Add a groupName to the expandedGroups table.
 boolean doSearch(java.lang.String group)
          Recursive function to do the search through all the subgroups
 java.lang.String getCurrentGroupName()
           
 java.lang.String getDisplayType()
          Getting the display type.
 java.lang.String getSearchGroup()
           
static UserManager getUserManager()
          Convenience method to return an instance of the UserManager session bean
 boolean isCreatePage()
          if the display type is create page, return true
 boolean isEditPage()
          if the display type is edit page, return true
 boolean isExpanded(java.lang.String groupName)
          This method checks whether the group passed in is expanded or not - it does it by searching for the group within the Hashtable.
 boolean isSearchPage()
          if the display type is search page, return true
 void removeGroupAsExpanded(java.lang.String group)
          Remove the group from the expandedGroups table.
 void reset()
          Reset the expanded groups hashtable
 boolean search(java.lang.String group2Search)
          Search for a particular group in the hierarchy.
 void setCurrentGroupName(java.lang.String groupName)
           
 void setDisplayType(java.lang.String type)
          Setting the hierarchy display type to a particular value Currently, the hierarchy displays only two display types - list/create & search/edit
 void setSearchGroup(java.lang.String group)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATE

public static final java.lang.String CREATE
Constant used to help determine if the bean is used in the create group page

SEARCH

public static final java.lang.String SEARCH
Constant used to help determine if the bean is used in the search group page

EDIT

public static final java.lang.String EDIT
Constant used to help determine if the bean is used in the edit group page

EXPAND

public static final java.lang.String EXPAND
for expand tree action

COLLAPSE

public static final java.lang.String COLLAPSE
for collapse tree action

DELETE

public static final java.lang.String DELETE
for deleting tree item action
Constructor Detail

HierarchyManagementBean

public HierarchyManagementBean()
Method Detail

getSearchGroup

public java.lang.String getSearchGroup()

setSearchGroup

public void setSearchGroup(java.lang.String group)

getCurrentGroupName

public java.lang.String getCurrentGroupName()

setCurrentGroupName

public void setCurrentGroupName(java.lang.String groupName)

isExpanded

public boolean isExpanded(java.lang.String groupName)
This method checks whether the group passed in is expanded or not - it does it by searching for the group within the Hashtable. If not found, it assumes that the group is not expanded
Parameters:
groupName - the name of the group to check
Returns:
true if the group is expanded

setDisplayType

public void setDisplayType(java.lang.String type)
Setting the hierarchy display type to a particular value Currently, the hierarchy displays only two display types - list/create & search/edit
Parameters:
type - String

getDisplayType

public java.lang.String getDisplayType()
Getting the display type.
Returns:
String

isCreatePage

public boolean isCreatePage()
if the display type is create page, return true

isEditPage

public boolean isEditPage()
if the display type is edit page, return true

isSearchPage

public boolean isSearchPage()
if the display type is search page, return true

addGroupAsExpanded

public void addGroupAsExpanded(java.lang.String group)
Add a groupName to the expandedGroups table.
Parameters:
group - String

removeGroupAsExpanded

public void removeGroupAsExpanded(java.lang.String group)
Remove the group from the expandedGroups table.
Parameters:
group - String

reset

public void reset()
Reset the expanded groups hashtable

search

public boolean search(java.lang.String group2Search)
               throws UserManagementException,
                      ToolkitException,
                      javax.ejb.CreateException,
                      java.rmi.RemoteException
Search for a particular group in the hierarchy. If found, it resets the expandedGroups table, and adds that group to the table, along with all its parents so that they can be displayed later.
Returns:
boolean

doSearch

public boolean doSearch(java.lang.String group)
                 throws java.rmi.RemoteException,
                        UserManagementException,
                        ToolkitException,
                        javax.ejb.CreateException
Recursive function to do the search through all the subgroups
Parameters:
String - group

getUserManager

public static UserManager getUserManager()
                                  throws UserManagementException,
                                         ToolkitException,
                                         javax.ejb.CreateException,
                                         java.rmi.RemoteException
Convenience method to return an instance of the UserManager session bean

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved