本文整理了Java中javax.jcr.Node.removeShare()
方法的一些代码示例,展示了Node.removeShare()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.removeShare()
方法的具体详情如下:
包路径:javax.jcr.Node
类名称:Node
方法名:removeShare
[英]Removes this node, but does not remove any other node in the shared set of this node.
[中]删除此节点,但不删除此节点共享集中的任何其他节点。
代码示例来源:origin: net.adamcin.commons/net.adamcin.commons.jcr
public void removeShare() throws RepositoryException {
this.item.removeShare();
}
代码示例来源:origin: org.onehippo.cms7/hippo-repository-connector
public void removeShare() throws VersionException, LockException, ConstraintViolationException, RepositoryException {
node.removeShare();
}
代码示例来源:origin: apache/jackrabbit
/** {@inheritDoc} */
public void removeShare() throws RepositoryException, RemoteException {
try {
node.removeShare();
} catch (RepositoryException ex) {
throw getRepositoryException(ex);
}
}
代码示例来源:origin: org.apache.jackrabbit/oak-jcr
@Override
public void performVoid() throws RepositoryException {
// TODO: avoid nested calls
NodeIterator sharedSet = getSharedSet();
while (sharedSet.hasNext()) {
sharedSet.nextNode().removeShare();
}
}
});
代码示例来源:origin: apache/jackrabbit
protected void removeFromSharedSet(Node node) throws RepositoryException {
node.removeShare();
}
}
代码示例来源:origin: apache/jackrabbit-oak
@Override
public void performVoid() throws RepositoryException {
// TODO: avoid nested calls
NodeIterator sharedSet = getSharedSet();
while (sharedSet.hasNext()) {
sharedSet.nextNode().removeShare();
}
}
});
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak
@Override
public void performVoid() throws RepositoryException {
// TODO: avoid nested calls
NodeIterator sharedSet = getSharedSet();
while (sharedSet.hasNext()) {
sharedSet.nextNode().removeShare();
}
}
});
代码示例来源:origin: info.magnolia/magnolia-core
@Override
public void removeShare() throws VersionException, LockException, ConstraintViolationException, RepositoryException {
getWrappedNode().removeShare();
}
代码示例来源:origin: nl.vpro/jcr-criteria
@Override
public void removeShare() throws RepositoryException {
getNode().removeShare();
}
代码示例来源:origin: brix-cms/brix-cms
public void removeShare() throws VersionException, LockException, ConstraintViolationException,
RepositoryException {
getDelegate().removeShare();
}
代码示例来源:origin: brix-cms/brix-cms
public void execute() throws Exception {
getDelegate().removeShare();
}
});
代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core
/**
* A special kind of <code>remove()</code> that removes this node and every
* other node in the shared set of this node.
* <p>
* This removal must be done atomically, i.e., if one of the nodes cannot be
* removed, the function throws the exception <code>remove()</code> would
* have thrown in that case, and none of the nodes are removed.
* <p>
* If this node is not shared this method removes only this node.
*
* @throws VersionException
* @throws LockException
* @throws ConstraintViolationException
* @throws RepositoryException
* @see #removeShare()
* @see Item#remove()
* @since JCR 2.0
*/
public void removeSharedSet() throws VersionException, LockException,
ConstraintViolationException, RepositoryException {
// check state of this instance
sanityCheck();
NodeIterator iter = getSharedSet();
while (iter.hasNext()) {
iter.nextNode().removeShare();
}
}
代码示例来源:origin: apache/jackrabbit
/**
* A special kind of <code>remove()</code> that removes this node and every
* other node in the shared set of this node.
* <p>
* This removal must be done atomically, i.e., if one of the nodes cannot be
* removed, the function throws the exception <code>remove()</code> would
* have thrown in that case, and none of the nodes are removed.
* <p>
* If this node is not shared this method removes only this node.
*
* @throws VersionException
* @throws LockException
* @throws ConstraintViolationException
* @throws RepositoryException
* @see #removeShare()
* @see Item#remove()
* @since JCR 2.0
*/
public void removeSharedSet() throws VersionException, LockException,
ConstraintViolationException, RepositoryException {
// check state of this instance
sanityCheck();
NodeIterator iter = getSharedSet();
while (iter.hasNext()) {
iter.nextNode().removeShare();
}
}
代码示例来源:origin: apache/jackrabbit
/**
* Verify that invoking save() on a share-ancestor will save changes in
* all share-descendants.
*/
public void testModifyDescendantAndRemoveShareAndSave() throws Exception {
// setup parent nodes and first child
Node a1 = testRootNode.addNode("a1");
Node a2 = testRootNode.addNode("a2");
Node b1 = a1.addNode("b1");
testRootNode.getSession().save();
// add mixin
ensureMixinType(b1, mixShareable);
b1.save();
// clone
Workspace workspace = b1.getSession().getWorkspace();
workspace.clone(workspace.getName(), b1.getPath(),
a2.getPath() + "/b2", false);
// add child node c to b1
Node c = b1.addNode("c");
b1.save();
// add child d to c, this modifies c
c.addNode("d");
// remove share b2 from a2
a2.getNode("b2").removeShare();
// save a2 (having path /testroot/a2): this should save c as well
// since one of the paths to c was /testroot/a2/b2/c
a2.save();
assertFalse("Saving share-ancestor should save share-descendants",
c.isModified());
}
代码示例来源:origin: apache/jackrabbit
a2.getNode("b2").removeShare();
代码示例来源:origin: apache/jackrabbit
/**
* Check new API Node.removeShare() (6.13.4).
*/
public void testRemoveShare() throws Exception {
// setup parent nodes and first child
Node a1 = testRootNode.addNode("a1");
Node a2 = testRootNode.addNode("a2");
Node b1 = a1.addNode("b1");
testRootNode.getSession().save();
// add mixin
ensureMixinType(b1, mixShareable);
b1.save();
// clone
Workspace workspace = b1.getSession().getWorkspace();
workspace.clone(workspace.getName(), b1.getPath(),
a2.getPath() + "/b2", false);
Node[] shared = getSharedSet(b1);
assertEquals(2, shared.length);
b1 = shared[0];
Node b2 = shared[1];
// remove b1 from shared set
b1.removeShare();
a1.save();
// verify shared set of b2 contains only 1 item, namely b2 itself
shared = getSharedSet(b2);
assertEquals(1, shared.length);
assertTrue(shared[0].isSame(b2));
}
代码示例来源:origin: apache/jackrabbit
/**
* @see DeleteHandler#delete(DeleteContext, DavResource)
*/
public boolean delete(DeleteContext deleteContext, DavResource member) throws DavException {
try {
String itemPath = member.getLocator().getRepositoryPath();
Item item = deleteContext.getSession().getItem(itemPath);
if (item instanceof Node) {
((Node) item).removeShare();
} else {
item.remove();
}
deleteContext.getSession().save();
log.debug("default handler deleted {}", member.getResourcePath());
return true;
} catch (RepositoryException e) {
throw new JcrDavException(e);
}
}
代码示例来源:origin: apache/jackrabbit
s.removeShare();
testRootNode.save();
s.removeShare();
testRootNode.save();
代码示例来源:origin: apache/jackrabbit
s.removeShare();
testRootNode.save();
s.removeShare();
testRootNode.save();
内容来源于网络,如有侵权,请联系作者删除!