]> git.argeo.org Git - lgpl/argeo-commons.git/blob - cms/ux/CmsUxUtils.java
Prepare next development cycle
[lgpl/argeo-commons.git] / cms / ux / CmsUxUtils.java
1 package org.argeo.cms.ux;
2
3 import org.argeo.api.acr.Content;
4 import org.argeo.api.acr.ContentRepository;
5 import org.argeo.api.acr.ContentSession;
6 import org.argeo.api.cms.ux.CmsView;
7 import org.argeo.util.CurrentSubject;
8
9 public class CmsUxUtils {
10 public static ContentSession getContentSession(ContentRepository contentRepository, CmsView cmsView) {
11 return CurrentSubject.callAs(cmsView.getCmsSession().getSubject(), () -> contentRepository.get());
12 }
13
14 public static String getTitle(Content content) {
15 return content.getName().getLocalPart();
16 }
17
18 /** singleton */
19 private CmsUxUtils() {
20
21 }
22 }