Package org.modeshape.jcr.value

Examples of org.modeshape.jcr.value.NamespaceRegistry


        assertThat(nodeTypesNodes.getSize(), is(1L));
    }

    @Test
    public void shouldAllowMultipleSiblingsDefinitionIfOneSibling() throws Exception {
        NamespaceRegistry registry = context.getNamespaceRegistry();

        // There's no definition for this node or for a * child node that does not allow SNS
        JcrNodeDefinition def = repoTypeManager.getNodeTypes()
                                               .findChildNodeDefinitions(JcrNtLexicon.NODE_TYPE, null)
                                               .findBestDefinitionForChild(JcrLexicon.PROPERTY_DEFINITION,
View Full Code Here


    @Override
    public Iterator<Property> getProperties( Collection<?> namePatterns,
                                             NodeCache cache ) {
        final AbstractSessionCache session = session(cache);
        final NamespaceRegistry registry = session.context().getNamespaceRegistry();
        return new PatternIterator<Property>(getProperties(session), namePatterns) {
            @Override
            protected String matchable( Property value ) {
                return value.getName().getString(registry);
            }
View Full Code Here

        public Node storeQuery( String absolutePath,
                                Name nodeType,
                                String language,
                                String statement ) throws RepositoryException {
            session.checkLive();
            NamespaceRegistry namespaces = session.namespaces();

            Path path;
            try {
                path = session.pathFactory().create(absolutePath);
            } catch (IllegalArgumentException iae) {
View Full Code Here

            throw new IllegalStateException("Unexpected constraints for property: " + property);
        }
    }

    private NodeType validateTypeDefinition() throws Exception {
        NamespaceRegistry nsr = context.getNamespaceRegistry();

        NodeType constrainedType = nodeTypeManager.getNodeType(TestLexicon.CONSTRAINED_TYPE.getString(nsr));
        assertThat(constrainedType, notNullValue());
        assertThat(propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_BINARY), notNullValue());
        assertThat(propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_DATE), notNullValue());
View Full Code Here

    protected static void registerMissingNamespaces( ExecutionContext originalContext,
                                                     ExecutionContext newContext,
                                                     Name... names ) {
        if (names == null) return;
        NamespaceRegistry newRegistry = newContext.getNamespaceRegistry();
        NamespaceRegistry originalRegistry = originalContext.getNamespaceRegistry();
        for (Name name : names) {
            if (name != null) {
                String uri = name.getNamespaceUri();
                if (!newRegistry.isRegisteredNamespaceUri(uri)) {
                    String prefix = originalRegistry.getPrefixForNamespaceUri(uri, false);
                    newRegistry.register(prefix, uri);
                }
            }
        }
    }
View Full Code Here

    @Override
    public Iterator<Property> getProperties( Collection<?> namePatterns,
                                             NodeCache cache ) {
        WorkspaceCache wsCache = workspaceCache(cache);
        final NamespaceRegistry registry = wsCache.context().getNamespaceRegistry();
        return new PatternIterator<Property>(getProperties(wsCache), namePatterns) {
            @Override
            protected String matchable( Property value ) {
                return value.getName().getString(registry);
            }
View Full Code Here

            // There are at least some changes ...
            ExecutionContext context = getContext();
            String id = context.getId();
            String username = context.getSecurityContext().getUserName();
            NamespaceRegistry registry = context.getNamespaceRegistry();
            if (username == null) username = "<anonymous>";
            SAVE_LOGGER.trace("Save #{0} (part of transaction '{1}') by session {2}({3}) is persisting the following changes:",
                              s, txn, username, id);
            for (NodeKey key : firstNodesInOrder) {
                SessionNode node = changedNodes.get(key);
View Full Code Here

    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        NamespaceRegistry reg = context().getNamespaceRegistry();
        sb.append("Session ").append(context().getId()).append(" to workspace '").append(workspaceName());
        for (NodeKey key : changedNodesInOrder) {
            SessionNode changes = changedNodes.get(key);
            if (changes == null) {
                continue;
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.value.NamespaceRegistry

Copyright © 2018 www.massapicom. 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.