You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2020/04/09 03:51:34 UTC

[sling-org-apache-sling-app-cms] branch master updated: Fixing SLING-9344: Updating the Sling Namespace URL

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

dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git


The following commit(s) were added to refs/heads/master by this push:
     new 90056ba  Fixing SLING-9344: Updating the Sling Namespace URL
90056ba is described below

commit 90056ba78dc94d0b9b5497ec6e21f8cc849ce931
Author: Dan Klco <dk...@apache.org>
AuthorDate: Wed Apr 8 23:51:06 2020 -0400

    Fixing SLING-9344: Updating the Sling Namespace URL
---
 builder/src/main/scripts/fix_package_namespace.sh   | 21 +++++++++++++++++++++
 .../resources/SLING-INF/nodetypes/nodetypes.cnd     |  2 +-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/builder/src/main/scripts/fix_package_namespace.sh b/builder/src/main/scripts/fix_package_namespace.sh
new file mode 100644
index 0000000..34aa7fc
--- /dev/null
+++ b/builder/src/main/scripts/fix_package_namespace.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+PACKAGE=$1
+unzip $PACKAGE -d out
+IFS=$'\n'
+for CONTENT_XML in $(find out -name .content.xml) 
+do
+    echo "Replacing Sling Namespace in ${CONTENT_XML}"
+    sed -i "" "s|http\://www.sling.apache.org/sling/1.0|http://sling.apache.org/jcr/sling/1.0|g" "$CONTENT_XML"
+done
+for CND in $(find . -name *.cnd) 
+do
+    echo "Replacing Sling Namespace in ${CND}"
+    sed -i "" "s|http\://www.sling.apache.org/sling/1.0|http://sling.apache.org/jcr/sling/1.0|g" "$CND"
+done
+
+cd out
+zip -r "../replaced-$PACKAGE" * 
+cd ..
+rm -rf out
+echo "Sling Namespace replaced successfully in replaced-$PACKAGE"
\ No newline at end of file
diff --git a/ui/src/main/resources/SLING-INF/nodetypes/nodetypes.cnd b/ui/src/main/resources/SLING-INF/nodetypes/nodetypes.cnd
index 04a8db3..f164147 100644
--- a/ui/src/main/resources/SLING-INF/nodetypes/nodetypes.cnd
+++ b/ui/src/main/resources/SLING-INF/nodetypes/nodetypes.cnd
@@ -21,7 +21,7 @@
 //    -  http://sling.apache.org/site/content-loading.html
 //    -  http://jackrabbit.apache.org/node-type-notation.html
 
-<sling = 'http://www.sling.apache.org/sling/1.0'>
+<sling = 'http://sling.apache.org/jcr/sling/1.0'>
     
 
 [sling:Component] > nt:unstructured