Make ODK submission compatible with ACR
[gpl/argeo-suite.git] / swt / org.argeo.app.swt / src / org / argeo / app / swt / ux / SwtArgeoApp.java
index 80bd3552b4346e7bb52748fec83b7d7714decb75..42148df57dd9507322eb8b074ff8d52ebfeaaaad 100644 (file)
@@ -36,7 +36,6 @@ import org.argeo.app.ux.AppUi;
 import org.argeo.app.ux.SuiteUxEvent;
 import org.argeo.cms.LocaleUtils;
 import org.argeo.cms.Localized;
-import org.argeo.cms.acr.ContentUtils;
 import org.argeo.cms.swt.CmsSwtUtils;
 import org.argeo.cms.swt.acr.SwtUiProvider;
 import org.argeo.cms.swt.dialogs.CmsFeedback;
@@ -128,6 +127,8 @@ public class SwtArgeoApp extends AbstractArgeoApp implements CmsEventSubscriber
                        appPid = "<unknown>";
                }
 
+               Objects.requireNonNull(contentRepository, "Content repository must be provided");
+               Objects.requireNonNull(appUserState, "App user state must be provided");
 //             if (pidPrefix == null)
 //                     throw new IllegalArgumentException("PID prefix must be set.");
 
@@ -247,10 +248,10 @@ public class SwtArgeoApp extends AbstractArgeoApp implements CmsEventSubscriber
                                        if (cmsSession == null || cmsView.isAnonymous()) {
                                                assert publicBasePath != null;
                                                Content userDir = contentSession
-                                                               .get(ContentUtils.SLASH + CmsConstants.SYS_WORKSPACE + publicBasePath);
+                                                               .get(Content.ROOT_PATH + CmsConstants.SYS_WORKSPACE + publicBasePath);
                                                ui.setUserDir(userDir);
                                        } else {
-                                               Content userDir = appUserState.getOrCreateSessionDir(contentSession, cmsSession);
+                                               Content userDir = appUserState.getOrCreateSessionDir(cmsSession);
                                                ui.setUserDir(userDir);
 //                                             Node userDirNode = jcrContentProvider.doInAdminSession((adminSession) -> {
 //                                                     Node node = SuiteUtils.getOrCreateCmsSessionNode(adminSession, cmsSession);
@@ -467,7 +468,7 @@ public class SwtArgeoApp extends AbstractArgeoApp implements CmsEventSubscriber
        }
 
        // TODO move it to an internal package?
-       public static String nodeToState(Content node) {
+       private static String nodeToState(Content node) {
                return node.getPath();
        }