edu.internet2.middleware.grouper.ui.actions
Class GrouperCapableAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by edu.internet2.middleware.grouper.ui.actions.LowLevelGrouperCapableAction
          extended by edu.internet2.middleware.grouper.ui.actions.GrouperCapableAction
Direct Known Subclasses:
AddSavedStemAction, AddSavedSubjectAction, AssignSavedSubjectsAction, BrowseStemsAction, CancelFindNewMembersAction, CopyGroupAction, CopyGroupToStemAction, CopyOtherStemToStemAction, CopyStemAction, DeleteGroupAction, DeleteStemAction, DoAssignNewMembersAction, DoSearchSubjectsAction, DoUserAuditReportAction, EditJSPAction, ExportMembersAction, ImportMembersAction, JoinGroupAction, LeaveGroupAction, LoginAction, LogoutAction, MoveGroupAction, MoveGroupToStemAction, MoveOtherStemToStemAction, MoveStemAction, PopulateAddCompositeAction, PopulateAllGroupsAction, PopulateAssignNewMembersAction, PopulateChainAction, PopulateChainsAction, PopulateCopyGroupAction, PopulateCopyGroupToStemAction, PopulateCopyOtherStemToStemAction, PopulateCopyStemAction, PopulateCreateGroupAction, PopulateCreateGroupsAction, PopulateCreateStemAction, PopulateDebugPrefsAction, PopulateEditGroupAction, PopulateEditGroupAttributesAction, PopulateEditStemAction, PopulateFindNewMembersAction, PopulateGroupAsFactorAction, PopulateGroupMemberAction, PopulateGroupMembersAction, PopulateGroupPriviligeesAction, PopulateGroupSummaryAction, PopulateGroupTypesAction, PopulateHelpAction, PopulateIndexAction, PopulateJoinGroupsAction, PopulateListSavedStemsAction, PopulateListSavedSubjectsAction, PopulateManageGroupsAction, PopulateMoveGroupAction, PopulateMoveGroupToStemAction, PopulateMoveOtherStemToStemAction, PopulateMovesCopiesLinksAction, PopulateMoveStemAction, PopulateMyGroupsAction, PopulateSearchSubjectsAction, PopulateStemPriviligeesAction, PopulateSubjectSummaryAction, PopulateUploadTestAction, RemoveCompositeAction, RemoveGroupMembersAction, RemoveSavedStemsAction, RemoveSavedSubjectsAction, SaveCompositeAction, SaveDebugPrefsAction, SaveGroupAction, SaveGroupAttributesAction, SaveGroupMemberAction, SaveStemAction, SaveStemMemberAction, SearchGroupsAction, SearchNewMembersAction, SearchStemsAction

public abstract class GrouperCapableAction
extends LowLevelGrouperCapableAction

Superclass for all Actions which need to do Grouper stuff. Other handy methods shared by virtue of being here, however, should refactor so that handy methods are in a base class which is extended by GrouperCapableAction as some things done here only need to be done for top level actions.

