Explicitly specify server base for img.
[lgpl/argeo-commons.git] / org.argeo.cms.ui / src / org / argeo / cms / ui / util / CmsUiUtils.java
index 6b411cc302eb994676423a873003e22141dc3dce..428c910e54133dee353aa8d034ffc388fb8f30a5 100644 (file)
@@ -156,6 +156,9 @@ public class CmsUiUtils implements CmsConstants {
                return new GridData(horizontalAlignment, horizontalAlignment, false, true);
        }
 
+       /*
+        * ROW LAYOUT
+        */
        public static RowData rowData16px() {
                return new RowData(16, 16);
        }
@@ -278,7 +281,11 @@ public class CmsUiUtils implements CmsConstants {
 
        // IMAGES
        public static String img(Node fileNode, String width, String height) {
-               String src = NodeUtils.getDataPath(fileNode);
+               return img(null, fileNode, width, height);
+       }
+
+       public static String img(String serverBase, Node fileNode, String width, String height) {
+               String src = (serverBase != null ? serverBase : "") + NodeUtils.getDataPath(fileNode);
                return imgBuilder(src, width, height).append("/>").toString();
        }