Examples of VersionManager


Examples of org.apache.jackrabbit.core.version.VersionManager

        EffectiveNodeType ent = itemOps.getEffectiveNodeType(node);
        if (ent.includesNodeType(QName.MIX_VERSIONABLE)) {
            PropDef def;
            PropertyState prop;
            SessionImpl session = (SessionImpl) wsp.getSession();
            VersionManager vMgr = session.getVersionManager();
            /**
             * check if there's already a version history for that
             * node; this would e.g. be the case if a versionable node
             * had been exported, removed and re-imported with either
             * IMPORT_UUID_COLLISION_REMOVE_EXISTING or
             * IMPORT_UUID_COLLISION_REPLACE_EXISTING;
             * otherwise create a new version history
             */
            VersionHistory vh = vMgr.getVersionHistory(session, node);
            if (vh == null) {
                vh = vMgr.createVersionHistory(session, node);
            }

            // jcr:versionHistory
            if (!node.hasPropertyName(QName.JCR_VERSIONHISTORY)) {
                def = itemOps.findApplicablePropertyDefinition(QName.JCR_VERSIONHISTORY,
View Full Code Here

Examples of org.apache.jackrabbit.core.version.VersionManager

                NodeState nodeState = (NodeState) itemState;
                EffectiveNodeType nt = getEffectiveNodeType(nodeState);
                if (nt.includesNodeType(NameConstants.MIX_VERSIONABLE)) {
                    if (!nodeState.hasPropertyName(NameConstants.JCR_VERSIONHISTORY)) {
                        NodeImpl node = (NodeImpl) itemMgr.getItem(itemState.getId());
                        VersionManager vMgr = session.getVersionManager();
                        /**
                         * check if there's already a version history for that
                         * node; this would e.g. be the case if a versionable
                         * node had been exported, removed and re-imported with
                         * either IMPORT_UUID_COLLISION_REMOVE_EXISTING or
                         * 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);
                        node.internalSetProperty(
                                NameConstants.JCR_ISCHECKEDOUT,
                                InternalValue.create(true));
                        node.internalSetProperty(
                                NameConstants.JCR_PREDECESSORS,
                                new InternalValue[] { versionId });
                        createdTransientState = true;
                    }
                } else if (nt.includesNodeType(NameConstants.MIX_SIMPLE_VERSIONABLE)) {
                    // we need to check the version manager for an existing
                    // version history, since simple versioning does not
                    // expose it's reference in a property
                    VersionManager vMgr = session.getVersionManager();
                    vMgr.getVersionHistory(session, nodeState, null);

                    // create isCheckedOutProperty if not already exists
                    NodeImpl node = (NodeImpl) itemMgr.getItem(itemState.getId());
                    if (!nodeState.hasPropertyName(NameConstants.JCR_ISCHECKEDOUT)) {
                        node.internalSetProperty(
View Full Code Here

Examples of org.apache.jackrabbit.core.version.VersionManager

                    // the histories jcr:copiedFrom property
                    PropertyId propId = new PropertyId(srcState.getNodeId(), NameConstants.JCR_BASEVERSION);
                    PropertyState prop = (PropertyState) srcStateMgr.getItemState(propId);
                    copiedFrom = prop.getValues()[0].getNodeId();
                }
                VersionManager manager = session.getVersionManager();
                history = manager.getVersionHistory(session, newState, copiedFrom);
            }
            // copy properties
            for (Name propName : srcState.getPropertyNames()) {
                Path propPath = PathFactoryImpl.getInstance().create(srcPath, propName, true);
                if (!srcAccessMgr.canRead(propPath)) {
View Full Code Here

Examples of org.zanata.service.impl.VersionManager

                    throws Failure, WebApplicationException {
        String clientApiVer =
                request.getHttpHeaders().getRequestHeaders()
                        .getFirst(RestConstant.HEADER_VERSION_NO);
        String serverApiVer = VersionUtility.getAPIVersionInfo().getVersionNo();
        VersionManager verManager =
                ServiceLocator.instance().getInstance(VersionManager.class);

        return verManager.checkVersion(clientApiVer, serverApiVer) ? null
                : ServerResponse
                        .copyIfNotServerResponse(Response
                                .status(Status.PRECONDITION_FAILED)
                                .entity("Client API Version '"
                                        + clientApiVer
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.