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 Details

  • Constructor Details

    • AbstractAdminController

      protected AbstractAdminController(R repository, P predicatesBuilder)
      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 read
      presponse - 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 query
      pageable - 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 create
      presponse - 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 change
      pentry - entity to change
      presponse - 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 delete
      presponse - http servlet response
      Returns:
      administration result with first entry
    • getManualSortableFields

      protected Map<String,Comparator<T>> getManualSortableFields(String local)