Request Parameter Direction Description
pageSize IN/OUT Used to reset the Session default. If a Strut's DynaActionForm is present attempts to set the pageSize field for it
advancedSearch IN Used to reset the Session default for current browseMode
callerPageId IN the pageId of the previous page
flat IN true indicates that hierarchy should not be shown - just a list of groups
_reinstatePageId IN indicates that this page is being restored - and so shouldn`t be saved again
Request Attribute Direction Description
loggedOut IN true indicates Session has been invalidated and should not be used
isAdvancedSearch OUT Takes the Session default and makes it available to Request
isFlat OUT true indicates that hierarchy should not be shown - just a list of groups
thisPageId OUT the page id used to look up the saved data for this page (assuming it was saved)
Session Attribute Direction Description
default.pagesize IN/OUT Set if pageSize request parameter set, or read for default otherwise
nav, media IN Used to obtain LocalizationContext of that name from which ResourceBundle can be retrieved
isFlat<Mode> IN/OUT Set if flat request parameter set, or read for default otherwise
browseMode IN/OUT Methods present to maintain state
browseNodeId<browseMode> IN/OUT Methods present to maintain state
searchMode<browseMode> IN/OUT Methods present to maintain state
mediaMap IN Used to obtain default.browse.stem value from media RresourceBundle
Strut's Action Parameter Direction Description
     

Version:
$Id: GrouperCapableAction.java,v 1.23 2009-08-12 04:52:14 mchyzer Exp $
Author:
Gary Brown.

Field Summary
static String HIER_DELIM
           
 
Constructor Summary
GrouperCapableAction()
           
 
Method Summary
static void clearCallerPageHistory(HttpServletRequest request)
          Wipe out saved pages - should probably be called when changing browse mode
 ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
          Makes HttpSession and GrouperSession available to subclasses Also handles pageSize parameter and times how long is spent in an action
static Map[] getCallerPageData(HttpServletRequest request, String id)
          Retrieve actual data which was saved - called by Filter.
 int getPageSize(HttpSession session)
          Convenience method to stop duplication of logic in Actions
abstract  ActionForward grouperExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, HttpSession session, GrouperSession grouperSession)
          Action specific - must be implemented by all subclasses
 ActionForward grouperTransactionExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, HttpSession session, GrouperSession grouperSession)
          Transaction support implemented centrally here.
static void restoreDynaFormBean(HttpSession session, DynaActionForm form, String name)
          Restores previously saved DynaFormBean
static void saveAsCallerPage(HttpServletRequest request, DynaActionForm form)
          Saves the current page so it can be restored.
static void saveAsCallerPage(HttpServletRequest request, DynaActionForm form, String sessionKeepers)
          Saves the current page so it can be restored.
static void saveDynaFormBean(HttpSession session, DynaActionForm form, String name)
          Saves a DynaActionForm in the session so it can be restored later.
 void setAdvancedSearchMode(boolean mode, HttpSession session)
          Place centrally for consistency and to hide session attribute name
 
Methods inherited from class edu.internet2.middleware.grouper.ui.actions.LowLevelGrouperCapableAction
findAttribute, getAdvancedSearchMode, getBrowseMode, getBrowseNode, getCookie, getCurrentGroupOrStem, getDefaultRootStemName, getExceptionHelper, getLinkBrowseMode, getTilesAttributes, isEmpty, readDebugPrefs, saveDebugPrefs, setBrowseMode, setBrowseNode, sort
 
Methods inherited from class org.apache.struts.action.Action
execute, getServlet, setServlet
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HIER_DELIM

public static final String HIER_DELIM
See Also:
Constant Field Values
Constructor Detail

GrouperCapableAction

public GrouperCapableAction()
Method Detail

grouperExecute

public abstract ActionForward grouperExecute(ActionMapping mapping,
                                             ActionForm form,
                                             HttpServletRequest request,
                                             HttpServletResponse response,
                                             HttpSession session,
                                             GrouperSession grouperSession)
                                      throws Exception
Action specific - must be implemented by all subclasses

Specified by:
grouperExecute in class LowLevelGrouperCapableAction
Throws:
Exception

grouperTransactionExecute

public ActionForward grouperTransactionExecute(ActionMapping mapping,
                                               ActionForm form,
                                               HttpServletRequest request,
                                               HttpServletResponse response,
                                               HttpSession session,
                                               GrouperSession grouperSession)
                                        throws Exception
Transaction support implemented centrally here. the execute method calls this rather than grouperExecute as used to be the case.

Throws:
Exception

execute

public ActionForward execute(ActionMapping mapping,
                             ActionForm form,
                             HttpServletRequest request,
                             HttpServletResponse response)
                      throws Exception
Makes HttpSession and GrouperSession available to subclasses Also handles pageSize parameter and times how long is spent in an action

Overrides:
execute in class LowLevelGrouperCapableAction
Throws:
Exception

getPageSize

public int getPageSize(HttpSession session)
Convenience method to stop duplication of logic in Actions

Overrides:
getPageSize in class LowLevelGrouperCapableAction

setAdvancedSearchMode

public void setAdvancedSearchMode(boolean mode,
                                  HttpSession session)
Place centrally for consistency and to hide session attribute name


saveDynaFormBean

public static void saveDynaFormBean(HttpSession session,
                                    DynaActionForm form,
                                    String name)
Saves a DynaActionForm in the session so it can be restored later. Used so that all parameters don`t have to be passed through complex chains of pages

Parameters:
session -
form -
name -

restoreDynaFormBean

public static void restoreDynaFormBean(HttpSession session,
                                       DynaActionForm form,
                                       String name)
Restores previously saved DynaFormBean

Parameters:
session -
form -
name -

saveAsCallerPage

public static void saveAsCallerPage(HttpServletRequest request,
                                    DynaActionForm form)
Saves the current page so it can be restored. This signature doesn`t save any session attributes

Parameters:
request -
form -

saveAsCallerPage

public static void saveAsCallerPage(HttpServletRequest request,
                                    DynaActionForm form,
                                    String sessionKeepers)
Saves the current page so it can be restored. Saves specified session attributes

Parameters:
request -
form -
sessionKeepers - - splt on spaces to get attribute names

clearCallerPageHistory

public static void clearCallerPageHistory(HttpServletRequest request)
Wipe out saved pages - should probably be called when changing browse mode

Parameters:
request -

getCallerPageData

public static Map[] getCallerPageData(HttpServletRequest request,
                                      String id)
Retrieve actual data which was saved - called by Filter. Chose to keep all logic here for saving and retrieving data TODO find away of purging stuff *when* it is reasonable to do so

Parameters:
request -
id -
Returns:
Map containing details of previous pages visited
Throws:
IllegalStateException