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

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


The following commit(s) were added to refs/heads/master by this push:
     new bfaf7e0  SLING-7308 - Sling 9 Compatibility
bfaf7e0 is described below

commit bfaf7e0a1555b569b0d40b5e21c7e20a7249c23d
Author: Chris Millar <[email protected]>
AuthorDate: Wed Dec 13 14:39:00 2017 -0700

    SLING-7308 - Sling 9 Compatibility
    
    Explicity only install into the HTLBlog folder instead
    of blindly installing all initial-content.
    
    It appears initial content loading has changed slightly
    in Sling 9 which caused htlblog to incorrectly override
    nodes / properties in apps.
    
    Resolves: SLING-7308
---
 htlblog/README.md                                  |  9 +++--
 htlblog/pom.xml                                    | 15 +++++----
 .../apps/htlblog/admin/page/nav.html               |  2 +-
 .../apps/htlblog/public/page/nav.html              |  2 +-
 .../resources/initial-content/content/htlblog.json | 39 ----------------------
 .../initial-content/content/htlblog/admin.json     | 11 ++++++
 .../initial-content/content/htlblog/posts.json     | 22 ++++++++++++
 7 files changed, 48 insertions(+), 52 deletions(-)

diff --git a/htlblog/README.md b/htlblog/README.md
index 2e0c79d..640d664 100644
--- a/htlblog/README.md
+++ b/htlblog/README.md
@@ -11,13 +11,13 @@ This sample is designed as an introduction to Sling and HTL.
 
 ## Requirements
 * [Java 
8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
-* [Sling 8](http://sling.apache.org/downloads.cgi)
+* [Sling 9](http://sling.apache.org/downloads.cgi)
 * [Maven 3+](http://maven.apache.org/download.cgi)
 
 ## Installation
 ### 1. Run Sling
 
-    java -jar org.apache.sling.launchpad-8.jar
+    java -jar org.apache.sling.launchpad-9.jar
 
 ### 2. Install HTLBlog
 
@@ -25,7 +25,7 @@ This sample is designed as an introduction to Sling and HTL.
 
 ### 3. Explore
 
-    http://localhost:8080/content/htlblog.html
+    http://localhost:8080/content/htlblog/posts.html
 
 ## Parts of the Application
 ### Java
@@ -50,9 +50,8 @@ HTL Blog uses Sling Models extensively. You can read about 
them [here](https://s
   * Mostly Bootstrap and some basic custom styles.
 
 ### Content
-The content is built using a single JSON file called `htlblog.json`. It maps 
to the following nodes:
+The content is built using a two JSON files under `/content/htlblog`. They map 
to the following nodes:
 
-* `/content/htlblog` - Our homepage. Currently lists our posts.
 * `/content/htlblog/admin` - Our admin home. Used to list our posts for 
editing or deleting.
 * `/content/htlblog/admin/edit` - Our edit page. Use to create, or if a post 
path is supplied, it will edit an existing post.
 * `/content/htlblog/posts` - Another post list, but also used as the parent of 
our posts.
diff --git a/htlblog/pom.xml b/htlblog/pom.xml
index a96f3a9..3d54198 100644
--- a/htlblog/pom.xml
+++ b/htlblog/pom.xml
@@ -56,7 +56,10 @@
                             org.apache.sling.samples.htlblog
                         </Sling-Model-Packages>
                         <!-- Always overwrite all content to give us a fresh 
start -->
-                        
<Sling-Initial-Content>initial-content;overwrite:=true;uninstall:=true</Sling-Initial-Content>
+                        <Sling-Initial-Content>
+                            
initial-content/apps/htlblog;overwrite:=true;uninstall:=true;path:=/apps/htlblog,
+                            
initial-content/content/htlblog;overwrite:=true;uninstall:=true;path:=/content/htlblog
+                        </Sling-Initial-Content>
                   </instructions>
                 </configuration>
                 <version>3.3.0</version>
@@ -66,8 +69,8 @@
                 <artifactId>maven-compiler-plugin</artifactId>
                 <version>3.3</version>
                 <configuration>
-                    <source>7</source>
-                    <target>7</target>
+                    <source>8</source>
+                    <target>8</target>
                 </configuration>
             </plugin>
             <plugin>
@@ -127,7 +130,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.api</artifactId>
-            <version>2.9.0</version>
+            <version>2.16.2</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
@@ -156,13 +159,13 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.models.api</artifactId>
-            <version>1.2.2</version>
+            <version>1.3.4</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.models.impl</artifactId>
-            <version>1.2.2</version>
+            <version>1.4.2</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
diff --git 
a/htlblog/src/main/resources/initial-content/apps/htlblog/admin/page/nav.html 
b/htlblog/src/main/resources/initial-content/apps/htlblog/admin/page/nav.html
index 007b54b..e611072 100644
--- 
a/htlblog/src/main/resources/initial-content/apps/htlblog/admin/page/nav.html
+++ 
b/htlblog/src/main/resources/initial-content/apps/htlblog/admin/page/nav.html
@@ -23,7 +23,7 @@
         <span class="icon-bar"></span>
         <span class="icon-bar"></span>
       </button>
-      <a class="navbar-brand" href="/content/htlblog.html">HTL Blog</a>
+      <a class="navbar-brand" href="/content/htlblog/posts.html">HTL Blog</a>
     </div>
     <div id="navbar" class="collapse navbar-collapse">
       <ul class="nav navbar-nav">
diff --git 
a/htlblog/src/main/resources/initial-content/apps/htlblog/public/page/nav.html 
b/htlblog/src/main/resources/initial-content/apps/htlblog/public/page/nav.html
index b97ff94..5cee374 100644
--- 
a/htlblog/src/main/resources/initial-content/apps/htlblog/public/page/nav.html
+++ 
b/htlblog/src/main/resources/initial-content/apps/htlblog/public/page/nav.html
@@ -23,7 +23,7 @@
                 <span class="icon-bar"></span>
                 <span class="icon-bar"></span>
             </button>
-            <a class="navbar-brand" href="/content/htlblog.html">HTL Blog</a>
+            <a class="navbar-brand" href="/content/htlblog/posts.html">HTL 
Blog</a>
         </div>
         <div id="navbar" class="collapse navbar-collapse">
             <ul class="nav navbar-nav">
diff --git a/htlblog/src/main/resources/initial-content/content/htlblog.json 
b/htlblog/src/main/resources/initial-content/content/htlblog.json
deleted file mode 100644
index 83633c3..0000000
--- a/htlblog/src/main/resources/initial-content/content/htlblog.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
-       "jcr:primaryType": "nt:unstructured",
-       "sling:resourceType": "htlblog/public/list",
-       "title": "HTL Blog",
-       "description": "The blog homepage.",
-       "posts": {
-               "jcr:primaryType": "sling:OrderedFolder",
-               "sling:resourceType": "htlblog/public/list",
-               "title": "HTL Blog",
-               "description": "The blog homepage.",
-               "hello-world" : {
-                       "jcr:primaryType": "nt:unstructured",
-                       "sling:resourceType": "htlblog/public/post",
-                       "title": "Hello World",
-                       "jcr:createdBy": "admin",
-                       "created": "2017-04-01T13:26:00.000+01:00",
-                       "body": "Lorem ipsum dolor sit amet, consectetur 
adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna 
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi 
ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in 
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint 
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim 
id est laborum."
-               },
-               "hola-mundo" : {
-                       "jcr:primaryType": "nt:unstructured",
-                       "sling:resourceType": "htlblog/public/post",
-                       "title": "Hola Mundo",
-                       "jcr:createdBy": "admin",
-                       "created": "2017-04-01T13:26:00.000+01:00",
-                       "body": "Lorem ipsum dolor sit amet, consectetur 
adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna 
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi 
ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in 
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint 
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim 
id est laborum."
-               }
-       },
-       "admin": {
-               "jcr:primaryType": "nt:unstructured",
-               "sling:resourceType": "htlblog/admin/list",
-               "title": "HTL Blog Admin",
-               "description": "The blog admin.",
-               "edit": {
-                       "jcr:primaryType": "nt:unstructured",
-                       "sling:resourceType": "htlblog/admin/edit",
-                       "title": "HTL Blog Edit"
-               }
-       }
-}
\ No newline at end of file
diff --git 
a/htlblog/src/main/resources/initial-content/content/htlblog/admin.json 
b/htlblog/src/main/resources/initial-content/content/htlblog/admin.json
new file mode 100644
index 0000000..46a6f65
--- /dev/null
+++ b/htlblog/src/main/resources/initial-content/content/htlblog/admin.json
@@ -0,0 +1,11 @@
+{
+    "jcr:primaryType": "nt:unstructured",
+    "sling:resourceType": "htlblog/admin/list",
+    "title": "HTL Blog Admin",
+    "description": "The blog admin.",
+    "edit": {
+        "jcr:primaryType": "nt:unstructured",
+        "sling:resourceType": "htlblog/admin/edit",
+        "title": "HTL Blog Edit"
+    }
+}
\ No newline at end of file
diff --git 
a/htlblog/src/main/resources/initial-content/content/htlblog/posts.json 
b/htlblog/src/main/resources/initial-content/content/htlblog/posts.json
new file mode 100644
index 0000000..3eea1fa
--- /dev/null
+++ b/htlblog/src/main/resources/initial-content/content/htlblog/posts.json
@@ -0,0 +1,22 @@
+{
+    "jcr:primaryType": "sling:OrderedFolder",
+    "sling:resourceType": "htlblog/public/list",
+    "title": "HTL Blog",
+    "description": "The blog homepage.",
+    "hello-world" : {
+        "jcr:primaryType": "nt:unstructured",
+        "sling:resourceType": "htlblog/public/post",
+        "title": "Hello World",
+        "jcr:createdBy": "admin",
+        "created": "2017-04-01T13:26:00.000+01:00",
+        "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed 
do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim 
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse 
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non 
proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
+    },
+    "hola-mundo" : {
+        "jcr:primaryType": "nt:unstructured",
+        "sling:resourceType": "htlblog/public/post",
+        "title": "Hola Mundo",
+        "jcr:createdBy": "admin",
+        "created": "2017-04-01T13:26:00.000+01:00",
+        "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed 
do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim 
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse 
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non 
proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
+    }
+}
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to