org.ikasan.framework.web.controller
Class UsersController

java.lang.Object
  extended by org.ikasan.framework.web.controller.UsersController

@Controller
@RequestMapping(value="/admin/users/*.htm")
@SessionAttributes(value="user")
public class UsersController
extends Object

The controller for the various user views

Author:
Ikasan Development Team

Constructor Summary
UsersController(UserService userService)
          Constructor
 
Method Summary
 String changePassword(User user, String confirmNewPassword, org.springframework.ui.ModelMap model, org.springframework.validation.BindingResult result)
          Accepts submission of the changePassword form
 String createUser(org.springframework.ui.ModelMap model, User user, org.springframework.validation.BindingResult result)
          Accepts submission of the createUser form
 String deleteUser(String username, org.springframework.ui.ModelMap model)
          Delete a existing user
 String disableUser(String username, org.springframework.ui.ModelMap model)
          Disable an existing user
 String enableUser(String username, org.springframework.ui.ModelMap model)
          Enable an existing user
 String grantAuthority(String username, String authority, org.springframework.ui.ModelMap model)
          Grant a new authority to an existing user
 String listUsers(org.springframework.ui.ModelMap model)
          List the users known to the system
 String revokeAuthority(String username, String authority, org.springframework.ui.ModelMap model)
          Revoke an authority from a existing user
 String viewUser(String username, org.springframework.ui.ModelMap model)
          List the users known to the system
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsersController

public UsersController(UserService userService)
Constructor

Parameters:
userService - - The user service to use
Method Detail

listUsers

@RequestMapping(value="list.htm")
public String listUsers(org.springframework.ui.ModelMap model)
List the users known to the system

Parameters:
model - - The model (map)
Returns:
"modules/modules"

createUser

@RequestMapping(value="createUser.htm",
                method=POST)
public String createUser(org.springframework.ui.ModelMap model,
                                        @ModelAttribute(value="user")
                                        User user,
                                        org.springframework.validation.BindingResult result)
Accepts submission of the createUser form

Parameters:
model - - The model (map)
user - - The user we're trying to create
result - - The result
Returns:
view the user

viewUser

@RequestMapping(value="view.htm",
                method=GET)
public String viewUser(@RequestParam(value="username")
                                      String username,
                                      org.springframework.ui.ModelMap model)
List the users known to the system

Parameters:
username - - The name of the user we're trying to view
model - - The model (map)
Returns:
path to user view

changePassword

@RequestMapping(value="changePassword.htm",
                method=POST)
public String changePassword(@ModelAttribute(value="user")
                                            User user,
                                            @RequestParam(value="confirm_password")
                                            String confirmNewPassword,
                                            org.springframework.ui.ModelMap model,
                                            org.springframework.validation.BindingResult result)
Accepts submission of the changePassword form

Parameters:
user - - The user we're changing the password for
confirmNewPassword - - The password again, for confirmation
model - - The model (map)
result - - The binding result
Returns:
view the user

grantAuthority

@RequestMapping(value="grantAuthority.htm",
                method=POST)
public String grantAuthority(@RequestParam(value="username")
                                            String username,
                                            @RequestParam(value="authority")
                                            String authority,
                                            org.springframework.ui.ModelMap model)
Grant a new authority to an existing user

Parameters:
username - - The name of the user we're granting authority to
authority - - The authority we're granting the user
model - - The model (map)
Returns:
to the view users

revokeAuthority

@RequestMapping(value="revokeAuthority.htm",
                method=POST)
public String revokeAuthority(@RequestParam(value="username")
                                             String username,
                                             @RequestParam(value="authority")
                                             String authority,
                                             org.springframework.ui.ModelMap model)
Revoke an authority from a existing user

Parameters:
username - - The name of the user we're revoking authority from
authority - - The authority we're revoking from the user
model - - The model (map)
Returns:
to the view users

deleteUser

@RequestMapping(value="delete.htm",
                method=POST)
public String deleteUser(@RequestParam(value="username")
                                        String username,
                                        org.springframework.ui.ModelMap model)
Delete a existing user

Parameters:
username - - The name of the user we're deleting
model - - The model (map)
Returns:
to the view users

disableUser

@RequestMapping(value="disable.htm",
                method=POST)
public String disableUser(@RequestParam(value="username")
                                         String username,
                                         org.springframework.ui.ModelMap model)
Disable an existing user

Parameters:
username - - The name of the user we're disabling
model - - The model (map)
Returns:
to the view users

enableUser

@RequestMapping(value="enable.htm",
                method=POST)
public String enableUser(@RequestParam(value="username")
                                        String username,
                                        org.springframework.ui.ModelMap model)
Enable an existing user

Parameters:
username - - The name of the user we're enabling
model - - The model (map)
Returns:
to the view users


Copyright © 2007-2011 Ikasan. All Rights Reserved.