Package org.apache.jackrabbit.core.value

Examples of org.apache.jackrabbit.core.value.InternalValue


            // read info map
            int infoSize = record.readInt();
            for (int i = 0; i < infoSize; i++) {
                String key = record.readString();
                int propType = record.readInt();
                InternalValue value;
                if (propType == PropertyType.UNDEFINED) {
                    // indicates null value
                    value = null;
                } else {
                    value = InternalValue.valueOf(record.readString(), propType);
View Full Code Here


            Map info = event.getInfo();
            record.writeInt(info.size());
            for (Iterator it = info.entrySet().iterator(); it.hasNext(); ) {
                Map.Entry entry = (Map.Entry) it.next();
                String key = (String) entry.getKey();
                InternalValue value = (InternalValue) entry.getValue();
                record.writeString(key);
                if (value == null) {
                    // use undefined for null value
                    record.writeInt(PropertyType.UNDEFINED);
                } else {
                    record.writeInt(value.getType());
                    record.writeString(value.toString());
                }
            }
        }
    }
View Full Code Here

        // delete binary values (stored as files)
        InternalValue[] values = state.getValues();
        if (values != null) {
            for (int i = 0; i < values.length; i++) {
                InternalValue val = values[i];
                if (val != null) {
                    val.deleteBinaryResource();
                }
            }
        }
        // delete property file
        String propFilePath = buildPropFilePath(state.getPropertyId());
View Full Code Here

            if (!jcrData.equals(fieldName)) {
                // don't know how to index
                return;
            }

            InternalValue typeValue = getValue(NameConstants.JCR_MIMETYPE);
            if (typeValue != null) {
                String type = typeValue.getString();

                // jcr:encoding is not mandatory
                String encoding = null;
                InternalValue encodingValue = getValue(NameConstants.JCR_ENCODING);
                if (encodingValue != null) {
                    encoding = encodingValue.getString();
                }

                InputStream stream = internalValue.getStream();
                Reader reader = extractor.extractText(stream, type, encoding);
                doc.add(createFulltextField(reader));
View Full Code Here

        // make sure binary values (BLOBs) are properly removed
        InternalValue[] values = state.getValues();
        if (values != null) {
            for (int i = 0; i < values.length; i++) {
                InternalValue val = values[i];
                if (val != null) {
                    if (val.getType() == PropertyType.BINARY) {
                        val.deleteBinaryResource();
                        // also remove from BLOBStore
                        String blobId = blobStore.createId(state.getPropertyId(), i);
                        try {
                            blobStore.remove(blobId);
                        } catch (Exception e) {
View Full Code Here

        for (int i = 0; i < props.length; i++) {
            PropertyState prop = props[i];
            if (prop.getName().equals(NameConstants.JCR_FROZENUUID)) {
                // special property
                InternalValue value =
                    node.getPropertyValue(NameConstants.JCR_FROZENUUID);
                // JCR-1803: The value should be a STRING, but older Jackrabbit
                // versions (< 1.1, see JCR-487) used REFERENCE values. Since
                // we do not automatically upgrade old content, we need to be
                // ready to handle both types of values here.
                if (value.getType() == PropertyType.STRING) {
                    frozenUUID = new NodeId(value.getString());
                } else {
                    frozenUUID = value.getNodeId();
                }
            } else if (prop.getName().equals(NameConstants.JCR_FROZENPRIMARYTYPE)) {
                // special property
                frozenPrimaryType = node.getPropertyValue(NameConstants.JCR_FROZENPRIMARYTYPE).getName();
            } else if (prop.getName().equals(NameConstants.JCR_FROZENMIXINTYPES)) {
View Full Code Here

     */
    public Map getInfo() throws RepositoryException {
        Map info = new HashMap();
        for (Iterator it = eventState.getInfo().entrySet().iterator(); it.hasNext(); ) {
            Map.Entry entry = (Map.Entry) it.next();
            InternalValue value = (InternalValue) entry.getValue();
            String strValue = null;
            if (value != null) {
                strValue = ValueFormat.getJCRString(value, session);
            }
            info.put(entry.getKey(), strValue);
View Full Code Here

                                           boolean external) {
        EventState es = nodeMoved(parentId, parentPath, childId, destChildPath,
               nodeType, mixins, session, external);
        Map info = new HashMap();
        info.put(SRC_CHILD_REL_PATH, createValue(srcChildPath));
        InternalValue value = null;
        if (beforeChildPath != null) {
            value = createValue(beforeChildPath);
        }
        info.put(DEST_CHILD_REL_PATH, value);
        es.setInfo(info);
View Full Code Here

                         * IMPORT_UUID_COLLISION_REPLACE_EXISTING;
                         * otherwise create a new version history
                         */
                        VersionHistoryInfo history =
                            vMgr.getVersionHistory(session, nodeState, null);
                        InternalValue historyId = InternalValue.create(
                                history.getVersionHistoryId());
                        InternalValue versionId = InternalValue.create(
                                history.getRootVersionId());
                        node.internalSetProperty(
                                NameConstants.JCR_VERSIONHISTORY, historyId);
                        node.internalSetProperty(
                                NameConstants.JCR_BASEVERSION, versionId);
View Full Code Here

                if (history != null) {
                    if (fullVersionable) {
                        if (propName.equals(NameConstants.JCR_VERSIONHISTORY)) {
                            // jcr:versionHistory
                            InternalValue value = InternalValue.create(
                                    history.getVersionHistoryId());
                            newChildState.setValues(new InternalValue[] { value });
                        } else if (propName.equals(NameConstants.JCR_BASEVERSION)
                                || propName.equals(NameConstants.JCR_PREDECESSORS)) {
                            // jcr:baseVersion or jcr:predecessors
                            InternalValue value = InternalValue.create(
                                    history.getRootVersionId());
                            newChildState.setValues(new InternalValue[] { value });
                        } else if (propName.equals(NameConstants.JCR_ISCHECKEDOUT)) {
                            // jcr:isCheckedOut
                            newChildState.setValues(new InternalValue[]{InternalValue.create(true)});
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.value.InternalValue

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.