Package org.apache.jackrabbit.oak.api

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


                PropertyBuilder<String> prop = PropertyBuilder.copy(Type.WEAKREFERENCE, refs);
                if (prop.hasValue(memberContentId)) {
                    prop.removeValue(memberContentId);
                    if (prop.isEmpty()) {
                        if (t == groupTree) {
                            t.removeProperty(UserConstants.REP_MEMBERS);
                        } else {
                            t.remove();
                        }
                    } else {
                        t.setProperty(prop.getPropertyState());
View Full Code Here


            Tree namespaces = root.getTree(NAMESPACES_PATH);

            // remove existing mapping to given uri
            String ns = Namespaces.getNamespacePrefix(namespaces, uri);
            if (ns != null) {
                namespaces.removeProperty(ns);
            }
            namespaces.setProperty(prefix, uri);
            root.commit();
            refresh();
        } catch (CommitFailedException e) {
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;
            throw e.asRepositoryException(message);
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;
            throw e.asRepositoryException(message);
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

            restrictions.setProperty(entry.getKey());

            RestrictionPattern pattern = provider.getPattern("/testPath", restrictions);
            assertEquals(entry.getValue(), pattern);

            restrictions.removeProperty(entry.getKey().getName());
        }

        // test combination on multiple restrictions
        for (Map.Entry<PropertyState, RestrictionPattern> entry : map.entrySet()) {
            restrictions.setProperty(entry.getKey());
View Full Code Here

    @Test
    public void removePassword() throws Exception {
        try {
            Tree userTree = root.getTree(userPath);
            userTree.removeProperty(REP_PASSWORD);
            root.commit();
            fail("removing password should fail");
        } catch (CommitFailedException e) {
            // expected
        } finally {
View Full Code Here

    @Test
    public void removePrincipalName() throws Exception {
        try {
            Tree userTree = root.getTree(userPath);
            userTree.removeProperty(REP_PRINCIPAL_NAME);
            root.commit();
            fail("removing principal name should fail");
        } catch (CommitFailedException e) {
            // expected
        } finally {
View Full Code Here

    @Test
    public void removeAuthorizableId() throws Exception {
        try {
            Tree userTree = root.getTree(userPath);
            userTree.removeProperty(REP_AUTHORIZABLE_ID);
            root.commit();
            fail("removing authorizable id should fail");
        } catch (CommitFailedException e) {
            // expected
        } finally {
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.