PropertyInclude(Path pattern) throws RepositoryException { super(pattern.getAncestor(1), null); this.propertyName = pattern.getName(); }
protected Path getParent() throws RepositoryException { if (parent != null) { return parent.getAncestor(1); } else { return new ParentPath(null); } }
protected Path getParent() throws RepositoryException { if (parent != null) { return parent.getAncestor(1); } else { return new ParentPath(null); } }
PropertyInclude(Path pattern) throws RepositoryException { super(pattern.getAncestor(1), null); this.propertyName = pattern.getName(); }
/** * Returns the path of the parent node of node at <code>path</code>.. * * @param p the path. * @return the parent path. * @throws ItemStateException if <code>p</code> does not have a parent * path. E.g. <code>p</code> designates root. */ private Path getParent(Path p) throws ItemStateException { try { return p.getAncestor(1); } catch (RepositoryException e) { // should never happen actually String msg = "Unable to resolve parent for path: " + p; log.error(msg); throw new ItemStateException(msg, e); } }
/** * Returns the path of the parent node of node at <code>path</code>.. * * @param p the path. * @return the parent path. * @throws ItemStateException if <code>p</code> does not have a parent * path. E.g. <code>p</code> designates root. */ private Path getParent(Path p) throws ItemStateException { try { return p.getAncestor(1); } catch (RepositoryException e) { // should never happen actually String msg = "Unable to resolve parent for path: " + p; log.error(msg); throw new ItemStateException(msg, e); } }
public final Path getAncestor(int degree) throws RepositoryException { if (degree < 0) { throw new IllegalArgumentException( "Invalid ancestor degree " + degree); } else if (degree == 0) { return getNormalizedPath(); } else { return getParent().getAncestor(degree - 1); } }
public final Path getAncestor(int degree) throws RepositoryException { if (degree < 0) { throw new IllegalArgumentException( "Invalid ancestor degree " + degree); } else if (degree == 0) { return getNormalizedPath(); } else { return getParent().getAncestor(degree - 1); } }
public Path getCanonicalPath() throws RepositoryException { if (parent != null) { return parent.getCanonicalPath().getAncestor(1); } else { throw new RepositoryException( "There is no canonical representation of .."); } }
protected Path getParent() throws RepositoryException { if (isNormalized()) { return new ParentPath(this); } else { return parent.getAncestor(2); } }
public Path getCanonicalPath() throws RepositoryException { if (parent != null) { return parent.getCanonicalPath().getAncestor(1); } else { throw new RepositoryException( "There is no canonical representation of .."); } }
protected Path getParent() throws RepositoryException { if (isNormalized()) { return new ParentPath(this); } else { return parent.getAncestor(2); } }
/** * Invoked when some node has been removed. Remove the child from our * path map. Disable all locks contained in that subtree. * * @param path path of removed node */ private void nodeRemoved(Path path) { acquire(); try { PathMap.Element<LockInfo> parent = lockMap.map(path.getAncestor(1), true); if (parent != null) { refresh(parent); } } catch (RepositoryException e) { log.warn("Unable to determine path of removed node's parent.", e); } finally { release(); } }
@Override public boolean grants(Path itemPath, int permissions) throws RepositoryException { long magnoliaPermissions = convertJackrabbitPermissionsToMagnoliaPermissions(permissions); String originalPath = pathResolver.getJCRPath(itemPath); int emersion = getEmersion(originalPath); String path = pathResolver.getJCRPath(itemPath.getAncestor(emersion)); log.debug("{} permission request for {}. The permissions will be retrieved from ancestor path: {}.", PermissionImpl.getPermissionAsName(permissions), originalPath, path); return ami.isGranted(path, magnoliaPermissions); }
public Path getNormalizedPath() throws RepositoryException { if (isNormalized()) { return this; } else { // parent is guaranteed to be !null Path normalized = parent.getNormalizedPath(); if (normalized.denotesParent()) { return new ParentPath(normalized); // special case: ../.. } else if (normalized.denotesCurrent()) { return new ParentPath(null); // special case: ./.. } else { return normalized.getAncestor(1); } } }
private boolean hasRetention(ItemImpl item, boolean isRemoval) throws RepositoryException { if (item.isNew()) { return false; } Path path = item.getPrimaryPath(); if (!item.isNode()) { path = path.getAncestor(1); } boolean checkParent = (item.isNode() && isRemoval); return context.getSessionImpl().getRetentionRegistry().hasEffectiveRetention(path, checkParent); }
private boolean hasRetention(ItemImpl item, boolean isRemoval) throws RepositoryException { if (item.isNew()) { return false; } Path path = item.getPrimaryPath(); if (!item.isNode()) { path = path.getAncestor(1); } boolean checkParent = (item.isNode() && isRemoval); return context.getSessionImpl().getRetentionRegistry().hasEffectiveRetention(path, checkParent); }
public Path getNormalizedPath() throws RepositoryException { if (isNormalized()) { return this; } else { // parent is guaranteed to be !null Path normalized = parent.getNormalizedPath(); if (normalized.denotesParent()) { return new ParentPath(normalized); // special case: ../.. } else if (normalized.denotesCurrent()) { return new ParentPath(null); // special case: ./.. } else { return normalized.getAncestor(1); } } }
private boolean hasHold(ItemImpl item, boolean isRemoval) throws RepositoryException { if (item.isNew()) { return false; } Path path = item.getPrimaryPath(); if (!item.isNode()) { path = path.getAncestor(1); } boolean checkParent = (item.isNode() && isRemoval); return context.getSessionImpl().getRetentionRegistry().hasEffectiveHold(path, checkParent); }
private boolean hasHold(ItemImpl item, boolean isRemoval) throws RepositoryException { if (item.isNew()) { return false; } Path path = item.getPrimaryPath(); if (!item.isNode()) { path = path.getAncestor(1); } boolean checkParent = (item.isNode() && isRemoval); return context.getSessionImpl().getRetentionRegistry().hasEffectiveHold(path, checkParent); }