Package org.apache.jackrabbit.core

Examples of org.apache.jackrabbit.core.SessionImpl.nodeExists()


                    a = null;
                }
            }

            // authNode - anyNode - authFolder -> create User
            if (!sImpl.nodeExists(path)) {
                someContent = userNode.addNode("mystuff", "nt:unstructured");              
            }
            folder = someContent.addNode("folder", sImpl.getJCRName(UserConstants.NT_REP_AUTHORIZABLE_FOLDER));
            sImpl.save(); // this time save node structure
            try {
View Full Code Here


                if (a != null) {
                    a.remove();
                }
            }
        } finally {
            if (sImpl.nodeExists(path)) {
                someContent.remove();
                sImpl.save();
            }
        }
    }
View Full Code Here

    public void testFindNodeWithNonExistingSearchRoot() throws NotExecutableException, RepositoryException {
        String searchRoot = nodeResolver.getSearchRoot(UserConstants.NT_REP_AUTHORIZABLE_FOLDER);
        SessionImpl sImpl = (SessionImpl) superuser;

        if (sImpl.nodeExists(searchRoot)) {
            throw new NotExecutableException();
        }
        Node result = nodeResolver.findNode(sImpl.getQName(UserConstants.GROUP_ADMIN_GROUP_NAME), UserConstants.NT_REP_AUTHORIZABLE);
        assertNull(result);
    }
View Full Code Here

    public void testFindNodeWithNonExistingSearchRoot() throws NotExecutableException, RepositoryException {
        String searchRoot = nodeResolver.getSearchRoot(UserConstants.NT_REP_AUTHORIZABLE_FOLDER);
        SessionImpl sImpl = (SessionImpl) superuser;

        if (sImpl.nodeExists(searchRoot)) {
            throw new NotExecutableException();
        }
        Node result = nodeResolver.findNode(sImpl.getQName(UserConstants.GROUP_ADMIN_GROUP_NAME), UserConstants.NT_REP_AUTHORIZABLE);
        assertNull(result);
    }
View Full Code Here

                if (a != null) {
                    a.remove();
                }
            }
        } finally {
            if (sImpl.nodeExists(path)) {
                folder.remove();
                sImpl.save();
            }
        }
View Full Code Here

                    a = null;
                }
            }

            // authNode - anyNode - authFolder -> create User
            if (!sImpl.nodeExists(path)) {
                someContent = userNode.addNode("mystuff", "nt:unstructured");              
            }
            folder = someContent.addNode("folder", sImpl.getJCRName(UserConstants.NT_REP_AUTHORIZABLE_FOLDER));
            sImpl.save(); // this time save node structure
            try {
View Full Code Here

                if (a != null) {
                    a.remove();
                }
            }
        } finally {
            if (sImpl.nodeExists(path)) {
                someContent.remove();
                sImpl.save();
            }
        }
    }
View Full Code Here

    public void testFindNodeWithNonExistingSearchRoot() throws NotExecutableException, RepositoryException {
        String searchRoot = nodeResolver.getSearchRoot(UserConstants.NT_REP_AUTHORIZABLE_FOLDER);
        SessionImpl sImpl = (SessionImpl) superuser;

        if (sImpl.nodeExists(searchRoot)) {
            throw new NotExecutableException();
        }
        Node result = nodeResolver.findNode(sImpl.getQName(UserConstants.GROUP_ADMIN_GROUP_NAME), UserConstants.NT_REP_AUTHORIZABLE);
        assertNull(result);
    }
View Full Code Here

     * @see org.apache.jackrabbit.api.security.user.UserManager#getAuthorizableByPath(String)
     */
    @Override
    public Authorizable getAuthorizableByPath(String path) throws UnsupportedRepositoryOperationException, RepositoryException {
        SessionImpl session = getSession();
        if (session.nodeExists(path)) {
            NodeImpl n = (NodeImpl) session.getNode(path);
            return getAuthorizable(n);
        } else {
            return null;
        }
View Full Code Here

     */
    public Node findNode(Name nodeName, Name ntName) throws RepositoryException {
        String sr = getSearchRoot(ntName);
        // TODO: remove cast once 283 is released
        SessionImpl sImpl = (SessionImpl) getSession();
        if (sImpl.nodeExists(sr)) {
            try {
                Node root = sImpl.getNode(sr);
                return collectNode(nodeName, ntName, root.getNodes());
            } catch (PathNotFoundException e) {
                // should not get here
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.