Package org.modeshape.jcr.value

Examples of org.modeshape.jcr.value.Path$Segment


    }

    protected void assertPathResolves( PathMappings mappings,
                                       String externalPath,
                                       String... workspaceNameAndPathPairs ) {
        Path extPath = mappings.getPathFactory().create(externalPath);
        Set<WorkspaceAndPath> expectedWsAndPaths = new HashSet<WorkspaceAndPath>();
        for (int i = 0; i != workspaceNameAndPathPairs.length; ++i) {
            String workspaceName = workspaceNameAndPathPairs[i];
            String repoPath = workspaceNameAndPathPairs[++i];
            Path repPath = mappings.getPathFactory().create(repoPath);
            expectedWsAndPaths.add(new WorkspaceAndPath(workspaceName, repPath));
        }
        Collection<WorkspaceAndPath> wsAndPaths = mappings.resolveExternalPathToInternal(extPath);
        Set<WorkspaceAndPath> actualWsAndPaths = new HashSet<WorkspaceAndPath>(wsAndPaths);
        assertThat(actualWsAndPaths, is(expectedWsAndPaths));
View Full Code Here


            } catch (IllegalArgumentException t) {
                // Catch and eat, letting the slower implementation catch anything ...
            }
        }
        // It is a subpath with more than one segment, so create a relative path for the subpath ...
        Path relativeSubpath = create(subpath);
        return create(parentPath, relativeSubpath);

    }
View Full Code Here

                    case PropertyType.NAME:
                        Name nameValue = original.getContext().getValueFactories().getNameFactory().create(jcrValue.value());
                        JcrItemDefinitionTemplate.registerMissingNamespaces(original.getContext(), context, nameValue);
                        break;
                    case PropertyType.PATH:
                        Path pathValue = original.getContext().getValueFactories().getPathFactory().create(jcrValue.value());
                        JcrItemDefinitionTemplate.registerMissingNamespaces(original.getContext(), context, pathValue);
                        break;
                }
            }
        }
View Full Code Here

    RepositoryNodeTypeManager with( JcrRepository.RunningState repository,
                                    boolean includeColumnsForInheritedProperties,
                                    boolean includePseudoColumnsInSelectStar ) {
        assert this.systemWorkspaceName.equals(repository.repositoryCache().getSystemWorkspaceName());
        PathFactory pathFactory = repository.context().getValueFactories().getPathFactory();
        Path nodeTypesPath = pathFactory.createAbsolutePath(JcrLexicon.SYSTEM, JcrLexicon.NODE_TYPES);
        assert this.nodeTypesPath.equals(nodeTypesPath);
        RepositoryNodeTypeManager result = new RepositoryNodeTypeManager(repository, includeColumnsForInheritedProperties,
                                                                         includePseudoColumnsInSelectStar);
        // Now copy the node types from this cache into the new manager's cache ...
        // (If we didn't do this, we'd have to refresh from the system storage)
View Full Code Here

        Set<Name> nodeTypesToRefresh = new HashSet<Name>();
        Set<Name> nodeTypesToDelete = new HashSet<Name>();
        for (Change change : changeSet) {
            if (change instanceof NodeAdded) {
                NodeAdded added = (NodeAdded)change;
                Path addedPath = added.getPath();
                if (nodeTypesPath.isAncestorOf(addedPath)) {
                    // Get the name of the node type ...
                    Name nodeTypeName = addedPath.getSegment(2).getName();
                    nodeTypesToRefresh.add(nodeTypeName);
                }
            } else if (change instanceof NodeRemoved) {
                NodeRemoved removed = (NodeRemoved)change;
                Path removedPath = removed.getPath();
                if (nodeTypesPath.isAncestorOf(removedPath)) {
                    // Get the name of the node type ...
                    Name nodeTypeName = removedPath.getSegment(2).getName();
                    if (removedPath.size() == 3) {
                        nodeTypesToDelete.add(nodeTypeName);
                    } else {
                        // It's a child defn or property defn ...
                        if (!nodeTypesToDelete.contains(nodeTypeName)) {
                            // The child defn or property defn is being removed but the node type is not ...
                            nodeTypesToRefresh.add(nodeTypeName);
                        }
                    }
                }
            } else if (change instanceof PropertyChanged) {
                PropertyChanged propChanged = (PropertyChanged)change;
                Path changedPath = propChanged.getPathToNode();
                if (nodeTypesPath.isAncestorOf(changedPath)) {
                    // Get the name of the node type ...
                    Name nodeTypeName = changedPath.getSegment(2).getName();
                    nodeTypesToRefresh.add(nodeTypeName);
                }
            } // we don't care about node moves (don't happen) or property added/removed (handled by node add/remove)
        }
View Full Code Here

                             Set<Name> mixinTypes,
                             Map<Name, Property> properties,
                             boolean queryable ) {
        NodeKey key = nodeKey(docId);
        NodeKey parentKey = nodeKey(parentDocId);
        Path externalPath = pathMappings.getPathFactory().create(path);
        // This external path in the connector may be projected into *multiple* nodes in the same or different workspaces ...
        for (WorkspaceAndPath wsAndPath : pathMappings.resolveExternalPathToInternal(externalPath)) {
            changesFor(wsAndPath).nodeCreated(key, parentKey, wsAndPath.getPath(), primaryType, mixinTypes, properties, queryable);
        }
    }
