public Node addNode(String key, String primaryNodeTypeName) throws RepositoryException { Node parent = getOrCreateParent(key); if (parent.hasNode(key)) { throw new ItemExistsException(key); } Node n; if (parent.getPrimaryNodeType().hasOrderableChildNodes()) { Node dest = getSuccessor(parent, key); n = parent.addNode(key, primaryNodeTypeName); parent.orderBefore(key, dest == null ? null : dest.getName()); } else { n = parent.addNode(key, primaryNodeTypeName); } treeManager.split(this, parent, n); if (autoSave) { parent.getSession().save(); } return n; }
public boolean hasItem(String key) throws RepositoryException { return getParent(key).hasNode(key); }
public Node addNode(String key, String primaryNodeTypeName) throws RepositoryException { Node parent = getOrCreateParent(key); if (parent.hasNode(key)) { throw new ItemExistsException(key); } Node n; if (parent.getPrimaryNodeType().hasOrderableChildNodes()) { Node dest = getSuccessor(parent, key); n = parent.addNode(key, primaryNodeTypeName); parent.orderBefore(key, dest == null ? null : dest.getName()); } else { n = parent.addNode(key, primaryNodeTypeName); } treeManager.split(this, parent, n); if (autoSave) { parent.getSession().save(); } return n; }
public Node addNode(String key, String primaryNodeTypeName) throws RepositoryException { Node parent = getOrCreateParent(key); if (parent.hasNode(key)) { throw new ItemExistsException(key); } Node n; if (parent.getPrimaryNodeType().hasOrderableChildNodes()) { Node dest = getSuccessor(parent, key); n = parent.addNode(key, primaryNodeTypeName); parent.orderBefore(key, dest == null ? null : dest.getName()); } else { n = parent.addNode(key, primaryNodeTypeName); } treeManager.split(this, parent, n); if (autoSave) { parent.getSession().save(); } return n; }
public boolean hasItem(String key) throws RepositoryException { return getParent(key).hasNode(key); }
public Node getItem(String key) throws RepositoryException { return getParent(key).getNode(key); }
public Node getItem(String key) throws RepositoryException { return getParent(key).getNode(key); }
/** * Create a new {@link NodeSequence} instance with the same parameterization * as this instance. * * @return */ public NodeSequence getNodeSequence() { return new NodeSequenceImpl(treeManager, errorHandler); }
/** * Create a new {@link NodeSequence} instance. * * @param treeManager The {@link TreeManager} for managing the mapping * between the sequence view and the JCR hierarchy. * @return */ public static NodeSequence createNodeSequence(TreeManager treeManager) { return new NodeSequenceImpl(treeManager, ErrorHandler.IGNORE); }
public void removeNode(String key) throws RepositoryException { Node parent = getParent(key); Node n = parent.getNode(key); n.remove(); treeManager.join(this, parent, n); if (autoSave) { parent.getSession().save(); } }
public Node getItem(String key) throws RepositoryException { return getParent(key).getNode(key); }
/** * Create a new {@link NodeSequence} instance with the same parameterization * as this instance. * * @return */ public NodeSequence getNodeSequence() { return new NodeSequenceImpl(treeManager, errorHandler); }
/** * Create a new {@link NodeSequence} instance. * * @param treeManager The {@link TreeManager} for managing the mapping * between the sequence view and the JCR hierarchy. * @param errorHandler The {@link ErrorHandler} for handling exceptions * occurring while * @return */ public static NodeSequence createNodeSequence(TreeManager treeManager, ErrorHandler errorHandler) { return new NodeSequenceImpl(treeManager, errorHandler); }
@Override public Node getParent(String key) throws RepositoryException { Node p = getPredecessor(key); if (treeManager.isLeaf(p) && !treeManager.isRoot(p)) { return p.getParent(); } else { return p; } }
public boolean hasItem(String key) throws RepositoryException { return getParent(key).hasNode(key); }
@Override public Node getParent(String key) throws RepositoryException { Node p = getPredecessor(key); if (treeManager.isLeaf(p) && !treeManager.isRoot(p)) { return p.getParent(); } else { return p; } }
/** * Create a new {@link NodeSequence} instance. * * @param treeManager The {@link TreeManager} for managing the mapping * between the sequence view and the JCR hierarchy. * @param errorHandler The {@link ErrorHandler} for handling exceptions * occurring while * @return */ public static NodeSequence createNodeSequence(TreeManager treeManager, ErrorHandler errorHandler) { return new NodeSequenceImpl(treeManager, errorHandler); }
/** * Create a new {@link NodeSequence} instance. * * @param treeManager The {@link TreeManager} for managing the mapping * between the sequence view and the JCR hierarchy. * @return */ public static NodeSequence createNodeSequence(TreeManager treeManager) { return new NodeSequenceImpl(treeManager, ErrorHandler.IGNORE); }
public void removeNode(String key) throws RepositoryException { Node parent = getParent(key); Node n = parent.getNode(key); n.remove(); treeManager.join(this, parent, n); if (autoSave) { parent.getSession().save(); } }
private Node getOrCreateParent(String key) throws RepositoryException { Node p = getParent(key); if (treeManager.isRoot(p)) { Node min = getMinimal(); if (min != null) { p = min.getParent(); renamePath(p, key); } } return p; }