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.
  • Constructor Details

    • FileArchiveTreeRestController

      public FileArchiveTreeRestController()
  • Method Details

    • tree

      protected void tree(Map<String,Object> result, JsTreeMoveItem item)
      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:
      tree in class JsTreeRestController<DirTreeItem>
      Parameters:
      result - - map to populate with "result", "items" or "error"
      item - - jsTree move item containing the requested node id
    • save

      protected void save(Map<String,Object> result, DirTreeItem item)
      Specified by:
      save in class JsTreeRestController<DirTreeItem>
      Parameters:
      result - - mapa s vysledkom, ocakava sa kluc result (boolean) a moze obsahovat error (String), ktory sa na FE zobrazi v toastr.error
      item - - JsTreeRestController polozka na ulozenie
    • checkAccessAllowed

      public boolean checkAccessAllowed(jakarta.servlet.http.HttpServletRequest request)
      Description copied from class: JsTreeRestController
      Metoda pre kontrolu pristupu pouzivatela pomocou requestu
      Specified by:
      checkAccessAllowed in class JsTreeRestController<DirTreeItem>
      Returns:
    • delete

      protected void delete(Map<String,Object> result, DirTreeItem item)
      Specified by:
      delete in class JsTreeRestController<DirTreeItem>
      Parameters:
      result - - mapa s vysledkom, ocakava sa kluc result (boolean) a moze obsahovat error (String), ktory sa na FE zobrazi v toastr.error
      item - - JsTreeRestController polozka na zmazanie
    • move

      protected void move(Map<String,Object> result, JsTreeMoveItem item)
      Specified by:
      move in class JsTreeRestController<DirTreeItem>
      Parameters:
      result - - mapa s vysledkom, ocakava sa kluc result (boolean) a moze obsahovat error (String), ktory sa na FE zobrazi v toastr.error
      item - - JsTreeMoveItem presunuta 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