diff --git a/admin-base/pom.xml b/admin-base/pom.xml index e3307413cf..3a40ce1681 100644 --- a/admin-base/pom.xml +++ b/admin-base/pom.xml @@ -69,9 +69,9 @@ + sling.ui.apps core materialize ui.apps - sling.ui.apps \ No newline at end of file diff --git a/admin-base/ui.apps/src/main/content/jcr_root/apps/admin/components/contentview/template.vue b/admin-base/ui.apps/src/main/content/jcr_root/apps/admin/components/contentview/template.vue index 4267bc3989..71c0f4d435 100644 --- a/admin-base/ui.apps/src/main/content/jcr_root/apps/admin/components/contentview/template.vue +++ b/admin-base/ui.apps/src/main/content/jcr_root/apps/admin/components/contentview/template.vue @@ -533,6 +533,10 @@ export default { this.reWrapEditable() }, + refreshEditor(vm) { + vm.$refs.editview.contentWindow.location.reload() + }, + onInlineClick(event) { this.pingToolbar() }, diff --git a/admin-base/ui.apps/src/main/content/jcr_root/apps/admin/runmodes/config/org.apache.sling.jcr.repoinit.RepositoryInitializer-peregrineAdminBaseUI.config b/admin-base/ui.apps/src/main/content/jcr_root/apps/admin/runmodes/config/org.apache.sling.jcr.repoinit.RepositoryInitializer-peregrineAdminBaseUI.config new file mode 100644 index 0000000000..b477419898 --- /dev/null +++ b/admin-base/ui.apps/src/main/content/jcr_root/apps/admin/runmodes/config/org.apache.sling.jcr.repoinit.RepositoryInitializer-peregrineAdminBaseUI.config @@ -0,0 +1,37 @@ +# 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. + +scripts=[\ +" +# This Repoinit Script is here to make sure that during an upgrade the necessary users +# and permissions are available +# +# ATTENTION: because of creating users and groups with path this script depends on org.apache.sling.jcr.repoinit-1.1.10 +# + +# 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 + +"\ +] diff --git a/admin-base/ui.apps/src/main/js/stateActions/addComponentToPath.js b/admin-base/ui.apps/src/main/js/stateActions/addComponentToPath.js index c8f186a784..c171f00b23 100644 --- a/admin-base/ui.apps/src/main/js/stateActions/addComponentToPath.js +++ b/admin-base/ui.apps/src/main/js/stateActions/addComponentToPath.js @@ -61,19 +61,22 @@ export default function(me, target) { processed = true; return me.getApi().insertNodeAt(target.pagePath+targetNode.path, componentPath, target.drop, variation) .then( (data) => { - if(targetNodeUpdate.fromTemplate === true) { - return me.getApi().populatePageView(me.getNodeFromView('/pageView/path')) - } else { - if(target.drop.startsWith('into')) { - Vue.set(targetNodeUpdate, 'children', data.children) - } - else if(target.drop === 'before' || target.drop === 'after') - { - Vue.set(targetNodeUpdate, 'children', data.children) - } - log.fine(data) - } - }) + if(view.pageView.page.serverSide) { + me.action(me.getApp().$children[0], 'refreshEditor', view.pageView.page) + return me.getApi().populatePageView(me.getNodeFromView('/pageView/path')) + } else if(targetNodeUpdate.fromTemplate === true) { + return me.getApi().populatePageView(me.getNodeFromView('/pageView/path')) + } else { + if(target.drop.startsWith('into')) { + Vue.set(targetNodeUpdate, 'children', data.children) + } + else if(target.drop === 'before' || target.drop === 'after') + { + Vue.set(targetNodeUpdate, 'children', data.children) + } + log.fine(data) + } + }) } // copy/paste? diff --git a/admin-base/ui.apps/src/main/js/stateActions/savePageEdit.js b/admin-base/ui.apps/src/main/js/stateActions/savePageEdit.js index 9167d1038a..fa02c9443a 100644 --- a/admin-base/ui.apps/src/main/js/stateActions/savePageEdit.js +++ b/admin-base/ui.apps/src/main/js/stateActions/savePageEdit.js @@ -38,7 +38,8 @@ export default function(me, target) { delete view.state.editor; set(view, '/state/editorVisible', false) if(view.pageView.page.serverSide) { - me.action(me.getApp().$children[0], 'refreshEditor', view.pageView.page).then( () => { resolve() }) + me.action(me.getApp().$children[0], 'refreshEditor', view.pageView.page) + resolve() } else { resolve() } diff --git a/pagerenderer/server/core/pom.xml b/pagerenderer/server/core/pom.xml index e47f1e3871..a020d8b218 100644 --- a/pagerenderer/server/core/pom.xml +++ b/pagerenderer/server/core/pom.xml @@ -132,8 +132,9 @@ - commons-lang - commons-lang + commons-lang3 + org.apache.commons + provided @@ -150,6 +151,19 @@ javax.inject javax.inject + + + javax.annotation + javax.annotation-api + 1.3.2 + + + + org.apache.sling + org.apache.sling.scripting.sightly.compiler.java + 1.0.18 + provided + diff --git a/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/helpers/BaseHelper.java b/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/helpers/BaseHelper.java new file mode 100644 index 0000000000..c81ccb6449 --- /dev/null +++ b/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/helpers/BaseHelper.java @@ -0,0 +1,150 @@ +package com.peregrine.pagerender.server.helpers; + +import com.peregrine.adaption.PerPage; +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.api.SlingHttpServletResponse; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.api.resource.ResourceResolver; +import org.apache.sling.api.resource.ValueMap; +import org.apache.sling.api.scripting.SlingScriptHelper; +import org.apache.sling.models.factory.ModelFactory; +import org.apache.sling.scripting.sightly.pojo.Use; +import org.slf4j.Logger; + +import javax.jcr.Node; +import javax.jcr.Session; +import javax.script.Bindings; +import java.io.BufferedReader; +import java.io.PrintWriter; +import java.util.Objects; + +import static com.peregrine.commons.util.PerConstants.JCR_CONTENT; + +public class BaseHelper implements Use { + + // GLOBAL OBJECTS (from Use API Binding) + private Node currentNode; + private Session currentSession; + private Logger log; + private PrintWriter out; + private ValueMap properties; + private BufferedReader reader; + private SlingHttpServletRequest request; + private ResourceResolver resolver; + private Resource resource; + private SlingHttpServletResponse response; + private SlingScriptHelper sling; + + // Peregrine API + private Object model; + private Resource siteRoot; + private PerPage currentPage; + private String pagePath; + + // Constants + public static String CURRENT_NODE = "currentNode"; + public static String CURRENT_SESSION = "currentSession"; + public static String LOG = "log"; + public static String OUT = "out"; + public static String PROPERTIES = "properties"; + public static String READER = "reader"; + public static String REQUEST = "request"; + public static String RESOLVER = "resolver"; + public static String RESOURCE = "resource"; + public static String RESPONSE = "response"; + public static String SLING = "sling"; + + public void init(Bindings bindings) { + // initialize all global bindings (minus caconfig) + currentNode = (Node) bindings.get(CURRENT_NODE); + currentSession = (Session) bindings.get(CURRENT_SESSION); + log = (Logger) bindings.get(LOG); + out = (PrintWriter) bindings.get(OUT); + properties = (ValueMap) bindings.get(PROPERTIES); + reader = (BufferedReader) bindings.get(READER); + request = (SlingHttpServletRequest) bindings.get(REQUEST); + resolver = (ResourceResolver) bindings.get(RESOLVER); + resource = (Resource) bindings.get(RESOURCE); + response = (SlingHttpServletResponse) bindings.get(RESPONSE); + sling = (SlingScriptHelper) bindings.get(SLING); + + // initialize peregrine api + pagePath = request.getRequestPathInfo().getResourcePath(); + pagePath = pagePath.substring(0, pagePath.indexOf(JCR_CONTENT)); + Resource pageRes = resolver.getResource(pagePath); + if (Objects.nonNull(pageRes)){ + currentPage = pageRes.adaptTo(PerPage.class); + } + if (Objects.nonNull(currentPage)){ + siteRoot = currentPage.getSiteResource(); + } + try { + model = sling.getService(ModelFactory.class).getModelFromResource(resource); + if (Objects.isNull(model)) { + model = sling.getService(ModelFactory.class).getModelFromRequest(request); + } + } catch(Throwable t) { + log.warn("could not get model for "+resource.getPath()); + } + } + + public PrintWriter getOut() { + return out; + } + + public ValueMap getProperties() { + return properties; + } + + public BufferedReader getReader() { + return reader; + } + + public SlingHttpServletRequest getRequest() { + return request; + } + + public ResourceResolver getResolver() { + return resolver; + } + + public Resource getResource() { + return resource; + } + + public SlingHttpServletResponse getResponse() { + return response; + } + + public SlingScriptHelper getSling() { + return sling; + } + + public Object getModel() { + return model; + } + + public Resource getSiteRoot() { + return siteRoot; + } + + public PerPage getCurrentPage() { + return currentPage; + } + + public String getPagePath() { + return pagePath; + } + + public Node getCurrentNode() { + return currentNode; + } + + public Session getCurrentSession() { + return currentSession; + } + + public Logger getLog() { + return log; + } +} diff --git a/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/helpers/PageHelper.java b/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/helpers/PageHelper.java new file mode 100644 index 0000000000..ddff8c18c4 --- /dev/null +++ b/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/helpers/PageHelper.java @@ -0,0 +1,30 @@ +package com.peregrine.pagerender.server.helpers; + +import javax.script.Bindings; +import com.peregrine.pagerender.server.models.PageModel; + +import java.util.Objects; + +public class PageHelper extends BaseHelper { + + public String getPath() { + return this.getResource().getPath(); + } + + public String getSiteRootPath() { + return Objects.nonNull(getSiteRoot()) ? getSiteRoot().getPath() : null; + } + + public String getModelClass() { + return Objects.nonNull(getModel()) ? getModel().getClass().toString() : null; + } + + public String[] getSiteCSS(){ + PageModel page = getResource().adaptTo(PageModel.class); + return page.getSiteCSS(); + } + + public void init(Bindings bindings) { + super.init(bindings); + } +} \ No newline at end of file diff --git a/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/models/Container.java b/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/models/Container.java index 40c8978e8a..a3fedd6463 100644 --- a/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/models/Container.java +++ b/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/models/Container.java @@ -25,19 +25,28 @@ * #L% */ -import static com.peregrine.commons.util.PerConstants.JACKSON; -import static com.peregrine.commons.util.PerConstants.JSON; -import static com.peregrine.pagerender.server.models.PageRenderServerConstants.PR_SERVER_COMPONENT_CONTAINER_TYPE; - import com.fasterxml.jackson.annotation.JsonIgnore; +import com.peregrine.adaption.PerPage; import com.peregrine.nodetypes.models.AbstractComponent; import com.peregrine.nodetypes.models.IComponent; -import java.util.List; -import javax.inject.Inject; -import javax.inject.Named; import org.apache.sling.api.resource.Resource; +import org.apache.sling.api.resource.ResourceResolver; +import org.apache.sling.api.resource.ValueMap; +import org.apache.sling.api.wrappers.CompositeValueMap; import org.apache.sling.models.annotations.Exporter; import org.apache.sling.models.annotations.Model; +import javax.annotation.PostConstruct; + +import javax.inject.Inject; +import javax.inject.Named; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +import static com.peregrine.commons.util.PerConstants.JACKSON; +import static com.peregrine.commons.util.PerConstants.JCR_CONTENT; +import static com.peregrine.commons.util.PerConstants.JSON; +import static com.peregrine.pagerender.server.models.PageRenderServerConstants.PR_SERVER_COMPONENT_CONTAINER_TYPE; /** * Created by rr on 12/2/2016. @@ -51,6 +60,14 @@ extensions = JSON) public class Container extends AbstractComponent { + private ResourceResolver resolver; + private String pagePath; + private Resource page; + private PerPage templatePage; + private PerPage perPage; + private String relativePath; + private Resource templateContainer; + @Inject @Named(".") private List children; @@ -64,4 +81,47 @@ public Container(Resource r) { public List getChildren() { return children; } + + public List getCombinedResources(){ + if (Objects.isNull(resolver)){ + setup(); + } + List merged = new ArrayList<>(); + // get template container children, add them to the list + if(Objects.nonNull(templateContainer)){ + templateContainer.getChildren().forEach(resource -> merged.add(resource)); + } + // get page container children + this.getResource().getChildren().forEach(resource -> { + merged.add(resource); + }); + return merged; + } + + public ValueMap getCombinedProperties(){ + if (Objects.isNull(resolver)){ + setup(); + } + ValueMap contentVM = this.getResource().getValueMap(); + if (Objects.nonNull(templateContainer)){ + ValueMap templateVM = templateContainer.getValueMap(); + return new CompositeValueMap(contentVM, templateVM, true); + } else { + return contentVM; + } + } + + + void setup() { + resolver = this.getResource().getResourceResolver(); + pagePath = this.getResource().getPath().substring(0, this.getResource().getPath().indexOf(JCR_CONTENT)); + page = resolver.getResource(pagePath); + perPage = page.adaptTo(PerPage.class); + templatePage = perPage.getTemplate(); + relativePath = this.getPath(); + // find the container under the template + if (Objects.nonNull(templatePage)) { + templateContainer = resolver.getResource(templatePage.getPath() + relativePath); + } + } } diff --git a/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/models/PageModel.java b/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/models/PageModel.java index 305c127287..fc193f9815 100644 --- a/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/models/PageModel.java +++ b/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/models/PageModel.java @@ -45,6 +45,8 @@ import org.apache.sling.models.annotations.Optional; import org.apache.sling.models.factory.ModelFactory; +import java.util.Objects; + /** * Created by rr on 12/2/2016. */ @@ -71,11 +73,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; @@ -126,7 +126,9 @@ public String getPagePath() { public String[] getSiteCSS() { if(siteCSS == null) { String[] value = (String[]) getInheritedProperty(SITE_CSS); - if(value != null && value.length != 0) return value; + if(value != null && value.length != 0) { + return value; + } if(getTemplate() != null) { PageModel templatePageModel = getTemplatePageModel(); if(templatePageModel != null) { diff --git a/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/models/PageRenderServerConstants.java b/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/models/PageRenderServerConstants.java index 62c9bfcc08..e6dc8f36b5 100644 --- a/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/models/PageRenderServerConstants.java +++ b/pagerenderer/server/core/src/main/java/com/peregrine/pagerender/server/models/PageRenderServerConstants.java @@ -2,6 +2,6 @@ public class PageRenderServerConstants { public static final String PR_SERVER_COMPONENT_BASE_TYPE = "pagerenderserver/components/base"; - public static final String PR_SERVER_COMPONENT_CONTAINER_TYPE = "pagerenderserver/structure/container"; - public static final String PR_SERVER_COMPONENT_PAGE_TYPE = "pagerenderserver/structure/page"; + public static final String PR_SERVER_COMPONENT_CONTAINER_TYPE = "pagerenderserver/components/container"; + public static final String PR_SERVER_COMPONENT_PAGE_TYPE = "pagerenderserver/components/page"; } diff --git a/pagerenderer/server/ui.apps/package-lock.json b/pagerenderer/server/ui.apps/package-lock.json new file mode 100644 index 0000000000..7978f9866f --- /dev/null +++ b/pagerenderer/server/ui.apps/package-lock.json @@ -0,0 +1,871 @@ +{ + "name": "pcms-pagerender-server", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/parser": { + "version": "7.12.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz", + "integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw==" + }, + "@types/estree": { + "version": "0.0.45", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.45.tgz", + "integrity": "sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g==" + }, + "@types/node": { + "version": "14.14.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.5.tgz", + "integrity": "sha512-H5Wn24s/ZOukBmDn03nnGTp18A60ny9AmCwnEcgJiTgSGsCO7k+NWP7zjCCbhlcnVCoI+co52dUAt9GMhOSULw==" + }, + "@vue/component-compiler": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@vue/component-compiler/-/component-compiler-3.6.0.tgz", + "integrity": "sha512-NIA0vmOI4zbtJAn69iZls8IJ8VxmguswAuiUdu8TcR+YYTYzntfw290HUCSFjzAdRg+FUWZv8r+wc3TzJ/IjwA==", + "requires": { + "@vue/component-compiler-utils": "^2.1.0", + "clean-css": "^4.1.11", + "hash-sum": "^1.0.2", + "postcss-modules-sync": "^1.0.0", + "source-map": "0.6.*" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "@vue/component-compiler-utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@vue/component-compiler-utils/-/component-compiler-utils-2.6.0.tgz", + "integrity": "sha512-IHjxt7LsOFYc0DkTncB7OXJL7UzwOLPPQCfEUNyxL2qt+tF12THV+EO33O1G2Uk4feMSWua3iD39Itszx0f0bw==", + "requires": { + "consolidate": "^0.15.1", + "hash-sum": "^1.0.2", + "lru-cache": "^4.1.2", + "merge-source-map": "^1.1.0", + "postcss": "^7.0.14", + "postcss-selector-parser": "^5.0.0", + "prettier": "1.16.3", + "source-map": "~0.6.1", + "vue-template-es2015-compiler": "^1.9.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==" + }, + "acorn-dynamic-import": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", + "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==" + }, + "acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==" + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==" + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" + }, + "buble": { + "version": "0.19.8", + "resolved": "https://registry.npmjs.org/buble/-/buble-0.19.8.tgz", + "integrity": "sha512-IoGZzrUTY5fKXVkgGHw3QeXFMUNBFv+9l8a4QJKG1JhG3nCMHTdEX1DCOg8568E2Q9qvAQIiSokv6Jsgx8p2cA==", + "requires": { + "acorn": "^6.1.1", + "acorn-dynamic-import": "^4.0.0", + "acorn-jsx": "^5.0.1", + "chalk": "^2.4.2", + "magic-string": "^0.25.3", + "minimist": "^1.2.0", + "os-homedir": "^2.0.0", + "regexpu-core": "^4.5.4" + }, + "dependencies": { + "acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==" + } + } + }, + "catharsis": { + "version": "0.8.11", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.11.tgz", + "integrity": "sha512-a+xUyMV7hD1BrDQA/3iPV7oc+6W26BgVJO05PGEoatMyIuPScQKsde6i3YorWX1qs+AZjnJ18NqdKoCtKiNh1g==", + "requires": { + "lodash": "^4.17.14" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + } + } + }, + "clean-css": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz", + "integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==", + "requires": { + "source-map": "~0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "consolidate": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/consolidate/-/consolidate-0.15.1.tgz", + "integrity": "sha512-DW46nrsMJgy9kqAbPt5rKaCr7uFtpo4mSUvLHIUbJEjm0vo+aY5QLwBUq3FK4tRnJr/X0Psc0C4jf/h+HtXSMw==", + "requires": { + "bluebird": "^3.1.1" + } + }, + "css-selector-tokenizer": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.3.tgz", + "integrity": "sha512-jWQv3oCEL5kMErj4wRnK/OPoBi0D+P1FR2cDCKYPaMeD2eW3/mttav8HT4hT1CKopiJI/psEULjkClhvJo4Lvg==", + "requires": { + "cssesc": "^3.0.0", + "fastparse": "^1.1.2" + }, + "dependencies": { + "cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==" + } + } + }, + "cssesc": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz", + "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==" + }, + "de-indent": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", + "integrity": "sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0=" + }, + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "requires": { + "ms": "2.1.2" + } + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=" + }, + "entities": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz", + "integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==" + }, + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==" + }, + "estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==" + }, + "fastparse": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", + "integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==" + }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "generic-names": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/generic-names/-/generic-names-1.0.3.tgz", + "integrity": "sha1-LXhqEhruUIh2eWk56OO/+DbCCRc=", + "requires": { + "loader-utils": "^0.2.16" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "hash-sum": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz", + "integrity": "sha1-M7QHd3VMZDJXPBIMw4CLvRDUfwQ=" + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" + }, + "icss-replace-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", + "integrity": "sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=" + }, + "indexes-of": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", + "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=" + }, + "js-base64": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", + "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==" + }, + "js2xmlparser": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.1.tgz", + "integrity": "sha512-KrPTolcw6RocpYjdC7pL7v62e55q7qOMHvLX1UCLc5AAS8qeJ6nukarEJAF2KL2PZxlbGueEbINqZR2bDe/gUw==", + "requires": { + "xmlcreate": "^2.0.3" + } + }, + "jsdoc": { + "version": "3.6.6", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.6.tgz", + "integrity": "sha512-znR99e1BHeyEkSvgDDpX0sTiTu+8aQyDl9DawrkOGZTTW8hv0deIFXx87114zJ7gRaDZKVQD/4tr1ifmJp9xhQ==", + "requires": { + "@babel/parser": "^7.9.4", + "bluebird": "^3.7.2", + "catharsis": "^0.8.11", + "escape-string-regexp": "^2.0.0", + "js2xmlparser": "^4.0.1", + "klaw": "^3.0.0", + "markdown-it": "^10.0.0", + "markdown-it-anchor": "^5.2.7", + "marked": "^0.8.2", + "mkdirp": "^1.0.4", + "requizzle": "^0.2.3", + "strip-json-comments": "^3.1.0", + "taffydb": "2.6.2", + "underscore": "~1.10.2" + } + }, + "jsdoc-vue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-vue/-/jsdoc-vue-1.0.0.tgz", + "integrity": "sha1-/zrBumvEp0B5u3kFinvwBm40YjU=" + }, + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "klaw": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", + "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "linkify-it": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", + "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", + "requires": { + "uc.micro": "^1.0.1" + } + }, + "loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0", + "object-assign": "^4.0.1" + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "magic-string": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", + "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", + "requires": { + "sourcemap-codec": "^1.4.4" + } + }, + "markdown-it": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz", + "integrity": "sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg==", + "requires": { + "argparse": "^1.0.7", + "entities": "~2.0.0", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + } + }, + "markdown-it-anchor": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.3.0.tgz", + "integrity": "sha512-/V1MnLL/rgJ3jkMWo84UR+K+jF1cxNG1a+KwqeXqTIJ+jtA8aWSHuigx8lTzauiIjBDbwF3NcWQMotd0Dm39jA==" + }, + "marked": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz", + "integrity": "sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw==" + }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=" + }, + "merge-source-map": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", + "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", + "requires": { + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "os-homedir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-2.0.0.tgz", + "integrity": "sha512-saRNz0DSC5C/I++gFIaJTXoFJMRwiP5zHar5vV3xQ2TkgEw6hDCcU5F272JjUylpiVgBrZNQHnfjkLabTfb92Q==" + }, + "postcss": { + "version": "7.0.35", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", + "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "requires": { + "chalk": "^2.4.2", + "source-map": "^0.6.1", + "supports-color": "^6.1.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-modules-local-by-default": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-1.2.0.tgz", + "integrity": "sha1-99gMOYxaOT+nlkRmvRlQCn1hwGk=", + "requires": { + "css-selector-tokenizer": "^0.7.0", + "postcss": "^6.0.1" + }, + "dependencies": { + "postcss": { + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "postcss-modules-scope": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-1.1.0.tgz", + "integrity": "sha1-1upkmUx5+XtipytCb75gVqGUu5A=", + "requires": { + "css-selector-tokenizer": "^0.7.0", + "postcss": "^6.0.1" + }, + "dependencies": { + "postcss": { + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "postcss-modules-sync": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-sync/-/postcss-modules-sync-1.0.0.tgz", + "integrity": "sha1-YZpxnPeN0WpINBNRQLMkz3czS+E=", + "requires": { + "generic-names": "^1.0.2", + "icss-replace-symbols": "^1.0.2", + "postcss": "^5.2.5", + "postcss-modules-local-by-default": "^1.1.1", + "postcss-modules-scope": "^1.0.2", + "string-hash": "^1.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "dependencies": { + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=" + }, + "postcss": { + "version": "5.2.18", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", + "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "requires": { + "chalk": "^1.1.3", + "js-base64": "^2.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "requires": { + "has-flag": "^1.0.0" + } + } + } + }, + "postcss-selector-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz", + "integrity": "sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ==", + "requires": { + "cssesc": "^2.0.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + }, + "prettier": { + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.3.tgz", + "integrity": "sha512-kn/GU6SMRYPxUakNXhpP0EedT/KmaPzr0H5lIsDogrykbaxOpOfAFfk5XA7DZrJyMAv1wlMV3CPcZruGXVVUZw==" + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" + }, + "regenerate": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.1.tgz", + "integrity": "sha512-j2+C8+NtXQgEKWk49MMP5P/u2GhnahTtVkRIHr5R5lVRlbKvmQ+oS+A5aLKWp2ma5VkT8sh6v+v4hbH0YHR66A==" + }, + "regenerate-unicode-properties": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", + "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", + "requires": { + "regenerate": "^1.4.0" + } + }, + "regexpu-core": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.1.tgz", + "integrity": "sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ==", + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.2.0", + "regjsgen": "^0.5.1", + "regjsparser": "^0.6.4", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.2.0" + } + }, + "regjsgen": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==" + }, + "regjsparser": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz", + "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==", + "requires": { + "jsesc": "~0.5.0" + } + }, + "requizzle": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", + "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", + "requires": { + "lodash": "^4.17.14" + } + }, + "rollup": { + "version": "1.32.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.32.1.tgz", + "integrity": "sha512-/2HA0Ec70TvQnXdzynFffkjA6XN+1e2pEv/uKS5Ulca40g2L7KuOE3riasHoNVHOsFD5KKZgDsMk1CP3Tw9s+A==", + "requires": { + "@types/estree": "*", + "@types/node": "*", + "acorn": "^7.1.0" + } + }, + "rollup-plugin-buble": { + "version": "0.19.8", + "resolved": "https://registry.npmjs.org/rollup-plugin-buble/-/rollup-plugin-buble-0.19.8.tgz", + "integrity": "sha512-8J4zPk2DQdk3rxeZvxgzhHh/rm5nJkjwgcsUYisCQg1QbT5yagW+hehYEW7ZNns/NVbDCTv4JQ7h4fC8qKGOKw==", + "requires": { + "buble": "^0.19.8", + "rollup-pluginutils": "^2.3.3" + } + }, + "rollup-plugin-vue": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-vue/-/rollup-plugin-vue-4.7.2.tgz", + "integrity": "sha512-RuAK+YTL81/iccOWoadqQz2TXqOogivjbvtCuU6EfVP9/E5XIjuMNVsVWHkSelZQblI1z2b5tshWL7XoiOfABQ==", + "requires": { + "@vue/component-compiler": "^3.6", + "@vue/component-compiler-utils": "^2.1.0", + "debug": "^4.1.1", + "hash-sum": "^1.0.2", + "magic-string": "^0.25.2", + "querystring": "^0.2.0", + "rollup-pluginutils": "^2.0.1", + "source-map": "0.7.3", + "vue-runtime-helpers": "1.0.0" + } + }, + "rollup-pluginutils": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", + "requires": { + "estree-walker": "^0.6.1" + } + }, + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==" + }, + "sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "string-hash": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", + "integrity": "sha1-6Kr8CsGFW0Zmkp7X3RJ1311sgRs=" + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=" + }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + }, + "underscore": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.10.2.tgz", + "integrity": "sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==" + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==" + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", + "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==" + }, + "unicode-property-aliases-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", + "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==" + }, + "uniq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=" + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + }, + "vue": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.12.tgz", + "integrity": "sha512-uhmLFETqPPNyuLLbsKz6ioJ4q7AZHzD8ZVFNATNyICSZouqP2Sz0rotWQC8UNBF6VGSCs5abnKJoStA6JbCbfg==" + }, + "vue-runtime-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/vue-runtime-helpers/-/vue-runtime-helpers-1.0.0.tgz", + "integrity": "sha512-DgwCNgIXkq1GJsWwtFOjA/K2nxpjyon/QqAut0EiwrMHBatAPbfdqksDdRoK15b5YrSJRa59rx3pc0L6V4udUA==" + }, + "vue-template-compiler": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.12.tgz", + "integrity": "sha512-OzzZ52zS41YUbkCBfdXShQTe69j1gQDZ9HIX8miuC9C3rBCk9wIRjLiZZLrmX9V+Ftq/YEyv1JaVr5Y/hNtByg==", + "requires": { + "de-indent": "^1.0.2", + "he": "^1.1.0" + } + }, + "vue-template-es2015-compiler": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz", + "integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==" + }, + "xmlcreate": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.3.tgz", + "integrity": "sha512-HgS+X6zAztGa9zIK3Y3LXuJes33Lz9x+YyTxgrkIdabu2vqcGOWwdfCpf1hWLRrd553wd4QCDf6BBO6FfdsRiQ==" + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + } + } +} diff --git a/pagerenderer/server/ui.apps/package.json b/pagerenderer/server/ui.apps/package.json index 075238b783..6c7186fb02 100644 --- a/pagerenderer/server/ui.apps/package.json +++ b/pagerenderer/server/ui.apps/package.json @@ -1,5 +1,5 @@ { - "name": "modeltest", + "name": "pcms-pagerender-server", "version": "1.0.0", "description": "base render infrastructure for server rendered sites", "repository": { @@ -17,10 +17,10 @@ "license": "Apache-2.0", "dependencies": { "fs-extra": "^7.0.1", - "jsdoc": "^3.5.5", + "jsdoc": "^3.6.5", "jsdoc-vue": "^1.0.0", - "rollup": "^1.1.2", - "rollup-plugin-buble": "^0.19.6", + "rollup": "^1.16.6", + "rollup-plugin-buble": "^0.19.8", "rollup-plugin-vue": "^4.6.1", "vue": "^2.5.22", "vue-template-compiler": "^2.5.22" diff --git a/pagerenderer/server/ui.apps/pom.xml b/pagerenderer/server/ui.apps/pom.xml index 3d2f5c47c4..1fc7d4b777 100644 --- a/pagerenderer/server/ui.apps/pom.xml +++ b/pagerenderer/server/ui.apps/pom.xml @@ -92,7 +92,7 @@ frontend-maven-plugin ${nodepath} - + install node and npm diff --git a/pagerenderer/server/ui.apps/src/main/content/META-INF/vault/filter.xml b/pagerenderer/server/ui.apps/src/main/content/META-INF/vault/filter.xml index 9225182859..e19dd730cc 100644 --- a/pagerenderer/server/ui.apps/src/main/content/META-INF/vault/filter.xml +++ b/pagerenderer/server/ui.apps/src/main/content/META-INF/vault/filter.xml @@ -31,4 +31,5 @@ + diff --git a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/nt/unstructured/unstructured.html b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/nt/unstructured/unstructured.html new file mode 100644 index 0000000000..19311a1cfe --- /dev/null +++ b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/nt/unstructured/unstructured.html @@ -0,0 +1,22 @@ + +
+
+ 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/base/base.html b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/base/base.html index af91ac3191..73c0694983 100644 --- a/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/base/base.html +++ b/pagerenderer/server/ui.apps/src/main/content/jcr_root/apps/pagerenderserver/components/base/base.html @@ -1,4 +1,6 @@ -
${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} + + + + + + + + + + + + + + + +
+ ${helper.path} +
+ +
+
+ + + + + + + + + + + + + + + + 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