/** * @inheritDoc */ public boolean isCheckedOut() throws RepositoryException { return node.isCheckedOut(); }
public boolean jsFunction_getCheckedOut() { try { return node.isCheckedOut(); } catch (RepositoryException re) { return false; } }
public StackElement(Node node, boolean isNew) throws RepositoryException { this.node = node; this.isNew = isNew; isCheckedOut = node == null || !node.isNodeType(JcrConstants.MIX_VERSIONABLE) || node.isCheckedOut(); }
public static boolean isCheckedOut(Node node) { try { return node.isCheckedOut(); } catch (RepositoryException e) { throw new MetadataRepositoryException("Unable to check if the node is checked out", e); } }
/** {@inheritDoc} */ public boolean isCheckedOut() throws RepositoryException, RemoteException { try { return node.isCheckedOut(); } catch (RepositoryException ex) { throw getRepositoryException(ex); } }
/** * Test if workspace-restoring a node works on checked-in node. */ @SuppressWarnings("deprecation") public void testWorkspaceRestoreOnCheckedInNode() throws RepositoryException { if (versionableNode.isCheckedOut()) { versionableNode.checkin(); } superuser.getWorkspace().restore(new Version[]{version}, true); }
/** * Test if workspace-restoring a node works on checked-out node. */ @SuppressWarnings("deprecation") public void testWorkspaceRestoreOnCheckedOutNode() throws RepositoryException { if (!versionableNode.isCheckedOut()) { versionableNode.checkout(); } superuser.getWorkspace().restore(new Version[]{version}, true); }
/** * Test if Node.isCheckedOut() returns true, if the versionable node has * been checked out before. */ public void testIsCheckedOut() throws RepositoryException { versionableNode.checkout(); assertTrue("After calling Node.checkout() a versionable node N, N.isCheckedOut() must return true.", versionableNode.isCheckedOut()); }
/** * Test if Node.isCheckedOut() returns true, if the versionable node has * been checked out before. */ @SuppressWarnings("deprecation") public void testIsCheckedOut() throws RepositoryException { versionableNode.checkout(); assertTrue("After calling Node.checkout() a versionable node N, N.isCheckedOut() must return true.", versionableNode.isCheckedOut()); }
/** * Restoring a node set the jcr:isCheckedOut property to false. * * @throws RepositoryException */ @SuppressWarnings("deprecation") public void testRestoreSetsIsCheckedOutToFalse() throws RepositoryException { versionableNode.restore(version, true); assertFalse("Restoring a node sets the jcr:isCheckedOut property to false", versionableNode.isCheckedOut()); }
protected void checkoutIfNecessary(Node node, List<Modification> changes, VersioningConfiguration versioningConfiguration) throws RepositoryException { if (versioningConfiguration.isAutoCheckout()) { Node versionableNode = findVersionableAncestor(node); if (versionableNode != null) { if (!versionableNode.isCheckedOut()) { versionableNode.checkout(); changes.add(Modification.onCheckout(versionableNode.getPath())); } } } }
private boolean checkin(final ResourceResolver resolver, final String path) throws RepositoryException { final Resource rsrc = resolver.getResource(path); final Node node = (rsrc == null ? null : rsrc.adaptTo(Node.class)); if (node != null) { if (node.isCheckedOut() && isVersionable(node)) { node.checkin(); return true; } } return false; }
public Object doInJcr( final Session session ) throws RepositoryException { Item item = session.getItem( absPath ); Assert.isTrue( item.isNode() ); return ( (Node) item ).isCheckedOut(); } } );
@Override public void checkPreconditions() throws RepositoryException { super.checkPreconditions(); if (!getParent().isCheckedOut() && getDefinition().getOnParentVersion() != OnParentVersionAction.IGNORE) { throw new VersionException( "Cannot set property. Node is checked in."); } }
@Override public void checkPreconditions() throws RepositoryException { super.checkPreconditions(); if (!getParent().isCheckedOut() && getDefinition().getOnParentVersion() != OnParentVersionAction.IGNORE) { throw new VersionException( "Cannot set property. Node is checked in."); } }
@Override public void checkPreconditions() throws RepositoryException { super.checkPreconditions(); if (!getParent().isCheckedOut() && getDefinition().getOnParentVersion() != OnParentVersionAction.IGNORE) { throw new VersionException( "Cannot set property. Node is checked in."); } }
@Override public void checkPreconditions() throws RepositoryException { super.checkPreconditions(); if (!getParent().isCheckedOut() && getDefinition().getOnParentVersion() != OnParentVersionAction.IGNORE) { throw new VersionException( "Cannot set property. Node is checked in."); } }
@Override public void checkPreconditions() throws RepositoryException { super.checkPreconditions(); if (!getParent().isCheckedOut() && getDefinition().getOnParentVersion() != OnParentVersionAction.IGNORE) { throw new VersionException( "Cannot set property. Node is checked in."); } }
/** * 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); } }
public void testCheckoutWithPendingChanges() throws Exception { Node node = testRootNode.addNode(nodeName1, testNodeType); node.addMixin(mixVersionable); superuser.save(); node.checkin(); Node newNode = testRootNode.addNode(nodeName2, testNodeType); assertTrue(newNode.isNew()); node.checkout(); assertTrue(node.isCheckedOut()); assertTrue(newNode.isNew()); }