Package org.apache.jackrabbit.oak.api

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


        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


        String lockOwner = sessionDelegate.getOakPathOrThrow(JCR_LOCK_OWNER);
        String lockIsDeep = sessionDelegate.getOakPathOrThrow(JCR_LOCK_IS_DEEP);
        try {
            Root root = sessionDelegate.getContentSession().getCurrentRoot();
            Tree tree = root.getTree(dlg.getPath());
            tree.removeProperty(lockOwner);
            tree.removeProperty(lockIsDeep);
            root.commit(DefaultConflictHandler.OURS);
        } catch (CommitFailedException e) {
            throw new RepositoryException("Unable to unlock " + this, e);
        }
View Full Code Here

        String lockIsDeep = sessionDelegate.getOakPathOrThrow(JCR_LOCK_IS_DEEP);
        try {
            Root root = sessionDelegate.getContentSession().getCurrentRoot();
            Tree tree = root.getTree(dlg.getPath());
            tree.removeProperty(lockOwner);
            tree.removeProperty(lockIsDeep);
            root.commit(DefaultConflictHandler.OURS);
        } catch (CommitFailedException e) {
            throw new RepositoryException("Unable to unlock " + this, e);
        }
View Full Code Here

    public void removeProperty() throws CommitFailedException {
        RootImpl root = new RootImpl(store, null);
        Tree tree = root.getTree("/");

        assertTrue(tree.hasProperty("a"));
        tree.removeProperty("a");
        assertFalse(tree.hasProperty("a"));

        root.commit(DefaultConflictHandler.OURS);
        tree = root.getTree("/");
View Full Code Here

        CoreValue value = valueFactory.createValue("foo");
        tree.setProperty("a", value);
        assertEquals(3, tree.getPropertyCount());

        tree.removeProperty("a");
        assertEquals(2, tree.getPropertyCount());

        tree.setProperty("x", value);
        assertEquals(3, tree.getPropertyCount());
View Full Code Here

        tree.setProperty("P0", valueFactory.createValue("V1"));
        root.commit(DefaultConflictHandler.OURS);
        tree = root.getTree("/");
        assertTrue(tree.hasProperty("P0"));

        tree.removeProperty("P0");
        root.commit(DefaultConflictHandler.OURS);
        tree = root.getTree("/");
        assertFalse(tree.hasProperty("P0"));
    }
View Full Code Here

        assertEquals(Status.MODIFIED, tree.getPropertyStatus("new"));
        root.commit(DefaultConflictHandler.OURS);

        tree = root.getTree("/");
        assertEquals(Status.EXISTING, tree.getPropertyStatus("new"));
        tree.removeProperty("new");
        assertEquals(Status.REMOVED, tree.getPropertyStatus("new"));
        root.commit(DefaultConflictHandler.OURS);

        tree = root.getTree("/");
        assertNull(tree.getPropertyStatus("new"));
View Full Code Here

    public void unregisterNamespace(String prefix) throws RepositoryException {
        try {
            Root root = session.getCurrentRoot();
            Tree namespaces = getOrCreate(root, "jcr:system", Namespaces.NSMAPNODENAME);
            if (namespaces.hasProperty(prefix)) {
                namespaces.removeProperty(prefix);
            } else {
                throw new NamespaceException(
                        "Namespace mapping from " + prefix + " to "
                        + getURI(prefix) + " can not be unregistered");
            }
View Full Code Here

    public void removeProperty() throws CommitFailedException {
        RootImpl root = createRootImpl(null);
        Tree tree = root.getTree("/");

        assertTrue(tree.hasProperty("a"));
        tree.removeProperty("a");
        assertFalse(tree.hasProperty("a"));

        root.commit(DefaultConflictHandler.OURS);
        tree = root.getTree("/");
View Full Code Here

        CoreValue value = valueFactory.createValue("foo");
        tree.setProperty("a", value);
        assertEquals(3, tree.getPropertyCount());

        tree.removeProperty("a");
        assertEquals(2, tree.getPropertyCount());

        tree.setProperty("x", value);
        assertEquals(3, tree.getPropertyCount());
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.