nl.gx.webmanager.authorization.command
Class AuthorizationCommandObject

java.lang.Object
  extended by nl.gx.webmanager.springmvc.FormBindableBase
      extended by nl.gx.webmanager.springmvc.panel.PanelTabFBO
          extended by nl.gx.webmanager.authorization.command.AuthorizationCommandObject
All Implemented Interfaces:
DelegatedController, DelegatedControllerAware, FormBackingObject
Direct Known Subclasses:
ImportUsersCommandObject, RoleCommandObject, UserCommandObject

public class AuthorizationCommandObject
extends PanelTabFBO

This class is the command object for the authorization panel. Note that this command only is a Java representation of the content displayed in the HTML form. So it will only retrieve information from the JCR but never change any content. It does however contain navigation logic.

Author:
arjans

Field Summary
 
Fields inherited from class nl.gx.webmanager.springmvc.FormBindableBase
editViews
 
Constructor Summary
AuthorizationCommandObject()
           
 
Method Summary
protected  void addUsedRoleId(java.lang.String usedRoleId)
          Add a role to the list of used roles within the tab that should no longer be selectable within the tab.
 java.lang.String getActionCommand()
          Return the action command.
 User getCurrentUser()
          Return the current user login.
 Role[] getCurrentUserAuthorizingRoles()
          Returns an array of roles which are assigned to the current user which provide access to the user maintenance tab.
 java.lang.String getErrorMessage()
          Return error message.
protected  Role getRoleByGroupObject(nl.gx.siteworks.core.GroupObject roleObject)
          Returns a Role class instance based on a GroupObject siteworks object.
protected static Role getRoleByHtmlObject(nl.gx.siteworks.core.GroupObject groupObject)
          Returns a User class instance based on a UserObject siteworks object.
protected  Role[] getRoles(boolean addUnassigned)
          Returns all roles for the current webinitiatif.
 java.lang.String getStaticBackendDir()
          Get the directory of the static directory.
protected static User getUserByHtmlObject(nl.gx.siteworks.core.UserObject userObject)
          Returns a User class instance based on a UserObject siteworks object.
 int getWebid()
          Returns the siteworks object id of the current webinitiatif.
 void initBinder(javax.servlet.http.HttpServletRequest request, org.springframework.web.bind.ServletRequestDataBinder binder)
          Callback for additional binder initialisations.
 java.util.Map referenceData(javax.servlet.http.HttpServletRequest request, java.lang.Object command, org.springframework.validation.Errors errors)
          Does nothing but has te be implemented according to the component interface.
 void setActionCommand(java.lang.String action)
          Set the action command to be performed (create, update, etc.).
 void setErrorMessage(java.lang.String error)
          Sets an error message that occurs.
 void setWebid(int webid)
          Set the siteworks object id of the current webinitiatif.
protected  PermissionCategory[] sortPermissionCategories(PermissionCategory[] categories)
          Sort PermissionCategory array by name.
 
Methods inherited from class nl.gx.webmanager.springmvc.panel.PanelTabFBO
addToFBOMap, getEditViews, getFBOMap, getNestedPath, getNode, getPanel, getPanelAction, getPanelGotoTabId, getUUID, getWebContainerNode, setPanel, setPanelAction, setPanelGotoTabId
 
Methods inherited from class nl.gx.webmanager.springmvc.FormBindableBase
addDisallowedField, addEditView, addValidator, formBackingObject, getControllerDelegationMap, getDelegatedController, getEditView, getEditViewByValue, getParentController, getResourceBaseNames, getValidators, initialize, onBind, onBindAndValidate, onSubmit, setDelegatedController, setEditViews, setParentController, setValidators, showForm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthorizationCommandObject

public AuthorizationCommandObject()
Method Detail

setActionCommand

public void setActionCommand(java.lang.String action)
Set the action command to be performed (create, update, etc.).

Parameters:
action - Action command to perform

getActionCommand

public java.lang.String getActionCommand()
Return the action command.

Returns:
Action command to perform

initBinder

