Examples of unregisterNamespace()


Examples of javax.jcr.NamespaceRegistry.unregisterNamespace()

        assertEquals("bar:test", n.getName());
        s.logout();

        getAdminSession().getRootNode().getNode("foo:test").remove();
        getAdminSession().save();
        nsReg.unregisterNamespace("foo");
    }

    @Test
    public void registryRemappedNamespace() throws RepositoryException {
        NamespaceRegistry nsReg =
View Full Code Here

Examples of javax.jcr.NamespaceRegistry.unregisterNamespace()

            // expected
        } finally {
            getAdminSession().getRootNode().getNode("foo:test").remove();
            getAdminSession().save();

            nsReg.unregisterNamespace("foo");
        }
    }

    @Test  // Regression test for OAK-299
    public void importNodeType() throws RepositoryException, IOException, ParseException {
View Full Code Here

Examples of javax.jcr.NamespaceRegistry.unregisterNamespace()

                String[] registeredPrefixes = nsReg.getPrefixes();
                for (int i = 0; i < registeredPrefixes.length; i++) {
                    String prfx = registeredPrefixes[i];
                    if (!changes.containsKey(prfx)) {
                        // prefix not present amongst the new values any more > unregister
                        nsReg.unregisterNamespace(prfx);
                    } else if (changes.get(prfx).equals(nsReg.getURI(prfx))) {
                        // present with same uri-value >> no action required
                        changes.remove(prfx);
                    }
                }
View Full Code Here

Examples of javax.jcr.NamespaceRegistry.unregisterNamespace()

        nsReg.registerNamespace("foo", "file:///foo");
        assertTrue(asList(nsReg.getPrefixes()).contains("foo"));
        assertTrue(asList(nsReg.getURIs()).contains("file:///foo"));

        nsReg.unregisterNamespace("foo");
        assertFalse(asList(nsReg.getPrefixes()).contains("foo"));
        assertFalse(asList(nsReg.getURIs()).contains("file:///foo"));
    }

    @Test
View Full Code Here

Examples of javax.jcr.NamespaceRegistry.unregisterNamespace()

        assertEquals("bar:test", n.getName());
        s.logout();

        getAdminSession().getRootNode().getNode("foo:test").remove();
        getAdminSession().save();
        nsReg.unregisterNamespace("foo");
    }

    @Test
    public void registryRemappedNamespace() throws RepositoryException {
        NamespaceRegistry nsReg =
View Full Code Here

Examples of javax.jcr.NamespaceRegistry.unregisterNamespace()

            // expected
        } finally {
            getAdminSession().getRootNode().getNode("foo:test").remove();
            getAdminSession().save();

            nsReg.unregisterNamespace("foo");
        }
    }

    @Test  // Regression test for OAK-299
    public void importNodeType() throws RepositoryException, IOException, ParseException {
View Full Code Here

Examples of javax.jcr.NamespaceRegistry.unregisterNamespace()

     */
    public void unregisterNamespace(SessionInfo sessionInfo, String uri)
            throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException {
        Session session = getSessionInfoImpl(sessionInfo).getSession();
        NamespaceRegistry nsReg = session.getWorkspace().getNamespaceRegistry();
        nsReg.unregisterNamespace(nsReg.getPrefix(uri));
    }

    /**
     * {@inheritDoc}
     */
 
View Full Code Here

Examples of javax.jcr.NamespaceRegistry.unregisterNamespace()

     */
    public void unregisterNamespace(SessionInfo sessionInfo, String uri)
            throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException {
        Session session = getSessionInfoImpl(sessionInfo).getSession();
        NamespaceRegistry nsReg = session.getWorkspace().getNamespaceRegistry();
        nsReg.unregisterNamespace(nsReg.getPrefix(uri));
    }

    /**
     * {@inheritDoc}
     */
 
View Full Code Here

Examples of javax.jcr.NamespaceRegistry.unregisterNamespace()

                Map<String, String> changes = new HashMap<String, String>(nsp.getNamespaces());
                NamespaceRegistry nsReg = getRepositorySession().getWorkspace().getNamespaceRegistry();
                for (String prefix : nsReg.getPrefixes()) {
                    if (!changes.containsKey(prefix)) {
                        // prefix not present amongst the new values any more > unregister
                        nsReg.unregisterNamespace(prefix);
                    } else if (changes.get(prefix).equals(nsReg.getURI(prefix))) {
                        // present with same uri-value >> no action required
                        changes.remove(prefix);
                    }
                }
View Full Code Here

Examples of javax.jcr.NamespaceRegistry.unregisterNamespace()

                Map<String, String> changes = new HashMap<String, String>(nsp.getNamespaces());
                NamespaceRegistry nsReg = getRepositorySession().getWorkspace().getNamespaceRegistry();
                for (String prefix : nsReg.getPrefixes()) {
                    if (!changes.containsKey(prefix)) {
                        // prefix not present amongst the new values any more > unregister
                        nsReg.unregisterNamespace(prefix);
                    } else if (changes.get(prefix).equals(nsReg.getURI(prefix))) {
                        // present with same uri-value >> no action required
                        changes.remove(prefix);
                    }
                }
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.