Class FileArchiveTreeRestController
java.lang.Object
sk.iway.iwcm.admin.jstree.JsTreeRestController<DirTreeItem>
sk.iway.iwcm.components.file_archiv.FileArchiveTreeRestController
@RestController
@RequestMapping("/admin/rest/components/archive/tree")
@PreAuthorize("@WebjetSecurityService.hasPermission(\'cmp_file_archiv\')")
public class FileArchiveTreeRestController
extends JsTreeRestController<DirTreeItem>
REST controller providing the jsTree folder structure for the file archive.
Supports lazy-loading of subdirectories within the configured archive root path.
Directory creation, deletion, and move operations are intentionally disabled.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classRequest body for creating a folder. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckAccessAllowed(jakarta.servlet.http.HttpServletRequest request) Metoda pre kontrolu pristupu pouzivatela pomocou requestuCreates a new folder within the archive root.protected voiddelete(Map<String, Object> result, DirTreeItem item) protected voidmove(Map<String, Object> result, JsTreeMoveItem item) protected voidsave(Map<String, Object> result, DirTreeItem item) protected voidtree(Map<String, Object> result, JsTreeMoveItem item) Returns the directory tree data for jsTree.Methods inherited from class sk.iway.iwcm.admin.jstree.JsTreeRestController
deleteItem, getProp, getRequest, getUser, moveItem, saveItem, setRequest, tree
-
Constructor Details
-
FileArchiveTreeRestController
public FileArchiveTreeRestController()
-
-
Method Details
-
tree
Returns the directory tree data for jsTree. For root requests, returns the archive root node with its children flag. For sub-folder requests, returns the immediate child directories. Validates that the requested path is within the archive root to prevent path traversal.- Specified by:
treein classJsTreeRestController<DirTreeItem>- Parameters:
result- - map to populate with "result", "items" or "error"item- - jsTree move item containing the requested node id
-
save
- Specified by:
savein classJsTreeRestController<DirTreeItem>- Parameters:
result- - mapa s vysledkom, ocakava sa kluc result (boolean) a moze obsahovat error (String), ktory sa na FE zobrazi v toastr.erroritem- -JsTreeRestControllerpolozka na ulozenie
-
checkAccessAllowed
public boolean checkAccessAllowed(jakarta.servlet.http.HttpServletRequest request) Description copied from class:JsTreeRestControllerMetoda pre kontrolu pristupu pouzivatela pomocou requestu- Specified by:
checkAccessAllowedin classJsTreeRestController<DirTreeItem>- Returns:
-
delete
- Specified by:
deletein classJsTreeRestController<DirTreeItem>- Parameters:
result- - mapa s vysledkom, ocakava sa kluc result (boolean) a moze obsahovat error (String), ktory sa na FE zobrazi v toastr.erroritem- -JsTreeRestControllerpolozka na zmazanie
-
move
- Specified by:
movein classJsTreeRestController<DirTreeItem>- Parameters:
result- - mapa s vysledkom, ocakava sa kluc result (boolean) a moze obsahovat error (String), ktory sa na FE zobrazi v toastr.erroritem- -JsTreeMoveItempresunuta polozka
-
createFolder
@PostMapping("create") @PreAuthorize("@WebjetSecurityService.hasPermission(\'menuFileArchivManagerCategory\')") protected org.springframework.http.ResponseEntity<Map<String,Object>> createFolder(@RequestBody FileArchiveTreeRestController.CreateFolderRequest request) Creates a new folder within the archive root. Validates the folder name (forbidden symbols check), normalizes it (diacritics → English, special chars removed, lowercase), and creates the folder under the specified parent path.- Parameters:
request- request body containing the folder name and parent virtual path- Returns:
- response containing the result or a localized error
-