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;
this.jcrWorkspace = jcrWorkspace;
this.jcrPath = jcrPath;
- this.isMountBase = ContentUtils.SLASH_STRING.equals(jcrPath);
+ this.isMountBase = "/".equals(jcrPath);
}
/*
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);
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
@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) {
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;
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);
}
@Override
public boolean exists(ProvidedSession contentSession, String relativePath) {
- String jcrPath = ContentUtils.SLASH + relativePath;
+ String jcrPath = '/' + relativePath;
return new JcrContent(contentSession, this, jcrWorkspace, jcrPath).exists();
}
* workspace of this provider.
*/
private String toJcrPath(String relativePath) {
- return ContentUtils.SLASH + relativePath;
+ return '/' + relativePath;
}
/*
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;
/** 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;
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());
private static BundleContext bundleContext;
// private List<Runnable> stopHooks = new ArrayList<>();
- private StatisticsThread kernelThread;
+// private StatisticsThread kernelThread;
// private JackrabbitRepositoryContextsFactory repositoryServiceFactory;
// private CmsJcrDeployment jcrDeployment;
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();
// if (repositoryServiceFactory != null)
// repositoryServiceFactory.shutdown();
- if (kernelThread != null)
- kernelThread.destroyAndJoin();
+// if (kernelThread != null)
+// kernelThread.destroyAndJoin();
bundleContext = null;
}
major=2
minor=3
-micro=20
+micro=21
qualifier=
Bundle-Copyright= \
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;
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.
viewer.setContentProvider(new BundleContentProvider());
viewer.getTable().setHeaderVisible(true);
- EclipseUiSpecificUtils.enableToolTipSupport(viewer);
+ //EclipseUiSpecificUtils.enableToolTipSupport(viewer);
// ID
TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
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;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
+import jakarta.annotation.PostConstruct;
+
/**
* Overview of the active CMS sessions.
*/
viewer.setContentProvider(new CmsSessionContentProvider());
viewer.getTable().setHeaderVisible(true);
- EclipseUiSpecificUtils.enableToolTipSupport(viewer);
+ //EclipseUiSpecificUtils.enableToolTipSupport(viewer);
int longColWidth = 150;
int smallColWidth = 100;