+ /**
+ * The CMS view related to this display, or null if none is available from
+ * this call.
+ */
+ public static CmsView getCmsView() {
+ return UiContext.getData(CmsView.KEY);
+ }
+
+ public static String getDataUrl(Node node, HttpServletRequest request)
+ throws RepositoryException {
+ return request.getRequestURL().append(getDataPath(node).substring(1))
+ .toString();
+ }
+
+ public static String getDataPath(Node node) throws RepositoryException {
+ return new StringBuilder().append(WEBDAV_PUBLIC).append('/')
+ .append(ALIAS_NODE + "/")
+ .append(node.getSession().getWorkspace().getName())
+ .append(node.getPath()).toString();
+ }
+
+ public static String getCanonicalUrl(Node node, HttpServletRequest request)
+ throws RepositoryException {
+ return request.getRequestURL().append('!').append(node.getPath())
+ .toString();
+ }
+