@Override public void restoreByLabel( String versionLabel, boolean removeExisting ) throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException { restore(getVersionHistory().getVersionByLabel(versionLabel), removeExisting); }
@Override public void restoreByLabel( String versionLabel, boolean removeExisting ) throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException { restore(getVersionHistory().getVersionByLabel(versionLabel), removeExisting); }
@Override public void restore( Version version, boolean removeExisting ) throws VersionException, ItemExistsException, InvalidItemStateException, UnsupportedRepositoryOperationException, LockException, RepositoryException { try { checkNotProtected(); } catch (ConstraintViolationException cve) { throw new UnsupportedRepositoryOperationException(cve); } versionManager().restoreAtAbsPath(getPath(), version, removeExisting, false); }
@Override public void restore( Version version, boolean removeExisting ) throws VersionException, ItemExistsException, InvalidItemStateException, UnsupportedRepositoryOperationException, LockException, RepositoryException { try { checkNotProtected(); } catch (ConstraintViolationException cve) { throw new UnsupportedRepositoryOperationException(cve); } versionManager().restoreAtAbsPath(getPath(), version, removeExisting, false); }
@Override public void restore( String absPath, String versionName, boolean removeExisting ) throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException { if (LOGGER.isDebugEnabled()) LOGGER.debug("VersionManager.restore('{0}','{1}',{2})", absPath, versionName, removeExisting); validateSessionLiveWithoutPendingChanges(); // Create a new session in which we'll finish the restore, so this session remains thread-safe ... JcrSession restoreSession = session.spawnSession(false); Version version = null; // See if the node at absPath exists and has version storage. Path path = restoreSession.absolutePathFor(absPath); AbstractJcrNode existingNode = restoreSession.node(path); VersionHistory historyNode = existingNode.getVersionHistory(); version = historyNode.getVersion(versionName); assert version != null; restore(restoreSession, path, version, null, removeExisting); }
@Override public void restore( String absPath, String versionName, boolean removeExisting ) throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException { if (LOGGER.isDebugEnabled()) LOGGER.debug("VersionManager.restore('{0}','{1}',{2})", absPath, versionName, removeExisting); validateSessionLiveWithoutPendingChanges(); // Create a new session in which we'll finish the restore, so this session remains thread-safe ... JcrSession restoreSession = session.spawnSession(false); Version version = null; // See if the node at absPath exists and has version storage. Path path = restoreSession.absolutePathFor(absPath); AbstractJcrNode existingNode = restoreSession.node(path); VersionHistory historyNode = existingNode.getVersionHistory(); version = historyNode.getVersion(versionName); assert version != null; restore(restoreSession, path, version, null, removeExisting); }
if (node.isNodeType(JcrMixLexicon.VERSIONABLE)) { JcrVersionHistoryNode history = node.getVersionHistory(); org.modeshape.jcr.value.Property primaryType = propertyFactory().create(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.VERSIONED_CHILD);
if (node.isNodeType(JcrMixLexicon.VERSIONABLE)) { JcrVersionHistoryNode history = node.getVersionHistory(); org.modeshape.jcr.value.Property primaryType = propertyFactory().create(JcrLexicon.PRIMARY_TYPE, JcrNtLexicon.VERSIONED_CHILD);
JcrVersionHistoryNode versionHistory = existingNode.getVersionHistory(); if (!versionHistory.isSame(jcrVersion.getParent())) { throw new VersionException(JcrI18n.invalidVersion.text(version.getPath(), versionHistory.getPath())); if (!versionHistory.isSame(existingNode.getVersionHistory())) { throw new VersionException(JcrI18n.invalidVersion.text(version.getPath(), existingNode.getVersionHistory() .getPath()));
JcrVersionHistoryNode versionHistory = existingNode.getVersionHistory(); if (!versionHistory.isSame(jcrVersion.getParent())) { throw new VersionException(JcrI18n.invalidVersion.text(version.getPath(), versionHistory.getPath())); if (!versionHistory.isSame(existingNode.getVersionHistory())) { throw new VersionException(JcrI18n.invalidVersion.text(version.getPath(), existingNode.getVersionHistory() .getPath()));