SLING-7589 - HTL doesn't correctly handle synthetic resource inclusions
authorRadu Cotescu <170911+raducotescu@users.noreply.github.com>
Tue, 24 Apr 2018 07:45:19 +0000 (09:45 +0200)
committerGitHub <noreply@github.com>
Tue, 24 Apr 2018 07:45:19 +0000 (09:45 +0200)
* added test content

src/main/resources/SLING-INF/apps/sightly/scripts/syntheticresource/selector.html [new file with mode: 0644]
src/main/resources/SLING-INF/apps/sightly/scripts/syntheticresource/syntheticresource.html [new file with mode: 0644]
src/main/resources/SLING-INF/apps/sightly/scripts/syntheticresourcecaller/syntheticresourcecaller.html [new file with mode: 0644]
src/main/resources/SLING-INF/sightly.json

diff --git a/src/main/resources/SLING-INF/apps/sightly/scripts/syntheticresource/selector.html b/src/main/resources/SLING-INF/apps/sightly/scripts/syntheticresource/selector.html
new file mode 100644 (file)
index 0000000..c76059c
--- /dev/null
@@ -0,0 +1,19 @@
+<!--/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
+<span id="synthetic-resource-selector">It works!</span>
diff --git a/src/main/resources/SLING-INF/apps/sightly/scripts/syntheticresource/syntheticresource.html b/src/main/resources/SLING-INF/apps/sightly/scripts/syntheticresource/syntheticresource.html
new file mode 100644 (file)
index 0000000..fd30b8f
--- /dev/null
@@ -0,0 +1,22 @@
+<!--/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
+<div id="synthetic-resource">
+    <span class="wrapper-text">Testing synthetic resource delegation</span>
+    <div class="wrapper" data-sly-resource="${@ selectors='selector'}"></div>
+</div>
diff --git a/src/main/resources/SLING-INF/apps/sightly/scripts/syntheticresourcecaller/syntheticresourcecaller.html b/src/main/resources/SLING-INF/apps/sightly/scripts/syntheticresourcecaller/syntheticresourcecaller.html
new file mode 100644 (file)
index 0000000..413c010
--- /dev/null
@@ -0,0 +1,19 @@
+<!--/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
+<div id="caller" data-sly-resource="${'/content/lorem-ipsum' @ resourceType='/apps/sightly/scripts/syntheticresource'}"></div>
index 6588dcd..0d8ac4b 100644 (file)
     },
     "resource.with.dots.in.path": {
         "jcr:primaryType": "nt:unstructured"
+    },
+    "synthetic-resource": {
+        "jcr:primaryType": "nt:unstructured",
+        "sling:resourceType": "/apps/sightly/scripts/syntheticresourcecaller"
     }
+
 }