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

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

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

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

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

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

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

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

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

代码示例来源:origin: org.apache.jackrabbit/oak-jcr

  1. @Override
  2. public void performVoid() throws RepositoryException {
  3. // TODO: avoid nested calls
  4. NodeIterator sharedSet = getSharedSet();
  5. while (sharedSet.hasNext()) {
  6. sharedSet.nextNode().removeShare();
  7. }
  8. }
  9. });

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

  1. protected void removeFromSharedSet(Node node) throws RepositoryException {
  2. node.removeShare();
  3. }
  4. }

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

  1. @Override
  2. public void performVoid() throws RepositoryException {
  3. // TODO: avoid nested calls
  4. NodeIterator sharedSet = getSharedSet();
  5. while (sharedSet.hasNext()) {
  6. sharedSet.nextNode().removeShare();
  7. }
  8. }
  9. });

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

  1. @Override
  2. public void performVoid() throws RepositoryException {
  3. // TODO: avoid nested calls
  4. NodeIterator sharedSet = getSharedSet();
  5. while (sharedSet.hasNext()) {
  6. sharedSet.nextNode().removeShare();
  7. }
  8. }
  9. });

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

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

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

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

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

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

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

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

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core

  1. /**
  2. * A special kind of <code>remove()</code> that removes this node and every
  3. * other node in the shared set of this node.
  4. * <p>
  5. * This removal must be done atomically, i.e., if one of the nodes cannot be
  6. * removed, the function throws the exception <code>remove()</code> would
  7. * have thrown in that case, and none of the nodes are removed.
  8. * <p>
  9. * If this node is not shared this method removes only this node.
  10. *
  11. * @throws VersionException
  12. * @throws LockException
  13. * @throws ConstraintViolationException
  14. * @throws RepositoryException
  15. * @see #removeShare()
  16. * @see Item#remove()
  17. * @since JCR 2.0
  18. */
  19. public void removeSharedSet() throws VersionException, LockException,
  20. ConstraintViolationException, RepositoryException {
  21. // check state of this instance
  22. sanityCheck();
  23. NodeIterator iter = getSharedSet();
  24. while (iter.hasNext()) {
  25. iter.nextNode().removeShare();
  26. }
  27. }

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

  1. /**
  2. * A special kind of <code>remove()</code> that removes this node and every
  3. * other node in the shared set of this node.
  4. * <p>
  5. * This removal must be done atomically, i.e., if one of the nodes cannot be
  6. * removed, the function throws the exception <code>remove()</code> would
  7. * have thrown in that case, and none of the nodes are removed.
  8. * <p>
  9. * If this node is not shared this method removes only this node.
  10. *
  11. * @throws VersionException
  12. * @throws LockException
  13. * @throws ConstraintViolationException
  14. * @throws RepositoryException
  15. * @see #removeShare()
  16. * @see Item#remove()
  17. * @since JCR 2.0
  18. */
  19. public void removeSharedSet() throws VersionException, LockException,
  20. ConstraintViolationException, RepositoryException {
  21. // check state of this instance
  22. sanityCheck();
  23. NodeIterator iter = getSharedSet();
  24. while (iter.hasNext()) {
  25. iter.nextNode().removeShare();
  26. }
  27. }

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

  1. /**
  2. * Verify that invoking save() on a share-ancestor will save changes in
  3. * all share-descendants.
  4. */
  5. public void testModifyDescendantAndRemoveShareAndSave() throws Exception {
  6. // setup parent nodes and first child
  7. Node a1 = testRootNode.addNode("a1");
  8. Node a2 = testRootNode.addNode("a2");
  9. Node b1 = a1.addNode("b1");
  10. testRootNode.getSession().save();
  11. // add mixin
  12. ensureMixinType(b1, mixShareable);
  13. b1.save();
  14. // clone
  15. Workspace workspace = b1.getSession().getWorkspace();
  16. workspace.clone(workspace.getName(), b1.getPath(),
  17. a2.getPath() + "/b2", false);
  18. // add child node c to b1
  19. Node c = b1.addNode("c");
  20. b1.save();
  21. // add child d to c, this modifies c
  22. c.addNode("d");
  23. // remove share b2 from a2
  24. a2.getNode("b2").removeShare();
  25. // save a2 (having path /testroot/a2): this should save c as well
  26. // since one of the paths to c was /testroot/a2/b2/c
  27. a2.save();
  28. assertFalse("Saving share-ancestor should save share-descendants",
  29. c.isModified());
  30. }

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

  1. a2.getNode("b2").removeShare();

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

  1. /**
  2. * Check new API Node.removeShare() (6.13.4).
  3. */
  4. public void testRemoveShare() 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. Node[] shared = getSharedSet(b1);
  18. assertEquals(2, shared.length);
  19. b1 = shared[0];
  20. Node b2 = shared[1];
  21. // remove b1 from shared set
  22. b1.removeShare();
  23. a1.save();
  24. // verify shared set of b2 contains only 1 item, namely b2 itself
  25. shared = getSharedSet(b2);
  26. assertEquals(1, shared.length);
  27. assertTrue(shared[0].isSame(b2));
  28. }

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

  1. /**
  2. * @see DeleteHandler#delete(DeleteContext, DavResource)
  3. */
  4. public boolean delete(DeleteContext deleteContext, DavResource member) throws DavException {
  5. try {
  6. String itemPath = member.getLocator().getRepositoryPath();
  7. Item item = deleteContext.getSession().getItem(itemPath);
  8. if (item instanceof Node) {
  9. ((Node) item).removeShare();
  10. } else {
  11. item.remove();
  12. }
  13. deleteContext.getSession().save();
  14. log.debug("default handler deleted {}", member.getResourcePath());
  15. return true;
  16. } catch (RepositoryException e) {
  17. throw new JcrDavException(e);
  18. }
  19. }

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

  1. s.removeShare();
  2. testRootNode.save();
  3. s.removeShare();
  4. testRootNode.save();

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

  1. s.removeShare();
  2. testRootNode.save();
  3. s.removeShare();
  4. testRootNode.save();

相关文章