Hi,
I'm extending a QueryUtil to create a  JackrabbitQueryUtil  similar to the
function in
http://wiki.magnolia-cms.com/display/WIKI/Limiting+number+of+search+results+with+simpleSearch

My class works but I do not understand a trick. I looked at the code of
http://wiki.magnolia-cms.com/display/WIKI/Hibernate%27s+Criteria-like+API+for+Magnolia-JCR
but there's a similar snippet that I do not understand.
The code is the following:

private void build(javax.jcr.Node node, String nodeType,
java.util.Collection collection, java.util.Map dirtyHandles,
                info.magnolia.cms.security.AccessManager accessManager) throws
javax.jcr.RepositoryException {

       if ((node.isNodeType(nodeType) ||
org.apache.commons.lang.StringUtils.isEmpty(nodeType)) &&
                !node.isNodeType(info.magnolia.cms.core.ItemType.NT_RESOURCE)) {
            if (dirtyHandles.get(node.getPath()) == null) {
                boolean isAllowed =
accessManager.isGranted(info.magnolia.cms.core.Path.getAbsolutePath(node.getPath()),
                        info.magnolia.cms.security.Permission.READ);
                if (isAllowed) {
                    collection.add(new
info.magnolia.cms.core.DefaultContent(node, accessManager));
                    dirtyHandles.put(node.getPath(),
org.apache.commons.lang.StringUtils.EMPTY);
                }
            }
            return;
        }

       if (node.getDepth() > 0) {
            build(node.getParent(), nodeType, collection,
dirtyHandles, accessManager);
        }
    }

What are dirtyHandles? How they are managed?

Thanks.
Andrea

----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to