Class ResultItemSetCollector

java.lang.Object
org.onehippo.forge.content.exim.repository.jaxrs.util.ResultItemSetCollector

public class ResultItemSetCollector extends Object
Utility to collect ResultItems based on various conditions.
  • Method Details

    • collectItemsFromExecutionParams

      public static Result collectItemsFromExecutionParams(Session session, ExecutionParams params) throws RepositoryException
      Collect ResultItems from the given params by picking nodes from the given paths or querying nodes from the given queries.
      Parameters:
      session - JCR session
      params - ExecutionParams instance
      Returns:
      collected ResultItems
      Throws:
      RepositoryException - if repository exception occurs
    • fillResultItemsForNodePaths

      public static void fillResultItemsForNodePaths(Session session, Collection<String> nodePaths, boolean binary, Set<String> pathsCache, Result resultOut) throws RepositoryException
      Collect nodes from nodePaths with validations and fill ResultItem instances in resultOut.
      Parameters:
      session - JCR session
      nodePaths - document or binary node paths to validate
      binary - flag whether the node paths are for binary content or not
      pathsCache - node path cache set, which can be useful if you want to avoid putting the same items multiple times. This can be null.
      resultOut - Result instance
      Throws:
      RepositoryException - if repository exception occurs
    • fillResultItemsFromQueries

      public static void fillResultItemsFromQueries(Session session, Collection<String> queries, boolean binary, Set<String> pathsCache, Result resultOut) throws RepositoryException
      Collect nodes by executing the queries with validations and fill ResultItem instances in resultOut.
      Parameters:
      session - JCR session
      queries - JCR query statements for documents or binaries
      binary - flag whether the node paths are for binary content or not
      pathsCache - node path cache set, which can be useful if you want to avoid putting the same items multiple times. This can be null.
      resultOut - Result instance
      Throws:
      RepositoryException - if repository exception occurs