Class SplibSearchListController<FST extends SplibSearchForm, FLT extends SplibListForm<?>, S extends SplibSearchListService<FST,FLT>>

Type Parameters:
FST - SplibSearchForm
FLT - SplibListForm
S - SplibSearchListService

public abstract class SplibSearchListController<FST extends SplibSearchForm, FLT extends SplibListForm<?>, S extends SplibSearchListService<FST,FLT>> extends SplibGeneral2FormsController<FST,FLT,S>
Controls the search and listing of the search result.
  • Constructor Details

    • SplibSearchListController

      public SplibSearchListController(@Nonnull String function)
      Construct a new instance with function.
      Parameters:
      function - function
    • SplibSearchListController

      public SplibSearchListController(@Nonnull String function, SplibGeneralController.ControllerContext settings)
      Construct a new instance with function, settings.
      Parameters:
      function - function
      settings - settings
  • Method Details

    • getDefaultDestSubFunctionOnNormalEnd

      public String getDefaultDestSubFunctionOnNormalEnd()
      Description copied from class: SplibGeneralController
      Provides the default subFunction value as the part of the redirecting URL after the server procedure finished successfully.

      In this class context.subFunction() is set as the default return value, but for instance in "edit" controller class, "searchList" is set because after insert or update a record, going back to the list screen seems to be normal.

      Overrides:
      getDefaultDestSubFunctionOnNormalEnd in class SplibGeneralController<S extends SplibSearchListService<FST,FLT>>
      Returns:
      default subFunction value
    • submitOnChangeToRefresh

      public String submitOnChangeToRefresh(org.springframework.ui.Model model, FST searchForm, FLT listForm, @AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails loginUser) throws Exception
      Overrides the parent method to add getProperSearchForm procedure.
      Overrides:
      submitOnChangeToRefresh in class SplibGeneral2FormsController<FST extends SplibSearchForm, FLT extends SplibListForm<?>, S extends SplibSearchListService<FST,FLT>>
      Parameters:
      model - model
      searchForm - form
      listForm - form
      loginUser - loginUser
      Returns:
      html page
      Throws:
      Exception - Exception
    • page

      public String page(org.springframework.ui.Model model, FST searchForm, FLT listForm, @AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails loginUser) throws Exception
      Overrides the parent method to add getProperSearchForm, listForm.setDataKind() and redirectUrlOnAppExceptionBean procedures.
      Overrides:
      page in class SplibGeneral2FormsController<FST extends SplibSearchForm, FLT extends SplibListForm<?>, S extends SplibSearchListService<FST,FLT>>
      Parameters:
      model - model
      searchForm - form
      listForm - form
      loginUser - loginUser
      Returns:
      URL
      Throws:
      Exception - Exception
    • search

      @GetMapping(value="action", params="search") public String search(org.springframework.ui.Model model, FST searchForm, FLT listForm, @AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails loginUser) throws Exception
      Searches from the search conditions in searchForm.

      This method only redirects to page because the actual search procedure is implemented at page method.

      Parameters:
      model - model
      searchForm - searchForm
      listForm - listForm
      loginUser - loginUser
      Returns:
      URL
      Throws:
      Exception - Exception
    • searchAgain

      @GetMapping(value="action", params="action=searchAgain") public String searchAgain(org.springframework.ui.Model model, FST searchForm, FLT listForm, @AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails loginUser) throws Exception
      Searches from the search conditions in searchForm.

      This is exactly the same procedure as search, but there seems to be no way to integrate these because multiple @GetMapping cannot be added to a single method.

      Parameters:
      model - model
      searchForm - searchForm
      listForm - listForm
      loginUser - loginUser
      Returns:
      URL
      Throws:
      Exception - Exception
    • searchConditionClear

      @GetMapping(value="action", params="conditionClear") public String searchConditionClear(org.springframework.ui.Model model, FST searchForm, FLT listForm, @AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails loginUser) throws Exception
      Clears search conditions.
      Parameters:
      model - model
      searchForm - searchForm
      listForm - listForm
      loginUser - loginUser
      Returns:
      URL
      Throws:
      Exception - Exception
    • getProperSearchForm

      protected FST getProperSearchForm(org.springframework.ui.Model model, FST searchForm)
      Returns proper search form.

      This feature stores the search conditions in session, so the search conditions are recorded even if you go to the other function pages and come back.

      Parameters:
      model - model
      searchForm - searchForm
      Returns:
      proper searchForm
    • delete

      @PostMapping(value="action", params="delete") public String delete(org.springframework.ui.Model model, FST searchForm, FLT listForm, @AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails loginUser) throws Exception
      Deletes the specified record.
      Parameters:
      model - model
      searchForm - searchForm
      listForm - listForm
      loginUser - loginUser
      Returns:
      URL
      Throws:
      Exception - Exception
    • showInsertForm

      @PostMapping(value="action", params="showInsertForm") public String showInsertForm(org.springframework.ui.Model model, FST searchForm, FLT listForm, @AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails loginUser) throws jp.ecuacion.lib.core.exception.checked.AppException
      Shows edit page in insert mode.
      Parameters:
      model - model
      loginUser - loginUser
      Returns:
      URL
      Throws:
      jp.ecuacion.lib.core.exception.checked.AppException - AppException
    • showUpdateForm

      @PostMapping(value="action", params="showUpdateForm") public String showUpdateForm(org.springframework.ui.Model model, FST searchForm, FLT listForm, @AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails loginUser) throws jp.ecuacion.lib.core.exception.checked.AppException
      Shows edit page in update mode.
      Parameters:
      model - model
      loginUser - loginUser
      Returns:
      URL
      Throws:
      jp.ecuacion.lib.core.exception.checked.AppException - AppException