import javax.servlet.http.HttpServletRequest;
import org.argeo.api.NodeConstants;
-import org.argeo.api.NodeUtils;
+import org.argeo.cms.jcr.CmsJcrUtils;
import org.argeo.cms.ui.CmsConstants;
import org.argeo.cms.ui.CmsView;
import org.argeo.eclipse.ui.Selected;
import org.argeo.eclipse.ui.specific.EclipseUiSpecificUtils;
+import org.argeo.jcr.JcrException;
import org.argeo.jcr.JcrUtils;
import org.eclipse.rap.rwt.RWT;
import org.eclipse.rap.rwt.service.ResourceManager;
}
public static String getDataPath(String cn, Node node) throws RepositoryException {
- return NodeUtils.getDataPath(cn, node);
+ return CmsJcrUtils.getDataPath(cn, node);
}
/** Clean reserved URL characters for use in HTTP links. */
return widget;// does nothing
EclipseUiSpecificUtils.setStyleData(widget, style);
if (widget instanceof Control) {
- CmsView.getCmsView((Control) widget).applyStyles(widget);
+ CmsView cmsView = CmsView.getCmsView((Control) widget);
+ if (cmsView != null)
+ cmsView.applyStyles(widget);
}
return widget;
}
}
public static String img(String serverBase, Node fileNode, String width, String height) {
- String src = (serverBase != null ? serverBase : "") + NodeUtils.getDataPath(fileNode);
+// String src = (serverBase != null ? serverBase : "") + NodeUtils.getDataPath(fileNode);
+ String src;
+ try {
+ src = (serverBase != null ? serverBase : "") + getDataPathForUrl(fileNode);
+ } catch (RepositoryException e) {
+ throw new JcrException("Cannot get URL data path for " + fileNode, e);
+ }
return imgBuilder(src, width, height).append("/>").toString();
}