${helper.model}
+
+
${properties.text @ context='html'}
+ ${properties.text ? '': 'placeholder text'}
\ No newline at end of file
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/container/.content.xml b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/container/.content.xml
new file mode 100644
index 0000000000..265b492298
--- /dev/null
+++ b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/container/.content.xml
@@ -0,0 +1,36 @@
+
+
+
+
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/container/container.html b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/container/container.html
new file mode 100644
index 0000000000..4996c93705
--- /dev/null
+++ b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/container/container.html
@@ -0,0 +1,23 @@
+
+
+
+
+ container start
+
+
+
+
+
+
+
+ container end
+
+
+
+
\ No newline at end of file
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/.content.xml b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/.content.xml
new file mode 100644
index 0000000000..037db5ecdd
--- /dev/null
+++ b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/.content.xml
@@ -0,0 +1,36 @@
+
+
+
+
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/dialog.json b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/dialog.json
similarity index 100%
rename from pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/dialog.json
rename to pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/dialog.json
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/explorer_dialog.json b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/explorer_dialog.json
similarity index 100%
rename from pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/explorer_dialog.json
rename to pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/explorer_dialog.json
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/page.html b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/page.html
new file mode 100644
index 0000000000..46c3dd07a2
--- /dev/null
+++ b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/page.html
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
${resource.jcr:title}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/renderer.html b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/renderer.html
similarity index 100%
rename from pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/renderer.html
rename to pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/renderer.html
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/serviceworker.html b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/serviceworker.html
similarity index 100%
rename from pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/serviceworker.html
rename to pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/serviceworker.html
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/tracker-bodyend.html b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/tracker-bodyend.html
similarity index 100%
rename from pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/tracker-bodyend.html
rename to pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/tracker-bodyend.html
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/tracker-bodystart.html b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/tracker-bodystart.html
similarity index 100%
rename from pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/tracker-bodystart.html
rename to pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/tracker-bodystart.html
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/tracker-head.html b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/tracker-head.html
similarity index 100%
rename from pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/tracker-head.html
rename to pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/page/tracker-head.html
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/container/container.html b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/container/container.html
deleted file mode 100644
index d1c9ea4d01..0000000000
--- a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/container/container.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/Helper.java b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/Helper.java
deleted file mode 100644
index bc315ce60c..0000000000
--- a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/Helper.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package apps.pagerenderserver.structure.page;
-
-/*-
- * #%L
- * peregrine server page renderer - UI Apps
- * %%
- * Copyright (C) 2017 headwire inc.
- * %%
- * 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.
- * #L%
- */
-
-import javax.script.Bindings;
-
-import org.apache.sling.scripting.sightly.pojo.Use;
-import org.apache.sling.api.resource.Resource;
-
-import org.apache.sling.models.factory.ModelFactory;
-import org.apache.sling.api.SlingHttpServletRequest;
-import org.apache.sling.api.scripting.SlingScriptHelper;
-
-public class Helper implements Use {
-
- private Object model;
- private String siteRootPath;
- private Resource resource;
-
- public String getHello() {
- return "hello";
- }
-
- public String getPath() {
- return resource.getPath();
- }
-
- public Object getModel() {
- return model;
- }
-
- public String getSiteRootPath() {
- return siteRootPath;
- }
-
- public String getModelClass() {
- return model.getClass().toString();
- }
-
- public void init(Bindings bindings) {
- Resource resource = (Resource) bindings.get("resource");
- SlingHttpServletRequest request = (SlingHttpServletRequest) bindings.get("request");
- SlingScriptHelper sling = (SlingScriptHelper) bindings.get("sling");
-
- String path = resource.getPath();
- path = path.substring("/content/".length());
-
- int slash = path.indexOf("/");
- String siteName = slash > 0 ? path.substring(0, path.indexOf("/")) : path;
- siteRootPath = "/content/" + siteName + "/pages";
-
- try {
- model = sling.getService(ModelFactory.class).getModelFromResource(resource);
- } catch(Throwable t) {
- model = sling.getService(ModelFactory.class).getModelFromRequest(request);
- }
- }
-
-}
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/page.html b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/page.html
deleted file mode 100644
index 43e70cd476..0000000000
--- a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/structure/page/page.html
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-
${resource.jcr:title}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ${helper.path}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/.content.xml b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/.content.xml
index 2835bfff8f..052636d83d 100644
--- a/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/.content.xml
+++ b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/.content.xml
@@ -27,5 +27,11 @@
xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="per:Site"
jcr:title="Pagerender-Server Site"
- internal="false"
- template="false"/>
\ No newline at end of file
+ internal="true"
+ template="false">
+
+
\ No newline at end of file
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/assets/.content.xml b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/assets/.content.xml
index d6cb19117d..904644f80c 100644
--- a/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/assets/.content.xml
+++ b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/assets/.content.xml
@@ -32,7 +32,7 @@
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/objects/.content.xml b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/objects/.content.xml
index d930fdca50..2e68f4b841 100644
--- a/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/objects/.content.xml
+++ b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/objects/.content.xml
@@ -32,7 +32,7 @@
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/pages/.content.xml b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/pages/.content.xml
index 7edf53998d..7c010fffa2 100644
--- a/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/pages/.content.xml
+++ b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/pages/.content.xml
@@ -32,7 +32,7 @@
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/pages/about/.content.xml b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/pages/about/.content.xml
index b4a1046773..b89cbfa00e 100644
--- a/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/pages/about/.content.xml
+++ b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/pages/about/.content.xml
@@ -31,11 +31,13 @@
+ sling:resourceType="pagerenderserver/components/page"
+ jcr:title="peregrine-server About"
+ template="/content/pagerenderserver/templates/base"
+ templatePath="/content/pagerenderserver/templates/base" >
+ sling:resourceType="pagerenderserver/components/container">
+ sling:resourceType="pagerenderserver/components/page"
+ jcr:title="peregrine-server Index"
+ template="/content/pagerenderserver/templates/base"
+ templatePath="/content/pagerenderserver/templates/base" >
+ sling:resourceType="pagerenderserver/components/container">
+
+
+
+
+
+
+
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/pages/non-empty-container/.content.xml b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/pages/non-empty-container/.content.xml
new file mode 100644
index 0000000000..4479287ae5
--- /dev/null
+++ b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/pages/non-empty-container/.content.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/templates/.content.xml b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/templates/.content.xml
index e3b91265b2..70f706e055 100644
--- a/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/templates/.content.xml
+++ b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/templates/.content.xml
@@ -32,9 +32,7 @@
+ sling:resourceType="pagerenderserver/components/page"
+ jcr:title="pagerender-server root template"/>
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/templates/base/.content.xml b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/templates/base/.content.xml
new file mode 100644
index 0000000000..75ab1a900c
--- /dev/null
+++ b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/templates/base/.content.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/templates/empty-container/.content.xml b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/templates/empty-container/.content.xml
new file mode 100644
index 0000000000..1ba277a85a
--- /dev/null
+++ b/pagerenderer/server/ui.apps/src/main/content/jcr_root/content/pagerenderserver/templates/empty-container/.content.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/etc/felibs/pagerenderserver/css/server.css b/pagerenderer/server/ui.apps/src/main/content/jcr_root/etc/felibs/pagerenderserver/css/server.css
new file mode 100644
index 0000000000..a30dda6620
--- /dev/null
+++ b/pagerenderer/server/ui.apps/src/main/content/jcr_root/etc/felibs/pagerenderserver/css/server.css
@@ -0,0 +1,27 @@
+.per-drop-target {
+ display: none;
+}
+.per-drop-target-empty {
+ display: none;
+}
+.edit-mode .per-drop-target {
+ display: inherit;
+ border: 1px dashed #c0c0c0;
+ clear: both;
+ padding: 4px;
+ margin: 4px;
+ text-align: center;
+ width: calc(100% - 8px);
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ color: black !important;
+ overflow: hidden;
+ font-size: 0.75em;
+ background: #f8f8f8e0;
+}
+.edit-mode .per-drop-target-empty {
+ display: inherit;
+ font-size: 1.5em;
+ height: 3em;
+ padding-top: 0.75em;
+}
\ No newline at end of file
diff --git a/pagerenderer/vue/core/src/main/java/com/peregrine/pagerender/vue/models/PageModel.java b/pagerenderer/vue/core/src/main/java/com/peregrine/pagerender/vue/models/PageModel.java
index 8a9b311841..0f1d382b8d 100644
--- a/pagerenderer/vue/core/src/main/java/com/peregrine/pagerender/vue/models/PageModel.java
+++ b/pagerenderer/vue/core/src/main/java/com/peregrine/pagerender/vue/models/PageModel.java
@@ -38,6 +38,7 @@
import com.peregrine.nodetypes.models.IComponent;
import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
import javax.inject.Inject;
import javax.inject.Named;
@@ -78,11 +79,9 @@ public Resource getParentContent(Resource res) {
Resource page = res.getParent();
if(page != null) {
Resource parentPage = page.getParent();
- if(parentPage != null) {
- if(PAGE_PRIMARY_TYPE.equals(parentPage.getResourceType())) {
- Resource child = parentPage.getChild(JCR_CONTENT);
- return child;
- }
+ if(Objects.nonNull(parentPage) && Objects.nonNull(parentPage.getChild(JCR_CONTENT))) {
+ Resource child = parentPage.getChild(JCR_CONTENT);
+ return child;
}
}
return null;
diff --git a/pagerenderer/vue/ui.apps/src/main/content/jcr_root/apps/pagerendervue/structure/container/.content.xml b/pagerenderer/vue/ui.apps/src/main/content/jcr_root/apps/pagerendervue/structure/container/.content.xml
new file mode 100644
index 0000000000..22fe87646a
--- /dev/null
+++ b/pagerenderer/vue/ui.apps/src/main/content/jcr_root/apps/pagerendervue/structure/container/.content.xml
@@ -0,0 +1,7 @@
+
+
+
diff --git a/pagerenderer/vue/ui.apps/src/main/content/jcr_root/apps/pagerendervue/structure/page/.content.xml b/pagerenderer/vue/ui.apps/src/main/content/jcr_root/apps/pagerendervue/structure/page/.content.xml
new file mode 100644
index 0000000000..87f8279968
--- /dev/null
+++ b/pagerenderer/vue/ui.apps/src/main/content/jcr_root/apps/pagerendervue/structure/page/.content.xml
@@ -0,0 +1,10 @@
+
+
+
+
diff --git a/pagerenderer/vue/ui.apps/src/main/content/jcr_root/content/pagerendervue/templates/base/.content.xml b/pagerenderer/vue/ui.apps/src/main/content/jcr_root/content/pagerendervue/templates/base/.content.xml
new file mode 100644
index 0000000000..8f46279033
--- /dev/null
+++ b/pagerenderer/vue/ui.apps/src/main/content/jcr_root/content/pagerendervue/templates/base/.content.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/platform/base/core/src/main/java/com/peregrine/adaption/PerBase.java b/platform/base/core/src/main/java/com/peregrine/adaption/PerBase.java
index 423f845856..01e39be1e8 100644
--- a/platform/base/core/src/main/java/com/peregrine/adaption/PerBase.java
+++ b/platform/base/core/src/main/java/com/peregrine/adaption/PerBase.java
@@ -60,6 +60,16 @@ public interface PerBase
public ValueMap getProperties();
/** @return Modifiable Value Map of the Content Resource if the page has a content **/
public ModifiableValueMap getModifiableProperties();
+ /**
+ *
+ * @return the parent site/tenant per:Site resource
+ */
+ public Resource getSiteResource();
+ /**
+ *
+ * @return the parent site/tenant per:Site/jcr:content properties
+ */
+ public ValueMap getSiteProperties();
/**
* Provide Content Property
diff --git a/platform/base/core/src/main/java/com/peregrine/adaption/impl/PerBaseImpl.java b/platform/base/core/src/main/java/com/peregrine/adaption/impl/PerBaseImpl.java
index a65e83cb91..075c3e1999 100644
--- a/platform/base/core/src/main/java/com/peregrine/adaption/impl/PerBaseImpl.java
+++ b/platform/base/core/src/main/java/com/peregrine/adaption/impl/PerBaseImpl.java
@@ -33,21 +33,22 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
import javax.jcr.Session;
+import javax.jcr.nodetype.NodeType;
import java.util.Calendar;
+import java.util.Objects;
-import static com.peregrine.commons.util.PerConstants.JCR_CONTENT;
-import static com.peregrine.commons.util.PerConstants.JCR_LAST_MODIFIED;
-import static com.peregrine.commons.util.PerConstants.JCR_LAST_MODIFIED_BY;
+import static com.peregrine.commons.util.PerConstants.*;
/**
* Common Base Class for Peregrine Object Wrappers
*
* Created by Andreas Schaefer on 6/4/17.
*/
-public abstract class PerBaseImpl
- implements PerBase
-{
+public abstract class PerBaseImpl implements PerBase {
+
public static final String RESOURCE_MUST_BE_PROVIDED = "Resource must be provided";
Logger logger = LoggerFactory.getLogger(getClass());
@@ -144,6 +145,35 @@ public T getContentProperty(String propertyName, T defaultValue) {
answer;
}
+ @Override
+ public ValueMap getSiteProperties(){
+ if(Objects.nonNull(getSiteResource()) && Objects.nonNull(getSiteResource().getChild(JCR_CONTENT))){
+ return getSiteResource().getChild(JCR_CONTENT).getValueMap();
+ }
+ return null;
+ }
+
+ @Override
+ public Resource getSiteResource(){
+ return this.getSiteResource(this.resource);
+ }
+
+ private Resource getSiteResource(Resource resource){
+ if (Objects.nonNull(this.resource)){
+ try {
+ NodeType nt = Objects.requireNonNull(resource.adaptTo(Node.class)).getPrimaryNodeType();
+ if( nt.getName().equals(SITE_PRIMARY_TYPE)){
+ return resource;
+ } else {
+ return getSiteResource(resource.getParent());
+ }
+ } catch (RepositoryException e) {
+ logger.error("Error getting root per:Site resource ", e);
+ }
+ }
+ return null;
+ }
+
@Override
public AdapterType adaptTo(Class type) {
if(type.equals(Resource.class)) {
diff --git a/platform/base/core/src/main/java/com/peregrine/nodetypes/merge/PageMerge.java b/platform/base/core/src/main/java/com/peregrine/nodetypes/merge/PageMerge.java
index 92556538c6..67fcc6993e 100644
--- a/platform/base/core/src/main/java/com/peregrine/nodetypes/merge/PageMerge.java
+++ b/platform/base/core/src/main/java/com/peregrine/nodetypes/merge/PageMerge.java
@@ -25,25 +25,10 @@
* #L%
*/
-import static com.peregrine.commons.util.PerConstants.COMPONENT;
-import static com.peregrine.commons.util.PerConstants.JACKSON;
-import static com.peregrine.commons.util.PerConstants.JCR_CONTENT;
-import static com.peregrine.commons.util.PerConstants.NT_UNSTRUCTURED;
-import static com.peregrine.commons.util.PerConstants.PAGE_PRIMARY_TYPE;
-import static com.peregrine.commons.util.PerConstants.PATH;
-import static java.util.regex.Pattern.compile;
-
import com.fasterxml.jackson.databind.ObjectMapper;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
-import javax.script.Bindings;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.scripting.SlingScriptHelper;
import org.apache.sling.models.factory.ExportException;
import org.apache.sling.models.factory.MissingExporterException;
@@ -52,6 +37,27 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.script.Bindings;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.TreeMap;
+
+import static com.peregrine.commons.util.PerConstants.COMPONENT;
+import static com.peregrine.commons.util.PerConstants.JACKSON;
+import static com.peregrine.commons.util.PerConstants.JCR_CONTENT;
+import static com.peregrine.commons.util.PerConstants.NT_UNSTRUCTURED;
+import static com.peregrine.commons.util.PerConstants.PAGE_PRIMARY_TYPE;
+import static com.peregrine.commons.util.PerConstants.PATH;
+import static java.util.regex.Pattern.compile;
+import static org.apache.sling.api.scripting.SlingBindings.RESOLVER;
+import static org.apache.sling.api.scripting.SlingBindings.RESOURCE;
+
/**
* Created by rr on 5/8/2017.
*/
@@ -63,15 +69,17 @@ public class PageMerge implements Use {
private static ThreadLocal renderContext = new ThreadLocal<>();
public static final String FROM_TEMPLATE = "fromTemplate";
+ public static final String CHILDREN = "children";
public static final String REQUEST = "request";
public static final String SLING = "sling";
public static final String TEMPLATE = "template";
+ public static final String MODEL_FACTORY = "modelFactory";
public static final String REGEX_TEMPLATES = "(?<=\\/content\\/)([a-zA-Z0-9\\\\s\\\\_-])*(?=\\/templates)";
private ModelFactory modelFactory;
-
+ private ResourceResolver resolver;
private SlingHttpServletRequest request;
-
+ private Resource resource;
public static RenderContext getRenderContext() {
return renderContext.get();
}
@@ -85,6 +93,56 @@ public String getMerged() {
return toJSON(getMerged(res));
}
+ public List getMergedResources(){
+ List pageResources = new ArrayList<>();
+ if (Objects.isNull(resource)){
+ resource = request.getResource();
+ }
+ if(resource.getName().equals(JCR_CONTENT)) {
+ resource = resource.getParent();
+ }
+ Map resourceMap = getMerged(resource);
+ // MAP to List
+ List maps = (ArrayList) resourceMap.get(CHILDREN);
+ for (Map map : maps) {
+ getChildren(map, pageResources);
+ }
+ return pageResources;
+ }
+
+ private void getChildren(Map map, List resources) {
+ String templatePath = getTemplatePath();
+ String relativePath = (String) map.get("path");
+ String basePath = resource.getPath();
+
+ if (Objects.nonNull(resolver.getResource(basePath+relativePath))){
+ // if resource is from the template and the resource is not a type of container
+ // then the base path should point to the template
+ resources.add(resolver.getResource(basePath+relativePath));
+
+ } else if (Objects.nonNull(resolver.getResource(templatePath+relativePath))){
+ // if resource is from the template and the resource is type of container
+ // then the base path should point to the page
+ resources.add(resolver.getResource(templatePath+relativePath));
+ } else {
+ // otherwise try to add content resource inherited from parent templates
+ Resource templateContent = this.resolver.getResource(basePath+relativePath);
+ Resource templateResource = this.resolver.getResource(templatePath);
+ while (Objects.isNull(templateContent) && Objects.nonNull(templateResource)){
+ // while loop logic. Enter if templateContent is null, but templateResource is non null.
+ // then try to resolve the templateContent from template parents content
+ // exit while loop when templateContent is resolved or templateResource becomes null
+ templateResource = templateResource.getParent();
+ if (Objects.nonNull(templateResource)) {
+ templateContent = resolver.getResource(templateResource.getPath()+relativePath);
+ }
+ }
+ if (Objects.nonNull(templateContent)){
+ resources.add(templateContent);
+ }
+ }
+ }
+
public String getMergedForScript() {
log.debug("merge on {}", request.getResource().getPath());
Resource res = request.getResource();
@@ -111,7 +169,7 @@ public Map getMerged(Resource resource) {
}
}
if(templatePath != null) {
- Map template = getMerged(request.getResourceResolver().getResource(templatePath));
+ Map template = getMerged(this.resolver.getResource(templatePath));
flagFromTemplate(template);
return merge(template, page);
}
@@ -140,6 +198,11 @@ private void flagFromTemplate(Map template) {
}
}
+ private String getTemplatePath(){
+ Resource jcrContent = this.resource.getChild(JCR_CONTENT);
+ return jcrContent.getValueMap().get(TEMPLATE, String.class);
+ }
+
private Map merge(Map template, Map page) {
TreeMap res = new TreeMap();
res.putAll(template);
@@ -203,8 +266,16 @@ private String toJSON(Map template) {
@Override
public void init(final Bindings bindings) {
request = (SlingHttpServletRequest) bindings.get(REQUEST);
- SlingScriptHelper sling = (SlingScriptHelper) bindings.get(SLING);
- modelFactory = sling.getService(ModelFactory.class);
+ resource = (Resource) bindings.get(RESOURCE);
renderContext.set(new RenderContext(request));
+ resolver = (ResourceResolver) bindings.get(RESOLVER);
+ SlingScriptHelper sling = (SlingScriptHelper) bindings.get(SLING);
+ if (Objects.nonNull(sling)) {
+ // the typical path
+ modelFactory = sling.getService(ModelFactory.class);
+ } else if ( Objects.nonNull(bindings.get(MODEL_FACTORY))) {
+ // for unit testing
+ modelFactory = (ModelFactory) bindings.get(MODEL_FACTORY);
+ }
}
}
diff --git a/platform/base/ui.apps/src/main/content/jcr_root/apps/runmodes/config/org.apache.sling.jcr.repoinit.RepositoryInitializer-peregrine.config b/platform/base/ui.apps/src/main/content/jcr_root/apps/runmodes/config/org.apache.sling.jcr.repoinit.RepositoryInitializer-peregrine.config
index c14d7f0b49..3bb562dd46 100644
--- a/platform/base/ui.apps/src/main/content/jcr_root/apps/runmodes/config/org.apache.sling.jcr.repoinit.RepositoryInitializer-peregrine.config
+++ b/platform/base/ui.apps/src/main/content/jcr_root/apps/runmodes/config/org.apache.sling.jcr.repoinit.RepositoryInitializer-peregrine.config
@@ -30,6 +30,10 @@ scripts=[\
create path (sling:Folder) /etc/packages
create path (sling:Folder) /var/recyclebin
create path (sling:Folder) /var/sitemaps
+ create path (sling:Folder) /etc/distribution
+ create path (sling:Folder) /i18n
+ create path (sling:Folder) /libs/sling/distribution
+ create path (sling:Folder) /var/sling/distribution
# Create the Peregrine Service Users
create service user peregrine-service-user
@@ -72,17 +76,6 @@ scripts=[\
allow jcr:read on /content
end
-# set ACL's for all_tenants group on paths lower than root
-# Note: this replaces jcr:read for everyone on root
- set ACL for all_tenants
- allow jcr:read on /index.html
- allow jcr:read on /favicon.ico
- allow jcr:read on /robots.txt
- allow jcr:read on /perapi/admin
- allow jcr:read on /apps
- allow jcr:read on /i18n
- allow jcr:read on /content
- end
# Create Tenant Groups for Peregrine
create group all_tenants with path /home/groups/tenants
diff --git a/pom.xml b/pom.xml
index eae72b2eeb..dc0bcf40e9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,7 +53,7 @@
1.0.18
1.1.8
0.3.0
- 0.3.1-SNAPSHOT
+ 0.3.4
2.2.2
@@ -1004,6 +1004,7 @@
buildscripts
platform
pagerenderer/vue
+ pagerenderer/server
admin-base
samples/example-vue-site
themes/themeclean
diff --git a/samples/example-vue-site/core/src/main/java/com/example/site/models/NavModel.java b/samples/example-vue-site/core/src/main/java/com/example/site/models/NavModel.java
index 11b933de10..8d524acde0 100644
--- a/samples/example-vue-site/core/src/main/java/com/example/site/models/NavModel.java
+++ b/samples/example-vue-site/core/src/main/java/com/example/site/models/NavModel.java
@@ -54,7 +54,7 @@ public NavModel(Resource resource) {
public String getBrand() {
RenderContext rx = PageMerge.getRenderContext();
SlingHttpServletRequest request = rx.getRequest();
- Resource homePage = getResourceAt(request.getResource(), 3);
+ Resource homePage = getResourceAt(this.getResource(), 3);
Resource content = homePage.getChild("jcr:content");
return content.adaptTo(ValueMap.class).get("brand", String.class);
}
@@ -63,8 +63,8 @@ public List getNavigation() {
List ret = new ArrayList<>();
RenderContext rx = PageMerge.getRenderContext();
- SlingHttpServletRequest request = rx.getRequest();
- Resource homePage = getResourceAt(request.getResource(), 3);
+// SlingHttpServletRequest request = rx.getRequest();
+ Resource homePage = getResourceAt( this.getResource(), 3);
Iterator children = homePage.listChildren();
diff --git a/sling/peregrine-builder-sling-12/pom.xml b/sling/peregrine-builder-sling-12/pom.xml
index 2ca40bdf63..5112c0858b 100644
--- a/sling/peregrine-builder-sling-12/pom.xml
+++ b/sling/peregrine-builder-sling-12/pom.xml
@@ -16,7 +16,7 @@
org.apache.sling
sling
- 35
+ 39
@@ -31,14 +31,18 @@
8
- 126
+ 126
+ 9.0
2.20.0
1.32.0
1.7.25
- 1.12.0
+ 2.1.1
2.11.1
+ 3.0.6
+
+ true
@@ -72,58 +76,38 @@
org.apache.sling
slingfeature-maven-plugin
- 1.3.14
+ 1.4.2
true
- jackrabbit.version,oak.version,slf4j.version,composum.nodes.version,jackson.version
+ asm.version,jackrabbit.version,groovy.version,oak.version,slf4j.version,composum.nodes.version,jackson.version
org.apache.felix
org.apache.felix.framework
6.0.3
-
- oak_tar
- *.json
- oak/*.json
- oak/persistence/oak_persistence_sns.json
- app/composum.json
- app/distribution.json
- Sling With Oak Segment NS Persistence
-
oak_tar_fds
*.json
oak/*.json
oak/persistence/oak_persistence_sns_fds.json
+
app/composum.json
- app/distribution.json
- Sling with Oak Segment NodeStore (sns) and File Datastore (fds)
-
-
- nosample_base
- *.json
- oak/*.json
- Sling With No Samples and No Persistence
+ app/distribution.json
+ Sling With Oak Segment NS Persistence
- oak_tar
oak_tar_fds
- nosample_base
-
- oak_tar_far
- oak_tar
-
oak_tar_fds_far
oak_tar_fds
-
+
@@ -149,12 +133,100 @@
package
- org.apache.sling:org.apache.sling.feature.launcher:1.1.4
+ org.apache.sling:org.apache.sling.feature.launcher:1.1.6
true
+
+
+ biz.aQute.bnd
+ bnd-indexer-maven-plugin
+ 5.2.0
+
+
+ index
+
+ index
+
+
+ provided
+ ${bnd.index.generation.skip}
+
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+
+
+ reserve-network-port
+
+ reserve-network-port
+
+ pre-integration-test
+
+
+ http.port
+
+
+
+
+
+
+
+ org.apache.sling
+ feature-launcher-maven-plugin
+ 0.1.0
+
+
+
+ sling-12-oak-tar
+
+ ${project.groupId}
+ ${project.artifactId}
+ ${project.version}
+ oak_tar_fds
+ slingosgifeature
+
+
+
+ ${http.port}
+
+
+
+
+
+
+
+
+ start
+ stop
+
+
+
+
+
+
+ maven-failsafe-plugin
+
+
+
+ integration-test
+ verify
+
+
+
+
+
+ ${http.port}
+ ${starter.min.bundles.count}
+
+
+
@@ -194,4 +266,21 @@
test
+
+
+
+
+ apache-release
+
+ false
+
+
+
+
+ ci
+
+ false
+
+
+
diff --git a/sling/peregrine-builder-sling-12/src/main/features/app/composum.json b/sling/peregrine-builder-sling-12/src/main/features/app/composum.json
index d0ae8b5306..064d2816b5 100644
--- a/sling/peregrine-builder-sling-12/src/main/features/app/composum.json
+++ b/sling/peregrine-builder-sling-12/src/main/features/app/composum.json
@@ -2,32 +2,32 @@
{
"bundles":[
{
- "id":"com.composum.sling.core:composum-sling-core-commons:${composum.nodes.version}",
+ "id":"com.composum.nodes:composum-nodes-commons:${composum.nodes.version}",
"start-order":"20"
},
{
- "id":"com.composum.sling.core:composum-sling-core-console:${composum.nodes.version}",
+ "id":"com.composum.nodes:composum-nodes-console:${composum.nodes.version}",
"start-order":"20"
},
{
- "id":"com.composum.sling.core:composum-sling-core-jslibs:${composum.nodes.version}",
+ "id":"com.composum.nodes:composum-nodes-jslibs:${composum.nodes.version}",
"start-order":"20"
},
{
- "id":"com.composum.sling.core:composum-sling-package-manager:${composum.nodes.version}",
+ "id":"com.composum.nodes:composum-nodes-pckgmgr:${composum.nodes.version}",
"start-order":"20"
},
{
- "id":"com.composum.sling.core:composum-sling-user-management:${composum.nodes.version}",
+ "id":"com.composum.nodes:composum-nodes-usermgr:${composum.nodes.version}",
"start-order":"20"
}
],
"configurations":{
"org.apache.sling.jcr.base.internal.LoginAdminWhitelist.fragment~composum":{
"whitelist.bundles":[
- "com.composum.core.commons",
- "com.composum.core.pckgmgr",
- "com.composum.core.pckginstall"
+ "com.composum.nodes.commons",
+ "com.composum.nodes.pckgmgr",
+ "com.composum.nodes.usermgr"
],
"whitelist.name":"composum"
}
diff --git a/sling/peregrine-builder-sling-12/src/main/features/app/distribution.json b/sling/peregrine-builder-sling-12/src/main/features/app/distribution.json
index 7ada2317cf..776b611666 100644
--- a/sling/peregrine-builder-sling-12/src/main/features/app/distribution.json
+++ b/sling/peregrine-builder-sling-12/src/main/features/app/distribution.json
@@ -2,11 +2,11 @@
{
"bundles":[
{
- "id":"org.apache.sling:org.apache.sling.distribution.api:0.4.0",
+ "id":"org.apache.sling:org.apache.sling.distribution.api:0.3.0",
"start-order":"20"
},
{
- "id":"org.apache.sling:org.apache.sling.distribution.core:0.4.2",
+ "id":"org.apache.sling:org.apache.sling.distribution.core:0.3.4",
"start-order":"20"
}
diff --git a/sling/peregrine-builder-sling-12/src/main/features/app/slingshot.json b/sling/peregrine-builder-sling-12/src/main/features/app/slingshot.json
deleted file mode 100644
index 62350eb195..0000000000
--- a/sling/peregrine-builder-sling-12/src/main/features/app/slingshot.json
+++ /dev/null
@@ -1,38 +0,0 @@
-
-{
- "bundles":[
- {
- "id":"org.apache.sling:org.apache.sling.sample.slingshot:0.9.0",
- "start-order":"20"
- }
- ],
- "configurations":{
- "org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~sling.slingshot":{
- "user.mapping":[
- "org.apache.sling.sample.slingshot=slingshot-service"
- ]
- }
- },
- "repoinit:TEXT|true":[
- "create service user slingshot-service",
- "create user slingshot1 with password slingshot1",
- "create user slingshot2 with password slingshot2",
- "",
- "create path (sling:Folder) /content/slingshot",
- "create path (sling:Folder) /content/slingshot/users",
- "create path (sling:Folder) /content/slingshot/users/slingshot1",
- "create path (sling:Folder) /content/slingshot/users/slingshot2",
- "",
- "set ACL for slingshot-service",
- "allow jcr:read,rep:write on /content/slingshot",
- "end",
- "",
- "set ACL for slingshot1",
- "allow jcr:read,rep:write on /content/slingshot/users/slingshot1",
- "end",
- "",
- "set ACL for slingshot2",
- "allow jcr:read,rep:write on /content/slingshot/users/slingshot2",
- "end"
- ]
-}
\ No newline at end of file
diff --git a/sling/peregrine-builder-sling-12/src/main/features/base-repoinit.txt b/sling/peregrine-builder-sling-12/src/main/features/base-repoinit.txt
new file mode 100644
index 0000000000..dc4a7e8841
--- /dev/null
+++ b/sling/peregrine-builder-sling-12/src/main/features/base-repoinit.txt
@@ -0,0 +1,80 @@
+#
+# 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.
+#
+
+# general
+create path (sling:OrderedFolder) /content
+set ACL for everyone
+ allow jcr:read on /content
+end
+
+# sling-readall
+create service user sling-readall with path system/sling
+
+set principal ACL for sling-readall
+ allow jcr:read on /
+end
+
+# sling-xss
+create service user sling-xss with path system/sling
+
+create path (sling:Folder) /apps/sling/xss
+
+set principal ACL for sling-xss
+ allow jcr:read on /apps/sling/xss
+end
+
+# sling-jcr-install
+create service user sling-jcr-install with path system/sling
+
+# used for config OSGi writeback
+create path (sling:Folder) /apps/sling/install
+
+set principal ACL for sling-jcr-install
+ allow rep:write on /apps/sling/install
+end
+
+# content-package installer
+create service user sling-package-install with path system/sling
+
+set principal ACL for sling-package-install
+ allow jcr:all on /
+ allow jcr:namespaceManagement,jcr:nodeTypeDefinitionManagement on :repository
+end
+#<<< SLING-5848 - Define service user and ACLs for Scripting
+create service user sling-search-path-reader with path system/sling
+
+create path (sling:Folder) /libs
+create path (sling:Folder) /apps
+
+set principal ACL for sling-search-path-reader
+ allow jcr:read on /libs,/apps
+end
+# SLING-5848 - Define service user and ACLs for Scripting >>>
+#<<< SLING-9735 - Define service user and ACLs for jcr.contentloader
+create service user sling-jcr-content-loader with path system/sling
+set principal ACL for sling-jcr-content-loader
+ allow jcr:all on /
+end
+# SLING-9735 - Define service user and ACLs for jcr.contentloader >>>
+#<<< SLING-9809 - Define service user and ACLs for jcr.usermanager
+create service user sling-jcr-usermanager with path system/sling
+set principal ACL for sling-jcr-usermanager
+ allow jcr:read,jcr:readAccessControl,jcr:modifyAccessControl,rep:write,rep:userManagement on /home
+end
+# SLING-9809 - Define service user and ACLs for jcr.usermanager >>>
diff --git a/sling/peregrine-builder-sling-12/src/main/features/base.json b/sling/peregrine-builder-sling-12/src/main/features/base.json
index eb88b401d5..480c1f5afd 100644
--- a/sling/peregrine-builder-sling-12/src/main/features/base.json
+++ b/sling/peregrine-builder-sling-12/src/main/features/base.json
@@ -98,7 +98,7 @@
"start-order":"20"
},
{
- "id":"org.apache.sling:org.apache.sling.resourceresolver:1.6.16",
+ "id":"org.apache.sling:org.apache.sling.resourceresolver:1.7.0",
"start-order":"20"
},
{
@@ -114,11 +114,11 @@
"start-order":"20"
},
{
- "id":"org.apache.sling:org.apache.sling.servlets.resolver:2.7.8",
+ "id":"org.apache.sling:org.apache.sling.servlets.resolver:2.7.10",
"start-order":"20"
},
{
- "id":"org.apache.sling:org.apache.sling.xss:2.2.6",
+ "id":"org.apache.sling:org.apache.sling.xss:2.2.8",
"start-order":"20"
},
{
@@ -170,11 +170,11 @@
"start-order":"5"
},
{
- "id":"org.apache.sling:org.apache.sling.api:2.22.0",
+ "id":"org.apache.sling:org.apache.sling.api:2.23.0",
"start-order":"5"
},
{
- "id":"org.apache.sling:org.apache.sling.auth.core:1.4.8",
+ "id":"org.apache.sling:org.apache.sling.auth.core:1.5.0",
"start-order":"5"
},
{
@@ -226,7 +226,7 @@
"start-order":"20"
},
{
- "id":"org.apache.sling:org.apache.sling.jcr.repoinit:1.1.24",
+ "id":"org.apache.sling:org.apache.sling.jcr.repoinit:1.1.26",
"start-order":"20"
}
],
@@ -286,103 +286,58 @@
},
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~i18n":{
"user.mapping":[
- "org.apache.sling.i18n=sling-i18n"
+ "org.apache.sling.i18n=[sling-readall]"
]
},
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~installer-factories":{
"user.mapping":[
- "org.apache.sling.installer.factory.packages=sling-package-install"
+ "org.apache.sling.installer.factory.packages=[sling-package-install]"
]
},
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~jcr-install":{
"user.mapping":[
- "org.apache.sling.installer.provider.jcr=sling-jcr-install"
+ "org.apache.sling.installer.provider.jcr=[sling-readall,sling-jcr-install]"
]
},
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~jcr-resource":{
"user.mapping":[
- "org.apache.sling.jcr.resource:validation=sling-readall"
+ "org.apache.sling.jcr.resource:validation=[sling-readall]"
]
},
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~observation":{
"user.mapping":[
- "org.apache.sling.jcr.resource:observation=sling-readall"
+ "org.apache.sling.jcr.resource:observation=[sling-readall]"
]
},
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~resourceresolver":{
"user.mapping":[
- "org.apache.sling.resourceresolver:mapping=sling-mapping",
- "org.apache.sling.resourceresolver:hierarchy=sling-readall",
- "org.apache.sling.resourceresolver:observation=sling-readall",
- "org.apache.sling.resourceresolver:console=sling-readall"
+ "org.apache.sling.resourceresolver:mapping=[sling-readall]",
+ "org.apache.sling.resourceresolver:hierarchy=[sling-readall]",
+ "org.apache.sling.resourceresolver:observation=[sling-readall]",
+ "org.apache.sling.resourceresolver:console=[sling-readall]"
]
},
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~servletsresolver":{
"user.mapping":[
- "org.apache.sling.servlets.resolver:console=sling-readall",
- "org.apache.sling.servlets.resolver:scripts=sling-scripting"
+ "org.apache.sling.servlets.resolver:console=[sling-readall]",
+ "org.apache.sling.servlets.resolver:scripts=[sling-search-path-reader]"
]
},
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~xss":{
"user.mapping":[
- "org.apache.sling.xss=sling-xss"
+ "org.apache.sling.xss=[sling-xss]"
+ ]
+ },
+ "org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~jcr-usermanager":{
+ "user.mapping":[
+ "org.apache.sling.jcr.jackrabbit.usermanager=[sling-jcr-usermanager]"
+ ]
+ },
+ "org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~jcr-contentloader":{
+ "user.mapping":[
+ "org.apache.sling.jcr.contentloader=[sling-jcr-content-loader]"
]
}
},
- "repoinit:TEXT|true":[
- "# general",
- "create path (sling:OrderedFolder) /content",
- "set ACL for everyone",
- "allow jcr:read on /content",
- "end",
- "",
- "# sling-mapping",
- "create service user sling-mapping",
- "",
- "set ACL for sling-mapping",
- "allow jcr:read on /",
- "end",
- "",
- "# sling-readall",
- "create service user sling-readall",
- "",
- "set ACL for sling-readall",
- "allow jcr:read on /",
- "end",
- "",
- "# sling-xss",
- "create service user sling-xss",
- "",
- "create path (sling:Folder) /apps/sling/xss",
- "",
- "set ACL for sling-xss",
- "allow jcr:read on /apps/sling/xss",
- "end",
- "",
- "# sling-i18n",
- "create service user sling-i18n",
- "",
- "set ACL for sling-i18n",
- "allow jcr:read on /",
- "end",
- "",
- "# sling-jcr-install",
- "create service user sling-jcr-install",
- "",
- "# used for config OSGi writeback",
- "create path (sling:Folder) /apps/sling/install",
- "",
- "set ACL for sling-jcr-install",
- "allow jcr:read on /",
- "allow rep:write on /apps/sling/install",
- "end",
- "",
- "# content-package installer",
- "create service user sling-package-install",
- "",
- "set ACL for sling-package-install",
- "allow jcr:all on /",
- "allow jcr:namespaceManagement,jcr:nodeTypeDefinitionManagement on :repository",
- "end"
- ]
+ "repoinit:TEXT|true":"@file"
}
diff --git a/sling/peregrine-builder-sling-12/src/main/features/boot.json b/sling/peregrine-builder-sling-12/src/main/features/boot.json
index 2ca94b9791..1ffd439ad5 100644
--- a/sling/peregrine-builder-sling-12/src/main/features/boot.json
+++ b/sling/peregrine-builder-sling-12/src/main/features/boot.json
@@ -1,5 +1,8 @@
{
+ "variables": {
+ "sling.home": null
+ },
"bundles":[
{
"id":"org.apache.aries:org.apache.aries.util:1.1.3",
@@ -66,8 +69,12 @@
"start-order":"1"
},
{
- "id":"org.apache.sling:org.apache.sling.commons.osgi:2.4.0",
+ "id":"org.apache.felix:org.apache.felix.log:1.2.4",
"start-order":"1"
+ },
+ {
+ "id":"org.apache.sling:org.apache.sling.commons.osgi:2.4.0",
+ "start-order":"1"
},
{
"id":"org.apache.sling:org.apache.sling.installer.core:3.11.2",
@@ -86,7 +93,7 @@
"start-order":"1"
},
{
- "id":"org.apache.sling:org.apache.sling.settings:1.4.0",
+ "id":"org.apache.sling:org.apache.sling.settings:1.4.2",
"start-order":"1"
},
{
diff --git a/sling/peregrine-builder-sling-12/src/main/features/caconfig-repoinit.txt b/sling/peregrine-builder-sling-12/src/main/features/caconfig-repoinit.txt
new file mode 100644
index 0000000000..db8d2a5bb6
--- /dev/null
+++ b/sling/peregrine-builder-sling-12/src/main/features/caconfig-repoinit.txt
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+create path (sling:Folder) /conf
\ No newline at end of file
diff --git a/sling/peregrine-builder-sling-12/src/main/features/caconfig.json b/sling/peregrine-builder-sling-12/src/main/features/caconfig.json
index 36ac1531c1..8d3ff03989 100644
--- a/sling/peregrine-builder-sling-12/src/main/features/caconfig.json
+++ b/sling/peregrine-builder-sling-12/src/main/features/caconfig.json
@@ -1,4 +1,3 @@
-
{
"bundles":[
{
@@ -17,11 +16,9 @@
"configurations":{
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~sling-caconfig":{
"user.mapping":[
- "org.apache.sling.caconfig.impl=sling-readall"
+ "org.apache.sling.caconfig.impl=[sling-readall]"
]
}
},
- "repoinit:TEXT|true":[
- "create path (sling:Folder) /conf"
- ]
+ "repoinit:TEXT|true": "@file"
}
\ No newline at end of file
diff --git a/sling/peregrine-builder-sling-12/src/main/features/discovery-repoinit.txt b/sling/peregrine-builder-sling-12/src/main/features/discovery-repoinit.txt
new file mode 100644
index 0000000000..17b5f0f47c
--- /dev/null
+++ b/sling/peregrine-builder-sling-12/src/main/features/discovery-repoinit.txt
@@ -0,0 +1,27 @@
+#
+# 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.
+#
+
+create service user sling-discovery with path system/sling
+
+create path (sling:Folder) /var/discovery
+create path (sling:Folder) /var/discovery/oak
+
+set principal ACL for sling-discovery
+ allow jcr:read,rep:write on /var/discovery
+end
\ No newline at end of file
diff --git a/sling/peregrine-builder-sling-12/src/main/features/discovery.json b/sling/peregrine-builder-sling-12/src/main/features/discovery.json
index 52bf85fc79..76eadfae1f 100644
--- a/sling/peregrine-builder-sling-12/src/main/features/discovery.json
+++ b/sling/peregrine-builder-sling-12/src/main/features/discovery.json
@@ -25,20 +25,11 @@
"configurations":{
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~sling.discovery":{
"user.mapping":[
- "org.apache.sling.discovery.commons=sling-discovery",
- "org.apache.sling.discovery.base=sling-discovery",
- "org.apache.sling.discovery.oak=sling-discovery"
+ "org.apache.sling.discovery.commons=[sling-discovery]",
+ "org.apache.sling.discovery.base=[sling-discovery]",
+ "org.apache.sling.discovery.oak=[sling-discovery]"
]
}
},
- "repoinit:TEXT|true":[
- "create service user sling-discovery",
- "",
- "create path (sling:Folder) /var/discovery",
- "create path (sling:Folder) /var/discovery/oak",
- "",
- "set ACL for sling-discovery",
- "allow jcr:read,rep:write on /var/discovery",
- "end"
- ]
+ "repoinit:TEXT|true": "@file"
}
\ No newline at end of file
diff --git a/sling/peregrine-builder-sling-12/src/main/features/event-repoinit.txt b/sling/peregrine-builder-sling-12/src/main/features/event-repoinit.txt
new file mode 100644
index 0000000000..7ad7244649
--- /dev/null
+++ b/sling/peregrine-builder-sling-12/src/main/features/event-repoinit.txt
@@ -0,0 +1,27 @@
+#
+# 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.
+#
+
+create service user sling-event with path system/sling
+
+create path (sling:Folder) /var
+create path (sling:Folder) /var/eventing
+
+set principal ACL for sling-event
+ allow jcr:read,rep:write on /var/eventing
+end
\ No newline at end of file
diff --git a/sling/peregrine-builder-sling-12/src/main/features/event.json b/sling/peregrine-builder-sling-12/src/main/features/event.json
index 2d96d7d0fa..19d17d725d 100644
--- a/sling/peregrine-builder-sling-12/src/main/features/event.json
+++ b/sling/peregrine-builder-sling-12/src/main/features/event.json
@@ -13,19 +13,10 @@
"configurations":{
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~sling.event":{
"user.mapping":[
- "org.apache.sling.event=sling-event",
- "org.apache.sling.event.dea=sling-event"
+ "org.apache.sling.event=[sling-event]",
+ "org.apache.sling.event.dea=[sling-event]"
]
}
},
- "repoinit:TEXT|true":[
- "create service user sling-event",
- "",
- "create path (sling:Folder) /var",
- "create path (sling:Folder) /var/eventing",
- "",
- "set ACL for sling-event",
- "allow jcr:read,rep:write on /var/eventing",
- "end"
- ]
+ "repoinit:TEXT|true": "@file"
}
\ No newline at end of file
diff --git a/sling/peregrine-builder-sling-12/src/main/features/groovy.json b/sling/peregrine-builder-sling-12/src/main/features/groovy.json
new file mode 100644
index 0000000000..62cd7d245a
--- /dev/null
+++ b/sling/peregrine-builder-sling-12/src/main/features/groovy.json
@@ -0,0 +1,116 @@
+{
+ "bundles": [
+ {
+ "id": "org.ow2.asm:asm:${asm.version}",
+ "start-order": "15"
+ },
+ {
+ "id": "org.ow2.asm:asm-analysis:${asm.version}",
+ "start-order": "15"
+ },
+ {
+ "id": "org.ow2.asm:asm-commons:${asm.version}",
+ "start-order": "15"
+ },
+ {
+ "id": "org.ow2.asm:asm-tree:${asm.version}",
+ "start-order": "15"
+ },
+ {
+ "id": "org.ow2.asm:asm-util:${asm.version}",
+ "start-order": "15"
+ },
+ {
+ "id": "org.apache.aries.spifly:org.apache.aries.spifly.dynamic.bundle:1.3.2",
+ "start-order": "15"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-ant:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-astbuilder:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-cli-picocli:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-console:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-datetime:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-docgenerator:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-groovydoc:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-groovysh:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-jmx:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-json:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-jsr223:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-macro:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-nio:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-servlet:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-sql:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-swing:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-templates:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-test:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-test-junit5:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-testng:${groovy.version}",
+ "start-order": "20"
+ },
+ {
+ "id": "org.codehaus.groovy:groovy-xml:${groovy.version}",
+ "start-order": "20"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/sling/peregrine-builder-sling-12/src/main/features/oak/oak_base.json b/sling/peregrine-builder-sling-12/src/main/features/oak/oak_base.json
index 00f9795f29..ccdb74089b 100644
--- a/sling/peregrine-builder-sling-12/src/main/features/oak/oak_base.json
+++ b/sling/peregrine-builder-sling-12/src/main/features/oak/oak_base.json
@@ -98,7 +98,7 @@
"start-order":"15"
},
{
- "id":"org.apache.sling:org.apache.sling.jcr.base:3.1.4",
+ "id":"org.apache.sling:org.apache.sling.jcr.base:3.1.6",
"start-order":"15"
},
{
@@ -118,7 +118,7 @@
"start-order":"15"
},
{
- "id":"org.apache.sling:org.apache.sling.jcr.oak.server:1.2.4",
+ "id":"org.apache.sling:org.apache.sling.jcr.oak.server:1.2.10",
"start-order":"16"
},
{
@@ -134,15 +134,15 @@
"start-order":"20"
},
{
- "id":"org.apache.sling:org.apache.sling.jcr.contentloader:2.3.0",
+ "id":"org.apache.sling:org.apache.sling.jcr.contentloader:2.4.0",
"start-order":"20"
},
{
- "id":"org.apache.sling:org.apache.sling.jcr.jackrabbit.accessmanager:3.0.6",
+ "id":"org.apache.sling:org.apache.sling.jcr.jackrabbit.accessmanager:3.0.8",
"start-order":"20"
},
{
- "id":"org.apache.sling:org.apache.sling.jcr.jackrabbit.usermanager:2.2.10",
+ "id":"org.apache.sling:org.apache.sling.jcr.jackrabbit.usermanager:2.2.12",
"start-order":"20"
}
],
diff --git a/sling/peregrine-builder-sling-12/src/main/features/scripting.json b/sling/peregrine-builder-sling-12/src/main/features/scripting.json
index 45c420500f..210b145958 100644
--- a/sling/peregrine-builder-sling-12/src/main/features/scripting.json
+++ b/sling/peregrine-builder-sling-12/src/main/features/scripting.json
@@ -14,7 +14,7 @@
"start-order":"20"
},
{
- "id":"org.apache.sling:org.apache.sling.scripting.core:2.3.2",
+ "id":"org.apache.sling:org.apache.sling.scripting.core:2.3.4",
"start-order":"20"
},
{
@@ -22,7 +22,7 @@
"start-order":"20"
},
{
- "id":"org.apache.sling:org.apache.sling.scripting.javascript:3.1.2",
+ "id":"org.apache.sling:org.apache.sling.scripting.javascript:3.1.4",
"start-order":"20"
},
{
@@ -38,15 +38,15 @@
"start-order":"20"
},
{
- "id":"org.apache.sling:org.apache.sling.scripting.sightly.compiler.java:1.2.0-1.4.0",
+ "id":"org.apache.sling:org.apache.sling.scripting.sightly.compiler.java:1.2.2-1.4.0",
"start-order":"20"
},
{
- "id":"org.apache.sling:org.apache.sling.scripting.sightly.compiler:1.2.6-1.4.0",
+ "id":"org.apache.sling:org.apache.sling.scripting.sightly.compiler:1.2.8-1.4.0",
"start-order":"20"
},
{
- "id":"org.apache.sling:org.apache.sling.scripting.sightly.js.provider:1.2.0",
+ "id":"org.apache.sling:org.apache.sling.scripting.sightly.js.provider:1.2.6",
"start-order":"20"
},
{
@@ -54,11 +54,43 @@
"start-order":"20"
},
{
- "id":"org.apache.sling:org.apache.sling.scripting.sightly.runtime:1.2.2-1.4.0",
+ "id":"org.apache.sling:org.apache.sling.scripting.sightly.runtime:1.2.4-1.4.0",
"start-order":"20"
},
{
- "id":"org.apache.sling:org.apache.sling.scripting.sightly:1.4.2-1.4.0",
+ "id":"org.apache.sling:org.apache.sling.scripting.sightly:1.4.4-1.4.0",
+ "start-order":"20"
+ },
+ {
+ "id":"org.apache.sling:org.apache.sling.scripting.freemarker:1.0.4",
+ "start-order":"20"
+ },
+ {
+ "id": "org.freemarker:freemarker:2.3.30",
+ "start-order": "20"
+ },
+ {
+ "id":"org.apache.sling:org.apache.sling.scripting.thymeleaf:2.0.2",
+ "start-order":"20"
+ },
+ {
+ "id":"org.apache.servicemix.bundles:org.apache.servicemix.bundles.thymeleaf:3.0.11.RELEASE_1",
+ "start-order":"20"
+ },
+ {
+ "id":"org.attoparser:attoparser:2.0.5.RELEASE",
+ "start-order":"20"
+ },
+ {
+ "id":"org.unbescape:unbescape:1.1.6.RELEASE",
+ "start-order":"20"
+ },
+ {
+ "id":"org.apache.servicemix.bundles:org.apache.servicemix.bundles.ognl:3.2.1_1",
+ "start-order":"20"
+ },
+ {
+ "id":"org.javassist:javassist:3.27.0-GA",
"start-order":"20"
}
],
@@ -70,22 +102,10 @@
},
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~scripting":{
"user.mapping":[
- "org.apache.sling.scripting.core=sling-scripting",
- "org.apache.sling.scripting.sightly.js.provider=sling-scripting"
+ "org.apache.sling.scripting.core=[sling-search-path-reader]",
+ "org.apache.sling.scripting.sightly.js.provider=[sling-search-path-reader]",
+ "org.apache.sling.scripting.thymeleaf=[sling-search-path-reader]"
]
}
- },
- "repoinit:TEXT|true":[
- "#<<< SLING-5848 - Define service user and ACLs for Scripting",
- "create service user sling-scripting",
- "",
- "create path (sling:Folder) /libs",
- "create path (sling:Folder) /apps",
- "",
- "set ACL for sling-scripting",
- "deny jcr:all on /",
- "allow jcr:read on /libs,/apps",
- "end",
- "# SLING-5848 - Define service user and ACLs for Scripting >>>"
- ]
+ }
}
diff --git a/sling/peregrine-builder-sling-12/src/main/features/validation.json b/sling/peregrine-builder-sling-12/src/main/features/validation.json
index 4fac69abfd..d9598e5975 100644
--- a/sling/peregrine-builder-sling-12/src/main/features/validation.json
+++ b/sling/peregrine-builder-sling-12/src/main/features/validation.json
@@ -17,19 +17,8 @@
"configurations":{
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~validation":{
"user.mapping":[
- "org.apache.sling.validation.core=sling-validation"
+ "org.apache.sling.validation.core=[sling-search-path-reader]"
]
}
- },
- "repoinit:TEXT|true":[
- "create service user sling-validation",
- "",
- "create path (sling:Folder) /apps",
- "create path (sling:Folder) /libs",
- "",
- "set ACL for sling-validation",
- "allow jcr:read on /apps",
- "allow jcr:read on /libs",
- "end"
- ]
+ }
}
\ No newline at end of file
diff --git a/sling/peregrine-builder-sling-12/src/main/features/webconsole.json b/sling/peregrine-builder-sling-12/src/main/features/webconsole.json
index 06156c5457..6b296854cf 100644
--- a/sling/peregrine-builder-sling-12/src/main/features/webconsole.json
+++ b/sling/peregrine-builder-sling-12/src/main/features/webconsole.json
@@ -41,7 +41,7 @@
"start-order":"15"
},
{
- "id":"org.apache.sling:org.apache.sling.jcr.webconsole:1.0.2",
+ "id":"org.apache.sling:org.apache.sling.jcr.webconsole:1.1.0",
"start-order":"15"
},
{
diff --git a/sling/peregrine-builder-sling-12/src/test/java/org/apache/sling/launchpad/SmokeIT.java b/sling/peregrine-builder-sling-12/src/test/java/org/apache/sling/launchpad/SmokeIT.java
index 71676dcc9a..26381fc471 100644
--- a/sling/peregrine-builder-sling-12/src/test/java/org/apache/sling/launchpad/SmokeIT.java
+++ b/sling/peregrine-builder-sling-12/src/test/java/org/apache/sling/launchpad/SmokeIT.java
@@ -52,11 +52,11 @@
public class SmokeIT {
- private static final int LAUNCHPAD_PORT = Integer.getInteger("launchpad.http.port", 8080);
- private static final int EXPECTED_BUNDLES_COUNT = Integer.getInteger("IT.expected.bundles.count", Integer.MAX_VALUE);
+ private static final int STARTER_HTTP_PORT = Integer.getInteger("starter.http.port", 8080);
+ private static final int STARTER_MIN_BUNDLES_COUNT = Integer.getInteger("starter.min.bundles.count", Integer.MAX_VALUE);
@ClassRule
- public static LaunchpadReadyRule LAUNCHPAD = new LaunchpadReadyRule(LAUNCHPAD_PORT);
+ public static StarterReadyRule LAUNCHPAD = new StarterReadyRule(STARTER_HTTP_PORT);
private HttpClientContext httpClientContext;
@Before
@@ -64,11 +64,11 @@ public void prepareHttpContext() {
CredentialsProvider credsProvider = new BasicCredentialsProvider();
UsernamePasswordCredentials creds = new UsernamePasswordCredentials("admin", "admin");
- credsProvider.setCredentials(new AuthScope("localhost", LAUNCHPAD_PORT), creds);
+ credsProvider.setCredentials(new AuthScope("localhost", STARTER_HTTP_PORT), creds);
BasicAuthCache authCache = new BasicAuthCache();
BasicScheme basicAuth = new BasicScheme();
- authCache.put(new HttpHost("localhost", LAUNCHPAD_PORT, "http"), basicAuth);
+ authCache.put(new HttpHost("localhost", STARTER_HTTP_PORT, "http"), basicAuth);
httpClientContext = HttpClientContext.create();
httpClientContext.setCredentialsProvider(credsProvider);
@@ -87,7 +87,7 @@ public void verifyAllBundlesStarted() throws Exception {
try ( CloseableHttpClient client = newClient() ) {
- HttpGet get = new HttpGet("http://localhost:" + LAUNCHPAD_PORT + "/system/console/bundles.json");
+ HttpGet get = new HttpGet("http://localhost:" + STARTER_HTTP_PORT + "/system/console/bundles.json");
// pass the context to ensure preemptive basic auth is used
// https://hc.apache.org/httpcomponents-client-ga/tutorial/html/authentication.html
@@ -107,8 +107,8 @@ public void verifyAllBundlesStarted() throws Exception {
@SuppressWarnings("unchecked")
List bundles = (List) obj.get("data");
- if(bundles.size() < EXPECTED_BUNDLES_COUNT) {
- fail("Expected at least " + EXPECTED_BUNDLES_COUNT + " bundles, got " + bundles.size());
+ if(bundles.size() < STARTER_MIN_BUNDLES_COUNT) {
+ fail("Expected at least " + STARTER_MIN_BUNDLES_COUNT + " bundles, got " + bundles.size());
}
BundleStatus bs = new BundleStatus(status);
@@ -148,7 +148,7 @@ public void verifyAllBundlesStarted() throws Exception {
public void ensureRepositoryIsStarted() throws Exception {
try ( CloseableHttpClient client = newClient() ) {
- HttpGet get = new HttpGet("http://localhost:" + LAUNCHPAD_PORT + "/server/default/jcr:root/content");
+ HttpGet get = new HttpGet("http://localhost:" + STARTER_HTTP_PORT + "/server/default/jcr:root/content");
try ( CloseableHttpResponse response = client.execute(get) ) {
diff --git a/sling/peregrine-builder-sling-12/src/test/java/org/apache/sling/launchpad/LaunchpadReadyRule.java b/sling/peregrine-builder-sling-12/src/test/java/org/apache/sling/launchpad/StarterReadyRule.java
similarity index 75%
rename from sling/peregrine-builder-sling-12/src/test/java/org/apache/sling/launchpad/LaunchpadReadyRule.java
rename to sling/peregrine-builder-sling-12/src/test/java/org/apache/sling/launchpad/StarterReadyRule.java
index d6b6d6fd12..c9cb8b7142 100644
--- a/sling/peregrine-builder-sling-12/src/test/java/org/apache/sling/launchpad/LaunchpadReadyRule.java
+++ b/sling/peregrine-builder-sling-12/src/test/java/org/apache/sling/launchpad/StarterReadyRule.java
@@ -29,33 +29,33 @@
import org.apache.http.impl.client.HttpClients;
import org.junit.rules.ExternalResource;
-public class LaunchpadReadyRule extends ExternalResource {
+public class StarterReadyRule extends ExternalResource {
private static final int TRIES = 60;
private static final int WAIT_BETWEEN_TRIES_MILLIS = 1000;
private final List checks = new ArrayList<>();
- public LaunchpadReadyRule(int launchpadPort) {
+ public StarterReadyRule(int launchpadPort) {
checks.add(new Check("http://localhost:" + launchpadPort + "/server/default/jcr:root/content"));
- checks.add(new Check("http://localhost:" + launchpadPort + "/content/starter.html") {
- @Override
- public String runCheck(HttpResponse response) throws Exception {
- try (InputStreamReader isr = new InputStreamReader(response.getEntity().getContent());
- BufferedReader reader = new BufferedReader(isr)) {
-
- String line;
- while ((line = reader.readLine()) != null) {
- if (line.contains("Do not remove this comment, used for Starter integration tests")) {
- return null;
- }
- }
- }
-
- return "Did not find 'ready' marker in the response body";
- }
- });
+ // checks.add(new Check("http://localhost:" + launchpadPort + "/content/starter.html") {
+ // @Override
+ // public String runCheck(HttpResponse response) throws Exception {
+ // try (InputStreamReader isr = new InputStreamReader(response.getEntity().getContent());
+ // BufferedReader reader = new BufferedReader(isr)) {
+
+ // String line;
+ // while ((line = reader.readLine()) != null) {
+ // if (line.contains("Do not remove this comment, used for Starter integration tests")) {
+ // return null;
+ // }
+ // }
+ // }
+
+ // return "Did not find 'ready' marker in the response body";
+ // }
+ // });
}
@Override
@@ -93,7 +93,7 @@ private void runCheck(CloseableHttpClient client, Check check) throws Exception
Thread.sleep(WAIT_BETWEEN_TRIES_MILLIS);
}
- throw new RuntimeException(String.format("Launchpad not ready. Failed check for URL %s with message '%s'",
+ throw new RuntimeException(String.format("Starter not ready. Failed check for URL %s with message '%s'",
check.getUrl(), lastFailure));
}
diff --git a/slingjunit.parent/core/pom.xml b/slingjunit.parent/core/pom.xml
index b861fd5b12..40e2a3d934 100644
--- a/slingjunit.parent/core/pom.xml
+++ b/slingjunit.parent/core/pom.xml
@@ -36,6 +36,7 @@
+
org.apache.sling
org.apache.sling.junit.core
@@ -46,6 +47,7 @@
junit
provided
+
${project.groupId}
admin.core
@@ -65,38 +67,47 @@
provided
- org.slf4j
- slf4j-api
+ ${project.groupId}
+ pagerender-server.core
+ ${project.version}
provided
+
+
- guava
- com.google.guava
- provided
+ org.apache.sling
+ org.apache.sling.api
- org.apache.jackrabbit
- jackrabbit-jcr-commons
+ org.apache.sling
+ org.apache.sling.scripting.sightly.compiler.java
org.apache.sling
- org.apache.sling.api
+ org.apache.sling.servlet-helpers
- javax.jcr
- jcr
+ org.apache.sling
+ org.apache.sling.models.api
org.apache.sling
org.apache.sling.settings
+
+
- org.osgi
- osgi.annotation
+ javax.jcr
+ jcr
- org.osgi
- org.osgi.service.component.annotations
+ org.apache.jackrabbit
+ jackrabbit-jcr-commons
+
+
+ org.apache.jackrabbit
+ oak-core-spi
+ 1.32.0
org.apache.jackrabbit
@@ -114,20 +125,43 @@
3.0.4
provided
+
+
org.osgi
org.osgi.compendium
+
+ org.osgi
+ org.osgi.core
+ provided
+
+
+ org.osgi
+ osgi.annotation
+
+
+ org.osgi
+ org.osgi.service.component.annotations
+
+
+
+
+ org.slf4j
+ slf4j-api
+ provided
+
+
+ guava
+ com.google.guava
+ provided
+
org.apache.httpcomponents
httpclient
4.5.12
-
- org.apache.jackrabbit
- oak-core-spi
- 1.32.0
-
+
diff --git a/slingjunit.parent/core/src/main/java/com/peregrine/slingjunit/AdaptionJTest.java b/slingjunit.parent/core/src/main/java/com/peregrine/slingjunit/AdaptionJTest.java
new file mode 100644
index 0000000000..e074502241
--- /dev/null
+++ b/slingjunit.parent/core/src/main/java/com/peregrine/slingjunit/AdaptionJTest.java
@@ -0,0 +1,299 @@
+package com.peregrine.slingjunit;
+
+import com.peregrine.adaption.PerAsset;
+import com.peregrine.adaption.PerPage;
+import com.peregrine.nodetypes.merge.PageMerge;
+import com.peregrine.pagerender.server.models.Container;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceResolverFactory;
+import org.apache.sling.api.resource.ResourceUtil;
+import org.apache.sling.junit.annotations.SlingAnnotationsTestRunner;
+import org.apache.sling.junit.annotations.TestReference;
+import org.apache.sling.models.factory.ModelFactory;
+import org.apache.sling.servlethelpers.MockSlingHttpServletRequest;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.NodeType;
+import javax.script.SimpleBindings;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import static com.peregrine.commons.util.PerConstants.NT_UNSTRUCTURED;
+import static junit.framework.TestCase.assertNotNull;
+import static org.apache.sling.api.resource.Resource.RESOURCE_TYPE_NON_EXISTING;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+/**
+ * Run test using this URL
+ * http://localhost:8080/system/sling/junit/com.peregrine.slingjunit.AdaptionJTest.html
+ *
+ */
+@RunWith(SlingAnnotationsTestRunner.class)
+public class AdaptionJTest {
+ private static String CONTACT_PAGE_PATH = "/content/example/pages/contact";
+ private static String ASSET_EXAMPLE = "/content/example/assets/images/logo.png";
+ private static String OBJECT_EXAMPLE = "/content/example/objects/sample";
+ private static String TEMPLATE_EXAMPLE = "/content/example/templates/base";
+
+ private MockSlingHttpServletRequest request;
+ private Resource resource;
+ private SimpleBindings bindings;
+ @TestReference
+ private ResourceResolverFactory resolverFactory;
+ private ResourceResolver resourceResolver;
+
+ @TestReference
+ private ModelFactory modelFactory;
+
+ @Test
+ public void getSiteFromPage(){
+ assertNotNull(resourceResolver);
+ resource = resourceResolver.getResource(CONTACT_PAGE_PATH);
+ assertFalse( ResourceUtil.isNonExistingResource(resource));
+ PerPage page = resource.adaptTo(PerPage.class);
+ assertNotNull(page);
+ assertSiteResource(page.getSiteResource());
+ }
+
+ @Test
+ public void getSiteFromAsset(){
+ resource = resourceResolver.getResource(ASSET_EXAMPLE);
+ assertFalse( ResourceUtil.isNonExistingResource(resource));
+ PerAsset asset = resource.adaptTo(PerAsset.class);
+ assertNotNull(asset);
+ assertSiteResource(asset.getSiteResource());
+ }
+
+ private void assertSiteResource(Resource tenantRes){
+ assertNotNull(tenantRes);
+ Node tenantNode = tenantRes.adaptTo(Node.class);
+ try {
+ NodeType nt = tenantNode.getPrimaryNodeType();
+ assertEquals("per:Site", nt.getName());
+ } catch (RepositoryException e) {
+ fail("Could not get tenant nodetype");
+ }
+ }
+
+ @Test
+ public void getSiteFromTemplate(){
+ assertNotNull(resourceResolver);
+ resource = resourceResolver.getResource(TEMPLATE_EXAMPLE);
+ assertFalse( ResourceUtil.isNonExistingResource(resource));
+ PerPage template = resource.adaptTo(PerPage.class);
+ assertNotNull(template);
+ assertSiteResource(template.getSiteResource());
+ }
+
+ /**
+ * Server Side Rendering SSR Page Merge Scenario 1
+ *
+ * Template has structural components (nav and footer) no containers
+ * Page has content container with children
+ *
+ * Template: /content/example/templates/base/
+ * _jcr_content/nav
+ * _jcr_content/footer
+ *
+ * Page: /content/example/pages/contact/
+ * _jcr_content/nfceefd40-b802-4203-8147-9cb2b2c78c6b
+ * _jcr_content/n3736dc36-9cc3-49d7-a7d4-bf4d94e0ea2f
+ * n8680c077-cc22-40d3-8989-d86d832a85d1
+ *
+ * Resulting Page Merge
+ * /content/example/templates/base/_jcr_content/nav
+ * /content/example/templates/base/_jcr_content/footer
+ * /content/example/pages/contact/_jcr_content/nfceefd40-b802-4203-8147-9cb2b2c78c6b
+ * /content/example/pages/contact/_jcr_content/n3736dc36-9cc3-49d7-a7d4-bf4d94e0ea2f
+ * /content/example/pages/contact/_jcr_content/n3736dc36-9cc3-49d7-a7d4-bf4d94e0ea2f/n8680c077-cc22-40d3-8989-d86d832a85d1
+ *
+ */
+ @Test
+ public void ssrPageMergeScenario1(){
+ resource = resourceResolver.getResource(CONTACT_PAGE_PATH);
+ List resourcePaths = new ArrayList<>();
+ resourcePaths.add("/content/example/templates/base/jcr:content/nav");
+ resourcePaths.add("/content/example/templates/base/jcr:content/footer");
+ resourcePaths.add("/content/example/pages/contact/jcr:content/nfceefd40-b802-4203-8147-9cb2b2c78c6b");
+ resourcePaths.add("/content/example/pages/contact/jcr:content/n3736dc36-9cc3-49d7-a7d4-bf4d94e0ea2f");
+// Note: children of containers are not included in the resource list.
+// /content/example/pages/contact/jcr:content/n3736dc36-9cc3-49d7-a7d4-bf4d94e0ea2f/n8680c077-cc22-40d3-8989-d86d832a85d1
+// resources inside containers are rendered when the container is rendered, when it lists all children
+ bindings.put("resource", resource);
+ PageMerge pageMerge = new PageMerge();
+ pageMerge.init(bindings);
+ List actualResources = pageMerge.getMergedResources();
+ assertEquals(resourcePaths.size(), actualResources.size());
+ List actualResourcePaths = actualResources.stream()
+ .map(Resource::getPath)
+ .collect(Collectors.toList());
+ assertTrue(actualResourcePaths.containsAll(resourcePaths));
+ assertTrue(resourcePaths.containsAll(actualResourcePaths));
+ }
+
+ /**
+ *
+ ssrPageMergeScenario2 test pages based on a sub-template
+
+ parent-template: /content/example/templates/base
+ sub-template: /content/example/templates/base/sub-template
+ page: /content/example/pages/sub-template-page
+ Passes if the $page has content resources inherited from the $parent-template
+ */
+ @Test
+ public void ssrPageMergeScenario2(){
+ resource = resourceResolver.getResource("/content/example/pages/sub-template-page");
+ // set up expected resource list
+ List resourcePaths = new ArrayList<>();
+ resourcePaths.add("/content/example/templates/base/jcr:content/nav");
+ resourcePaths.add("/content/example/templates/base/jcr:content/footer");
+ resourcePaths.add("/content/example/pages/sub-template-page/jcr:content/container");
+ bindings.put("resource", resource);
+ PageMerge pageMerge = new PageMerge();
+ pageMerge.init(bindings);
+ // run test
+ List actualResources = pageMerge.getMergedResources();
+ assertEquals(resourcePaths.size(), actualResources.size());
+ List actualResourcePaths = actualResources.stream()
+ .map(Resource::getPath)
+ .collect(Collectors.toList());
+ assertTrue(actualResourcePaths.containsAll(resourcePaths));
+ assertTrue(resourcePaths.containsAll(actualResourcePaths));
+ }
+
+ /**
+ *
+ ssrPageMergeScenario3 templates with content containers
+
+ template: /content/pagerenderserver/templates/base
+ page: /content/pagerenderserver/pages/index
+ Passes if List actualResources has
+ content resources inherited from the $template
+ content resources from the $page
+ overrides template content with page content if their relative paths are the same
+ */
+ @Test
+ public void ssrPageMergeScenario3(){
+ // set up expected resource list
+ resource = resourceResolver.getResource("/content/pagerenderserver/pages/index");
+ List resourcePaths = new ArrayList<>();
+ resourcePaths.add("/content/pagerenderserver/templates/base/jcr:content/base");
+ resourcePaths.add("/content/pagerenderserver/pages/index/jcr:content/content");
+ bindings.put("resource", resource);
+ PageMerge pageMerge = new PageMerge();
+ pageMerge.init(bindings);
+
+ // run page merge test
+ List actualResources = pageMerge.getMergedResources();
+ assertEquals(resourcePaths.size(), actualResources.size());
+ List actualResourcePaths = actualResources.stream()
+ .map(Resource::getPath)
+ .collect(Collectors.toList());
+ assertTrue(actualResourcePaths.containsAll(resourcePaths));
+ assertTrue(resourcePaths.containsAll(actualResourcePaths));
+
+ // run container merge test
+ Resource containerRes = resourceResolver.getResource("/content/pagerenderserver/pages/index/jcr:content/content");
+ List containerPaths = new ArrayList<>();
+ containerPaths.add("/content/pagerenderserver/templates/base/jcr:content/content/text");
+ containerPaths.add("/content/pagerenderserver/templates/base/jcr:content/content/text1");
+ containerPaths.add("/content/pagerenderserver/pages/index/jcr:content/content/text1");
+ containerPaths.add("/content/pagerenderserver/pages/index/jcr:content/content/text2");
+ Container containerModel = containerRes.adaptTo(Container.class);
+ assertNotNull(containerModel);
+ List combinedResources = containerModel.getCombinedResources();
+ List actualCombinedPaths = combinedResources.stream()
+ .map(Resource::getPath)
+ .collect(Collectors.toList());
+ assertEquals(containerPaths.size(), actualCombinedPaths.size());
+ assertTrue(containerPaths.containsAll(actualCombinedPaths));
+ }
+
+ /**
+ *
+ ssrPageMergeScenario4 new page should have template content, and content containers for authoring
+ template: /content/pagerenderserver/templates/base
+ page: /content/pagerenderserver/pages/new-empty
+ *
+ */
+ @Test
+ public void ssrPageMergeScenario4(){
+ // set up expected resource list
+ resource = resourceResolver.getResource("/content/pagerenderserver/pages/new-empty");
+ List resourcePaths = new ArrayList<>();
+ resourcePaths.add("/content/pagerenderserver/templates/base/jcr:content/base");
+ resourcePaths.add("/content/pagerenderserver/templates/base/jcr:content/content");
+ // set PageMerge object to test
+ bindings.put("resource", resource);
+ PageMerge pageMerge = new PageMerge();
+ pageMerge.init(bindings);
+ // run page merge test
+ List actualResources = pageMerge.getMergedResources();
+ assertEquals(resourcePaths.size(), actualResources.size());
+ }
+
+ /**
+ *
+ ssrPageMergeScenario5
+ Test intermediate resources such that a template is configured with an empty container for authoring page
+ An author drops a component into the container from a page. The container resource type defined by the template should define the
+ rendering even though the container's intermediate path within the page's content has no resource type
+ template/jcr:content/container (sling:resourceType)
+ page/jcr:content/container (only nt:unstructured)
+
+ template: /content/pagerenderserver/templates/empty-container
+ page: /content/pagerenderserver/pages/non-empty-container
+ *
+ */
+ @Test
+ public void ssrPageMergeScenario5(){
+ // set up expected resource list
+ resource = resourceResolver.getResource("/content/pagerenderserver/pages/non-empty-container");
+ List resourcePaths = new ArrayList<>();
+ resourcePaths.add("/content/pagerenderserver/pages/non-empty-container/jcr:content/content");
+ // set PageMerge object to test
+ bindings.put("resource", resource);
+ PageMerge pageMerge = new PageMerge();
+ pageMerge.init(bindings);
+ // run page merge test
+ List actualResources = pageMerge.getMergedResources();
+ assertEquals(resourcePaths.size(), actualResources.size());
+
+ // test intermediate container (nt:unstructured)
+ resource = resourceResolver.getResource("/content/pagerenderserver/pages/non-empty-container/jcr:content/content");
+ assertTrue(resource.getResourceType().equals(NT_UNSTRUCTURED));
+ Container containerRes = resource.adaptTo(Container.class);
+ assertNotNull(containerRes);
+ assertEquals(1, containerRes.getCombinedResources().size());
+ assertEquals("/content/pagerenderserver/pages/non-empty-container/jcr:content/content/text1",
+ containerRes.getCombinedResources().get(0).getPath());
+ assertEquals("12", containerRes.getCombinedProperties().get("mobilecolspan", String.class));
+ }
+
+
+ @Before
+ public void setUp() throws Exception {
+ resourceResolver = resolverFactory.getAdministrativeResourceResolver(null);
+ request = new MockSlingHttpServletRequest(resourceResolver);
+ bindings = new SimpleBindings();
+ bindings.put("request", request);
+ bindings.put("modelFactory", modelFactory);
+ bindings.put("resolver", resourceResolver);
+ }
+
+ @After
+ public void cleanup() {
+ resource = null;
+ resourceResolver.close();
+ }
+}
diff --git a/slingjunit.parent/ui.apps/src/main/content/META-INF/vault/filter.xml b/slingjunit.parent/ui.apps/src/main/content/META-INF/vault/filter.xml
index fb9c67d675..35d60bae00 100644
--- a/slingjunit.parent/ui.apps/src/main/content/META-INF/vault/filter.xml
+++ b/slingjunit.parent/ui.apps/src/main/content/META-INF/vault/filter.xml
@@ -26,8 +26,10 @@
-
-
-
+
+
+
+
+
diff --git a/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/pages/manifest.json b/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/pages/manifest.json
deleted file mode 100644
index b4fce57b21..0000000000
--- a/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/pages/manifest.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "short_name": "pcms example",
- "name": "peregrine cms example site",
- "display": "fullscreen",
- "theme_color": "#c0c0c0",
- "background_color": "#ffffff",
- "icons": [
- {
- "src": "/etc/felibs/examplesite/images/launcher-icon-1x.png",
- "type": "image/png",
- "sizes": "48x48"
- },
- {
- "src": "/etc/felibs/examplesite/images/launcher-icon-2x.png",
- "type": "image/png",
- "sizes": "96x96"
- },
- {
- "src": "/etc/felibs/examplesite/images/launcher-icon-4x.png",
- "type": "image/png",
- "sizes": "192x192"
- },
- {
- "src": "/etc/felibs/examplesite/images/launcher-icon-4x.png",
- "type": "image/png",
- "sizes": "512x512"
- }
- ],
- "start_url": "/content/example/pages/index.html"
-}
\ No newline at end of file
diff --git a/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/pages/serviceworker.js b/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/pages/serviceworker.js
deleted file mode 100644
index 45a9a5a400..0000000000
--- a/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/pages/serviceworker.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-
- * #%L
- * example site - UI Apps
- * %%
- * Copyright (C) 2017 headwire inc.
- * %%
- * 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.
- * #L%
- */
-var CACHE_NAME = 'my-site-cache-v1';
-var urlsToCache = [
- '/content/example/pages/index.html',
- '/content/example/pages/index.html?launcher=true'
-];
-
-self.addEventListener('install', function(event) {
- // Perform install steps
- event.waitUntil(
- caches.open(CACHE_NAME)
- .then(function(cache) {
- console.log('Opened cache');
- console.log('cache for', urlsToCache)
- return cache.addAll(urlsToCache);
- })
- );
-});
-
-self.addEventListener('fetch', function(event) {
- event.respondWith(
- caches.match(event.request)
- .then(function(response) {
- console.log('request for',event.request)
-
- // Cache hit - return response
- if (response) {
- return response;
- }
-
- // IMPORTANT: Clone the request. A request is a stream and
- // can only be consumed once. Since we are consuming this
- // once by cache and once by the browser for fetch, we need
- // to clone the response.
- var fetchRequest = event.request.clone();
-
- return fetch(fetchRequest).then(
- function(response) {
- // Check if we received a valid response
- if(!response || response.status !== 200 || response.type !== 'basic') {
- return response;
- }
-
- // IMPORTANT: Clone the response. A response is a stream
- // and because we want the browser to consume the response
- // as well as the cache consuming the response, we need
- // to clone it so we have two streams.
- var responseToCache = response.clone();
-
- caches.open(CACHE_NAME)
- .then(function(cache) {
- cache.put(event.request, responseToCache);
- });
-
- return response;
- }
- );
- })
-
- );
-});
diff --git a/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/pages/sub-template-container-page/.content.xml b/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/pages/sub-template-container-page/.content.xml
new file mode 100644
index 0000000000..a323228d89
--- /dev/null
+++ b/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/pages/sub-template-container-page/.content.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/pages/sub-template-page/.content.xml b/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/pages/sub-template-page/.content.xml
new file mode 100644
index 0000000000..52b26d5688
--- /dev/null
+++ b/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/pages/sub-template-page/.content.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/templates/base/sub-template-container/.content.xml b/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/templates/base/sub-template-container/.content.xml
new file mode 100644
index 0000000000..9d6b63161e
--- /dev/null
+++ b/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/templates/base/sub-template-container/.content.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/templates/base/sub-template/.content.xml b/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/templates/base/sub-template/.content.xml
new file mode 100644
index 0000000000..c037322ccf
--- /dev/null
+++ b/slingjunit.parent/ui.apps/src/main/content/jcr_root/content/example/templates/base/sub-template/.content.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
\ No newline at end of file