Class AdminController
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.module.web.controllers.settings.admin.AdminController
-
@Controller public class AdminController extends java.lang.Object
The controller that deals with the admin settings pages
-
-
Constructor Summary
Constructors Constructor Description AdminController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
addGet(org.springframework.ui.Model model)
Handles GET requests to the add account pagejava.lang.String
addPost(AccountWrapper account, @Valid AccountForm accountForm, org.springframework.validation.BindingResult result, org.springframework.ui.Model model)
Handles POST requests to the add account page, creating a new account with a random password if validation succeedsjava.lang.String
indexGet()
Handles all requests to the admin pagejava.lang.String
listGetFragment(boolean isAjax, org.springframework.ui.Model model)
Handles GET requests to the list fragment on the admin page
-
-
-
Method Detail
-
indexGet
@GetMapping("/admin") public java.lang.String indexGet()
Handles all requests to the admin page- Returns:
- the path to the admin page
-
listGetFragment
@GetMapping("/admin/list") public java.lang.String listGetFragment(@ModelAttribute("isAjax") boolean isAjax, org.springframework.ui.Model model) throws NotAjaxRequest
Handles GET requests to the list fragment on the admin page- Parameters:
isAjax
- whether or not the request was ajax or notmodel
- holder for model attributes- Returns:
- the path to the list fragment
- Throws:
NotAjaxRequest
- if the request was not an ajax one, the message is where to redirect the user to
-
addGet
@GetMapping("/admin/add") public java.lang.String addGet(org.springframework.ui.Model model)
Handles GET requests to the add account page- Parameters:
model
- holder for model attributes- Returns:
- the path to the add account page
-
addPost
@PostMapping("/admin/add") public java.lang.String addPost(@ModelAttribute("account") AccountWrapper account, @Valid @ModelAttribute @Valid AccountForm accountForm, org.springframework.validation.BindingResult result, org.springframework.ui.Model model)
Handles POST requests to the add account page, creating a new account with a random password if validation succeeds- Parameters:
account
- the account wrapper for the logged in useraccountForm
- the form that should be submitted in the requestresult
- the results of the validation on the form abovemodel
- holder for model attributes- Returns:
- the path to the add account page, or the password page if an account is added
-
-