View Full Code Here

                             Name primaryType,
                             Set<Name> mixinTypes,
                             boolean queryable ) {
        NodeKey key = nodeKey(docId);
        NodeKey parentKey = nodeKey(parentDocId);
        Path externalPath = pathMappings.getPathFactory().create(path);
        // This external path in the connector may be projected into *multiple* nodes in the same or different workspaces ...
        for (WorkspaceAndPath wsAndPath : pathMappings.resolveExternalPathToInternal(externalPath)) {
            changesFor(wsAndPath).nodeRemoved(key, parentKey, wsAndPath.getPath(), primaryType, mixinTypes, queryable);
        }
        // Signal to the manager of the Connector instances that an external node was removed. If this external
View Full Code Here

                        DateTime thisDateValue = dateFactory.create(this.value);
                        DateTime thatDateValue = dateFactory.create(that.value);
                        return thisDateValue.equals(thatDateValue);
                    case PropertyType.PATH:
                        PathFactory pathFactory = factories().getPathFactory();
                        Path thisPathValue = pathFactory.create(this.value);
                        Path thatPathValue = pathFactory.create(that.value);
                        return thisPathValue.equals(thatPathValue);
                    case PropertyType.NAME:
                        NameFactory nameFactory = factories().getNameFactory();
                        Name thisNameValue = nameFactory.create(this.value);
                        Name thatNameValue = nameFactory.create(that.value);
View Full Code Here

                                      TextDecoder decoder ) throws EnclosingSAXException {
        }

        protected String name() {
            try {
                Path path = node().path();
                return path.isRoot() ? "" : stringFor(path.getLastSegment());
            } catch (Exception e) {
                throw new SystemFailureException(e);
            }
        }
View Full Code Here

                           String oldPath,
                           boolean queryable ) {
        NodeKey key = nodeKey(docId);
        NodeKey newParentKey = nodeKey(newParentDocId);
        NodeKey oldParentKey = nodeKey(oldParentDocId);
        Path newExternalPath = pathMappings.getPathFactory().create(newPath);
        Path oldExternalPath = pathMappings.getPathFactory().create(oldPath);
        Collection<WorkspaceAndPath> newWsAndPaths = pathMappings.resolveExternalPathToInternal(newExternalPath);
        Collection<WorkspaceAndPath> oldWsAndPaths = pathMappings.resolveExternalPathToInternal(oldExternalPath);

        // This method is unfortunately quite complicated because, while a single node can be moved within a connector's
        // single tree of content, different projections might mean the node's old location is in one projection while
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.value.Path$Segment

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.