Class 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 page
      java.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 succeeds
      java.lang.String indexGet()
      Handles all requests to the admin page
      java.lang.String listGetFragment​(boolean isAjax, org.springframework.ui.Model model)
      Handles GET requests to the list fragment on the admin page
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AdminController

        public AdminController()
    • 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 not
        model - 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 user
        accountForm - the form that should be submitted in the request
        result - the results of the validation on the form above
        model - holder for model attributes
        Returns:
        the path to the add account page, or the password page if an account is added