Details
Description
The UpdateExecutor currently requires either a node path or Xpath query definition to select or navigate through the nodes to update.
For some purposes, reporting (only) in particular, it is more convenient if the NodeUpdateVisitor can provide the nodes to process itself though.
Therefore the BaseNodeUpdateVisitor will be extended with the following methods to provide its own selection/navigation on the nodes to process (update or just query/report) :
/** * Initiates the retrieval of the nodes when using custom instead of path or xpath (query) based node selection, * returning the first node to visit * @param session * @return first node to visit, or null if none found * @throws RepositoryException */ public Node firstNode(final Session session) throws RepositoryException { return null; // implement when using custom node selection/navigation } /** * Return a following node, when using custom instead of path or xpath (query) based node selection * @return next node to visit, or null if none left * @throws RepositoryException */ public Node nextNode() throws RepositoryException { return null; // implement when using custom node selection/navigation }
In addition two more methods are added:
/** * Overridable boolean function to indicate if skipped node paths should be logged (default true) * @return true if skipped node paths should be logged */ public boolean logSkippedNodePaths() { return true; } /** * Overridable boolean function to indicate if node checkout can be skipped (default false) * @return true if node checkout can be skipped */ public boolean skipCheckoutNodes() { return false; // return true for readonly visitors and/or updates unrelated to versioned content }
The logSkippedNodePaths() method is useful to overrride when a (potentially) huge number of nodes are processed which are expected (or explicitly, like for reporting-only visitors) to be skipped.
The default implementation will still logs these skipped node paths, and store this in the repository as a binary log.
To reduce the (unused) report overhead of this binary property hipposys:skipped, a visitor can override this method and return false instead:
@Override boolean logSkippedNodePaths() { return false; }
The skipCheckoutNodes() method also is useful to override when running a readonly updater and/or updated unrelated to versioned content.
The default implementation will ensure nodes are checked out before invoking the doUpdate(Node) method, but that can have considerable overhead if done unnecessarily.
To reduce this overhead a visitor can override this method and return true instead:
@Override boolean skipCheckoutNodes() { return true; }
Attachments
Issue Links
- causes
-
CMS-11036 [UpdaterEditor] Provide support for custom node selection/navigation
- Closed
- is backported by
-
REPO-1922 [UpdateExecutor Backport 12.0] Provide support for custom node selection/navigation
- Closed
-
REPO-1923 [UpdateExecutor Backport 11.2] Provide support for custom node selection/navigation
- Closed
-
REPO-1924 [UpdateExecutor Backport 10.2] Provide support for custom node selection/navigation
- Closed