Package org.brixcms.jcr.api

Examples of org.brixcms.jcr.api.JcrValue$Wrapper


        }
        if (node.hasProperty("url")) {
            setUrl(node.getProperty("url").getString());
        }
        if (node.hasProperty("indexedParameters")) {
            JcrValue values[] = node.getProperty("indexedParameters").getValues();
            getParameters().clearIndexed();
            for (int i = 0; i < values.length; ++i) {
                getParameters().set(i, values[i].getString());
            }
        }
        if (node.hasNode("parameter")) {
            getParameters().clearNamed();
            JcrNodeIterator i = node.getNodes("parameter");
            while (i.hasNext()) {
                BrixNode n = (BrixNode) i.nextNode();
                if (n.hasProperty("key") && n.hasProperty("values")) {
                    String key = n.getProperty("key").getString();
                    JcrValue values[] = n.getProperty("values").getValues();
                    for (JcrValue v : values) {
                        getParameters().set(key, v.getString());
                    }
                }
            }
View Full Code Here


    public static JcrValue[] wrap(Value[] delegate, JcrSession session) {
        if (delegate == null) {
            return null;
        } else {
            JcrValue result[] = new JcrValue[delegate.length];
            for (int i = 0; i < delegate.length; ++i) {
                result[i] = wrap(delegate[i], session);
            }
            return result;
        }
View Full Code Here

            while (propertyIterator.hasNext()) {
                JcrProperty property = propertyIterator.nextProperty();
                String name = property.getName();
                if (!property.getDefinition().isProtected()) {
                    if (!property.getDefinition().isMultiple()) {
                        JcrValue value = property.getValue();
                        targetNode.setProperty(name, remapReference(value, uuidMap, vf));
                    } else {
                        JcrValue values[] = property.getValues();
                        for (int i = 0; i < values.length; ++i) {
                            values[i] = remapReference(values[i], uuidMap, vf);
                        }
                        targetNode.setProperty(name, values);
                    }
View Full Code Here

    private static JcrValue remapReference(JcrValue value, Map<String, String> uuidMap, JcrValueFactory valueFactory) {
        if (value.getType() == PropertyType.REFERENCE) {
            String uuid = value.getString();
            String newUuid = uuidMap.get(uuid);
            if (newUuid != null) {
                JcrValue newValue = valueFactory.createValue(newUuid, PropertyType.REFERENCE);
                return newValue;
            }
        }
        return value;
    }
View Full Code Here

            // if it is a reference property
            if (property.getType() == PropertyType.REFERENCE) {
                // if the property has multiple values
                if (property.getDefinition().isMultiple()) {
                    JcrValue values[] = property.getValues();
                    for (JcrValue value : values) {
                        checkReferenceValue(value, node, paths, targetWorkspace, result);
                    }
                } else {
                    JcrValue value = property.getValue();
                    checkReferenceValue(value, node, paths, targetWorkspace, result);
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.brixcms.jcr.api.JcrValue$Wrapper

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.