Class WebpagesRestController


@RestController @RequestMapping("/admin/rest/web-pages") @PreAuthorize("@WebjetSecurityService.hasPermission(\'menuWebpages\')") public class WebpagesRestController extends WebpagesDatatable
  • Constructor Details

  • Method Details

    • perexGroupOptions

      @PostMapping(value="/perex-groups", consumes="application/json") public List<OptionDto> perexGroupOptions(@RequestBody Long[] ids, @RequestParam boolean remove)
      Returns groups available on every selected page, or assigned to at least one page for removal.
    • userGroupOptions

      @PostMapping(value="/user-groups", consumes="application/json") public List<OptionDto> userGroupOptions(@RequestBody Long[] ids, @RequestParam boolean remove)
      Returns both user group types, limited to assigned groups when removing them.
    • processAction

      public boolean processAction(DocDetails entity, String action)
      Applies a group delta to freshly loaded editor data through the normal save workflow.
      Overrides:
      processAction in class WebpagesDatatable
      Returns:
      false ak nastane chyba
    • parentGroups

      @RequestMapping(path="/parents/{id}") public ParentGroupsResult parentGroups(@PathVariable("id") int docId)
      Vrati zoznam parent adresarov pre zadane docid, nastavi aj domenu ak je odlisna a kartu (System/Kos) v ktorej sa nachadza koren adresarov
      Parameters:
      docId -
      Returns:
    • validateEditorForCustomFields

      public void validateEditorForCustomFields(jakarta.servlet.http.HttpServletRequest request, DatatableRequest<Long,DocDetails> target, Identity user, org.springframework.validation.Errors errors, Long id, DocDetails entity)
      Description copied from class: DatatableRestControllerV2
      Validates custom fields and prepares valid JSON editor values for persistence.

      The method resolves required field alphabets via CustomFieldsService and checks corresponding properties (fieldX) on the entity. Missing values are reported using Errors.rejectValue(String, String, String) to keep validation consistent with editor error handling. Valid JSON values have literal angle brackets replaced with equivalent Unicode escapes so the JPA XSS filter does not alter their syntax when the entity is loaded again.

      If a field property is not readable on the entity, the method logs the issue and continues without failing the whole validation pass.

      Overrides:
      validateEditorForCustomFields in class DatatableRestControllerV2<DocDetails,Long>
      Parameters:
      request - current HTTP request
      target - datatable request wrapper
      user - current authenticated user
      errors - collector for validation errors
      id - entity identifier from request payload
      entity - entity instance to validate