I am trying to create a method that would let me figure out if the child is the last sibling of parent. All is going well, I have some help from Jackrabbit user group which recommended using following:

        NodeIterator iterator = parent.getJCRNode().getNodes();
        long siblingCount = iterator.getSize();
        iterator.skip(siblingCount-1);
        if (pSibling.getJCRNode().isSame(iterator.nextNode())) {
            return true; /* this is the last sibling */
        }



Obviously, the code relies on JCR (NodeIterator.skip, isSame,etc, etc)...

Does Magnolia API has similar mothods classes I could use that would not depend on using the JCR Node directly?

Unfortunately not. We will work on that topic for future versions (making the magnolia api compatible with the jcr api). Till now you have to use the jcr api.

Philipp Bracher



----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------

Reply via email to