Examples of VersionException


Examples of javax.jcr.version.VersionException

        checkVersionable();
        checkLock();

        // check if 'own' version
        if (!version.getContainingHistory().isSame(getVersionHistory())) {
            throw new VersionException("Unable to restore version. Not same version history.");
        }

        internalRestore(version, new DateVersionSelector(version.getCreated()), removeExisting);
        // session.save/revert is done in internal restore
    }
View Full Code Here

Examples of javax.jcr.version.VersionException

        checkSessionHasPending();
        checkLock();

        Version v = getVersionHistory().getVersionByLabel(versionLabel);
        if (v == null) {
            throw new VersionException("No version for label " + versionLabel + " found.");
        }
        internalRestore(v, new LabelVersionSelector(versionLabel), removeExisting);
        // session.save/revert is done in internal restore
    }
View Full Code Here

Examples of javax.jcr.version.VersionException

        // check if checked out
        if (!internalIsCheckedOut()) {
            String msg = "Unable to finish merge. Node is checked-in: " + safeGetJCRPath();
            log.error(msg);
            throw new VersionException(msg);
        }

        // check if version is in mergeFailed list
        Set failed = internalGetMergeFailed();
        if (!failed.remove(version.getUUID())) {
            String msg = "Unable to finish merge. Specified version is not in jcr:mergeFailed property: " + safeGetJCRPath();
            log.error(msg);
            throw new VersionException(msg);
        }

        // remove version from mergeFailed list
        internalSetMergeFailed(failed);
View Full Code Here

Examples of javax.jcr.version.VersionException

                                        boolean removeExisting)
            throws RepositoryException {

        // fail if root version
        if (version.isRootVersion()) {
            throw new VersionException("Restore of root version not allowed.");
        }

        // set jcr:isCheckedOut property to true, in order to avoid any conflicts
        internalSetProperty(QName.JCR_ISCHECKEDOUT, InternalValue.create(true));
View Full Code Here

Examples of javax.jcr.version.VersionException

                        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 {
View Full Code Here

Examples of javax.jcr.version.VersionException

        }

        try {
            createTemplate().execute(new JcrCallback() {
                public Object doInJcr(Session session) throws RepositoryException {
                    throw new VersionException();
                }
            });
            fail("Should have thrown DataIntegrityViolationException");
        } catch (DataIntegrityViolationException ex) {
            // expected
View Full Code Here

Examples of javax.jcr.version.VersionException

   {
      NodeImpl node = (NodeImpl)getItem(parentAbsPath);
      // checked-in check
      if (!node.checkedOut())
      {
         throw new VersionException("Node " + node.getPath() + " or its nearest ancestor is checked-in");
      }

      // Check if node is not protected
      if (node.getDefinition().isProtected())
      {
View Full Code Here

Examples of javax.jcr.version.VersionException

      InvalidSerializedDataException, RepositoryException
   {
      NodeImpl node = (NodeImpl)getItem(parentAbsPath);
      if (!node.checkedOut())
      {
         throw new VersionException("Node " + node.getPath() + " or its nearest ancestor is checked-in");
      }

      // Check if node is not protected
      if (node.getDefinition().isProtected())
      {
View Full Code Here

Examples of javax.jcr.version.VersionException

         }
      }

      // Check if versionable ancestor is not checked-in
      if (!srcNode.parent().checkedOut())
         throw new VersionException("Parent or source Node or its nearest ancestor is checked-in");

      if (!srcNode.checkLocking())
         throw new LockException("Source parent node " + srcNode.getPath() + " is locked ");

      ItemDataMoveVisitor initializer =
View Full Code Here

Examples of javax.jcr.version.VersionException

         {
            return;
         }
         else if (action == OnParentVersionAction.ABORT)
         {
            throw new VersionException("Property is aborted " + property.getQPath().getAsString());
         }
         else if (action == OnParentVersionAction.COPY || action == OnParentVersionAction.VERSION
            || action == OnParentVersionAction.COMPUTE)
         {
            frozenProperty =
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.