From: Mathieu Baudier Date: Sun, 10 Mar 2024 12:15:39 +0000 (+0100) Subject: Adapt to changes in Argeo Commons X-Git-Tag: v2.1.6~2^2~5 X-Git-Url: https://git.argeo.org/?p=gpl%2Fargeo-jcr.git;a=commitdiff_plain;h=8f85fc13d0d2cd5ce8c97ba8e4d0838e74928d08 Adapt to changes in Argeo Commons --- 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; } /*