From: Mathieu Baudier Date: Sat, 16 Mar 2024 07:15:42 +0000 (+0100) Subject: Merge tag 'v2.3.21' into testing X-Git-Tag: v2.1.6~2 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=7a6ba4e06aa62d10c6aadd32559bc9e550a4aba9;hp=c907acfe36acb8247bcdb8418b0e9bf81606957f;p=gpl%2Fargeo-jcr.git Merge tag 'v2.3.21' into testing --- diff --git a/org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContent.java b/org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContent.java index 880f29e..6a0cccb 100644 --- a/org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContent.java +++ b/org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContent.java @@ -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) { diff --git a/org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContentProvider.java b/org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContentProvider.java index 5fc7d7c..3850b0c 100644 --- a/org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContentProvider.java +++ b/org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContentProvider.java @@ -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; } /* diff --git a/org.argeo.cms.jcr/src/org/argeo/cms/jcr/internal/CmsJcrDeployment.java b/org.argeo.cms.jcr/src/org/argeo/cms/jcr/internal/CmsJcrDeployment.java index a871355..f3ce912 100644 --- a/org.argeo.cms.jcr/src/org/argeo/cms/jcr/internal/CmsJcrDeployment.java +++ b/org.argeo.cms.jcr/src/org/argeo/cms/jcr/internal/CmsJcrDeployment.java @@ -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()); diff --git a/org.argeo.cms.jcr/src/org/argeo/cms/jcr/internal/osgi/CmsJcrActivator.java b/org.argeo.cms.jcr/src/org/argeo/cms/jcr/internal/osgi/CmsJcrActivator.java index 57860d8..171117e 100644 --- a/org.argeo.cms.jcr/src/org/argeo/cms/jcr/internal/osgi/CmsJcrActivator.java +++ b/org.argeo.cms.jcr/src/org/argeo/cms/jcr/internal/osgi/CmsJcrActivator.java @@ -10,7 +10,7 @@ public class CmsJcrActivator implements BundleActivator { private static BundleContext bundleContext; // private List 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; } diff --git a/sdk/branches/unstable.bnd b/sdk/branches/unstable.bnd index b3ce8dc..53dae88 100644 --- a/sdk/branches/unstable.bnd +++ b/sdk/branches/unstable.bnd @@ -1,6 +1,6 @@ major=2 minor=3 -micro=20 +micro=21 qualifier= Bundle-Copyright= \ diff --git a/swt/org.argeo.tool.devops.e4/src/org/argeo/cms/e4/monitoring/BundlesView.java b/swt/org.argeo.tool.devops.e4/src/org/argeo/cms/e4/monitoring/BundlesView.java index 613134b..a25db23 100644 --- a/swt/org.argeo.tool.devops.e4/src/org/argeo/cms/e4/monitoring/BundlesView.java +++ b/swt/org.argeo.tool.devops.e4/src/org/argeo/cms/e4/monitoring/BundlesView.java @@ -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); diff --git a/swt/org.argeo.tool.devops.e4/src/org/argeo/cms/e4/monitoring/CmsSessionsView.java b/swt/org.argeo.tool.devops.e4/src/org/argeo/cms/e4/monitoring/CmsSessionsView.java index d1376ae..d2b4ace 100644 --- a/swt/org.argeo.tool.devops.e4/src/org/argeo/cms/e4/monitoring/CmsSessionsView.java +++ b/swt/org.argeo.tool.devops.e4/src/org/argeo/cms/e4/monitoring/CmsSessionsView.java @@ -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;