本文整理了Java中javax.jcr.Node.isCheckedOut()
方法的一些代码示例,展示了Node.isCheckedOut()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.isCheckedOut()
方法的具体详情如下:
包路径:javax.jcr.Node
类名称:Node
方法名:isCheckedOut
[英]Returns false
if this node is currently in the checked-in state (either due to its own status as a versionable node or due to the effect of a versionable node being checked in above it). Otherwise this method returns true
. This includes the case where the repository does not support versioning (and therefore all nodes are always "checked-out", by default).
[中]如果此节点当前处于签入状态(由于其自身作为可版本化节点的状态或由于其上方签入的可版本化节点的影响),则返回false
。否则,此方法返回true
。这包括存储库不支持版本控制的情况(因此默认情况下,所有节点都是“签出的”)。
代码示例来源:origin: org.onehippo.cms7/hippo-repository-connector
/**
* @inheritDoc
*/
public boolean isCheckedOut() throws RepositoryException {
return node.isCheckedOut();
}
代码示例来源:origin: org.apache.sling/org.apache.sling.scripting.javascript
public boolean jsFunction_getCheckedOut() {
try {
return node.isCheckedOut();
} catch (RepositoryException re) {
return false;
}
}
代码示例来源:origin: org.apache.jackrabbit.vault/org.apache.jackrabbit.vault
public StackElement(Node node, boolean isNew) throws RepositoryException {
this.node = node;
this.isNew = isNew;
isCheckedOut = node == null || !node.isNodeType(JcrConstants.MIX_VERSIONABLE) || node.isCheckedOut();
}
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
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);
}
}
代码示例来源:origin: apache/jackrabbit
/** {@inheritDoc} */
public boolean isCheckedOut() throws RepositoryException, RemoteException {
try {
return node.isCheckedOut();
} catch (RepositoryException ex) {
throw getRepositoryException(ex);
}
}
代码示例来源:origin: apache/jackrabbit
/**
* 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);
}
代码示例来源:origin: apache/jackrabbit
/**
* 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);
}
代码示例来源:origin: apache/jackrabbit
/**
* 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());
}
代码示例来源:origin: apache/jackrabbit
/**
* 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());
}
代码示例来源:origin: apache/jackrabbit
/**
* 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());
}
代码示例来源:origin: org.apache.sling/org.apache.sling.servlets.post
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()));
}
}
}
}
代码示例来源:origin: org.apache.sling/org.apache.sling.servlets.post
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;
}
代码示例来源:origin: pentaho/pentaho-platform
public Object doInJcr( final Session session ) throws RepositoryException {
Item item = session.getItem( absPath );
Assert.isTrue( item.isNode() );
return ( (Node) item ).isCheckedOut();
}
} );
代码示例来源:origin: org.apache.jackrabbit/oak-jcr
@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.");
}
}
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak
@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.");
}
}
代码示例来源:origin: apache/jackrabbit-oak
@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.");
}
}
代码示例来源:origin: apache/jackrabbit-oak
@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.");
}
}
代码示例来源:origin: apache/jackrabbit-oak
@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.");
}
}
代码示例来源:origin: apache/jackrabbit
/**
* 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);
}
}
代码示例来源:origin: apache/jackrabbit-oak
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());
}
内容来源于网络,如有侵权,请联系作者删除!