org.figure8.join.control.action
Class PermissionActions

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by org.figure8.join.control.JoinAction
          extended by org.figure8.join.control.action.PermissionActions

public class PermissionActions
extends JoinAction

Struts action set used for creating, saving and retrieving security roles and permissions through Join application.

Version:
$Revision: 1.1 $
Author:
Laurent Broudoux

Field Summary
static java.lang.String DUPLICATE_ROLE_KEY
          The request scope attribute under which is stored the Role that has raised a DuplicateEntityException during save of another one.
static java.lang.String LOAD_PERMISSIONS_OP
          Operation code for loading a specific user security Permission.
static java.lang.String LOAD_ROLE_OP
          Operation code for loading a specific security Role.
static java.lang.String ROLE_KEY
          The session scope attribute under which the Role object currently selected by our logged-in User is stored.
static java.lang.String SAVE_PERMISSIONS_OP
          Operation code for saving security Permissions for a user.
static java.lang.String SAVE_ROLE_OP
          Operation code for saving a security Role (create or update).
 
Fields inherited from class org.figure8.join.control.JoinAction
BODY_ATTRIBUTE, BODY_PARAMETER, EXCEPTION_KEY, GUI_KEY, OP_PARAMETER, REND_MAIN, REND_NONE, REND_PARAMETER, REND_POPUP, XHR_PARAMETER
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
PermissionActions()
          Creates a new instance of PermissionActions.
 
Method Summary
 org.apache.struts.action.ActionForward doExecute(java.lang.String operation, org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Abstract method that subclasses must implement.
protected  org.apache.struts.action.ActionForward loadPermissions(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Load security permissions from datastore for a specified user and fill form with them.
protected  org.apache.struts.action.ActionForward loadRole(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Load a specified role from datastore and fill form with it.
protected  org.apache.struts.action.ActionForward savePermissions(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Save security permissions for a specified user.
protected  org.apache.struts.action.ActionForward saveRole(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Save a role into datastore.
 void setPermissionManager(PermissionManager manager)
           
 void setUserManager(UserManager manager)
           
 
Methods inherited from class org.figure8.join.control.JoinAction
execute, getUserContainer, isLoggedIn, isXhrRequest, removeObsoleteForm
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOAD_ROLE_OP

public static final java.lang.String LOAD_ROLE_OP
Operation code for loading a specific security Role.

See Also:
Constant Field Values

SAVE_ROLE_OP

public static final java.lang.String SAVE_ROLE_OP
Operation code for saving a security Role (create or update).

See Also:
Constant Field Values

LOAD_PERMISSIONS_OP

public static final java.lang.String LOAD_PERMISSIONS_OP
Operation code for loading a specific user security Permission.

See Also:
Constant Field Values

SAVE_PERMISSIONS_OP

public static final java.lang.String SAVE_PERMISSIONS_OP
Operation code for saving security Permissions for a user.

See Also:
Constant Field Values

ROLE_KEY

public static final java.lang.String ROLE_KEY
The session scope attribute under which the Role object currently selected by our logged-in User is stored.

See Also:
Constant Field Values

DUPLICATE_ROLE_KEY

public static final java.lang.String DUPLICATE_ROLE_KEY
The request scope attribute under which is stored the Role that has raised a DuplicateEntityException during save of another one.

See Also:
Constant Field Values
Constructor Detail

PermissionActions

public PermissionActions()
Creates a new instance of PermissionActions.

Method Detail

setUserManager

public void setUserManager(UserManager manager)
Parameters:
manager - UserManager implementation instance

setPermissionManager

public void setPermissionManager(PermissionManager manager)
Parameters:
manager - PermissionManager implementation instance

doExecute

public org.apache.struts.action.ActionForward doExecute(java.lang.String operation,
                                                        org.apache.struts.action.ActionMapping mapping,
                                                        org.apache.struts.action.ActionForm form,
                                                        javax.servlet.http.HttpServletRequest request,
                                                        javax.servlet.http.HttpServletResponse response)
                                                 throws java.lang.Exception
Description copied from class: JoinAction
Abstract method that subclasses must implement. The real execution must be done here according to the specified operation. ActionForward returned by execution should only point on page fragment : this superclass is responsible of including them within a whole page.

Specified by:
doExecute in class JoinAction
Parameters:
operation - String representing the operation to invoke on Action
mapping - Mapping between forwards name and path for this action
form - The form object containing request parameters
request - The servlet container request wrapper
response - The servlet container response wrapper
Returns:
A forward to the next view to render and display
Throws:
java.lang.Exception - such as InfraStructureExceptions ...

loadRole

protected org.apache.struts.action.ActionForward loadRole(org.apache.struts.action.ActionMapping mapping,
                                                          org.apache.struts.action.ActionForm form,
                                                          javax.servlet.http.HttpServletRequest request,
                                                          javax.servlet.http.HttpServletResponse response)
                                                   throws java.lang.Exception
Load a specified role from datastore and fill form with it.

Returns:
A forward to the next view to render and display
Throws:
java.lang.Exception

saveRole

protected org.apache.struts.action.ActionForward saveRole(org.apache.struts.action.ActionMapping mapping,
                                                          org.apache.struts.action.ActionForm form,
                                                          javax.servlet.http.HttpServletRequest request,
                                                          javax.servlet.http.HttpServletResponse response)
                                                   throws java.lang.Exception
Save a role into datastore. The Role may be an already existing one or a new one (this is indeed a create or update method).

Returns:
A forward to the next view to render and display
Throws:
java.lang.Exception

loadPermissions

protected org.apache.struts.action.ActionForward loadPermissions(org.apache.struts.action.ActionMapping mapping,
                                                                 org.apache.struts.action.ActionForm form,
                                                                 javax.servlet.http.HttpServletRequest request,
                                                                 javax.servlet.http.HttpServletResponse response)
                                                          throws java.lang.Exception
Load security permissions from datastore for a specified user and fill form with them.

Returns:
A forward to the next view to render and display
Throws:
java.lang.Exception

savePermissions

protected org.apache.struts.action.ActionForward savePermissions(org.apache.struts.action.ActionMapping mapping,
                                                                 org.apache.struts.action.ActionForm form,
                                                                 javax.servlet.http.HttpServletRequest request,
                                                                 javax.servlet.http.HttpServletResponse response)
                                                          throws java.lang.Exception
Save security permissions for a specified user. This consists in removing all its already existing permissions and creating new ones according to form data.

Returns:
A forward to the next view to render and display
Throws:
java.lang.Exception


Copyright © 2005-2008 Join. All Rights Reserved.