Merge tag 'v2.3.21' into testing
authorMathieu Baudier <mbaudier@argeo.org>
Sat, 16 Mar 2024 07:15:42 +0000 (08:15 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Sat, 16 Mar 2024 07:15:42 +0000 (08:15 +0100)
org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContent.java
org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContentProvider.java
org.argeo.cms.jcr/src/org/argeo/cms/jcr/internal/CmsJcrDeployment.java
org.argeo.cms.jcr/src/org/argeo/cms/jcr/internal/osgi/CmsJcrActivator.java
sdk/branches/unstable.bnd
swt/org.argeo.tool.devops.e4/src/org/argeo/cms/e4/monitoring/BundlesView.java
swt/org.argeo.tool.devops.e4/src/org/argeo/cms/e4/monitoring/CmsSessionsView.java

index 880f29eeaebf4c30f87fd850ddd8ab84036b48c1..6a0cccb84fb8e9d0ae976a163e6f983c12e566bb 100644 (file)
@@ -46,7 +46,7 @@ import org.argeo.api.acr.NamespaceUtils;
 import org.argeo.api.acr.spi.ProvidedSession;
 import org.argeo.api.cms.CmsConstants;
 import org.argeo.cms.acr.AbstractContent;
-import org.argeo.cms.acr.ContentUtils;
+import org.argeo.cms.acr.CmsContent;
 import org.argeo.cms.util.AsyncPipedOutputStream;
 import org.argeo.jcr.Jcr;
 import org.argeo.jcr.JcrException;
@@ -78,7 +78,7 @@ public class JcrContent extends AbstractContent {
                this.jcrWorkspace = jcrWorkspace;
                this.jcrPath = jcrPath;
 
-               this.isMountBase = ContentUtils.SLASH_STRING.equals(jcrPath);
+               this.isMountBase = "/".equals(jcrPath);
        }
 
        /*
@@ -90,7 +90,7 @@ public class JcrContent extends AbstractContent {
                String name = Jcr.getName(getJcrNode());
                if (name.equals("")) {// root
                        String mountPath = provider.getMountPath();
-                       name = ContentUtils.getParentPath(mountPath)[1];
+                       name = CmsContent.getParentPath(mountPath)[1];
                        // name = Jcr.getWorkspaceName(getJcrNode());
                }
                return NamespaceUtils.parsePrefixedName(provider, name);
@@ -251,7 +251,7 @@ public class JcrContent extends AbstractContent {
                        String mountPath = provider.getMountPath();
                        if (mountPath == null || mountPath.equals("/"))
                                return null;
-                       String[] parent = ContentUtils.getParentPath(mountPath);
+                       String[] parent = CmsContent.getParentPath(mountPath);
                        return getSession().get(parent[0]);
                }
 //             if (Jcr.isRoot(getJcrNode())) // root
@@ -455,9 +455,9 @@ public class JcrContent extends AbstractContent {
 
        @Override
        public boolean isParentAccessible() {
-               String jcrParentPath = ContentUtils.getParentPath(jcrPath)[0];
+               String jcrParentPath = CmsContent.getParentPath(jcrPath)[0];
                if ("".equals(jcrParentPath)) // JCR root node
-                       jcrParentPath = ContentUtils.SLASH_STRING;
+                       jcrParentPath = "/";
                try {
                        return getJcrSession().hasPermission(jcrParentPath, Session.ACTION_READ);
                } catch (RepositoryException e) {
index 5fc7d7c241d2496b040a13d2f2a0b68fa1fc7ed8..3850b0c0c4f33e4310f86d3f44218e420edd5361 100644 (file)
@@ -25,7 +25,7 @@ import org.argeo.api.acr.spi.ContentProvider;
 import org.argeo.api.acr.spi.ProvidedContent;
 import org.argeo.api.acr.spi.ProvidedSession;
 import org.argeo.api.cms.CmsConstants;
-import org.argeo.cms.acr.ContentUtils;
+import org.argeo.cms.acr.CmsContent;
 import org.argeo.cms.jcr.CmsJcrUtils;
 import org.argeo.jcr.JcrException;
 import org.argeo.jcr.JcrUtils;
@@ -48,7 +48,7 @@ public class JcrContentProvider implements ContentProvider, NamespaceContext {
                if ("/".equals(mountPath))
                        throw new IllegalArgumentException("JCR content provider cannot be root /");
                Objects.requireNonNull(mountPath);
-               jcrWorkspace = ContentUtils.getParentPath(mountPath)[1];
+               jcrWorkspace = CmsContent.getParentPath(mountPath)[1];
                adminSession = CmsJcrUtils.openDataAdminSession(jcrRepository, jcrWorkspace);
        }
 
@@ -77,7 +77,7 @@ public class JcrContentProvider implements ContentProvider, NamespaceContext {
 
        @Override
        public boolean exists(ProvidedSession contentSession, String relativePath) {
-               String jcrPath = ContentUtils.SLASH + relativePath;
+               String jcrPath = '/' + relativePath;
                return new JcrContent(contentSession, this, jcrWorkspace, jcrPath).exists();
        }
 
@@ -261,7 +261,7 @@ public class JcrContentProvider implements ContentProvider, NamespaceContext {
         * workspace of this provider.
         */
        private String toJcrPath(String relativePath) {
-               return ContentUtils.SLASH + relativePath;
+               return '/' + relativePath;
        }
 
        /*
index a87135511e5e5ba21caa269f9c645df81a51c273..f3ce912951b5b522c5393151113f2480a76b20ac 100644 (file)
@@ -42,7 +42,6 @@ import org.argeo.jcr.JcrUtils;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
-import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.wiring.BundleCapability;
@@ -54,7 +53,7 @@ import org.osgi.util.tracker.ServiceTracker;
 /** Implementation of a CMS deployment. */
 public class CmsJcrDeployment {
        private final CmsLog log = CmsLog.getLog(getClass());
-       private final BundleContext bc = FrameworkUtil.getBundle(getClass()).getBundleContext();
+       private BundleContext bc;
 
        private DataModels dataModels;
        private String webDavConfig = JcrHttpUtils.WEBDAV_CONFIG;
@@ -66,8 +65,13 @@ public class CmsJcrDeployment {
 
        private ProvidedRepository contentRepository;
 
-//     CmsDeployment cmsDeployment;
-       public void start() {
+       public CmsJcrDeployment() {
+       }
+
+       // CmsDeployment cmsDeployment;
+       public void start(BundleContext bundleContext) {
+               // Bundle bundle = FrameworkUtil.getBundle(CmsJcrDeployment.class);
+               bc = bundleContext;
                dataModels = new DataModels(bc);
 
                contentRepository.registerTypes(JcrContentNamespace.values());
index 57860d84f4cb3d030436b00d593883a2e8f58f19..171117ec2935b05a54cc445a2086dcf20a64f4d6 100644 (file)
@@ -10,7 +10,7 @@ public class CmsJcrActivator implements BundleActivator {
        private static BundleContext bundleContext;
 
 //     private List<Runnable> stopHooks = new ArrayList<>();
-       private StatisticsThread kernelThread;
+//     private StatisticsThread kernelThread;
 
 //     private JackrabbitRepositoryContextsFactory repositoryServiceFactory;
 //     private CmsJcrDeployment jcrDeployment;
@@ -20,9 +20,9 @@ public class CmsJcrActivator implements BundleActivator {
                bundleContext = context;
                
                // kernel thread
-               kernelThread = new StatisticsThread("Kernel Thread");
-               kernelThread.setContextClassLoader(getClass().getClassLoader());
-               kernelThread.start();
+//             kernelThread = new StatisticsThread("CMS JCR statistics Thread");
+//             kernelThread.setContextClassLoader(getClass().getClassLoader());
+//             kernelThread.start();
 
                // JCR
 //             repositoryServiceFactory = new JackrabbitRepositoryContextsFactory();
@@ -60,8 +60,8 @@ public class CmsJcrActivator implements BundleActivator {
 //             if (repositoryServiceFactory != null)
 //                     repositoryServiceFactory.shutdown();
 
-               if (kernelThread != null)
-                       kernelThread.destroyAndJoin();
+//             if (kernelThread != null)
+//                     kernelThread.destroyAndJoin();
 
                bundleContext = null;
        }
index b3ce8dcd167451b47a8cff1841f5a8dd1b09c1ee..53dae8858e48f64174b7ee872313bb79276606bf 100644 (file)
@@ -1,6 +1,6 @@
 major=2
 minor=3
-micro=20
+micro=21
 qualifier=
 
 Bundle-Copyright= \
index 613134b65fbb32d5f5ba49ba122a1cbdc6624f4e..a25db2331382389bb453948e67b6dda080e58da1 100644 (file)
@@ -3,10 +3,7 @@
 
 package org.argeo.cms.e4.monitoring;
 
-import jakarta.annotation.PostConstruct;
-
 import org.argeo.eclipse.ui.ColumnViewerComparator;
-import org.argeo.eclipse.ui.specific.EclipseUiSpecificUtils;
 import org.eclipse.e4.ui.di.Focus;
 import org.eclipse.jface.viewers.ColumnLabelProvider;
 import org.eclipse.jface.viewers.IStructuredContentProvider;
@@ -19,6 +16,8 @@ import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.FrameworkUtil;
 
+import jakarta.annotation.PostConstruct;
+
 /**
  * Overview of the bundles as a table. Equivalent to Equinox 'ss' console
  * command.
@@ -33,7 +32,7 @@ public class BundlesView {
                viewer.setContentProvider(new BundleContentProvider());
                viewer.getTable().setHeaderVisible(true);
 
-               EclipseUiSpecificUtils.enableToolTipSupport(viewer);
+               //EclipseUiSpecificUtils.enableToolTipSupport(viewer);
 
                // ID
                TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
index d1376ae51722ac675ed3d707eabbb8465aa31e0a..d2b4acee85497787250b73102c09c7bbacdc72e3 100644 (file)
@@ -7,13 +7,10 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
-import jakarta.annotation.PostConstruct;
-
 import org.argeo.api.cms.CmsSession;
-import org.argeo.cms.RoleNameUtils;
+import org.argeo.api.cms.auth.RoleNameUtils;
 import org.argeo.cms.util.LangUtils;
 import org.argeo.eclipse.ui.ColumnViewerComparator;
-import org.argeo.eclipse.ui.specific.EclipseUiSpecificUtils;
 import org.eclipse.e4.ui.di.Focus;
 import org.eclipse.jface.viewers.ColumnLabelProvider;
 import org.eclipse.jface.viewers.IStructuredContentProvider;
@@ -27,6 +24,8 @@ import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceReference;
 
+import jakarta.annotation.PostConstruct;
+
 /**
  * Overview of the active CMS sessions.
  */
@@ -41,7 +40,7 @@ public class CmsSessionsView {
                viewer.setContentProvider(new CmsSessionContentProvider());
                viewer.getTable().setHeaderVisible(true);
 
-               EclipseUiSpecificUtils.enableToolTipSupport(viewer);
+               //EclipseUiSpecificUtils.enableToolTipSupport(viewer);
 
                int longColWidth = 150;
                int smallColWidth = 100;