BEA Systems, Inc.

com.beasys.commerce.portal.admin.jspbeans
Class PortalGroupHierarchyBean

java.lang.Object
  |
  +--com.beasys.commerce.portal.admin.jspbeans.PortalGroupHierarchyBean

public class PortalGroupHierarchyBean
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
static java.lang.String COLLAPSE
          for collapse tree action
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
PortalGroupHierarchyBean()
           
 
Method Summary
 void addGroupAsExpanded(java.lang.String group)
          Add a groupName to the expandedGroups table.
 java.util.HashMap createGroupKeyList()
          Method to create a HashMap of Groupnames mapping w/ numbers
 java.util.HashMap createGroupList()
          Method to create a HashMap of Groups with a value"N"
 boolean doSearch(java.lang.String group)
          Recursive function to do the search through all the subgroups
 java.lang.String getSearchGroup()
           
 java.lang.String[] getTopLevelGroupNames()
          Method which returns the top level group as an array of strings
static UserManager getUserManager()
          Get the UserManager object.
 boolean isElementInArray(java.lang.String elementName, java.lang.String[] array)
          Returns true if the string is in the array, false otherwise
 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.
 java.lang.String printExpandedGroup(java.lang.String groupName, java.util.HashMap groupList, java.util.HashMap groupKeyList, int position, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request)
          If a particular group is expanded, we need to print that in a separate table
 java.lang.String printGroupRow(java.lang.String groupName, java.util.HashMap groupList, java.util.HashMap groupKeyList, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request)
          Print the most basic element in the hierarchy - the group, when in the Search Group Page
 java.lang.String printSubGroups(java.lang.String groupName, java.util.HashMap groupList, java.util.HashMap groupKeyList, int position, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request)
          Goes through each group and writes it out in html
 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 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)
           
 boolean updateDataFromGroupList(java.util.HashMap groupList, java.lang.String portalName)
          Method to associate the selected groups with the portal via the portalmanager
 java.util.HashMap updateGroupListFromData(java.util.HashMap groupList, java.lang.String portalName)
          Method to get all pre-existing values from the user- and portalmanager and populate the HashSet with
 java.util.HashMap updateGroupListFromRequest(java.util.HashMap groupList, java.util.HashMap groupKeyList, javax.servlet.http.HttpServletRequest req)
          Method to get all checkbox hidden values from the request and populate the HashSet with
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEARCH

public static final java.lang.String SEARCH
Constant used to help determine if the bean is used in the search 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
Constructor Detail

PortalGroupHierarchyBean

public PortalGroupHierarchyBean()
Method Detail

getSearchGroup

public java.lang.String getSearchGroup()

setSearchGroup

public void setSearchGroup(java.lang.String group)

reset

public void reset()
Reset the expanded groups hashtable

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

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

getUserManager

public static UserManager getUserManager()
                                  throws UserManagementException,
                                         ToolkitException,
                                         javax.ejb.CreateException,
                                         java.rmi.RemoteException
Get the UserManager object.
Returns:
UserManager userManager

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 - String
Returns:
boolean

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

printSubGroups

public java.lang.String printSubGroups(java.lang.String groupName,
                                       java.util.HashMap groupList,
                                       java.util.HashMap groupKeyList,
                                       int position,
                                       javax.servlet.http.HttpServletResponse response,
                                       javax.servlet.http.HttpServletRequest request)
                                throws java.rmi.RemoteException,
                                       UserManagementException,
                                       ToolkitException,
                                       javax.ejb.CreateException
Goes through each group and writes it out in html
Parameters:
String - group

printExpandedGroup

public java.lang.String printExpandedGroup(java.lang.String groupName,
                                           java.util.HashMap groupList,
                                           java.util.HashMap groupKeyList,
                                           int position,
                                           javax.servlet.http.HttpServletResponse response,
                                           javax.servlet.http.HttpServletRequest request)
                                    throws java.rmi.RemoteException,
                                           UserManagementException,
                                           ToolkitException,
                                           javax.ejb.CreateException
If a particular group is expanded, we need to print that in a separate table

printGroupRow

public java.lang.String printGroupRow(java.lang.String groupName,
                                      java.util.HashMap groupList,
                                      java.util.HashMap groupKeyList,
                                      javax.servlet.http.HttpServletResponse response,
                                      javax.servlet.http.HttpServletRequest request)
                               throws UserManagementException,
                                      ToolkitException,
                                      javax.ejb.CreateException,
                                      java.rmi.RemoteException
Print the most basic element in the hierarchy - the group, when in the Search Group Page
Parameters:
groupName - String isExpanded boolean

getTopLevelGroupNames

public java.lang.String[] getTopLevelGroupNames()
                                         throws java.rmi.RemoteException,
                                                UserManagementException,
                                                ToolkitException,
                                                javax.ejb.CreateException
Method which returns the top level group as an array of strings

createGroupList

public java.util.HashMap createGroupList()
Method to create a HashMap of Groups with a value"N"

createGroupKeyList

public java.util.HashMap createGroupKeyList()
Method to create a HashMap of Groupnames mapping w/ numbers

updateGroupListFromRequest

public java.util.HashMap updateGroupListFromRequest(java.util.HashMap groupList,
                                                    java.util.HashMap groupKeyList,
                                                    javax.servlet.http.HttpServletRequest req)
Method to get all checkbox hidden values from the request and populate the HashSet with

updateGroupListFromData

public java.util.HashMap updateGroupListFromData(java.util.HashMap groupList,
                                                 java.lang.String portalName)
Method to get all pre-existing values from the user- and portalmanager and populate the HashSet with

updateDataFromGroupList

public boolean updateDataFromGroupList(java.util.HashMap groupList,
                                       java.lang.String portalName)
Method to associate the selected groups with the portal via the portalmanager

isElementInArray

public boolean isElementInArray(java.lang.String elementName,
                                java.lang.String[] array)
Returns true if the string is in the array, false otherwise

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved