nah, forget what I said.

[code]protected Node findPrincipalNode(String principalName, Session session) 
throws RepositoryException {
        final String where = "where name() = '" + principalName + "'";

        final String statement = "select * from [" + ItemType.GROUP + "] " + 
where;

        Query query = 
session.getWorkspace().getQueryManager().createQuery(statement, Query.JCR_SQL2);
        NodeIterator iter = query.execute().getNodes();
        Node group = null;
        while (iter.hasNext()) {
            Node node = iter.nextNode();
            // unnecessarily redundant since query is already limited no?
            if (node.isNodeType(ItemType.GROUP.getSystemName())) {
                group = node;
                break;
            }
        }
        if (iter.hasNext()) {
            log.error("More than one group found with name \"{}\"", 
principalName);
        }
        return group;[/code]

I rebuilt this query and it returns 1 result. This message is quite confusing. 
So there might be more then one result but there is only one allowed...

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=ed613803-e3d1-4991-b852-910056ca2b16


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

Reply via email to