Class SplibSearchListController<FST extends SplibSearchForm,FLT extends SplibListForm<?>,S extends SplibSearchListService<FST,FLT>>
- Type Parameters:
FST- SplibSearchFormFLT- SplibListFormS- SplibSearchListService
-
Nested Class Summary
Nested classes/interfaces inherited from class jp.ecuacion.splib.web.controller.SplibGeneralController
SplibGeneralController.ControllerContext -
Field Summary
Fields inherited from class jp.ecuacion.splib.web.controller.SplibGeneralController
context, paramListOnRedirectToSelf, redirectUrlOnAppExceptionBean, rolesAndAuthoritiesBean, serviceListFields inherited from class jp.ecuacion.splib.web.controller.SplibBaseController
request -
Constructor Summary
ConstructorsConstructorDescriptionSplibSearchListController(String function) Construct a new instance withfunction.SplibSearchListController(String function, SplibGeneralController.ControllerContext settings) Construct a new instance withfunction,settings. -
Method Summary
Modifier and TypeMethodDescriptiondelete(org.springframework.ui.Model model, FST searchForm, FLT listForm, org.springframework.security.core.userdetails.UserDetails loginUser) Deletes the specified record.Provides the defaultsubFunctionvalue as the part of the redirecting URL after the server procedure finished successfully.protected FSTgetProperSearchForm(org.springframework.ui.Model model, FST searchForm) Returns proper search form.page(org.springframework.ui.Model model, FST searchForm, FLT listForm, org.springframework.security.core.userdetails.UserDetails loginUser) Overrides the parent method to addgetProperSearchForm, listForm.setDataKind() and redirectUrlOnAppExceptionBeanprocedures.search(org.springframework.ui.Model model, FST searchForm, FLT listForm, org.springframework.security.core.userdetails.UserDetails loginUser) Searches from the search conditions insearchForm.searchAgain(org.springframework.ui.Model model, FST searchForm, FLT listForm, org.springframework.security.core.userdetails.UserDetails loginUser) Searches from the search conditions insearchForm.searchConditionClear(org.springframework.ui.Model model, FST searchForm, FLT listForm, org.springframework.security.core.userdetails.UserDetails loginUser) Clears search conditions.showInsertForm(org.springframework.ui.Model model, org.springframework.security.core.userdetails.UserDetails loginUser) Shows edit page in insert mode.showUpdateForm(org.springframework.ui.Model model, org.springframework.security.core.userdetails.UserDetails loginUser) Shows edit page in update mode.submitOnChangeToRefresh(org.springframework.ui.Model model, FST searchForm, FLT listForm, org.springframework.security.core.userdetails.UserDetails loginUser) Overrides the parent method to addgetProperSearchFormprocedure.Methods inherited from class jp.ecuacion.splib.web.controller.SplibGeneralController
addParamToParamListOnRedirectToSelf, addParamToParamListOnRedirectToSelf, getDefaultDestPageOnAbnormalEnd, getDefaultDestPageOnNormalEnd, getDefaultDestSubFunctionOnAbnormalEnd, getDefaultHtmlPageName, getFunction, getFunctionKinds, getParamListOnRedirectToSelf, getRedirectUrlOnAppExceptionBean, getRedirectUrlOnSuccess, getRootRecordName, getService, getSubFunction, newContext, prepare, prepare, redirectToSamePageTakingOverModel, redirectToSamePageTakingOverModel, throw404Methods inherited from class jp.ecuacion.splib.web.controller.SplibBaseController
initBinder
-
Constructor Details
-
SplibSearchListController
Construct a new instance withfunction.- Parameters:
function- function
-
SplibSearchListController
public SplibSearchListController(@Nonnull String function, SplibGeneralController.ControllerContext settings) Construct a new instance withfunction,settings.- Parameters:
function- functionsettings- settings
-
-
Method Details
-
getDefaultDestSubFunctionOnNormalEnd
Description copied from class:SplibGeneralControllerProvides the defaultsubFunctionvalue 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:
getDefaultDestSubFunctionOnNormalEndin classSplibGeneralController<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 addgetProperSearchFormprocedure.- Overrides:
submitOnChangeToRefreshin classSplibGeneral2FormsController<FST extends SplibSearchForm,FLT extends SplibListForm<?>, S extends SplibSearchListService<FST, FLT>> - Parameters:
model- modelsearchForm- formlistForm- formloginUser- 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 addgetProperSearchForm, listForm.setDataKind() and redirectUrlOnAppExceptionBeanprocedures.- Overrides:
pagein classSplibGeneral2FormsController<FST extends SplibSearchForm,FLT extends SplibListForm<?>, S extends SplibSearchListService<FST, FLT>> - Parameters:
model- modelsearchForm- formlistForm- formloginUser- 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 insearchForm.This method only redirects to
pagebecause the actual search procedure is implemented atpagemethod.- Parameters:
model- modelsearchForm- searchFormlistForm- listFormloginUser- 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 insearchForm.This method only redirects to
pagebecause the actual search procedure is implemented atpagemethod.This is exactly the same procedure as
search, but there seems to be no way to integrate these because multiple@GetMappingcannot be added to a single method.- Parameters:
model- modelsearchForm- searchFormlistForm- listFormloginUser- loginUser- Returns:
- URL
- Throws:
Exception- Exception
-
getProperSearchForm
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- modelsearchForm- searchForm- Returns:
- proper searchForm
-
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- modelsearchForm- searchFormlistForm- listFormloginUser- loginUser- Returns:
- URL
- Throws:
Exception- Exception
-
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- modelsearchForm- searchFormlistForm- listFormloginUser- loginUser- Returns:
- URL
- Throws:
Exception- Exception
-
showInsertForm
@PostMapping(value="action", params="showInsertForm") public String showInsertForm(org.springframework.ui.Model model, @AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails loginUser) throws jp.ecuacion.lib.core.exception.checked.AppException Shows edit page in insert mode.- Parameters:
model- modelloginUser- 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, @AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails loginUser) throws jp.ecuacion.lib.core.exception.checked.AppException Shows edit page in update mode.- Parameters:
model- modelloginUser- loginUser- Returns:
- URL
- Throws:
jp.ecuacion.lib.core.exception.checked.AppException- AppException
-