+ String dataPath = "";
+ return CmsUxUtils.img(dataPath, size);
+ }
+
+ protected String getDataPathForUrl(Content content) {
+ return CmsSwtUtils.cleanPathForUrl(getDataPath(content));
+ }
+
+ /** A path in the node repository */
+ protected String getDataPath(Content node) {
+ // TODO make it more configurable?
+ StringBuilder buf = new StringBuilder(CmsConstants.PATH_API_ACR);
+ buf.append(node.getPath());
+ return buf.toString();
+ }
+
+ @Override
+ public Cms2DSize getImageSize(Content node) {
+ // TODO cache it?
+ Optional<Integer> width = node.get(SvgAttrs.width, Integer.class);
+ Optional<Integer> height = node.get(SvgAttrs.height, Integer.class);
+ if (!width.isEmpty() && !height.isEmpty())
+ return new Cms2DSize(width.get(), height.get());
+ return super.getImageSize(node);