Examples of VersionImpl


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

     */
    protected VersionImpl createVersionInstance(
            NodeId id, NodeState state, NodeDefinition def,
            ItemLifeCycleListener[] listeners) throws RepositoryException {

        return new VersionImpl(this, session, id, state, def, listeners);
    }
View Full Code Here

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

        // if source node is not versionable, leave
        if (!srcNode.isNodeType(QName.MIX_VERSIONABLE)) {
            return null;
        }
        // test versions
        VersionImpl v = (VersionImpl) getBaseVersion();
        VersionImpl vp = (VersionImpl) srcNode.getBaseVersion();
        if (vp.isMoreRecent(v) && !isCheckedOut()) {
            // I f V' is a successor (to any degree) of V, then the merge result for
            // N is update. This case can be thought of as the case where N' is
            // "newer" than N and therefore N should be updated to reflect N'.
            return srcNode;
        } else if (v.isSame(vp) || v.isMoreRecent(vp)) {
View Full Code Here

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

                        throw new ItemExistsException("Unable to restore node, item already exists outside of restored tree: "
                                + n.safeGetJCRPath());
                    }
                }
                // get desired version from version selector
                VersionImpl v = (VersionImpl) vsel.select(history);

                // check existing version of item exists
                if (!itemMgr.itemExists(nodeId)) {
                    if (v == null) {
                        // if version selector was unable to select version,
                        // choose the initial one
                        Version[] vs = history.getRootVersion().getSuccessors();
                        if (vs.length == 0) {
                            String msg = "Unable to select appropariate version for " +
                                    child.getName() + " using " + vsel;
                            log.error(msg);
                            throw new VersionException(msg);
                        }
                        v = (VersionImpl) vs[0];
                    }
                    restoredChild = addNode(child.getName(), v.getFrozenNode());
                } else {
                    restoredChild = session.getNodeById(nodeId);
                    if (v == null || oldVersion == null || v.getName().equals(oldVersion)) {
                        v = null;
                    }
                }
                if (v != null) {
                    try {
                        restoredChild.internalRestore(v, vsel, removeExisting);
                    } catch (RepositoryException e) {
                        log.error("Error while restoring node: " + e.toString());
                        log.error("  child path: " + restoredChild.safeGetJCRPath());
                        log.error("  selected version: " + v.getName());
                        StringBuffer avail = new StringBuffer();
                        VersionIterator vi = history.getAllVersions();
                        while (vi.hasNext()) {
                            avail.append(vi.nextVersion().getName());
                            if (vi.hasNext()) {
View Full Code Here

Examples of org.apache.jackrabbit.jcr2spi.version.VersionImpl

        // check special nodes
        Name ntName = state.getNodeTypeName();
        if (NameConstants.NT_VERSION.equals(ntName)) {
            // version
            return new VersionImpl(session, state, listeners);
        } else if (NameConstants.NT_VERSIONHISTORY.equals(ntName)) {
            // version-history
            return new VersionHistoryImpl(session, state, listeners);
        } else {
            // create common node object
View Full Code Here

Examples of org.apache.jackrabbit.oak.jcr.version.VersionImpl

        PropertyDelegate pd = delegate.getPropertyOrNull(JCR_PRIMARYTYPE);
        String type = pd != null ? pd.getString() : null;
        if (JcrConstants.NT_VERSION.equals(type)) {
            VersionManagerDelegate vmd =
                    VersionManagerDelegate.create(context.getSessionDelegate());
            return new VersionImpl(vmd.createVersion(delegate), context);
        } else if (JcrConstants.NT_VERSIONHISTORY.equals(type)) {
            VersionManagerDelegate vmd =
                    VersionManagerDelegate.create(context.getSessionDelegate());
            return new VersionHistoryImpl(vmd.createVersionHistory(delegate), context);
        } else {
View Full Code Here

Examples of org.apache.jackrabbit.oak.jcr.version.VersionImpl

        PropertyDelegate pd = delegate.getPropertyOrNull(JCR_PRIMARYTYPE);
        String type = pd != null ? pd.getString() : null;
        if (JcrConstants.NT_VERSION.equals(type)) {
            VersionManagerDelegate vmd =
                    VersionManagerDelegate.create(context.getSessionDelegate());
            return new VersionImpl(vmd.createVersion(delegate), context);
        } else if (JcrConstants.NT_VERSIONHISTORY.equals(type)) {
            VersionManagerDelegate vmd =
                    VersionManagerDelegate.create(context.getSessionDelegate());
            return new VersionHistoryImpl(vmd.createVersionHistory(delegate), context);
        } else {
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.config.mappings.VersionImpl

        getMetadata().getAttributes().getVariableOneToOnes().add(variableOneToOne.getMetadata());
        return variableOneToOne;
    }
   
    public Version addVersion() {
        VersionImpl version = new VersionImpl();
        getMetadata().getAttributes().getVersions().add(version.getMetadata());
        return version;
    }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.version.VersionImpl

      changesLog.add(ItemState.createUpdatedState(updatePropertyData(Constants.JCR_PREDECESSORS,
         new ArrayList<ValueData>())));

      dataManager.getTransactManager().save(changesLog);

      VersionImpl version = (VersionImpl)dataManager.getItemByIdentifier(verIdentifier, true, false);

      session.getActionHandler().postCheckin(this);
      return version;
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.version.VersionImpl

            + session.getUserID() + " item owner " + getACL().getOwner());
      }

      PlainChangesLog changesLog = new PlainChangesLogImpl(session.getId());

      VersionImpl base = (VersionImpl)getBaseVersion();
      base.addPredecessor(version.getUUID(), changesLog);
      removeMergeFailed(version, changesLog);

      dataManager.getTransactManager().save(changesLog);
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.version.VersionImpl

    */
   public void restore(String versionName, boolean removeExisting) throws VersionException, ItemExistsException,
      UnsupportedRepositoryOperationException, LockException, RepositoryException, InvalidItemStateException
   {

      VersionImpl version = (VersionImpl)versionHistory(false).version(versionName, false);
      restore(version, removeExisting);
   }
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.