Package org.apache.jackrabbit.uuid

Examples of org.apache.jackrabbit.uuid.UUID


            Version rootVersion = history.getRootVersion();

            // jcr:versionHistory
            conditionalAddProperty(
                    node, QName.JCR_VERSIONHISTORY, PropertyType.REFERENCE, false,
                    InternalValue.create(new UUID(history.getUUID())));

            // jcr:baseVersion
            conditionalAddProperty(
                    node, QName.JCR_BASEVERSION, PropertyType.REFERENCE, false,
                    InternalValue.create(new UUID(rootVersion.getUUID())));

            // jcr:predecessors
            conditionalAddProperty(
                    node, QName.JCR_PREDECESSORS, PropertyType.REFERENCE, true,
                    InternalValue.create(new UUID(rootVersion.getUUID())));

            // jcr:isCheckedOut
            conditionalAddProperty(
                    node, QName.JCR_ISCHECKEDOUT, PropertyType.BOOLEAN, false,
                    InternalValue.create(true));
View Full Code Here


                boolean modified = false;
                InternalValue[] values = prop.getValues();
                InternalValue[] newVals = new InternalValue[values.length];
                for (int i = 0; i < values.length; i++) {
                    InternalValue val = values[i];
                    UUID original = (UUID) val.internalValue();
                    UUID adjusted = refTracker.getMappedUUID(original);
                    if (adjusted != null) {
                        newVals[i] = InternalValue.create(adjusted);
                        modified = true;
                    } else {
                        // reference doesn't need adjusting, just copy old value
View Full Code Here

                return (NodeId) uuidIndex.get(index);
            }
        } else if (uuidType == FileRecord.UUID_LITERAL) {
            byte[] b = new byte[Constants.UUID_BYTE_LENGTH];
            in.readFully(b);
            NodeId nodeId = new NodeId(new UUID(b));
            uuidIndex.add(nodeId);
            return nodeId;
        } else {
            String msg = "UUID type unknown: " + uuidType;
            throw new IOException(msg);
View Full Code Here

        } catch (IOException e) {
            log.error("Error while reading NodeTypeName: " + e);
            return false;
        }
        try {
            UUID parentUuid = readUUID(in);
            log.debug("ParentUUID: " + parentUuid);
        } catch (IOException e) {
            log.error("Error while reading ParentUUID: " + e);
            return false;
        }
        try {
            String definitionId = in.readUTF();
            log.debug("DefinitionId: " + definitionId);
        } catch (IOException e) {
            log.error("Error while reading DefinitionId: " + e);
            return false;
        }
        try {
            Name mixinName = readIndexedQName(in);
            while (mixinName != null) {
                log.debug("MixinTypeName: " + mixinName);
                mixinName = readIndexedQName(in);
            }
        } catch (IOException e) {
            log.error("Error while reading MixinTypes: " + e);
            return false;
        }
        try {
            Name propName = readIndexedQName(in);
            while (propName != null) {
                log.debug("PropertyName: " + propName);
                if (!checkPropertyState(in)) {
                    return false;
                }
                propName = readIndexedQName(in);
            }
        } catch (IOException e) {
            log.error("Error while reading property names: " + e);
            return false;
        }
        try {
            boolean hasUUID = in.readBoolean();
            log.debug("hasUUID: " + hasUUID);
        } catch (IOException e) {
            log.error("Error while reading 'hasUUID': " + e);
            return false;
        }
        try {
            UUID cneUUID = readUUID(in);
            while (cneUUID != null) {
                Name cneName = readQName(in);
                log.debug("ChildNodentry: " + cneUUID + ":" + cneName);
                cneUUID = readUUID(in);
            }
View Full Code Here

                        return false;
                    }
                    break;
                case PropertyType.REFERENCE:
                    try {
                        UUID uuid = readUUID(in);
                        log.debug("  reference: " + uuid);
                    } catch (IOException e) {
                        log.error("Error while reading reference value: " + e);
                        return false;
                    }
View Full Code Here

public class XMLTextFilterTest extends TestCase {

    public void testCanExtractAttributes() throws Exception {
        String xml = "<config><city name=\"Stockholm\"/></config>";
        PropertyId id = new PropertyId(new NodeId(new UUID(1, 1)), new QName("", ""));
        PropertyState state = new PropertyState(id, 1, true);

        InternalValue value = InternalValue.create(xml.getBytes());
        state.setValues(new InternalValue[]{value});
View Full Code Here

        assertEquals("Stockholm", result.trim());
    }

    public void testCanExtractCData() throws Exception {
        String xml = "<config><city>Stockholm</city></config>";
        PropertyId id = new PropertyId(new NodeId(new UUID(1, 1)), new QName("", ""));
        PropertyState state = new PropertyState(id, 1, true);

        InternalValue value = InternalValue.create(xml.getBytes());
        state.setValues(new InternalValue[]{value});
View Full Code Here

        checkLock();

        Version v = session.getVersionManager().checkin(this);
        Property prop = internalSetProperty(QName.JCR_ISCHECKEDOUT, InternalValue.create(false));
        prop.save();
        prop = internalSetProperty(QName.JCR_BASEVERSION, InternalValue.create(new UUID(v.getUUID())));
        prop.save();
        prop = internalSetProperty(QName.JCR_PREDECESSORS, InternalValue.EMPTY_ARRAY, PropertyType.REFERENCE);
        prop.save();
        return v;
    }
View Full Code Here

        Property prop = internalSetProperty(QName.JCR_ISCHECKEDOUT, InternalValue.create(true));
        prop.save();
        prop = internalSetProperty(QName.JCR_PREDECESSORS,
                new InternalValue[]{
                    InternalValue.create(new UUID(getBaseVersion().getUUID()))
                });
        prop.save();
    }
View Full Code Here

        // get frozen node type
        NodeTypeManagerImpl ntMgr = session.getNodeTypeManager();
        NodeTypeImpl nt = ntMgr.getNodeType(frozen.getFrozenPrimaryType());

        // get frozen uuid
        UUID uuid = frozen.getFrozenUUID();

        NodeImpl node = internalAddChildNode(name, nt, new NodeId(uuid));

        // get frozen mixin
        // todo: also respect mixing types on creation?
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.uuid.UUID

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.