Class FieldsSettingsRestController
java.lang.Object
sk.iway.iwcm.system.datatable.DatatableRestControllerV2<FieldsSettingsEntity,Long>
sk.iway.iwcm.system.datatable.settings.fields.rest.FieldsSettingsRestController
@RestController
@RequestMapping("/admin/rest/settings/fields-settings")
@PreAuthorize("@WebjetSecurityService.hasPermission(\'dataTablesConfig\')")
public class FieldsSettingsRestController
extends DatatableRestControllerV2<FieldsSettingsEntity,Long>
Manages field settings through DataTables Editor and supplies class, field and tab autocomplete options.
Saves use the current domain, and successful changes invalidate the affected settings caches.
Access requires the
dataTablesConfig permission.-
Constructor Summary
ConstructorsConstructorDescriptionFieldsSettingsRestController(FieldsSettingsRepository repository, FieldsSettingsService fieldsSettingsService) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcopyEntityIntoOriginal(FieldsSettingsEntity entity, FieldsSettingsEntity original) Merges submitted settings while preserving nullable Boolean fields omitted from an import.booleandeleteItem(FieldsSettingsEntity entity, long id) Deletes settings and invalidates their stored cache key when deletion succeeds.editItem(FieldsSettingsEntity entity, long id) Updates settings and invalidates both the previous and saved cache keys when they differ.getAutocompleteClass(String term) getAutocompleteField(String term, String className) getAutocompleteTab(String term, String className) insertItem(FieldsSettingsEntity entity) Inserts settings and invalidates the cache for the saved class and domain.processToEntity(FieldsSettingsEntity entity, ProcessItemAction action) Vykona upravy v entite pri odpovedi (ulozeni) z REST rozhranie napr.voidvalidateEditor(jakarta.servlet.http.HttpServletRequest request, DatatableRequest<Long, FieldsSettingsEntity> target, Identity user, org.springframework.validation.Errors errors, Long id, FieldsSettingsEntity entity) Rejects unsupported fields and tabs, self-referencing sort positions and duplicate class/field settings in the current domain.Methods inherited from class sk.iway.iwcm.system.datatable.DatatableRestControllerV2
action, add, addNotify, addNotify, addSpecSearch, addSpecSort, afterDelete, afterDuplicate, afterImportChunk, afterSave, allowGeneratedIdOnCreate, beforeDelete, beforeDuplicate, beforeDuplicate, beforeSave, checkAccessAllowed, checkItemPerms, checkRowReorderScope, delete, edit, findByColumns, findItemBy, getAll, getAllItems, getAllItemsIncludeSpecSearch, getCleanKey, getCleanValue, getCustomFieldsSearchDto, getDomainId, getImportedColumns, getImportMode, getInvalidImportedRows, getLastImportedRow, getNonEditableProperties, getOne, getOneItem, getOptions, getParamsMap, getProp, getRepo, getRequest, getSearchConditions, getSearchProperties, getSum, getUpdateByColumn, getUser, handleEditor, hasNotify, initBinder, isDuplicate, isExporting, isForceReload, isImporting, isSkipWrongData, jpaToBoolean, preImportDataEdit, processAction, processFromEntity, processFromEntity, processFromEntity, processFromEntity, rowReorder, searchItem, setForceReload, setRedirect, setRequest, setValidator, sumItems, throwConstraintViolation, throwError, throwError, throwError, throwError, throwError, throwError, validateEditorForCustomFields
-
Constructor Details
-
FieldsSettingsRestController
@Autowired public FieldsSettingsRestController(FieldsSettingsRepository repository, FieldsSettingsService fieldsSettingsService)
-
-
Method Details
-
processToEntity
Description copied from class:DatatableRestControllerV2Vykona upravy v entite pri odpovedi (ulozeni) z REST rozhranie napr. vyvola potrebne editorFields nastavenia (from editorFields to entity)- Overrides:
processToEntityin classDatatableRestControllerV2<FieldsSettingsEntity,Long> action- - typ zmeny - create,edit,getall,
-
insertItem
Inserts settings and invalidates the cache for the saved class and domain.- Overrides:
insertItemin classDatatableRestControllerV2<FieldsSettingsEntity,Long> - Returns:
-
editItem
Updates settings and invalidates both the previous and saved cache keys when they differ.- Overrides:
editItemin classDatatableRestControllerV2<FieldsSettingsEntity,Long> - Returns:
-
deleteItem
Deletes settings and invalidates their stored cache key when deletion succeeds.- Overrides:
deleteItemin classDatatableRestControllerV2<FieldsSettingsEntity,Long> - Returns:
-
copyEntityIntoOriginal
Merges submitted settings while preserving nullable Boolean fields omitted from an import. Omitted Boolean values are restored on the submitted entity before the inherited merge- Overrides:
copyEntityIntoOriginalin classDatatableRestControllerV2<FieldsSettingsEntity,Long> - Parameters:
entity- submitted entity containing the new field valuesoriginal- stored entity to update in place
-
validateEditor
public void validateEditor(jakarta.servlet.http.HttpServletRequest request, DatatableRequest<Long, FieldsSettingsEntity> target, Identity user, org.springframework.validation.Errors errors, Long id, FieldsSettingsEntity entity) Rejects unsupported fields and tabs, self-referencing sort positions and duplicate class/field settings in the current domain. Duplicate checks exclude the edited record and are left to the database constraint during imports.- Overrides:
validateEditorin classDatatableRestControllerV2<FieldsSettingsEntity,Long>
-
getAutocompleteClass
-
getAutocompleteField
@GetMapping("/autocomplete-field") public List<LabelValue> getAutocompleteField(@RequestParam String term, @RequestParam("DTE_Field_className") String className) -
getAutocompleteTab
@GetMapping("/autocomplete-tab") public List<LabelValue> getAutocompleteTab(@RequestParam String term, @RequestParam("DTE_Field_className") String className)
-