Package org.jboss.dna.graph.properties

Examples of org.jboss.dna.graph.properties.Name


        Path parentPath = path.getParent();
        BasicGetNodeCommand getNodeCommand = new BasicGetNodeCommand(parentPath);
        execute(getNodeCommand);
        // First search for a child with the last name in the path
        Segment lastSeg = path.getLastSegment();
        Name name = lastSeg.getName();
        for (Segment seg : getNodeCommand.getChildren()) {
            if (seg.getName().equals(name)) {
                return getNode(path);
            }
        }
View Full Code Here


        // Create JCR children for corresponding DNA children
        node.setChildren(getNodeCommand.getChildren());
        // Create JCR properties for corresponding DNA properties
        Set<Property> properties = new HashSet<Property>();
        UUID uuid = null;
        Name jcrUuidName = executionContext.getValueFactories().getNameFactory().create("jcr:uuid");
        Name jcrMixinTypesName = executionContext.getValueFactories().getNameFactory().create("jcr:mixinTypes");
        UuidFactory uuidFactory = executionContext.getValueFactories().getUuidFactory();
        org.jboss.dna.graph.properties.Property dnaUuidProp = null;
        boolean referenceable = false;
        for (org.jboss.dna.graph.properties.Property dnaProp : getNodeCommand.getProperties()) {
            Name name = dnaProp.getName();
            if (dnaProp.isMultiple()) properties.add(new JcrMultiValueProperty(node, executionContext, name, dnaProp));
            else {
                if (uuid == null && DnaLexicon.UUID.equals(name)) uuid = uuidFactory.create(dnaProp.getValues()).next();
                else if (jcrUuidName.equals(name)) dnaUuidProp = dnaProp;
                else if (jcrMixinTypesName.equals(name)) {
View Full Code Here

        if (this.children == null) {
            this.children = new ArrayList<Name>(children.size());
            childNameCounts = new ArrayList<Integer>(children.size());
        }
        for (Segment seg : children) {
            Name name = seg.getName();
            int ndx = this.children.indexOf(name);
            if (ndx >= 0) {
                childNameCounts.set(ndx, childNameCounts.get(ndx) + 1);
            } else {
                this.children.add(name);
View Full Code Here

        try {
            return getNode(path);
        } catch (org.jboss.dna.graph.properties.PathNotFoundException e) {
            // A node was not found, so treat look for a node using the parent as the node's path ...
            Path parentPath = path.getParent();
            Name propertyName = path.getLastSegment().getName();
            try {
                return getNode(parentPath).getProperty(propertyName.getString(executionContext.getNamespaceRegistry()));
            } catch (org.jboss.dna.graph.properties.PathNotFoundException e2) {
                // If the node isn't found, throw a PathNotFoundException
                throw new PathNotFoundException(JcrI18n.pathNotFound.text(path));
            }
        }
View Full Code Here

        // Create JCR children for corresponding DNA children
        node.setChildren(graphNode.getChildrenSegments());
        // Create JCR properties for corresponding DNA properties
        Set<Property> properties = new HashSet<Property>();
        UUID uuid = null;
        Name jcrUuidName = executionContext.getValueFactories().getNameFactory().create("jcr:uuid");
        Name jcrMixinTypesName = executionContext.getValueFactories().getNameFactory().create("jcr:mixinTypes");
        UuidFactory uuidFactory = executionContext.getValueFactories().getUuidFactory();
        org.jboss.dna.graph.properties.Property dnaUuidProp = null;
        boolean referenceable = false;
        for (org.jboss.dna.graph.properties.Property dnaProp : graphNode.getProperties()) {
            Name name = dnaProp.getName();
            if (dnaProp.isMultiple()) properties.add(new JcrMultiValueProperty(node, executionContext, name, dnaProp));
            else {
                if (uuid == null && DnaLexicon.UUID.equals(name)) uuid = uuidFactory.create(dnaProp.getValues()).next();
                else if (jcrUuidName.equals(name)) dnaUuidProp = dnaProp;
                else if (jcrMixinTypesName.equals(name)) {
View Full Code Here

            if (contribution.isPlaceholder()) {
                // Iterate over the children and add only if there is not already one ...
                Iterator<Location> childIterator = contribution.getChildren();
                while (childIterator.hasNext()) {
                    Location child = childIterator.next();
                    Name childName = child.getPath().getLastSegment().getName();
                    if (!childNames.containsKey(childName)) {
                        childNames.put(childName, 1);
                        Path pathToChild = pathFactory.create(location.getPath(), childName);
                        federatedNode.addChild(new Location(pathToChild));
                    }
                }
            } else {
                // Get the identification properties for each contribution ...
                Location contributionLocation = contribution.getLocationInSource();
                for (Property idProperty : contributionLocation) {
                    // Record the property ...
                    Property existing = properties.put(idProperty.getName(), idProperty);
                    if (existing != null) {
                        // There's already an existing property, so we need to merge them ...
                        Property merged = merge(existing, idProperty, context.getPropertyFactory(), removeDuplicateProperties);
                        properties.put(merged.getName(), merged);
                    }
                }

                // Accumulate the children ...
                Iterator<Location> childIterator = contribution.getChildren();
                while (childIterator.hasNext()) {
                    Location child = childIterator.next();
                    Name childName = child.getPath().getLastSegment().getName();
                    int index = Path.NO_INDEX;
                    Integer previous = childNames.put(childName, 1);
                    if (previous != null) {
                        int previousValue = previous.intValue();
                        // Correct the index in the child name map ...
View Full Code Here

                Child that = (Child)obj;
                if (this.placeholder && that.placeholder) {
                    // If both are placeholders, then compare just the name ...
                    assert this.location.hasPath();
                    assert that.location.hasPath();
                    Name thisName = this.location.getPath().getLastSegment().getName();
                    Name thatName = that.location.getPath().getLastSegment().getName();
                    return thisName.equals(thatName);
                }
                if (location.hasIdProperties() && that.location.hasIdProperties()) {
                    List<Property> thisIds = location.getIdProperties();
                    List<Property> thatIds = that.location.getIdProperties();
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.properties.Name

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.