T - public class CRUDController<T> extends ContentController<T>
env, logger, messageSource, request, session| Constructor and Description |
|---|
CRUDController()
Empty constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
contextPath()
Gets application context path.
|
org.springframework.http.HttpEntity<ResultObject> |
create(T objectForm,
org.springframework.validation.Errors errors)
Saves new content object and return WindnTrees compliant HTTP response content object.
|
org.springframework.http.HttpEntity<ResultObject> |
createContent(T objectForm,
org.springframework.web.multipart.MultipartFile file,
org.springframework.validation.Errors errors)
Saves new content object and file and return WindnTrees compliant HTTP response content object.
|
org.springframework.http.HttpEntity<ResultObject> |
delete(String key)
Deletes content object based on provided key and return WindnTrees compliant HTTP response content object.
|
org.springframework.http.HttpEntity<ResultObject> |
delete(T objectForm,
org.springframework.validation.Errors errors)
Deletes content object and return WindnTrees compliant HTTP response content object.
|
protected T |
generateNewKey(T object)
When overridden in extended class provide means of generating
new key for content object.
|
protected CRUDInterface<T> |
getRepository()
Gets CRUDController associated repository interface (CRUDInterface) reference.
|
protected Object |
getTypedKey(Object key)
Gets casted key object by providing extension mechanism in extended classes.
|
protected T |
postCreate(T object)
When overridden in extended class provide means of content object
processing or manipulation after saving object.
|
protected T |
postDelete(T object)
When overridden in extended class provide means of content object
processing or manipulation after deleting object.
|
protected List<T> |
postRead(List<T> list)
When overridden in extended class provide means of processing or manipulation
of list of content objects after reading from storage.
|
protected org.springframework.data.domain.Page<T> |
postRead(org.springframework.data.domain.Page<T> page)
When overridden in extended class provide means of processing or manipulation
of list of content objects after reading from storage in page or list-wise format.
|
protected T |
postRead(T object)
When overridden in extended class provide means of content object
processing or manipulation after reading or retrieving saved object.
|
protected List<T> |
postSelect(List<T> list)
When overridden in extended class provide means of processing or manipulation
of selected list of content objects (based on reference key) after reading from storage.
|
protected org.springframework.data.domain.Page<T> |
postSelect(org.springframework.data.domain.Page<T> page)
When overridden in extended class provide means of processing or manipulation
of selected list of content objects (based on reference key) after reading
from storage in list-wise or page format.
|
protected T |
postUpdate(T object)
When overridden in extended class provide means of content object
processing or manipulation after saving object.
|
protected T |
preCreate(T object)
When overridden in extended class provide means of content object
processing or manipulation before serializing or saving object.
|
protected T |
preDelete(T object)
When overridden in extended class provide means of content object
processing or manipulation before deleting object.
|
protected T |
preUpdate(T object)
When overridden in extended class provide means of content object
processing or manipulation before saving object.
|
org.springframework.http.HttpEntity<ResultList> |
readAll()
Read list of all content objects and return WindnTrees compliant HTTP response
content object using GET method.
|
org.springframework.http.HttpEntity<ResultList> |
readAllByPost()
Read list of all content objects and return WindnTrees compliant HTTP response
content object using POST method.
|
org.springframework.http.HttpEntity<ResultList> |
readList(SearchFilter objectFilter,
org.springframework.validation.Errors errors)
Read list of content objects based on provided filtering data
and return WindnTrees compliant HTTP response content object.
|
org.springframework.http.HttpEntity |
readListReturnFlexByGET(String keyword)
Read Flex object complaint list of content objects based on provided
keyword and return WindnTrees compliant HTTP response content object using GET
method.
|
org.springframework.http.HttpEntity |
readListReturnFlexByPOST(SearchFilter objectFilter,
org.springframework.validation.Errors errors)
Read Flex object complaint list of content objects based on provided
filtering data and return WindnTrees compliant HTTP response content object using POST
method.
|
org.springframework.http.HttpEntity<ResultList> |
readListWise(SearchFilter objectFilter,
org.springframework.validation.Errors errors)
Read list wise (or page) of content objects based on provided filtering data
and return WindnTrees compliant HTTP response content object using POST method.
|
org.springframework.http.HttpEntity<ResultList> |
readListWise(String keyword,
int page,
int size)
Read list wise (or page) of content objects based on provided filtering data
and return WindnTrees compliant HTTP response content object using GET method.
|
org.springframework.http.HttpEntity |
readListWiseReturnFlexByGET(String keyword,
int page,
int size)
Read Flex object complaint list of content objects based on provided
filtering data and return WindnTrees compliant HTTP response content object
in paged or list-wise format using GET method.
|
org.springframework.http.HttpEntity |
readListWiseReturnFlexByPOST(SearchFilter objectFilter,
org.springframework.validation.Errors errors)
Read Flex object complaint list of content objects based on provided
filtering data and return WindnTrees compliant HTTP response content object
in paged or list-wise format using POST method.
|
org.springframework.http.HttpEntity |
readSingle(SearchFilter objectFilter,
org.springframework.validation.Errors errors)
Reads content object based on provided filtering data and return WindnTrees
compliant response content object using POST method.
|
org.springframework.http.HttpEntity |
readSingle(String key)
Reads content object based on provided key and return WindnTrees
compliant response content object using GET method.
|
org.springframework.http.HttpEntity |
readSingleReturnFlex(SearchFilter objectFilter,
org.springframework.validation.Errors errors)
Reads Flex object complaint content object based on provided filtering data and
return WindnTrees compliant HTTP response content object using POST method.
|
org.springframework.http.HttpEntity |
readSingleReturnFlex(String key)
Reads Flex object complaint content object based on provided key and
return WindnTrees compliant HTTP response content object using GET method.
|
protected T |
saveExistingContent(T object,
String uploadType,
String fileName,
long size,
byte[] fileBytes)
When overridden in extended class provide means of content object
processing or manipulation for saving existing content object being
part of a multi-part form request.
|
protected T |
saveNewContent(T object,
String uploadType,
String fileName,
long size,
byte[] fileBytes)
When overridden in extended class provide means of content object
processing or manipulation for saving new content object being
part of a multi-part form request.
|
org.springframework.http.HttpEntity<ResultList> |
select(SearchFilter objectFilter,
org.springframework.validation.Errors errors)
Selects list of content objects based on provided filtering data
and return WindnTrees compliant HTTP response content object in list-wise
or paged format.
|
org.springframework.http.HttpEntity |
selectList(SearchFilter objectFilter,
org.springframework.validation.Errors errors)
Selects list of content objects based on provided filtering data
and return WindnTrees compliant HTTP response content object in listing
format.
|
org.springframework.http.HttpEntity |
selectListReturnFlex(SearchFilter objectFilter,
org.springframework.validation.Errors errors)
Read Flex object complaint list of content objects based on provided
filtering data and return WindnTrees compliant HTTP response content object
in listing format using POST method.
|
org.springframework.http.HttpEntity |
selectReturnFlex(SearchFilter objectFilter,
org.springframework.validation.Errors errors)
Read Flex object complaint list of content objects based on provided
filtering data and return WindnTrees compliant HTTP response content object
in paged or list-wise format using POST method.
|
org.springframework.http.HttpEntity<ResultObject> |
update(T objectForm,
org.springframework.validation.Errors errors)
Saves existing content object and return WindnTrees compliant HTTP response content object.
|
org.springframework.http.HttpEntity<ResultObject> |
updateContent(T objectForm,
org.springframework.web.multipart.MultipartFile file,
org.springframework.validation.Errors errors)
Saves existing content object and file and return WindnTrees compliant HTTP response content object.
|
getExceptionFlexObjectResult, getExceptionListResult, getExceptionObjectResult, getExceptionPageResult, getHttpExceptionFlexObjectResult, getHttpExceptionListResult, getHttpExceptionObjectResult, getHttpExceptionPageResult, getHttpFlexObjectResult, getHttpListResult, getHttpObjectResult, getHttpPagedResult, getStandardErrorLocaleMessage, getValidationLocaleMessagesgetFolderPath, getHtmlResponseHeaders, getLocale, getResponseHeaders, getStandardErrMessage, getStandardExceptionMessage, getStandardOkMessage, getValidationLocaleMessage, getWebAppProperties, getWelcomeMessageprotected CRUDInterface<T> getRepository()
protected Object getTypedKey(Object key)
key - protected T generateNewKey(T object)
object - protected T preCreate(T object)
object - protected T postCreate(T object)
object - protected T postRead(T object)
object - protected List<T> postRead(List<T> list)
list - protected org.springframework.data.domain.Page<T> postRead(org.springframework.data.domain.Page<T> page)
page - protected List<T> postSelect(List<T> list)
list - protected org.springframework.data.domain.Page<T> postSelect(org.springframework.data.domain.Page<T> page)
page - protected T preUpdate(T object)
object - protected T postUpdate(T object)
object - protected T preDelete(T object)
object - protected T postDelete(T object)
object - protected T saveNewContent(T object, String uploadType, String fileName, long size, byte[] fileBytes)
object - uploadType - fileName - size - fileBytes - protected T saveExistingContent(T object, String uploadType, String fileName, long size, byte[] fileBytes)
object - uploadType - fileName - size - fileBytes - @RequestMapping(value="/hostpath",
method=GET,
produces="text/plain")
@ResponseBody
public String contextPath()
@RequestMapping(value={"/create","new"},
method=POST,
produces="application/json;charset=UTF-8")
@ModelAttribute(value="objectForm")
@ResponseBody
public org.springframework.http.HttpEntity<ResultObject> create(@RequestBody
T objectForm,
org.springframework.validation.Errors errors)
objectForm - errors - @RequestMapping(value={"/reads","/one","/post"},
method=POST,
produces="application/json;charset=UTF-8")
@ModelAttribute(value="objectForm")
@ResponseBody
public org.springframework.http.HttpEntity readSingle(@RequestBody
SearchFilter objectFilter,
org.springframework.validation.Errors errors)
objectFilter - errors - @RequestMapping(value={"/reads/{key}","/one/{key}","/get/{key}"},
method=GET,
produces="application/json;charset=UTF-8")
@ResponseBody
public org.springframework.http.HttpEntity readSingle(@PathVariable
String key)
key - @RequestMapping(value={"/readlw","/find","/page"},
method=POST,
produces="application/json;charset=UTF-8")
@ModelAttribute(value="objectForm")
@ResponseBody
public org.springframework.http.HttpEntity<ResultList> readListWise(@RequestBody
SearchFilter objectFilter,
org.springframework.validation.Errors errors)
objectFilter - errors - @RequestMapping(value={"/readlw/{keyword}/{page}/{size}","/find/{keyword}/{page}/{size}","/page/{keyword}/{page}/{size}"},
method=GET,
produces="application/json;charset=UTF-8")
@ResponseBody
public org.springframework.http.HttpEntity<ResultList> readListWise(@PathVariable
String keyword,
@PathVariable
int page,
@PathVariable
int size)
keyword - page - size - @RequestMapping(value={"/readl","/list"},
method=POST,
produces="application/json;charset=UTF-8")
@ModelAttribute(value="objectForm")
@ResponseBody
public org.springframework.http.HttpEntity<ResultList> readList(@RequestBody
SearchFilter objectFilter,
org.springframework.validation.Errors errors)
objectFilter - errors - @RequestMapping(value={"/reada","/all","/listall"},
produces="application/json;charset=UTF-8")
public org.springframework.http.HttpEntity<ResultList> readAll()
@RequestMapping(value={"/readabypost","/allbypost","/listallbypost"},
method=POST,
produces="application/json;charset=UTF-8")
public org.springframework.http.HttpEntity<ResultList> readAllByPost()
@RequestMapping(value="/update",
method=POST,
produces="application/json;charset=UTF-8")
@ModelAttribute(value="objectForm")
@ResponseBody
public org.springframework.http.HttpEntity<ResultObject> update(@RequestBody
T objectForm,
org.springframework.validation.Errors errors)
objectForm - errors - @RequestMapping(value="/delete",
method=POST,
produces="application/json;charset=UTF-8")
@ModelAttribute(value="objectForm")
@ResponseBody
public org.springframework.http.HttpEntity<ResultObject> delete(@RequestBody
T objectForm,
org.springframework.validation.Errors errors)
objectForm - errors - @RequestMapping(value="/delete/{key}",
method=GET,
produces="application/json;charset=UTF-8")
@ResponseBody
public org.springframework.http.HttpEntity<ResultObject> delete(@PathVariable
String key)
key - @RequestMapping(value="/select",
method=POST,
produces="application/json;charset=UTF-8")
@ModelAttribute(value="objectForm")
@ResponseBody
public org.springframework.http.HttpEntity<ResultList> select(@RequestBody
SearchFilter objectFilter,
org.springframework.validation.Errors errors)
objectFilter - errors - @RequestMapping(value="/selectlist",
method=POST,
produces="application/json;charset=UTF-8")
@ModelAttribute(value="objectForm")
@ResponseBody
public org.springframework.http.HttpEntity selectList(@RequestBody
SearchFilter objectFilter,
org.springframework.validation.Errors errors)
objectFilter - errors - @RequestMapping(value={"/flexreads/{key}","/flexone/{key}","/flexget/{key}"},
method=GET,
produces="application/json;charset=UTF-8")
@ResponseBody
public org.springframework.http.HttpEntity readSingleReturnFlex(@PathVariable
String key)
key - @RequestMapping(value={"/flexreads","/flexone","/flexpost"},
method=POST,
produces="application/json;charset=UTF-8")
@ModelAttribute(value="objectForm")
@ResponseBody
public org.springframework.http.HttpEntity readSingleReturnFlex(@RequestBody
SearchFilter objectFilter,
org.springframework.validation.Errors errors)
objectFilter - errors - @RequestMapping(value={"/flexreadl/{keyword}","/flexlist/{keyword}"},
method=GET,
produces="application/json;charset=UTF-8")
@ModelAttribute(value="objectForm")
@ResponseBody
public org.springframework.http.HttpEntity readListReturnFlexByGET(@PathVariable
String keyword)
keyword - @RequestMapping(value={"/flexreadl","/flexlist"},
method=POST,
produces="application/json;charset=UTF-8")
@ModelAttribute(value="objectForm")
@ResponseBody
public org.springframework.http.HttpEntity readListReturnFlexByPOST(@RequestBody
SearchFilter objectFilter,
org.springframework.validation.Errors errors)
objectFilter - errors - @RequestMapping(value={"/flexreadlw/{keyword}/{page}/{size}","/flexfind/{keyword}/{page}/{size}","/flexpage/{keyword}/{page}/{size}"},
method=GET,
produces="application/json;charset=UTF-8")
@ResponseBody
public org.springframework.http.HttpEntity readListWiseReturnFlexByGET(@PathVariable
String keyword,
@PathVariable
int page,
@PathVariable
int size)
keyword - page - size - @RequestMapping(value={"/flexreadlw","/flexfind","/flexpage"},
method=POST,
produces="application/json;charset=UTF-8")
@ModelAttribute(value="objectForm")
@ResponseBody
public org.springframework.http.HttpEntity readListWiseReturnFlexByPOST(@RequestBody
SearchFilter objectFilter,
org.springframework.validation.Errors errors)
objectFilter - errors - @RequestMapping(value="/flexselect",
method=POST,
produces="application/json;charset=UTF-8")
@ModelAttribute(value="objectForm")
@ResponseBody
public org.springframework.http.HttpEntity selectReturnFlex(@RequestBody
SearchFilter objectFilter,
org.springframework.validation.Errors errors)
objectFilter - errors - @RequestMapping(value="/flexselectlist",
method=POST,
produces="application/json;charset=UTF-8")
@ModelAttribute(value="objectForm")
@ResponseBody
public org.springframework.http.HttpEntity selectListReturnFlex(@RequestBody
SearchFilter objectFilter,
org.springframework.validation.Errors errors)
objectFilter - errors - @RequestMapping(value={"/createcontent","new"},
method=POST,
produces="application/json;charset=UTF-8")
@ModelAttribute(value="objectForm")
@ResponseBody
public org.springframework.http.HttpEntity<ResultObject> createContent(@RequestBody
T objectForm,
@RequestParam(value="file")
org.springframework.web.multipart.MultipartFile file,
org.springframework.validation.Errors errors)
objectForm - file - errors - @RequestMapping(value="/updatecontent",
method=POST,
produces="application/json;charset=UTF-8")
@ModelAttribute(value="objectForm")
@ResponseBody
public org.springframework.http.HttpEntity<ResultObject> updateContent(@RequestBody
T objectForm,
@RequestParam(value="file")
org.springframework.web.multipart.MultipartFile file,
org.springframework.validation.Errors errors)
objectForm - file - errors - Copyright © 2018. All rights reserved.