Adapt to changes in Argeo Commons
authorMathieu Baudier <mbaudier@argeo.org>
Tue, 7 Dec 2021 09:36:43 +0000 (10:36 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Tue, 7 Dec 2021 09:36:43 +0000 (10:36 +0100)
org.argeo.entity.core/src/org/argeo/entity/core/JcrEntityDefinition.java
org.argeo.library.ui/src/org/argeo/library/ui/DocumentsTreeUiProvider.java
org.argeo.suite.core/src/org/argeo/suite/core/SuiteTermsManager.java
org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteApp.java
org.argeo.support.odk/src/org/argeo/support/odk/servlet/OdkSubmissionServlet.java

index 6eb086da2f40d6bfb1e2e60824674d50b4b661d9..d6d124680d15750bf315aa95cfb72babfc8cea25 100644 (file)
@@ -7,7 +7,7 @@ import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
-import org.argeo.api.NodeUtils;
+import org.argeo.cms.jcr.CmsJcrUtils;
 import org.argeo.entity.EntityConstants;
 import org.argeo.entity.EntityDefinition;
 import org.argeo.jcr.Jcr;
@@ -21,7 +21,7 @@ public class JcrEntityDefinition implements EntityDefinition {
        private String defaultEditorId;
 
        public void init(BundleContext bundleContext, Map<String, String> properties) throws RepositoryException {
-               Session adminSession = NodeUtils.openDataAdminSession(repository, null);
+               Session adminSession = CmsJcrUtils.openDataAdminSession(repository, null);
                try {
                        type = properties.get(EntityConstants.TYPE);
                        if (type == null)
index 466051553dddb221d74d695a96d2ab78505c6ff4..f5407320c8c28cfb61ea4ddc66ca2e053a36a600 100644 (file)
@@ -9,8 +9,8 @@ import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 
 import org.argeo.api.NodeConstants;
-import org.argeo.api.NodeUtils;
 import org.argeo.cms.fs.CmsFsUtils;
+import org.argeo.cms.jcr.CmsJcrUtils;
 import org.argeo.cms.ui.CmsUiProvider;
 import org.argeo.cms.ui.CmsView;
 import org.argeo.cms.ui.util.CmsUiUtils;
@@ -34,7 +34,7 @@ public class DocumentsTreeUiProvider implements CmsUiProvider {
                FsTreeViewer fsTreeViewer = new FsTreeViewer(parent, SWT.NONE);
                fsTreeViewer.configureDefaultSingleColumnTable(500);
                CmsView cmsView = CmsView.getCmsView(parent);
-               Node homeNode = NodeUtils.getUserHome(cmsView.doAs(() -> Jcr.login(repository, NodeConstants.HOME_WORKSPACE)));
+               Node homeNode = CmsJcrUtils.getUserHome(cmsView.doAs(() -> Jcr.login(repository, NodeConstants.HOME_WORKSPACE)));
                parent.addDisposeListener((e1) -> Jcr.logout(homeNode));
                Path homePath = CmsFsUtils.getPath(nodeFileSystemProvider, homeNode);
                fsTreeViewer.addSelectionChangedListener((e) -> {
index f8822f78c8b31a13909d07017e5f9a9081617279..ad4de57438e4b5a840f2e98d86905521bc0945de 100644 (file)
@@ -11,7 +11,7 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
 import org.argeo.api.NodeConstants;
-import org.argeo.api.NodeUtils;
+import org.argeo.cms.jcr.CmsJcrUtils;
 import org.argeo.entity.EntityNames;
 import org.argeo.entity.EntityType;
 import org.argeo.entity.Term;
@@ -29,7 +29,7 @@ public class SuiteTermsManager implements TermsManager {
        private Session adminSession;
 
        public void init() {
-               adminSession = NodeUtils.openDataAdminSession(repository, NodeConstants.SYS_WORKSPACE);
+               adminSession = CmsJcrUtils.openDataAdminSession(repository, NodeConstants.SYS_WORKSPACE);
        }
 
        @Override
index e499463781ac7a59795839abb2a929e49c8f1286..d766a9a6a91a0a3a55de2601686619d9cabdbcc9 100644 (file)
@@ -22,11 +22,11 @@ import javax.naming.ldap.LdapName;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.argeo.api.NodeUtils;
 import org.argeo.cms.CmsUserManager;
 import org.argeo.cms.LocaleUtils;
 import org.argeo.cms.Localized;
 import org.argeo.cms.auth.CmsSession;
+import org.argeo.cms.jcr.CmsJcrUtils;
 import org.argeo.cms.ui.AbstractCmsApp;
 import org.argeo.cms.ui.CmsTheme;
 import org.argeo.cms.ui.CmsUiProvider;
@@ -203,7 +203,7 @@ public class SuiteApp extends AbstractCmsApp implements EventHandler {
                                        } else {
                                                Session adminSession = null;
                                                try {
-                                                       adminSession = NodeUtils.openDataAdminSession(getRepository(), null);
+                                                       adminSession = CmsJcrUtils.openDataAdminSession(getRepository(), null);
                                                        Node userDir = SuiteUtils.getOrCreateCmsSessionNode(adminSession, cmsSession);
                                                        ui.initSessions(getRepository(), userDir.getPath());
                                                } finally {
@@ -303,7 +303,7 @@ public class SuiteApp extends AbstractCmsApp implements EventHandler {
 //                     if (context.getPath().equals("/")) {// root node
 //                             types.add("nt:folder");
 //                     }
-                       if (NodeUtils.isUserHome(context) && byType.containsKey("nt:folder")) {// home node
+                       if (CmsJcrUtils.isUserHome(context) && byType.containsKey("nt:folder")) {// home node
                                types.add("nt:folder");
                        }
 
@@ -520,7 +520,7 @@ public class SuiteApp extends AbstractCmsApp implements EventHandler {
                        else {
                                Session adminSession = null;
                                try {
-                                       adminSession = NodeUtils.openDataAdminSession(getRepository(), workspaceName);
+                                       adminSession = CmsJcrUtils.openDataAdminSession(getRepository(), workspaceName);
                                        SuiteUtils.getOrCreateUserNode(adminSession, userDn);
                                } finally {
                                        Jcr.logout(adminSession);
index 70a80c0cdb7e67732f5fa37ea17364bc1c761783..4e56367a791e88c29f495d776d0f5bda6349b040 100644 (file)
@@ -23,8 +23,8 @@ import javax.servlet.http.Part;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.argeo.api.NodeUtils;
 import org.argeo.cms.auth.CmsSession;
+import org.argeo.cms.jcr.CmsJcrUtils;
 import org.argeo.cms.servlet.ServletAuthUtils;
 import org.argeo.jcr.Jcr;
 import org.argeo.jcr.JcrUtils;
@@ -65,7 +65,7 @@ public class OdkSubmissionServlet extends HttpServlet {
                        Session adminSession = null;
                        try {
                                // TODO centralise at a deeper level
-                               adminSession = NodeUtils.openDataAdminSession(repository, null);
+                               adminSession = CmsJcrUtils.openDataAdminSession(repository, null);
                                SuiteUtils.getOrCreateCmsSessionNode(adminSession, cmsSession);
                        } finally {
                                Jcr.logout(adminSession);