jsr-333
  1. jsr-333
  2. JSR_333-38

Add a getNodes() method to the API

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: api
    • Labels:
      None

      Description

      Right now there is only a getNode() method defined in the API, however there are use cases where it would be more efficient to be able to get multiple nodes at once, especially when using a remote API.

      For example:

      • fetching the nodes associated with a result set from a search (actually it might be nice to also add some API to request nodes to be returned instead of lucene data in a search)
      • fetching multiple nodes who's paths/uuid are stored in a separate system (f.e. a list of nodes assembled in a browser interface on which certain operations should be executed, like a shopping cart)

        Activity

        Hide
        Peeter Piegaze added a comment -

        Proposal:
        Add the following two methods:
        (Note that the the returned nodes and properties are filtered by access control, with no exception thrown in cases of denied access. I thought this would be more natural that throwing if one path among many was denied.)

        /**

        • Returns an iterator over all the nodes at the specified absolute paths
        • in the workspace that exist and are accessible to this session.
        • If none of the specified paths leads to an existing and accessible
        • node then an empty iterator is returned.
          *
        • @param absPaths An array of absolute paths.
        • @return an iterator over all nodes that exist at the specified paths and that are accessible.
        • @throws RepositoryException If an error occurs.
        • @since JCR 2.1
          */
          public Node getNodes(String[] absPaths) throws RepositoryException;

        /**

        • Returns an iterator over all the properties at the specified absolute paths
        • in the workspace that exist and are accessible to this session.
        • If none of the specified paths leads to an existing and accessible
        • property then an empty iterator is returned.
          *
        • @param absPaths An array of absolute paths.
        • @return an iterator over all properties that exist at the specified paths and that are accessible.
        • @throws RepositoryException If an error occurs.
        • @since JCR 2.1
          */
          public Node getProperties(String[] absPaths) throws RepositoryException;
        Show
        Peeter Piegaze added a comment - Proposal: Add the following two methods: (Note that the the returned nodes and properties are filtered by access control, with no exception thrown in cases of denied access. I thought this would be more natural that throwing if one path among many was denied.) /** Returns an iterator over all the nodes at the specified absolute paths in the workspace that exist and are accessible to this session. If none of the specified paths leads to an existing and accessible node then an empty iterator is returned. * @param absPaths An array of absolute paths. @return an iterator over all nodes that exist at the specified paths and that are accessible. @throws RepositoryException If an error occurs. @since JCR 2.1 */ public Node getNodes(String[] absPaths) throws RepositoryException; /** Returns an iterator over all the properties at the specified absolute paths in the workspace that exist and are accessible to this session. If none of the specified paths leads to an existing and accessible property then an empty iterator is returned. * @param absPaths An array of absolute paths. @return an iterator over all properties that exist at the specified paths and that are accessible. @throws RepositoryException If an error occurs. @since JCR 2.1 */ public Node getProperties(String[] absPaths) throws RepositoryException;
        Hide
        Peeter Piegaze added a comment -

        Sorry, obviously those methods should return iterators:

        public NodeIterator getNodes(String[] absPaths) throws RepositoryException;
        public PropertyIterator getProperties(String[] absPaths) throws RepositoryException;

        Show
        Peeter Piegaze added a comment - Sorry, obviously those methods should return iterators: public NodeIterator getNodes(String[] absPaths) throws RepositoryException; public PropertyIterator getProperties(String[] absPaths) throws RepositoryException;
        Hide
        lsmith77 added a comment -

        just to make sure we are on the same page (which sounds like it from the above API):
        missing nodes (properties) should also not throw an error.

        Show
        lsmith77 added a comment - just to make sure we are on the same page (which sounds like it from the above API): missing nodes (properties) should also not throw an error.
        Hide
        Peeter Piegaze added a comment -

        > just to make sure we are on the same page (which sounds like it from the above API):
        > missing nodes (properties) should also not throw an error.

        Agreed. That is what I mean when I say that the retrurned nodes/properties are filtered...and might even be filtered to the point where the iterator is empty, in the extreme case where none of the paths given are existant/accessible

        Show
        Peeter Piegaze added a comment - > just to make sure we are on the same page (which sounds like it from the above API): > missing nodes (properties) should also not throw an error. Agreed. That is what I mean when I say that the retrurned nodes/properties are filtered...and might even be filtered to the point where the iterator is empty, in the extreme case where none of the paths given are existant/accessible
        Hide
        Peeter Piegaze added a comment -

        Added getNodes and getProperties as described above.

        Show
        Peeter Piegaze added a comment - Added getNodes and getProperties as described above.

          People

          • Assignee:
            Unassigned
            Reporter:
            lsmith77
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: