/** * The cancellation only considers canceling the parent node, which corresponds * to the policy node. */ public int cancel(CancelableOperation other) throws RepositoryException { if (other instanceof Remove) { Path thisPath = ConsolidatingChangeLog.getPath(parentId, tree.getName()); Path otherPath = ConsolidatingChangeLog.getPath(((Remove) other).itemId); if (thisPath == null || otherPath == null) { return CANCEL_NONE; } if (thisPath.equals(otherPath)) { return CANCEL_BOTH; } return (thisPath.isDescendantOf(otherPath)) ? CANCEL_THIS : CANCEL_NONE; } return CANCEL_NONE; } }
/** * The cancellation only considers canceling the parent node, which corresponds * to the policy node. */ public int cancel(CancelableOperation other) throws RepositoryException { if (other instanceof Remove) { Path thisPath = ConsolidatingChangeLog.getPath(parentId, tree.getName()); Path otherPath = ConsolidatingChangeLog.getPath(((Remove) other).itemId); if (thisPath == null || otherPath == null) { return CANCEL_NONE; } if (thisPath.equals(otherPath)) { return CANCEL_BOTH; } return (thisPath.isDescendantOf(otherPath)) ? CANCEL_THIS : CANCEL_NONE; } return CANCEL_NONE; } }
@Override public void setTree(NodeId parentId, Tree contentTree) throws RepositoryException { assertMethod(); if (!(contentTree instanceof JsonTree)) { throw new RepositoryException("Invalid Tree implementation : " + contentTree.getClass().getName()); } Path normalizedPath = getPathFactory().create(getPath(parentId, sessionInfo), contentTree.getName(), true); String jcrPath = getNamePathResolver(sessionInfo).getJCRPath(normalizedPath); appendDiff(SYMBOL_ADD_NODE, jcrPath, ((JsonTree) contentTree).toJsonString(parts, binaries)); }
@Override public void setTree(NodeId parentId, Tree contentTree) throws RepositoryException { assertMethod(); if (!(contentTree instanceof JsonTree)) { throw new RepositoryException("Invalid Tree implementation : " + contentTree.getClass().getName()); } Path normalizedPath = getPathFactory().create(getPath(parentId, sessionInfo), contentTree.getName(), true); String jcrPath = getNamePathResolver(sessionInfo).getJCRPath(normalizedPath); appendDiff(SYMBOL_ADD_NODE, jcrPath, ((JsonTree) contentTree).toJsonString(parts, binaries)); }