}
+ @Override
+ public String getPath() {
+ try {
+ // Note: it is important to to use the default way (recursing through parents),
+ // since the session may not have access to parent nodes
+ return ContentUtils.ROOT_SLASH + jcrWorkspace + getJcrNode().getPath();
+ } catch (RepositoryException e) {
+ throw new JcrException("Cannot get depth of " + getJcrNode(), e);
+ }
+ }
+
+ @Override
+ public int getDepth() {
+ try {
+ return getJcrNode().getDepth() + 1;
+ } catch (RepositoryException e) {
+ throw new JcrException("Cannot get depth of " + getJcrNode(), e);
+ }
+ }
+
@Override
public Content getParent() {
if (Jcr.isRoot(getJcrNode())) // root
* TYPING
*/
@Override
- public List<QName> getTypes() {
+ public List<QName> getContentClasses() {
try {
// Node node = getJcrNode();
// List<QName> res = new ArrayList<>();
return QName.valueOf(name);
}
+ @Override
+ public int getSiblingIndex() {
+ return Jcr.getIndex(getJcrNode());
+ }
+
/*
* STATIC UTLITIES
*/
if (contentSession == null)
throw new IllegalArgumentException(
"Cannot adapt " + node + " to content, because it was not loaded from a content session");
- return contentSession.get(CmsConstants.SYS_WORKSPACE + node.getPath());
+ return contentSession.get(ContentUtils.SLASH + CmsConstants.SYS_WORKSPACE + node.getPath());
} catch (RepositoryException e) {
throw new JcrException("Cannot adapt " + node + " to a content", e);
}