/** * Returns the path of this node. * <p> * The default implementation recursively calls this method on the * parent node and appends the name and optionally the index of this * node to construct the full path. Returns "/" if the parent node is * not available (i.e. this is the root node). * * @return node path * @throws RepositoryException if an error occurs */ public String getPath() throws RepositoryException { try { StringBuffer buffer = new StringBuffer(getParent().getPath()); if (buffer.length() > 1) { buffer.append('/'); } buffer.append(getName()); int index = getIndex(); if (index != 1) { buffer.append('['); buffer.append(index); buffer.append(']'); } return buffer.toString(); } catch (ItemNotFoundException e) { return "/"; } }
/** * Returns the path of this node. * <p> * The default implementation recursively calls this method on the * parent node and appends the name and optionally the index of this * node to construct the full path. Returns "/" if the parent node is * not available (i.e. this is the root node). * * @return node path * @throws RepositoryException if an error occurs */ public String getPath() throws RepositoryException { try { StringBuffer buffer = new StringBuffer(getParent().getPath()); if (buffer.length() > 1) { buffer.append('/'); } buffer.append(getName()); int index = getIndex(); if (index != 1) { buffer.append('['); buffer.append(index); buffer.append(']'); } return buffer.toString(); } catch (ItemNotFoundException e) { return "/"; } }
/** * Returns the path of this node. * <p> * The default implementation recursively calls this method on the * parent node and appends the name and optionally the index of this * node to construct the full path. Returns "/" if the parent node is * not available (i.e. this is the root node). * * @return node path * @throws RepositoryException if an error occurs */ public String getPath() throws RepositoryException { try { StringBuffer buffer = new StringBuffer(getParent().getPath()); if (buffer.length() > 1) { buffer.append('/'); } buffer.append(getName()); int index = getIndex(); if (index != 1) { buffer.append('['); buffer.append(index); buffer.append(']'); } return buffer.toString(); } catch (ItemNotFoundException e) { return "/"; } }
/** * Returns the path of this node. * <p> * The default implementation recursively calls this method on the * parent node and appends the name and optionally the index of this * node to construct the full path. Returns "/" if the parent node is * not available (i.e. this is the root node). * * @return node path * @throws RepositoryException if an error occurs */ public String getPath() throws RepositoryException { try { StringBuffer buffer = new StringBuffer(getParent().getPath()); if (buffer.length() > 1) { buffer.append('/'); } buffer.append(getName()); int index = getIndex(); if (index != 1) { buffer.append('['); buffer.append(index); buffer.append(']'); } return buffer.toString(); } catch (ItemNotFoundException e) { return "/"; } }
/** * Checks whether this node is checked out. * <p> * The default implementation checks the <code>jcr:isCheckedOut</code> * property if this node is versionable, and recursively calls this method * on the parent node if this node is not versionable. A non-versionable * root node always returns <code>true</code> from this method. * * @return <code>true</code> if this node is checked out, * <code>false</code> otherwise * @throws RepositoryException if an error occurs */ public boolean isCheckedOut() throws RepositoryException { if (isNodeType(getName(MIX, "versionable"))) { // This node is versionable, check the jcr:isCheckedOut property return getProperty(getName(JCR, "isCheckedOut")).getBoolean(); } else { try { // This node is not versionable, is the parent checked out? return getParent().isCheckedOut(); } catch (ItemNotFoundException e) { // This node is the root node, always checked out return true; } } }
/** * Checks whether this node is checked out. * <p> * The default implementation checks the <code>jcr:isCheckedOut</code> * property if this node is versionable, and recursively calls this method * on the parent node if this node is not versionable. A non-versionable * root node always returns <code>true</code> from this method. * * @return <code>true</code> if this node is checked out, * <code>false</code> otherwise * @throws RepositoryException if an error occurs */ public boolean isCheckedOut() throws RepositoryException { if (isNodeType(getName("jcr:versionable"))) { // This node is versionable, check the jcr:isCheckedOut property return getProperty(getName("jcr:isCheckedOut")).getBoolean(); } else { try { // This node is not versionable, is the parent checked out? return getParent().isCheckedOut(); } catch (ItemNotFoundException e) { // This node is the root node, always checked out return true; } } }
/** * Checks whether this node is checked out. * <p> * The default implementation checks the <code>jcr:isCheckedOut</code> * property if this node is versionable, and recursively calls this method * on the parent node if this node is not versionable. A non-versionable * root node always returns <code>true</code> from this method. * * @return <code>true</code> if this node is checked out, * <code>false</code> otherwise * @throws RepositoryException if an error occurs */ public boolean isCheckedOut() throws RepositoryException { if (isNodeType(getName("jcr:versionable"))) { // This node is versionable, check the jcr:isCheckedOut property return getProperty(getName("jcr:isCheckedOut")).getBoolean(); } else { try { // This node is not versionable, is the parent checked out? return getParent().isCheckedOut(); } catch (ItemNotFoundException e) { // This node is the root node, always checked out return true; } } }
/** * Checks whether this node is checked out. * <p> * The default implementation checks the <code>jcr:isCheckedOut</code> * property if this node is versionable, and recursively calls this method * on the parent node if this node is not versionable. A non-versionable * root node always returns <code>true</code> from this method. * * @return <code>true</code> if this node is checked out, * <code>false</code> otherwise * @throws RepositoryException if an error occurs */ public boolean isCheckedOut() throws RepositoryException { if (isNodeType(getName("jcr:versionable"))) { // This node is versionable, check the jcr:isCheckedOut property return getProperty(getName("jcr:isCheckedOut")).getBoolean(); } else { try { // This node is not versionable, is the parent checked out? return getParent().isCheckedOut(); } catch (ItemNotFoundException e) { // This node is the root node, always checked out return true; } } }