Class AbstractAdminController<T extends org.springframework.data.domain.Persistable<Long>,R extends AdminJpaRepository<T,Long,?>,P extends AbstractPredictatesBuilder<?>>
java.lang.Object
de.knightsoftnet.gwtp.spring.server.controller.AbstractAdminController<T,R,P>
public class AbstractAdminController<T extends org.springframework.data.domain.Persistable<Long>,R extends AdminJpaRepository<T,Long,?>,P extends AbstractPredictatesBuilder<?>>
extends Object
Abstract administration web service.
- Author:
- Manfred Tremmel
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractAdminController(R repository, P predicatesBuilder) constructor. -
Method Summary
Modifier and TypeMethodDescriptionchangeEntry(Long pid, T pentry, jakarta.servlet.http.HttpServletResponse presponse) change entry.createEntry(T pentry, jakarta.servlet.http.HttpServletResponse presponse) create entry.deleteEntry(Long pid, jakarta.servlet.http.HttpServletResponse presponse) delete entry.getEntry(jakarta.servlet.http.HttpServletResponse presponse) get first entry.getEntryById(Long pid, jakarta.servlet.http.HttpServletResponse presponse) get entry by id.protected Map<String,Comparator<T>> getManualSortableFields(String local) org.springframework.data.domain.Page<T>search in repository.
-
Field Details
-
repository
-
predicatesBuilder
-
-
Constructor Details
-
AbstractAdminController
constructor.
-
-
Method Details
-
getEntry
@GetMapping @Secured("ROLE_ADMIN") public AdminResult<Long,T> getEntry(jakarta.servlet.http.HttpServletResponse presponse) get first entry.- Parameters:
presponse- http servlet response- Returns:
- administration result with first entry
-
getEntryById
@GetMapping("/{id}") @Secured("ROLE_ADMIN") public AdminResult<Long,T> getEntryById(@PathVariable("id") Long pid, jakarta.servlet.http.HttpServletResponse presponse) get entry by id.- Parameters:
pid- id of the entry to readpresponse- http servlet response- Returns:
- administration result with first entry
-
search
@GetMapping("/search/{language}") @Secured("ROLE_ADMIN") public org.springframework.data.domain.Page<T> search(@PathVariable("language") String language, @RequestParam("search") String search, org.springframework.data.domain.Pageable pageable) search in repository.- Parameters:
search- search querypageable- sort and paging informations- Returns:
- page list of entries
-
createEntry
@PostMapping @Secured("ROLE_ADMIN") public AdminResult<Long,T> createEntry(@Validated(de.knightsoftnet.validators.shared.validationgroup.ValidationGroup.ServerControllerValidation.class) @RequestBody T pentry, jakarta.servlet.http.HttpServletResponse presponse) create entry.- Parameters:
pentry- entity to createpresponse- http servlet response- Returns:
- administration result with first entry
-
changeEntry
@PutMapping("/{id}") @Secured("ROLE_ADMIN") public AdminResult<Long,T> changeEntry(@PathVariable("id") Long pid, @Validated(de.knightsoftnet.validators.shared.validationgroup.ValidationGroup.ServerControllerValidation.class) @RequestBody T pentry, jakarta.servlet.http.HttpServletResponse presponse) change entry.- Parameters:
pid- id of the entry to changepentry- entity to changepresponse- http servlet response- Returns:
- administration result with first entry
-
deleteEntry
@DeleteMapping("/{id}") @Secured("ROLE_ADMIN") public AdminResult<Long,T> deleteEntry(@PathVariable("id") Long pid, jakarta.servlet.http.HttpServletResponse presponse) delete entry.- Parameters:
pid- id of the entry to deletepresponse- http servlet response- Returns:
- administration result with first entry
-
getManualSortableFields
-