X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;ds=inline;f=org.argeo.cms.ux%2Fsrc%2Forg%2Fargeo%2Fcms%2Fux%2FCmsUxUtils.java;h=916cc74f2feb4c8bef5f9d3cb2be460e3f549d17;hb=138e686fbf65683c3c94a52f1cfbaf8e02362e19;hp=1b2b0e9400390b8ad2605a6d8eda21b717b0d235;hpb=fdf44255df56ae179b904e4ab326bf595674800e;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms.ux/src/org/argeo/cms/ux/CmsUxUtils.java b/org.argeo.cms.ux/src/org/argeo/cms/ux/CmsUxUtils.java index 1b2b0e940..916cc74f2 100644 --- a/org.argeo.cms.ux/src/org/argeo/cms/ux/CmsUxUtils.java +++ b/org.argeo.cms.ux/src/org/argeo/cms/ux/CmsUxUtils.java @@ -3,12 +3,13 @@ package org.argeo.cms.ux; import org.argeo.api.acr.Content; import org.argeo.api.acr.ContentRepository; import org.argeo.api.acr.ContentSession; -import org.argeo.api.cms.CmsView; -import org.argeo.cms.auth.CurrentUser; +import org.argeo.api.cms.ux.Cms2DSize; +import org.argeo.api.cms.ux.CmsView; +import org.argeo.util.CurrentSubject; public class CmsUxUtils { public static ContentSession getContentSession(ContentRepository contentRepository, CmsView cmsView) { - return CurrentUser.callAs(cmsView.getCmsSession().getSubject(), () -> contentRepository.get()); + return CurrentSubject.callAs(cmsView.getCmsSession().getSubject(), () -> contentRepository.get()); } public static String getTitle(Content content) { @@ -19,4 +20,17 @@ public class CmsUxUtils { private CmsUxUtils() { } + + public static StringBuilder imgBuilder(String src, String width, String height) { + return new StringBuilder(64).append("").toString(); + } + + public static String img(String src, Cms2DSize size) { + return img(src, Integer.toString(size.getWidth()), Integer.toString(size.getHeight())); + } }