/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type { NodeIterator } from "../../types/javax/jcr/NodeIterator"; import type { Filter } from "../../types/senselogic/sitevision/api/base/Filter"; import type { String } from "../../types/java/lang/String"; import type { Node } from "../../types/javax/jcr/Node"; import type { List } from "../../types/java/util/List"; import type { FilterSplit } from "../../types/senselogic/sitevision/api/base/FilterSplit"; /** * Node iterator utility interface. * *
* An instance of the Sitevision class implementing this interface can be obtained via
* {@link senselogic.sitevision.api.Utils#getNodeIteratorUtil()}.
* See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the Utils interface.
*
* This NodeIterator decorates a NodeIterator with a Filter, i.e. it will only return nodes that matches given filter. *
* ** This server-side Javascript example demonstrates how to create a node iterator that is very similar to the * {@link #getMenuItems(Node) MenuItems} iterator but this node iterator is not respecting the "visibleInMenus" property. *
* const nodeFilterUtil = require('NodeFilterUtil');
* const nodeIteratorUtil = require('NodeIteratorUtil');
* const startNode = ...
*
* const filter = nodeFilterUtil.getAnyOfPrimaryNodeTypesFilter([
* 'sv:page', 'sv:structurePage', 'sv:article', 'sv:link', 'sv:structureLink', 'sv:collaborationGroupPage'
* ]);
* const nodes = nodeIteratorUtil.getFilteredNodeIterator(startNode.getNodes(), filter);
*
* while (nodes.hasNext()) {
* let node = nodes.nextNode();
* ...
* }
* @param aNodeIterator a NodeIterator, must not be null
* @param aFilter a Node Filter, must not be null
* @return a filtered NodeIterator
* @throws NullPointerException if aNodeIterator or aFilter is null
* @see NodeFilterUtil
* @since Sitevision 8.1
*/
getFilteredNodeIterator(
aNodeIterator: NodeIterator,
aFilter: Filter
): NodeIterator;
/**
* Gets a node iterator via a node identifier.
*
* * The purpose of this method is twofold: *
*NodeIterator for the sub nodes of the Node resolved via aIdentifier, or null if indeterminable
* @since Sitevision 4.0.2
*/
getNodeIteratorByIdentifier(aIdentifier: String | string): NodeIterator;
/**
* Gets an iterator for default menu items (i.e. non-hidden pages, link pages etc. where current user has read permission)
* @param aParent the base node for the iterator
* @return a NodeIterator for the sub nodes of aParent, or null if indeterminable
(i.e. aParent is not a Node in the page tree)
*/
getMenuItems(aParent: Node): NodeIterator;
/**
* Gets an iterator for default menu items via a node identifier.
*
* * The purpose of this method is twofold: *
*NodeIterator for the sub nodes of the Node resolved via aIdentifier, or null if indeterminable
* @since Sitevision 4.0.2
* @see #getMenuItems(Node)
*/
getMenuItemsByIdentifier(aIdentifier: String | string): NodeIterator;
/**
* Gets an iterator for default menu items (i.e. getMenuItems(Node)), including folders
* @see #getMenuItems(Node)
* @param aParent the base node for the iterator
* @return a NodeIterator for the sub nodes of aParent, or null if indeterminable
(i.e. aParent is not a Node in the page tree)
*/
getMenuItemsIncludingFolders(aParent: Node): NodeIterator;
/**
* Gets an iterator for default menu items (including folders) via a node identifier.
*
* * The purpose of this method is twofold: *
*NodeIterator for the sub nodes of the Node resolved via aIdentifier, or null if indeterminable
* @since Sitevision 4.0.2
* @see #getMenuItemsIncludingFolders(Node)
*/
getMenuItemsIncludingFoldersByIdentifier(
aIdentifier: String | string
): NodeIterator;
/**
* Gets the first node from a node iterator that matches a specified filter.
*
* * Tip! Use {@link senselogic.sitevision.api.node.NodeFilterUtil} to get * an appropriate node filter. *
* @param aNodeIterator a node iterator * @param aFilter a node filter * @return first node that matchesaFilter, or null.
If aFilter is null, the filter will be ignored (all nodes will be accepted).
If aNodeIterator is null, null will be returned.
* @since Sitevision 3.6.2
*/
findFirst(aNodeIterator: NodeIterator, aFilter: Filter): Node;
/**
* Gets a max-sized node list from a node iterator that matches a specified filter.
*
*
* Tip! Use {@link senselogic.sitevision.api.node.NodeFilterUtil} to get
* an appropriate node filter. If the list of nodes should be sorted by a specific property value,
* you would typically use {@link senselogic.sitevision.api.node.NodeComparatorUtil}
* to get an appropriate Comparator.
*
aFilter, never null.
The list will contain at most aLimit nodes.
If aNodeIterator is null, an empty list will be returned.
If aFilter is null, the filter will be ignored (all nodes will be accepted).
If aLimit is negative or zero, an empty list will be returned.
* @since Sitevision 3.6.2
*/
findNodes(aNodeIterator: NodeIterator, aFilter: Filter, aLimit: number): List;
/**
* Gets a max-sized node list from a node iterator that matches a specified filter, skipping a specified number of matching nodes.
*
*
* Executing findMoreNodes(nodeIterator, filter, 0, 10) is conceptually equivalent
* to executing findNodes(nodeIterator, filter, 10).
*
* Tip! Use {@link senselogic.sitevision.api.node.NodeFilterUtil} to get an appropriate node filter. *
* @param aNodeIterator a node iterator * @param aFilter a node filter * @param aSkip number of matching nodes to skip * @param aLimit max number of nodes to include in the result * @return a list of nodes that matches aFilter, never null. The list will contain at most aLimit number of nodes and aSkip number of nodes will be ignored. If aNodeIterator is null, an empty list will be returned. If aFilter is null, the filter will be ignored (all nodes will be accepted). If aSkip is negative or zero, no nodes will be skipped. If aLimit is negative or zero, an empty list will be returned. * @since Sitevision 2025.01.1 */ findMoreNodes( aNodeIterator: NodeIterator, aFilter: Filter, aSkip: number, aLimit: number ): List; /** * Gets a list of all nodes from a node iterator that matches a specified filter. * *
* Executing findAll(nodeIterator, null) is conceptually equivalent
* to executing toList(nodeIterator).
*
* Tip! Use {@link senselogic.sitevision.api.node.NodeFilterUtil} to get
* an appropriate node filter. If the list of nodes should be sorted by a specific property value,
* you would typically use {@link senselogic.sitevision.api.node.NodeComparatorUtil}
* to get an appropriate Comparator.
*
aFilter, never null.
If aFilter is null, the filter will be ignored (all nodes will be accepted).
If aNodeIterator is null, an empty list will be returned.
* @since Sitevision 3.6.2
*/
findAll(aNodeIterator: NodeIterator, aFilter: Filter): List;
/**
* Gets a list of all nodes of a node iterator.
*
*
* Note! This is a convenience method to use only when you must get nodes as a list!
* The only apparent reason is when you need need to sort the nodes! If you don't, you should use
* the NodeIterator instead and do your processing for each node.
*
* Sorting tip! When the list of nodes should be sorted by a specific property value,
* you would typically use {@link senselogic.sitevision.api.node.NodeComparatorUtil}to get an appropriate
* Comparator. The list can then be sorted by Collections.sort(List, Comparator).
* When using Velocity, you must use the non-static class {@link senselogic.sitevision.api.script.factory.CollectionsInstance}.
*
aNodeIterator, never null.
* @since Sitevision 3.6.2
*/
toList(aNodeIterator: NodeIterator): List;
/**
* Gets the filtering result of a split operation for a node iterator with a node filter as divider.
*
* * This method would typically be used instead of {@link #findAll(javax.jcr.NodeIterator, senselogic.sitevision.api.base.Filter)} * when you are also interested in the nodes that does NOT match the filter. *
*
* Note! If aFilter is null, no nodes will match (all nodes
* gathered via aNodeIterator will be rejected in the resulting filter split).
*