/** * @inheritDoc */ public Version getBaseVersion() throws UnsupportedRepositoryOperationException, RepositoryException { return factory.getVersionDecorator(session, node.getBaseVersion()); }
public Object jsFunction_getBaseVersion() { try { return ScriptRuntime.toObject(this, node.getBaseVersion()); } catch (RepositoryException re) { return Undefined.instance; } }
@Override @Deprecated public Version getBaseVersion() throws RepositoryException { return getNode().getBaseVersion(); }
/** * Entire subtree is protected. */ public void testVersionStorageProtected() throws RepositoryException { try { versionableNode.getBaseVersion().setProperty(jcrCreated, GregorianCalendar.getInstance()); fail("It should not be possible to modify a subnode/version in version storage."); } catch (ConstraintViolationException e) { // success } }
/** * Checks if all versions by the base and root one can be removed. */ public void testRemoveBaseVersion() throws RepositoryException { try { versionableNode.getBaseVersion().remove(); fail("Removal of base version should throw an exception."); } catch (RepositoryException e) { // ignore } } }
/** * Tests if <code>Version.isSame()</code> returns the right * <code>boolean</code> value */ public void testIsSame() throws Exception { assertTrue("Version.isSame(Item) did not return true", version2.isSame(versionableNode.getBaseVersion())); }
/** * @deprecated */ @Deprecated public Version getBaseVersion() throws RepositoryException { return VersionWrapper.wrap(getDelegate().getBaseVersion(), getSessionWrapper()); }
/** {@inheritDoc} */ public RemoteVersion getBaseVersion() throws RepositoryException, RemoteException { try { return getFactory().getRemoteVersion(node.getBaseVersion()); } catch (RepositoryException ex) { throw getRepositoryException(ex); } }
/** * Test if restoring a node sets the jcr:baseVersion property correctly. * * @throws javax.jcr.RepositoryException */ @SuppressWarnings("deprecation") public void testRestoreSetsBaseVersion() throws RepositoryException { versionableNode.restore(version, true); Version baseV = versionableNode.getBaseVersion(); assertTrue("Restoring a node must set node's base version in order to point to the restored version.", version.isSame(baseV)); }
/** * @see javax.jcr.version.VersionManager#getBaseVersion(String) */ public Version getBaseVersion(String absPath) throws UnsupportedRepositoryOperationException, RepositoryException { session.checkIsAlive(); Node n = itemManager.getNode(resolver.getQPath(absPath)); return n.getBaseVersion(); }
/** * @see javax.jcr.version.VersionManager#getBaseVersion(String) */ public Version getBaseVersion(String absPath) throws UnsupportedRepositoryOperationException, RepositoryException { session.checkIsAlive(); Node n = itemManager.getNode(resolver.getQPath(absPath)); return n.getBaseVersion(); }
/** * Test that the initial base version after creation of a versionable node * points to the root version. * * @throws javax.jcr.RepositoryException */ public void testInitialBaseVersionPointsToRootVersion() throws RepositoryException { Version rV = versionableNode.getVersionHistory().getRootVersion(); Version bV = versionableNode.getBaseVersion(); assertTrue("After creation of a versionable node the node's baseVersion must point to the rootVersion in the version history.", rV.isSame(bV)); }
@SuppressWarnings( "deprecation" ) protected Version baseVersion( Node node ) throws RepositoryException { if (useDeprecatedApi()) return node.getBaseVersion(); return session.getWorkspace().getVersionManager().getBaseVersion(node.getPath()); }
/** * @since oak */ @Test public void testGetBaseVersion() throws Exception { // version information must still be accessible Version base = testSession.getNode(versionablePath).getBaseVersion(); Version base2 = testSession.getWorkspace().getVersionManager().getBaseVersion(versionablePath); }
/** * Returns the versionable node. */ public NodeIterator execute() throws Exception { Node n = getNode(); if (!n.isCheckedOut()) { log.info(n.getPath() + ":" + n.getBaseVersion().getName()); n.checkout(); } return wrapWithIterator(n); } }
/** * @see VersionHistory#getAllLinearVersions() */ @SuppressWarnings("deprecation") public VersionIterator getAllLinearVersions() throws RepositoryException { // get base version. this can certainly be optimized SessionImpl session = sessionContext.getSessionImpl(); InternalVersionHistory vh = getInternalVersionHistory(); Node vn = session.getNodeById(vh.getVersionableId()); InternalVersion base = ((VersionImpl) vn.getBaseVersion()).getInternalVersion(); return new VersionIteratorImpl(getSession(), vh.getRootVersion(), base); }
/** * @see VersionHistory#getAllLinearVersions() */ @SuppressWarnings("deprecation") public VersionIterator getAllLinearVersions() throws RepositoryException { // get base version. this can certainly be optimized SessionImpl session = sessionContext.getSessionImpl(); InternalVersionHistory vh = getInternalVersionHistory(); Node vn = session.getNodeById(vh.getVersionableId()); InternalVersion base = ((VersionImpl) vn.getBaseVersion()).getInternalVersion(); return new VersionIteratorImpl(getSession(), vh.getRootVersion(), base); }
/** * Returns the versionable node. */ public NodeIterator execute() throws Exception { Node n = getNode(); String name = n.getBaseVersion().getName(); String label = getRandomText(3); log.info(n.getPath() + ":" + name + " -> " + label); n.getVersionHistory().addVersionLabel(name, label, true); return wrapWithIterator(n); } }
public void testReadVersionInfo2() throws RepositoryException, NotExecutableException { Node n = createVersionableNode(testRootNode); modifyPrivileges(VERSION_STORAGE_PATH, Privilege.JCR_READ, true); Node n2 = (Node) getTestSession().getItem(n.getPath()); n2.getVersionHistory(); n2.getBaseVersion(); }
/** * {@inheritDoc} */ public Version getLinearSuccessor() throws RepositoryException { // get base version. this can certainly be optimized SessionImpl session = sessionContext.getSessionImpl(); InternalVersionHistory vh = ((VersionHistoryImpl) getContainingHistory()) .getInternalVersionHistory(); Node vn = session.getNodeById(vh.getVersionableId()); InternalVersion base = ((VersionImpl) vn.getBaseVersion()).getInternalVersion(); InternalVersion suc = getInternalVersion().getLinearSuccessor(base); return suc == null ? null : (Version) session.getNodeById(suc.getId()); }