Package org.apache.jackrabbit.core.value

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


     * @return the activity or <code>null</code>
     * @throws RepositoryException if an error occurs
     */
    public InternalActivityImpl getActivity() throws RepositoryException {
        if (node.hasProperty(NameConstants.JCR_ACTIVITY)) {
            InternalValue value = node.getPropertyValue(NameConstants.JCR_ACTIVITY);
            return (InternalActivityImpl) vMgr.getItem(value.getNodeId());
        } else {
            return null;
        }
    }
View Full Code Here


        // init mix:versionable flags
        VersionHistoryInfo vh = vMgr.getVersionHistory(session, config.getState(), null);

        // and set the base version and history to the config
        InternalValue historyId = InternalValue.create(vh.getVersionHistoryId());
        InternalValue versionId = InternalValue.create(
                baseLine == null ? vh.getRootVersionId() : baseLine);

        config.setPropertyValue(NameConstants.JCR_BASEVERSION, versionId);
        config.setPropertyValue(NameConstants.JCR_VERSIONHISTORY, historyId);
        config.setPropertyValue(NameConstants.JCR_ISCHECKEDOUT, InternalValue.create(true));
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 (!ignorePermissions) {
            checkPermission(parentImpl, name, getPermission(false, false));
        }
        // validation: make sure Node is not locked or checked-in.
        parentImpl.checkSetProperty();
        InternalValue intVs = InternalValue.create(value, parentImpl.sessionContext);
        return parentImpl.internalSetProperty(name, intVs);
    }
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

            // 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

            // write info map
            Map<String, InternalValue> info = event.getInfo();
            record.writeInt(info.size());
            for (Map.Entry<String, InternalValue> entry : info.entrySet()) {
                String key = entry.getKey();
                InternalValue value = 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 type = getValue(NameConstants.JCR_MIMETYPE);
            if (type != null) {
                Metadata metadata = new Metadata();
                metadata.set(Metadata.CONTENT_TYPE, type.getString());

                // jcr:encoding is not mandatory
                InternalValue encoding = getValue(NameConstants.JCR_ENCODING);
                if (encoding != null) {
                    metadata.set(
                            Metadata.CONTENT_ENCODING, encoding.getString());
                }

                doc.add(createFulltextField(internalValue, metadata));
            }
        } catch (Throwable t) {
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

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.