jsr-333
  1. jsr-333
  2. JSR_333-57

give access to the list of child node names

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      instead of having to iterate of the nodes, it would be useful to simply get the list of child node names. this can for example be used to add a way to cycle through all the child nodes of a parent.

      imagine a node /news with /news/first /news/second /news/third /news/fourth
      when the user is presented the UI for /news/second it may be useful to allow them to have links pointing to /news/first and /news/third
      currently this requires fetching the parent, then getting an iterator with the children and then iterating to find the proper nodes.

        Activity

        Hide
        stefan_guggisberg added a comment -

        proposal:

        add

        StringIterator Node#getNodeNames() throws RepositoryException

        Show
        stefan_guggisberg added a comment - proposal: add StringIterator Node#getNodeNames() throws RepositoryException
        Hide
        rhauch added a comment -

        What does StringIterator look like? Is it a RangeIterator, or could it just be a Iterator<String>?

        An advantage of adding this method is that it may (depending upon the implementation) prevent the loading of the child nodes when the client only needs the child names.

        Show
        rhauch added a comment - What does StringIterator look like? Is it a RangeIterator , or could it just be a Iterator<String> ? An advantage of adding this method is that it may (depending upon the implementation) prevent the loading of the child nodes when the client only needs the child names.
        Hide
        stefan_guggisberg added a comment -

        What does StringIterator look like? Is it a RangeIterator, or could it just be a Iterator<String>?

        good point! i (wrongly) assumed that there's already a javax.jcr.StringIterator.

        it should be a RangeIterator (i.e. same semantics as NodeIterator).

        Show
        stefan_guggisberg added a comment - What does StringIterator look like? Is it a RangeIterator , or could it just be a Iterator<String> ? good point! i (wrongly) assumed that there's already a javax.jcr.StringIterator . it should be a RangeIterator (i.e. same semantics as NodeIterator ).
        Hide
        Peeter Piegaze added a comment -

        Node.getNodeNames and StringIterator added as suggested.

        Show
        Peeter Piegaze added a comment - Node.getNodeNames and StringIterator added as suggested.
        Hide
        lsmith77 added a comment -

        i have begun leveraging this new method inside a PHPCR project and found that it would be useful to also support a filter parameter like we do in getNodes. what do you think?

        Show
        lsmith77 added a comment - i have begun leveraging this new method inside a PHPCR project and found that it would be useful to also support a filter parameter like we do in getNodes. what do you think?
        Hide
        lsmith77 added a comment -

        see also JSR_333-66

        Show
        lsmith77 added a comment - see also JSR_333-66

          People

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

            Dates

            • Created:
              Updated:
              Resolved: