Class ScopedGroupsTreeService
The scope is resolved from GroupsDB during construction and contains configured roots
and their visible descendants. Visible ancestors outside that scope provide navigation paths
but cannot be selected. Folder permissions determine visibility and selection unless the caller
explicitly disables those checks for an application-managed scope.
Supports initial tree loading, lazy child loading, and folder-name searches through
getItems(int, int, String, String).
-
Constructor Summary
ConstructorsConstructorDescriptionScopedGroupsTreeService(List<LabelValue> folders, Identity user, String domain) Resolves the application folder scope with folder permission checks enabled.ScopedGroupsTreeService(List<LabelValue> folders, Identity user, String domain, boolean checkGroupsPerms) Resolves configured roots, visible descendants, and navigation ancestors from the folder cache. -
Method Summary
Modifier and TypeMethodDescriptionCreates a flat list of jsTree nodes for initial loading, lazy child loading, or searching.booleanisSelectable(int groupId) Checks whether a folder belongs to the selectable scope resolved during construction.
-
Constructor Details
-
ScopedGroupsTreeService
Resolves the application folder scope with folder permission checks enabled.- Parameters:
folders- configured roots whose values contain a positive folder ID, optionally followed by*to preserve recursive article filteringuser- user whose permissions and tree sorting preferences apply;nullproduces an empty scopedomain- domain to include whenmultiDomainEnabledis enabled; must not benullin that case- See Also:
-
ScopedGroupsTreeService
public ScopedGroupsTreeService(List<LabelValue> folders, Identity user, String domain, boolean checkGroupsPerms) Resolves configured roots, visible descendants, and navigation ancestors from the folder cache.Descendants are traversed regardless of a root's
*suffix. The suffix is retained in the node's article filter, and a suffixed value takes precedence for duplicate root IDs. Folders that fail visibility checks are skipped together with their descendant traversal.With permission checks enabled, only editable folders are selectable; viewable folders remain available for navigation. Users restricted to individual pages without editable folders receive an empty scope. Ancestors added above the configured roots are never selectable.
- Parameters:
folders- configured roots whose values contain a positive folder ID, optionally followed by*; labels are unused, and invalid or nonpositive IDs are ignoreduser- user whose permissions and tree sorting preferences apply;nullproduces an empty scopedomain- domain to include whenmultiDomainEnabledis enabled; must not benullin that casecheckGroupsPerms- whether to enforce folder edit and view permissions;falsetrusts the caller's configured scope while retaining domain and hidden-folder checks
-
-
Method Details
-
getItems
public List<GroupsJsTreeItem> getItems(int parentId, int selectedId, String searchValue, String searchType) Creates a flat list of jsTree nodes for initial loading, lazy child loading, or searching.Without a search,
parentId == 0loads the roots and opens navigation ancestors and the selected folder's path, including direct children of every opened folder. If the requested selection is unavailable, the first selectable folder collected during construction is selected if one exists. A nonzero parent ID loads only that folder's direct children.A nonblank search takes precedence over both IDs and returns matching folder names with their scoped ancestors opened. Comparisons ignore case and diacritics. Search and lazy-load responses do not mark any node as selected. Nodes outside the selectable set are disabled.
- Parameters:
parentId- parent folder whose children to load, or0for the initial treeselectedId- preferred selectable folder for initial loading; ignored for searches and lazy child loadingsearchValue- folder-name search text, ornullor a blank string to load the treesearchType- comparison mode:startwith,endwith, orequals; any other value, includingnull, uses substring matching- Returns:
- nodes ordered by the user's tree sorting preferences, with parent IDs and loading states set for jsTree; empty if no nodes qualify or a requested lazy-load parent is unknown
-
isSelectable
public boolean isSelectable(int groupId) Checks whether a folder belongs to the selectable scope resolved during construction.- Parameters:
groupId- folder ID to check- Returns:
trueif the folder is selectable;falsefor navigation-only, excluded, or unknown folders
-