public void initBinder(javax.servlet.http.HttpServletRequest request,
                       org.springframework.web.bind.ServletRequestDataBinder binder)
                throws java.lang.Exception
Description copied from interface: DelegatedController
Callback for additional binder initialisations. called by the WebmanagerController at form submission equivalent to org.springframework.web.servlet.mvc.SimpleFormController.initBinder(); called before the databinding to the commandobject.

Specified by:
initBinder in interface DelegatedController
Overrides:
initBinder in class FormBindableBase
Parameters:
request - current HTTP request
binder - binder instance
Throws:
java.lang.Exception - in case of invalid state or arguments

referenceData

public java.util.Map referenceData(javax.servlet.http.HttpServletRequest request,
                                   java.lang.Object command,
                                   org.springframework.validation.Errors errors)
                            throws java.lang.Exception
Description copied from class: PanelTabFBO
Does nothing but has te be implemented according to the component interface. Override this method to add data to the model.

Specified by:
referenceData in interface DelegatedController
Overrides:
referenceData in class PanelTabFBO
Parameters:
request - current HTTP request
command - form object with request parameters bound onto it
errors - validation errors holder
Returns:
a Map with reference data entries, or null if none
Throws:
java.lang.Exception - in case of invalid state or arguments
See Also:
ModelAndView

getRoles

protected Role[] getRoles(boolean addUnassigned)
Returns all roles for the current webinitiatif.

Parameters:
addUnassigned - Returns true if roles that are not already used within the panel should be returned
Returns:
all roles for the current webinitiatif

getRoleByGroupObject

protected Role getRoleByGroupObject(nl.gx.siteworks.core.GroupObject roleObject)
Returns a Role class instance based on a GroupObject siteworks object.

Parameters:
roleObject - GroupObject siteworks object
Returns:
a Role class instance based on a GroupObject siteworks object

getWebid

public int getWebid()
Returns the siteworks object id of the current webinitiatif.

Returns:
the siteworks object id of the current webinitiatif

setWebid

public void setWebid(int webid)
Set the siteworks object id of the current webinitiatif.

Parameters:
webid - The siteworks object id of the current webinitiatif

setErrorMessage

public void setErrorMessage(java.lang.String error)
Sets an error message that occurs.

Parameters:
error - The error message

getErrorMessage

public java.lang.String getErrorMessage()
Return error message.

Returns:
Error message that occured

addUsedRoleId

protected void addUsedRoleId(java.lang.String usedRoleId)
Add a role to the list of used roles within the tab that should no longer be selectable within the tab.

Parameters:
usedRoleId - Siteworks object id of a role

getUserByHtmlObject

protected static User getUserByHtmlObject(nl.gx.siteworks.core.UserObject userObject)
Returns a User class instance based on a UserObject siteworks object.

Parameters:
userObject - UserObject siteworks object
Returns:
a User class instance based on a UserObject siteworks object

getRoleByHtmlObject

protected static Role getRoleByHtmlObject(nl.gx.siteworks.core.GroupObject groupObject)
Returns a User class instance based on a UserObject siteworks object.

Parameters:
groupObject - GroupObject siteworks object
Returns:
a User class instance based on a UserObject siteworks object

getCurrentUser

public User getCurrentUser()
Return the current user login.

Returns:
Current user login

getCurrentUserAuthorizingRoles

public Role[] getCurrentUserAuthorizingRoles()
Returns an array of roles which are assigned to the current user which provide access to the user maintenance tab.

Returns:
an array of roles which are assigned to the current user which provide access to the user maintenance tab.

getStaticBackendDir

public java.lang.String getStaticBackendDir()
Get the directory of the static directory.

Returns:
Static backend directory

sortPermissionCategories

protected PermissionCategory[] sortPermissionCategories(PermissionCategory[] categories)
Sort PermissionCategory array by name.

Parameters:
categories - Array of PermissionCategory instances
Returns:
sorted Array of PermissionCategory instances


Copyright © 2007-2010 GX creative online development BV. All Rights Reserved.