Package org.apache.jackrabbit.oak.api

Examples of org.apache.jackrabbit.oak.api.Tree.removeProperty()


        tree.setProperty("P0", "V1");
        root.commit();

        assertTrue(tree.hasProperty("P0"));

        tree.removeProperty("P0");
        root.commit();

        assertFalse(tree.hasProperty("P0"));
    }
View Full Code Here


        tree.setProperty("new", "value2");
        assertEquals(Tree.Status.MODIFIED, tree.getPropertyStatus("new"));
        root.commit();

        assertEquals(Tree.Status.EXISTING, tree.getPropertyStatus("new"));
        tree.removeProperty("new");
        assertNull(tree.getPropertyStatus("new"));
        root.commit();

        assertNull(tree.getPropertyStatus("new"));
View Full Code Here

        } else if (!tree.hasProperty(JCR_LOCKISDEEP)) {
            throw new LockException("Node " + path + " is not locked");
        }

        try {
            tree.removeProperty(JCR_LOCKISDEEP);
            tree.removeProperty(JCR_LOCKOWNER);
            sessionDelegate.commit(root);
        } catch (CommitFailedException e) {
            if (e.isAccessViolation()) {
                throw new AccessControlException(
View Full Code Here

            throw new LockException("Node " + path + " is not locked");
        }

        try {
            tree.removeProperty(JCR_LOCKISDEEP);
            tree.removeProperty(JCR_LOCKOWNER);
            sessionDelegate.commit(root);
        } catch (CommitFailedException e) {
            if (e.isAccessViolation()) {
                throw new AccessControlException(
                        "Access denied to unlock node " + path, e);
View Full Code Here

        }
        Tree tree = getTree();
        if (reason == null) {
            if (tree.hasProperty(REP_DISABLED)) {
                // enable the user again.
                tree.removeProperty(REP_DISABLED);
            } // else: not disabled -> nothing to
        } else {
            tree.setProperty(REP_DISABLED, reason);
        }
    }
View Full Code Here

                        JcrConstants.NT_UNSTRUCTURED, NAME);
            }
            // remove existing mapping to given uri
            for (PropertyState p : namespaces.getProperties()) {
                if (!p.isArray() && p.getValue(STRING).equals(uri)) {
                    namespaces.removeProperty(p.getName());
                }
            }
            namespaces.setProperty(prefix, uri);
            root.commit();
            refresh();
View Full Code Here

                    "Namespace mapping from " + prefix + " to "
                    + getURI(prefix) + " can not be unregistered");
        }

        try {
            namespaces.removeProperty(prefix);
            root.commit();
            refresh();
        } catch (CommitFailedException e) {
            String message = "Failed to unregister namespace mapping for prefix " + prefix;
            if (e.isOfType("Namespace")) {
View Full Code Here

    public void setUserData(String userData) throws CommitFailedException {
        Root root = getLatestRoot();
        Tree listenerSpec = getOrCreateListenerSpec(root);
        if (userData == null) {
            listenerSpec.removeProperty(USER_DATA);
        } else {
            listenerSpec.setProperty(USER_DATA, userData);
        }
        root.commit();
    }
View Full Code Here

            Root root = sessionDelegate.getContentSession().getLatestRoot();
            Tree tree = root.getTree(dlg.getPath());
            if (!tree.exists()) {
                throw new ItemNotFoundException();
            }
            tree.removeProperty(lockOwner);
            tree.removeProperty(lockIsDeep);
            root.commit();
        } catch (CommitFailedException e) {
            throw new RepositoryException("Unable to unlock " + this, e);
        }
View Full Code Here

            Tree tree = root.getTree(dlg.getPath());
            if (!tree.exists()) {
                throw new ItemNotFoundException();
            }
            tree.removeProperty(lockOwner);
            tree.removeProperty(lockIsDeep);
            root.commit();
        } catch (CommitFailedException e) {
            throw new RepositoryException("Unable to unlock " + this, e);
        }
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.