nl.gx.webmanager.authorization.command
Class UserCommandObject

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
              extended by nl.gx.webmanager.authorization.command.UserCommandObject
All Implemented Interfaces:
DelegatedController, DelegatedControllerAware, FormBackingObject

public class UserCommandObject
extends AuthorizationCommandObject

This class is the command object for the user 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:
ivol

Field Summary
 
Fields inherited from class nl.gx.webmanager.springmvc.FormBindableBase
editViews
 
Constructor Summary
UserCommandObject()
           
 
Method Summary
 Role[] getRoles()
          Returns the roles assigned the selected user.
 java.lang.String getSelectedUserId()
          Return the id of the selected user.
 User getSelectedUserObject()
          Return the selected user.
 java.lang.String getSortBy()
          Return the property to sort on.
 java.lang.String getSortOrder()
          Sets the sort order, ascending of descending.
 java.lang.String getUserFilter()
          Returns the current user filter.
 User[] getUsers()
          Returns all users that can be selected given the current filter.
 void initBinder(javax.servlet.http.HttpServletRequest request, org.springframework.web.bind.ServletRequestDataBinder binder)
          Callback for additional binder initialisations.
 void onBindAndValidate(javax.servlet.http.HttpServletRequest request, java.lang.Object command, org.springframework.validation.BindException arg2)
          Callback for custom post-processing in terms of binding and validation.
 void onSubmit(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object command, org.springframework.validation.BindException errors, org.springframework.web.servlet.ModelAndView modelAndView)
          This is method is called by the Spring framework after binding posted form values onto the form backing object and invoking the onBind and onBindAndValidate callback methods.
 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 saveRoles()
          Save the roles assigned to the user.
 void setRoles(Role[] roles)
          Set the roles assigned the selected user.
 void setSelectedUserId(java.lang.String userid)
          Set the id of the selected user.
 void setSelectedUserObject(User user)
          Sets the selected user.
 void setSortBy(java.lang.String sortBy)
          Sets the property to sort on.
 void setSortOrder(java.lang.String sortOrder)
          Set the sort order, ascending of descending.
 void setUserFilter(java.lang.String userFilter)
          Sets the current user filter.
 void setUsers(User[] users)
          Set the roles assigned the selected user.
 
Methods inherited from class nl.gx.webmanager.authorization.command.AuthorizationCommandObject
addUsedRoleId, getActionCommand, getCurrentUser, getCurrentUserAuthorizingRoles, getErrorMessage, getRoleByGroupObject, getRoleByHtmlObject, getRoles, getStaticBackendDir, getUserByHtmlObject, getWebid, setActionCommand, setErrorMessage, setWebid, sortPermissionCategories
 
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, 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

UserCommandObject

public UserCommandObject()
Method Detail

getSelectedUserId

public java.lang.String getSelectedUserId()
Return the id of the selected user.

Returns:
Id of the selected user

setSelectedUserId

public void setSelectedUserId(java.lang.String userid)
Set the id of the selected user.

Parameters:
userid - Id of the selected user

getSelectedUserObject

public User getSelectedUserObject()
Return the selected user. User is retrieved from the user id if it is null.

Returns:
Currently selected user

setSelectedUserObject

public void setSelectedUserObject(User user)
Sets the selected user.

Parameters:
user - The newly selected user

getUserFilter

public java.lang.String getUserFilter()
Returns the current user filter.

Returns:
the current user filter

setUserFilter

public void setUserFilter(java.lang.String userFilter)
Sets the current user filter.

Parameters:
userFilter - The current user filter

getSortBy

public java.lang.String getSortBy()
Return the property to sort on.

Returns:
property to sort on

setSortBy

public void setSortBy(java.lang.String sortBy)
Sets the property to sort on.

Parameters:
sortBy - property to sort on

getSortOrder

public java.lang.String getSortOrder()
Sets the sort order, ascending of descending.

Returns:
'asc' when sort order is ascending, 'desc' otherwise

setSortOrder

public void setSortOrder(java.lang.String sortOrder)
Set the sort order, ascending of descending.

Parameters:
sortOrder - 'asc' when sort order is ascending, 'desc' otherwise

getRoles

public Role[] getRoles()
Returns the roles assigned the selected user.

Returns:
Roles assigned the selected user

setRoles

public void setRoles(Role[] roles)
Set the roles assigned the selected user.

Parameters:
roles - assigned the selected user

saveRoles

public void saveRoles()
Save the roles assigned to the user.


getUsers

public User[] getUsers()
Returns all users that can be selected given the current filter.

Returns:
all users that can be selected given the current filter

setUsers

public void setUsers(User[] users)
Set the roles assigned the selected user.

Parameters:
users - assigned the selected user

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 AuthorizationCommandObject
Parameters:
request - current HTTP request
binder - binder instance
Throws:
java.lang.Exception - in case of invalid state or arguments

onBindAndValidate

public void onBindAndValidate(javax.servlet.http.HttpServletRequest request,
                              java.lang.Object command,
                              org.springframework.validation.BindException arg2)
                       throws java.lang.Exception
Description copied from interface: DelegatedController
Callback for custom post-processing in terms of binding and validation. called by the WebmanagerController at form submission equivalent to org.springframework.web.servlet.mvc.SimpleFormController.onBindAndValidate(); called after the validate(), also in case of validation and/or bind errors

Specified by:
onBindAndValidate in interface DelegatedController
Overrides:
onBindAndValidate in class FormBindableBase
Parameters:
request - current HTTP request
command - the command object, still allowing for further binding
arg2 - errors holder, allowing for additional custom validation errors
Throws:
java.lang.Exception - in case of invalid state or arguments

onSubmit

public void onSubmit(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response,
                     java.lang.Object command,
                     org.springframework.validation.BindException errors,
                     org.springframework.web.servlet.ModelAndView modelAndView)
              throws java.lang.Exception
Description copied from class: FormBindableBase
This is method is called by the Spring framework after binding posted form values onto the form backing object and invoking the onBind and onBindAndValidate callback methods. In this method values contained by the form backing object can be set to the data model and be persisted.

Specified by:
onSubmit in interface DelegatedController
Overrides:
onSubmit in class FormBindableBase
Parameters:
request - current servlet request
response - current servlet response
command - form object with request parameters bound onto it
errors - Errors instance without errors (subclass can add errors if it wants to)
modelAndView - model and view of the original main spring controller which handles the request
Throws:
java.lang.Exception - in case of errors

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 AuthorizationCommandObject
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


Copyright © 2007-2011 GX Software BV. All Rights Reserved.