import org.argeo.jcr.Jcr;
import org.argeo.jcr.JcrException;
import org.argeo.jcr.JcrUtils;
+import org.argeo.jcr.JcrxApi;
/** A JCR {@link Node} accessed as {@link Content}. */
public class JcrContent extends AbstractContent {
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();
+ return Content.ROOT_PATH + jcrWorkspace + getJcrNode().getPath();
} catch (RepositoryException e) {
throw new JcrException("Cannot get depth of " + getJcrNode(), e);
}
public int getSiblingIndex() {
return Jcr.getIndex(getJcrNode());
}
+
+
+
+ @Override
+ public String getText() {
+ return JcrxApi.getXmlValue(getJcrNode());
+ }
/*
* MAP OPTIMISATIONS
if (contentSession == null)
throw new IllegalArgumentException(
"Cannot adapt " + node + " to content, because it was not loaded from a content session");
- return contentSession.get(ContentUtils.SLASH + CmsConstants.SYS_WORKSPACE + node.getPath());
+ return contentSession.get(Content.ROOT_PATH + CmsConstants.SYS_WORKSPACE + node.getPath());
} catch (RepositoryException e) {
throw new JcrException("Cannot adapt " + node + " to a content", e);
}