You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by pa...@apache.org on 2021/09/01 15:08:10 UTC

[sling-org-apache-sling-feature-cpconverter] branch issues/SLING-10770 created (now 0a4ba49)

This is an automated email from the ASF dual-hosted git repository.

pauls pushed a change to branch issues/SLING-10770
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-cpconverter.git.


      at 0a4ba49  SLING-10770: throw IllegalStateException when sling initial content has CNDs as we don't support that atm.

This branch includes the following new commits:

     new 0a4ba49  SLING-10770: throw IllegalStateException when sling initial content has CNDs as we don't support that atm.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[sling-org-apache-sling-feature-cpconverter] 01/01: SLING-10770: throw IllegalStateException when sling initial content has CNDs as we don't support that atm.

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pauls pushed a commit to branch issues/SLING-10770
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-cpconverter.git

commit 0a4ba49f1b072bf352ec21e642cdc86b81f50743
Author: Karl Pauls <ka...@gmail.com>
AuthorDate: Wed Sep 1 17:07:59 2021 +0200

    SLING-10770: throw IllegalStateException when sling initial content has CNDs as we don't support that atm.
---
 .../feature/cpconverter/handlers/BundleEntryHandler.java  |  5 +++++
 .../feature/cpconverter/vltpkg/JcrNamespaceRegistry.java  | 15 ++++++++-------
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/sling/feature/cpconverter/handlers/BundleEntryHandler.java b/src/main/java/org/apache/sling/feature/cpconverter/handlers/BundleEntryHandler.java
index 44a3da1..c14874c 100644
--- a/src/main/java/org/apache/sling/feature/cpconverter/handlers/BundleEntryHandler.java
+++ b/src/main/java/org/apache/sling/feature/cpconverter/handlers/BundleEntryHandler.java
@@ -87,9 +87,13 @@ import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 import org.osgi.framework.Constants;
 import org.osgi.framework.Version;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class BundleEntryHandler extends AbstractRegexEntryHandler {
 
+    private final Logger logger = LoggerFactory.getLogger(getClass());
+
     private static final String NAME_GROUP_ID = "groupId";
 
     private static final String NAME_ARTIFACT_ID = "artifactId";
@@ -305,6 +309,7 @@ public class BundleEntryHandler extends AbstractRegexEntryHandler {
             }
     
             // remap CND files to make sure they are picked up by NodeTypesEntryHandler
+            logger.warn("Unable to check for CND files for sling inital content - Not implemented!");
             if (nsRegistry.getRegisteredCndSystemIds().contains(jarEntry.getName())) {
                 contentPackageEntryPath = "/META-INF/vault/" + Text.getName(jarEntry.getName()) + ".cnd";
             }
diff --git a/src/main/java/org/apache/sling/feature/cpconverter/vltpkg/JcrNamespaceRegistry.java b/src/main/java/org/apache/sling/feature/cpconverter/vltpkg/JcrNamespaceRegistry.java
index 00021c3..8a1715a 100644
--- a/src/main/java/org/apache/sling/feature/cpconverter/vltpkg/JcrNamespaceRegistry.java
+++ b/src/main/java/org/apache/sling/feature/cpconverter/vltpkg/JcrNamespaceRegistry.java
@@ -26,10 +26,7 @@ import java.util.Map;
 import javax.jcr.NamespaceException;
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.RepositoryException;
-import javax.jcr.ValueFactory;
-import javax.jcr.nodetype.NodeTypeManager;
 
-import org.apache.jackrabbit.commons.cnd.CndImporter;
 import org.apache.jackrabbit.commons.cnd.ParseException;
 import org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver;
 import org.jetbrains.annotations.NotNull;
@@ -52,10 +49,14 @@ public class JcrNamespaceRegistry implements NamespaceRegistry, NamespaceResolve
     }
 
     public void registerCnd(Reader reader, String systemId) throws ParseException, RepositoryException, IOException {
-        NodeTypeManager ntManager = null;
-        ValueFactory valueFactory = null;
-        CndImporter.registerNodeTypes(reader, systemId, ntManager, this, valueFactory, false);
-        registeredCndSystemIds.add(systemId);
+        throw new IllegalStateException("Not implemented");
+        /*
+        TODO:
+            NodeTypeManager ntManager = null;
+            ValueFactory valueFactory = null;
+            CndImporter.registerNodeTypes(reader, systemId, ntManager, this, valueFactory, false);
+            registeredCndSystemIds.add(systemId);
+         */
     }
 
     @Override