javax.jcr.Node.removeSharedSet()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(182)

本文整理了Java中javax.jcr.Node.removeSharedSet()方法的一些代码示例,展示了Node.removeSharedSet()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.removeSharedSet()方法的具体详情如下:
包路径:javax.jcr.Node
类名称:Node
方法名:removeSharedSet

Node.removeSharedSet介绍

[英]Removes this node and every other node in the shared set of this node.

This removal must be done atomically, i.e., if one of the nodes cannot be removed, the method throws the exception Node#remove() would have thrown in that case, and none of the nodes are removed.

If this node is not shared this method removes only this node.
[中]删除此节点以及此节点的共享集中的所有其他节点。
此删除必须以原子方式完成,即,如果其中一个节点无法删除,则该方法会抛出异常节点#remove()在这种情况下会抛出,并且不会删除任何节点。
如果未共享此节点,则此方法仅删除此节点。

代码示例

代码示例来源:origin: net.adamcin.commons/net.adamcin.commons.jcr

  1. public void removeSharedSet() throws RepositoryException {
  2. this.item.removeSharedSet();
  3. }

代码示例来源:origin: org.onehippo.cms7/hippo-repository-connector

  1. public void removeSharedSet() throws VersionException, LockException, ConstraintViolationException, RepositoryException {
  2. node.removeSharedSet();
  3. }

代码示例来源:origin: apache/jackrabbit

  1. /** {@inheritDoc} */
  2. public void removeSharedSet() throws RepositoryException, RemoteException {
  3. try {
  4. node.removeSharedSet();
  5. } catch (RepositoryException ex) {
  6. throw getRepositoryException(ex);
  7. }
  8. }

代码示例来源:origin: info.magnolia/magnolia-core

  1. @Override
  2. public void removeSharedSet() throws VersionException, LockException, ConstraintViolationException, RepositoryException {
  3. getWrappedNode().removeSharedSet();
  4. }

代码示例来源:origin: nl.vpro/jcr-criteria

  1. @Override
  2. public void removeSharedSet() throws RepositoryException {
  3. getNode().removeSharedSet();
  4. }

代码示例来源:origin: brix-cms/brix-cms

  1. public void removeSharedSet() throws VersionException, LockException,
  2. ConstraintViolationException, RepositoryException {
  3. getDelegate().removeSharedSet();
  4. }

代码示例来源:origin: brix-cms/brix-cms

  1. public void execute() throws Exception {
  2. getDelegate().removeSharedSet();
  3. }
  4. });

代码示例来源:origin: apache/jackrabbit

  1. /**
  2. * Check new API Node.removeSharedSet() (6.13.4).
  3. */
  4. public void testRemoveSharedSet() throws Exception {
  5. // setup parent nodes and first child
  6. Node a1 = testRootNode.addNode("a1");
  7. Node a2 = testRootNode.addNode("a2");
  8. Node b1 = a1.addNode("b1");
  9. testRootNode.getSession().save();
  10. // add mixin
  11. ensureMixinType(b1, mixShareable);
  12. b1.save();
  13. // clone
  14. Workspace workspace = b1.getSession().getWorkspace();
  15. workspace.clone(workspace.getName(), b1.getPath(),
  16. a2.getPath() + "/b2", false);
  17. // remove shared set
  18. b1.removeSharedSet();
  19. testRootNode.getSession().save();
  20. // verify neither a1 nor a2 contain any more children
  21. assertFalse(a1.hasNodes());
  22. assertFalse(a2.hasNodes());
  23. }

代码示例来源:origin: apache/jackrabbit

  1. /**
  2. * Invoke Node.removeSharedSet(), but save only one of the parent nodes
  3. * of the shared set. This doesn't need to be supported according to the
  4. * specification (6.13.4).
  5. */
  6. public void testRemoveSharedSetSaveOneParentOnly() throws Exception {
  7. // setup parent nodes and first child
  8. Node a1 = testRootNode.addNode("a1");
  9. Node a2 = testRootNode.addNode("a2");
  10. Node b1 = a1.addNode("b1");
  11. testRootNode.getSession().save();
  12. // add mixin
  13. ensureMixinType(b1, mixShareable);
  14. b1.save();
  15. // clone
  16. Workspace workspace = b1.getSession().getWorkspace();
  17. workspace.clone(workspace.getName(), b1.getPath(),
  18. a2.getPath() + "/b2", false);
  19. // remove shared set
  20. b1.removeSharedSet();
  21. try {
  22. // save only one of the parents, should fail
  23. a1.save();
  24. fail("Removing a shared set requires saving all parents.");
  25. } catch (ConstraintViolationException e) {
  26. // expected
  27. }
  28. }

相关文章