@Override public Node setActivity(final Node activity) throws UnsupportedRepositoryOperationException, RepositoryException { return versionManager.setActivity(activity); }
@Override public Node setActivity(Node activity) throws UnsupportedRepositoryOperationException, RepositoryException { return getWrappedVersionManager().setActivity(activity); }
/** * {@inheritDoc} */ public void checkout(final SessionInfo sessionInfo, final NodeId nodeId, NodeId activityId) throws UnsupportedRepositoryOperationException, LockException, RepositoryException { final SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo); Node activity = (activityId == null) ? null : getNode(activityId, sInfo); VersionManager vMgr = sInfo.getSession().getWorkspace().getVersionManager(); vMgr.setActivity(activity); try { executeWithLocalEvents(new Callable() { public Object run() throws RepositoryException { getNode(nodeId, sInfo).checkout(); return null; } }, sInfo); } finally { vMgr.setActivity(null); } }
/** * {@inheritDoc} */ public void checkout(final SessionInfo sessionInfo, final NodeId nodeId, NodeId activityId) throws UnsupportedRepositoryOperationException, LockException, RepositoryException { final SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo); Node activity = (activityId == null) ? null : getNode(activityId, sInfo); VersionManager vMgr = sInfo.getSession().getWorkspace().getVersionManager(); vMgr.setActivity(activity); try { executeWithLocalEvents(new Callable() { public Object run() throws RepositoryException { getNode(nodeId, sInfo).checkout(); return null; } }, sInfo); } finally { vMgr.setActivity(null); } }
/** * {@inheritDoc} */ public NodeId checkpoint(SessionInfo sessionInfo, final NodeId nodeId, final NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException { final SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo); Node activity = (activityId == null) ? null : getNode(activityId, sInfo); VersionManager vMgr = sInfo.getSession().getWorkspace().getVersionManager(); vMgr.setActivity(activity); try { Version newVersion = (Version) executeWithLocalEvents(new Callable() { public Object run() throws RepositoryException { VersionManager vMgr = sInfo.getSession().getWorkspace().getVersionManager(); return vMgr.checkpoint(getNodePath(nodeId, sInfo)); } }, sInfo); return idFactory.createNodeId(newVersion); } finally { vMgr.setActivity(null); } }
/** * {@inheritDoc} */ public NodeId checkpoint(SessionInfo sessionInfo, final NodeId nodeId, final NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException { final SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo); Node activity = (activityId == null) ? null : getNode(activityId, sInfo); VersionManager vMgr = sInfo.getSession().getWorkspace().getVersionManager(); vMgr.setActivity(activity); try { Version newVersion = (Version) executeWithLocalEvents(new Callable() { public Object run() throws RepositoryException { VersionManager vMgr = sInfo.getSession().getWorkspace().getVersionManager(); return vMgr.checkpoint(getNodePath(nodeId, sInfo)); } }, sInfo); return idFactory.createNodeId(newVersion); } finally { vMgr.setActivity(null); } }
versionManager.setActivity(activityNode);
public void testSetGetActivity() throws Exception { Node an = null; try { an = vm.createActivity("foobar"); assertNotNull(an); assertNull(vm.getActivity()); Node old = vm.setActivity(an); assertNull(old); assertEquals(an.getPath(), vm.getActivity().getPath()); old = vm.setActivity(null); assertEquals(old.getPath(), an.getPath()); assertNull(vm.getActivity()); } finally { if (an != null) { vm.removeActivity(an); } } }
@Override public RemoteNode setActivity(String activityNodeIdentifier) throws RepositoryException, RemoteException { try { Node newActivityNode; if (activityNodeIdentifier == null) { newActivityNode = null; } else { newActivityNode = session.getNodeByIdentifier(activityNodeIdentifier); } Node oldActivityNode = manager.setActivity(newActivityNode); if (oldActivityNode == null) { return null; } else { return getFactory().getRemoteNode(oldActivityNode); } } catch (RepositoryException e) { throw getRepositoryException(e); } }
public void testActivitiesRelationWithCheckpoint() throws Exception { Node an = null; try { an = vm.createActivity("foobar2"); vm.setActivity(an); String path = versionableNode.getPath(); vm.checkpoint(path); versionableNode = superuser.getNode(path); Property act = versionableNode.getProperty(Property.JCR_ACTIVITY); assertNotNull(act); assertEquals(PropertyType.REFERENCE, act.getType()); assertTrue(act.getNode().isSame(an)); versionableNode.remove(); superuser.save(); } finally { if (an != null) { vm.removeActivity(an); } } } }