Package sk.iway.iwcm.editor.rest
Class WebpagesRestController
java.lang.Object
sk.iway.iwcm.system.datatable.DatatableRestControllerV2<DocDetails,Long>
sk.iway.iwcm.editor.rest.WebpagesDatatable
sk.iway.iwcm.editor.rest.WebpagesRestController
@RestController
@RequestMapping("/admin/rest/web-pages")
@PreAuthorize("@WebjetSecurityService.hasPermission(\'menuWebpages\')")
public class WebpagesRestController
extends WebpagesDatatable
-
Field Summary
Fields inherited from class sk.iway.iwcm.editor.rest.WebpagesDatatable
docAtrDefRepository, docDetailsRepository, editorFacade -
Constructor Summary
ConstructorsConstructorDescriptionWebpagesRestController(DocDetailsRepository docDetailsRepository, EditorFacade editorFacade, DocAtrDefRepository docAtrDefRepository, EditorService editorService) -
Method Summary
Modifier and TypeMethodDescriptionparentGroups(int docId) Vrati zoznam parent adresarov pre zadane docid, nastavi aj domenu ak je odlisna a kartu (System/Kos) v ktorej sa nachadza koren adresarovperexGroupOptions(Long[] ids, boolean remove) Returns groups available on every selected page, or assigned to at least one page for removal.booleanprocessAction(DocDetails entity, String action) Applies a group delta to freshly loaded editor data through the normal save workflow.userGroupOptions(Long[] ids, boolean remove) Returns both user group types, limited to assigned groups when removing them.voidvalidateEditorForCustomFields(jakarta.servlet.http.HttpServletRequest request, DatatableRequest<Long, DocDetails> target, Identity user, org.springframework.validation.Errors errors, Long id, DocDetails entity) Validates custom fields and prepares valid JSON editor values for persistence.Methods inherited from class sk.iway.iwcm.editor.rest.WebpagesDatatable
addInsertEditNotify, addSpecSearch, afterDuplicate, afterSave, checkItemPerms, deleteItem, editItem, findByColumns, getAllItems, getDefaultOptions, getOneItem, httpHeaders, insertItem, isRefreshMenuRequired, preview, processFromEntityMethods inherited from class sk.iway.iwcm.system.datatable.DatatableRestControllerV2
action, add, addNotify, addNotify, addSpecSort, afterDelete, afterImportChunk, allowGeneratedIdOnCreate, beforeDelete, beforeDuplicate, beforeDuplicate, beforeSave, checkAccessAllowed, checkRowReorderScope, copyEntityIntoOriginal, delete, edit, findItemBy, getAll, getAllItemsIncludeSpecSearch, getCleanKey, getCleanValue, getCustomFieldsSearchDto, getDomainId, getImportedColumns, getImportMode, getInvalidImportedRows, getLastImportedRow, getNonEditableProperties, getOne, getOptions, getParamsMap, getProp, getRepo, getRequest, getSearchConditions, getSearchProperties, getSum, getUpdateByColumn, getUser, handleEditor, hasNotify, initBinder, isDuplicate, isExporting, isForceReload, isImporting, isSkipWrongData, jpaToBoolean, preImportDataEdit, processFromEntity, processFromEntity, processFromEntity, processToEntity, rowReorder, searchItem, setForceReload, setRedirect, setRequest, setValidator, sumItems, throwConstraintViolation, throwError, throwError, throwError, throwError, throwError, throwError, validateEditor
-
Constructor Details
-
WebpagesRestController
@Autowired public WebpagesRestController(DocDetailsRepository docDetailsRepository, EditorFacade editorFacade, DocAtrDefRepository docAtrDefRepository, EditorService editorService)
-
-
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
Applies a group delta to freshly loaded editor data through the normal save workflow.- Overrides:
processActionin classWebpagesDatatable- 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:DatatableRestControllerV2Validates custom fields and prepares valid JSON editor values for persistence.The method resolves required field alphabets via
CustomFieldsServiceand checks corresponding properties (fieldX) on the entity. Missing values are reported usingErrors.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:
validateEditorForCustomFieldsin classDatatableRestControllerV2<DocDetails,Long> - Parameters:
request- current HTTP requesttarget- datatable request wrapperuser- current authenticated usererrors- collector for validation errorsid- entity identifier from request payloadentity- entity instance to validate
-