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

[sling-whiteboard] branch master updated: Adding a rewriter to map URL attributes, adding a getkeywords method to the page and cleaning up some null pointer exceptions

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 4fe012f  Adding a rewriter to map URL attributes, adding a getkeywords method to the page and cleaning up some null pointer exceptions
     new 70eac16  Merge branch 'master' of git@github.com:apache/sling-whiteboard.git
4fe012f is described below

commit 4fe012ff0b3b637eff96abdb8775b276b14ac560
Author: Dan Klco <da...@gmail.com>
AuthorDate: Fri Mar 9 11:08:40 2018 -0500

    Adding a rewriter to map URL attributes, adding a getkeywords method to
    the page and cleaning up some null pointer exceptions
---
 cms/builder/src/main/provisioning/cms.txt          |   2 +-
 cms/core/pom.xml                                   |   1 -
 .../java/org/apache/sling/cms/CMSConstants.java    |   7 +-
 .../cms/core/models/AbstractContentModel.java      |   2 +-
 .../apache/sling/cms/core/models/ErrorHandler.java |   7 +-
 .../org/apache/sling/cms/core/models/Page.java     |  31 ++++-
 .../core/rewriter/ReferenceMappingTransformer.java | 155 +++++++++++++++++++++
 .../ReferenceMappingTransformerConfig.java         |  36 +++++
 .../ReferenceMappingTransformerFactory.java        |  58 ++++++++
 .../apache/sling/cms/reference/models/Search.java  |   2 +-
 cms/docker/Dockerfile                              |   2 +-
 .../apps/reference/components/pages/base/edit.json |  24 ++++
 ...rewriter.ReferenceMappingTransformerConfig.json |  11 ++
 ....sling.engine.impl.auth.SlingAuthenticator.json |   0
 ....internal.JcrResourceResolverFactoryImpl.config |   0
 ...pl.ServiceUserMapperImpl.amended-sling-cms.json |   4 +
 .../rewriter/reference-mapping-rewriter.json       |  38 +++++
 17 files changed, 371 insertions(+), 9 deletions(-)

diff --git a/cms/builder/src/main/provisioning/cms.txt b/cms/builder/src/main/provisioning/cms.txt
index 03c1f47..6031049 100644
--- a/cms/builder/src/main/provisioning/cms.txt
+++ b/cms/builder/src/main/provisioning/cms.txt
@@ -22,7 +22,7 @@
 [artifacts startLevel=20]
 	org.apache.cocoon/cocoon-serializers-charsets/1.0.0
 	org.apache.sling/org.apache.sling.commons.html/1.0.0
-    org.apache.sling/org.apache.sling.rewriter/1.2.0
+    org.apache.sling/org.apache.sling.rewriter/1.2.2
     org.apache.sling/org.apache.sling.resourcemerger/1.3.6
     org.apache.sling/org.apache.sling.cms.core/1.0.0-SNAPSHOT
     org.apache.sling/org.apache.sling.cms.ui/1.0.0-SNAPSHOT
diff --git a/cms/core/pom.xml b/cms/core/pom.xml
index c38370c..7bf1be9 100644
--- a/cms/core/pom.xml
+++ b/cms/core/pom.xml
@@ -59,7 +59,6 @@
 			<plugin>
 				<groupId>org.apache.sling</groupId>
 				<artifactId>maven-sling-plugin</artifactId>
-				<version>2.1.0</version>
 				<configuration>
 					<slingUrl>http://${sling.host}:${sling.port}/system/console</slingUrl>
 					<user>${sling.username}</user>
diff --git a/cms/core/src/main/java/org/apache/sling/cms/CMSConstants.java b/cms/core/src/main/java/org/apache/sling/cms/CMSConstants.java
index 616c63d..3a77cef 100644
--- a/cms/core/src/main/java/org/apache/sling/cms/CMSConstants.java
+++ b/cms/core/src/main/java/org/apache/sling/cms/CMSConstants.java
@@ -69,7 +69,7 @@ public class CMSConstants {
 	/**
 	 * i18n Locale property
 	 */
-	public static final String PN_LANGUAGE =  "jcr:language";
+	public static final String PN_LANGUAGE = "jcr:language";
 
 	/**
 	 * Published flag property
@@ -77,6 +77,11 @@ public class CMSConstants {
 	public static final String PN_PUBLISHED = "published";
 
 	/**
+	 * Taxonomy attribute name
+	 */
+	public static final String PN_TAXONOMY = NAMESPACE + ":taxonomy";
+
+	/**
 	 * Title attribute name
 	 */
 	public static final String PN_TITLE = "jcr:title";
diff --git a/cms/core/src/main/java/org/apache/sling/cms/core/models/AbstractContentModel.java b/cms/core/src/main/java/org/apache/sling/cms/core/models/AbstractContentModel.java
index 5389294..d8464c2 100644
--- a/cms/core/src/main/java/org/apache/sling/cms/core/models/AbstractContentModel.java
+++ b/cms/core/src/main/java/org/apache/sling/cms/core/models/AbstractContentModel.java
@@ -104,7 +104,7 @@ public abstract class AbstractContentModel {
 		return getContentResource().getValueMap();
 	}
 
-	public abstract Boolean getPublished();
+	public abstract boolean isPublished();
 
 	public Resource getResource() {
 		return resource;
diff --git a/cms/core/src/main/java/org/apache/sling/cms/core/models/ErrorHandler.java b/cms/core/src/main/java/org/apache/sling/cms/core/models/ErrorHandler.java
index eb2333c..bceb46c 100644
--- a/cms/core/src/main/java/org/apache/sling/cms/core/models/ErrorHandler.java
+++ b/cms/core/src/main/java/org/apache/sling/cms/core/models/ErrorHandler.java
@@ -61,7 +61,12 @@ public class ErrorHandler {
 		Resource resource = slingRequest.getResource();
 		ResourceResolver resolver = slingRequest.getResourceResolver();
 
-		log.debug("Calculating error handling scripts for resource {} and error code ", resource);
+		log.debug("Calculating error handling scripts for resource {} and error code {}", resource, errorCode);
+
+		if (slingRequest.getAttribute(SlingConstants.ERROR_EXCEPTION) != null) {
+			log.warn("Handing exception of type " + errorCode,
+					slingRequest.getAttribute(SlingConstants.ERROR_EXCEPTION));
+		}
 		SiteManager siteMgr = resource.adaptTo(SiteManager.class);
 		if (siteMgr != null && siteMgr.getSite() != null) {
 			Site site = siteMgr.getSite();
diff --git a/cms/core/src/main/java/org/apache/sling/cms/core/models/Page.java b/cms/core/src/main/java/org/apache/sling/cms/core/models/Page.java
index 20c6740..27c6aa6 100644
--- a/cms/core/src/main/java/org/apache/sling/cms/core/models/Page.java
+++ b/cms/core/src/main/java/org/apache/sling/cms/core/models/Page.java
@@ -16,14 +16,19 @@
  */
 package org.apache.sling.cms.core.models;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.inject.Inject;
 import javax.inject.Named;
 
+import org.apache.jackrabbit.JcrConstants;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.cms.CMSConstants;
 import org.apache.sling.cms.CMSUtils;
 import org.apache.sling.models.annotations.Default;
 import org.apache.sling.models.annotations.Model;
+import org.apache.sling.models.annotations.Optional;
 
 /**
  * A model representing a page.
@@ -46,6 +51,12 @@ public class Page extends AbstractContentModel {
 	private boolean published;
 
 	@Inject
+	@Optional
+	@Named(JcrConstants.JCR_CONTENT + "/" + CMSConstants.PN_TAXONOMY)
+	private String[] taxonomy;
+
+	@Inject
+	@Optional
 	@Named("jcr:content/sling:template")
 	private String template;
 
@@ -53,7 +64,18 @@ public class Page extends AbstractContentModel {
 		this.resource = resource;
 	}
 
-	public Boolean getPublished() {
+	public String[] getKeywords() {
+		List<String> keywords = new ArrayList<String>();
+		if (taxonomy != null) {
+			for (String item : taxonomy) {
+				Resource resource = this.resource.getResourceResolver().getResource(item);
+				keywords.add(resource.getValueMap().get(CMSConstants.PN_TITLE, String.class));
+			}
+		}
+		return keywords.toArray(new String[keywords.size()]);
+	}
+
+	public boolean isPublished() {
 		return published;
 	}
 
@@ -76,7 +98,12 @@ public class Page extends AbstractContentModel {
 	}
 
 	public PageTemplate getTemplate() {
-		return this.resource.getResourceResolver().getResource(template).adaptTo(PageTemplate.class);
+		Resource templateResource = this.resource.getResourceResolver().getResource(template);
+		if (templateResource != null) {
+			return templateResource.adaptTo(PageTemplate.class);
+		} else {
+			return null;
+		}
 	}
 
 	public String getTemplatePath() {
diff --git a/cms/core/src/main/java/org/apache/sling/cms/core/rewriter/ReferenceMappingTransformer.java b/cms/core/src/main/java/org/apache/sling/cms/core/rewriter/ReferenceMappingTransformer.java
new file mode 100644
index 0000000..dd31a3b
--- /dev/null
+++ b/cms/core/src/main/java/org/apache/sling/cms/core/rewriter/ReferenceMappingTransformer.java
@@ -0,0 +1,155 @@
+/*
+ * 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.
+ */
+package org.apache.sling.cms.core.rewriter;
+
+import java.io.IOException;
+
+import org.apache.commons.lang.ArrayUtils;
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.rewriter.ProcessingComponentConfiguration;
+import org.apache.sling.rewriter.ProcessingContext;
+import org.apache.sling.rewriter.Transformer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+/**
+ * A Sling Rewriter Transformer which maps references to images, links, etc that
+ * are contained in the Sling repository.
+ */
+public class ReferenceMappingTransformer implements Transformer {
+
+	private static final Logger log = LoggerFactory.getLogger(ReferenceMappingTransformer.class);
+
+	private ContentHandler contentHandler;
+
+	private SlingHttpServletRequest slingRequest;
+
+	private ReferenceMappingTransformerConfig config;
+
+	private boolean enabled = false;
+
+	public ReferenceMappingTransformer(ReferenceMappingTransformerConfig config) {
+		this.config = config;
+	}
+
+	@Override
+	public void setDocumentLocator(Locator locator) {
+		contentHandler.setDocumentLocator(locator);
+	}
+
+	@Override
+	public void startDocument() throws SAXException {
+		contentHandler.startDocument();
+	}
+
+	@Override
+	public void endDocument() throws SAXException {
+		contentHandler.endDocument();
+	}
+
+	@Override
+	public void startPrefixMapping(String prefix, String uri) throws SAXException {
+		contentHandler.startPrefixMapping(prefix, uri);
+	}
+
+	@Override
+	public void endPrefixMapping(String prefix) throws SAXException {
+		contentHandler.endPrefixMapping(prefix);
+	}
+
+	@Override
+	public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
+		atts = mapReferences(atts);
+		contentHandler.startElement(uri, localName, qName, atts);
+	}
+
+	private Attributes mapReferences(Attributes atts) {
+		if (enabled) {
+			AttributesImpl newAtts = new AttributesImpl();
+			for (int i = 0; i < atts.getLength(); i++) {
+				String value = null;
+				if (ArrayUtils.contains(config.mappedAttributes(), atts.getLocalName(i).toLowerCase())
+						&& atts.getValue(i).startsWith("/")) {
+					log.trace("Updating attribute {}", atts.getLocalName(i));
+					value = slingRequest.getResourceResolver().map(slingRequest, atts.getValue(i));
+					log.trace("Mapped value {}", value);
+				} else {
+					log.trace("Skipping attribute {}", atts.getLocalName(i));
+					value = atts.getValue(i);
+				}
+				newAtts.addAttribute(atts.getURI(i), atts.getLocalName(i), atts.getQName(i), atts.getType(i), value);
+			}
+			return newAtts;
+		} else {
+			return atts;
+		}
+	}
+
+	@Override
+	public void endElement(String uri, String localName, String qName) throws SAXException {
+		contentHandler.endElement(uri, localName, qName);
+	}
+
+	@Override
+	public void characters(char[] ch, int start, int length) throws SAXException {
+		contentHandler.characters(ch, start, length);
+	}
+
+	@Override
+	public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
+		contentHandler.ignorableWhitespace(ch, start, length);
+	}
+
+	@Override
+	public void processingInstruction(String target, String data) throws SAXException {
+		contentHandler.processingInstruction(target, data);
+	}
+
+	@Override
+	public void skippedEntity(String name) throws SAXException {
+		contentHandler.skippedEntity(name);
+	}
+
+	@Override
+	public void dispose() {
+	}
+
+	@Override
+	public void init(ProcessingContext context, ProcessingComponentConfiguration cfg) throws IOException {
+		log.trace("init");
+		slingRequest = context.getRequest();
+		if(config != null && config.enabledPaths() != null) {
+			for (String enabledPath : config.enabledPaths()) {
+				if (slingRequest.getResource().getPath().startsWith(enabledPath)) {
+					enabled = true;
+					break;
+				}
+			}
+		}
+	}
+
+	@Override
+	public void setContentHandler(ContentHandler handler) {
+		this.contentHandler = handler;
+	}
+
+}
diff --git a/cms/core/src/main/java/org/apache/sling/cms/core/rewriter/ReferenceMappingTransformerConfig.java b/cms/core/src/main/java/org/apache/sling/cms/core/rewriter/ReferenceMappingTransformerConfig.java
new file mode 100644
index 0000000..b042414
--- /dev/null
+++ b/cms/core/src/main/java/org/apache/sling/cms/core/rewriter/ReferenceMappingTransformerConfig.java
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+package org.apache.sling.cms.core.rewriter;
+
+import org.osgi.service.metatype.annotations.ObjectClassDefinition;
+import org.osgi.service.metatype.annotations.AttributeDefinition;
+
+/**
+ * Configuration for the Reference Mapping Transformer
+ */
+@ObjectClassDefinition(name = "Reference Mapping Transformer Configuration")
+public @interface ReferenceMappingTransformerConfig {
+
+	@AttributeDefinition(name = "Mapped Attributes", description = "Element attributes which should be mapped", defaultValue = {
+			"action", "href", "src" })
+	String[] mappedAttributes();
+
+	@AttributeDefinition(name = "Enabled Paths", description = "Paths under which this transformer will be enabled", defaultValue = {
+			"/content" })
+	String[] enabledPaths();
+
+}
\ No newline at end of file
diff --git a/cms/core/src/main/java/org/apache/sling/cms/core/rewriter/ReferenceMappingTransformerFactory.java b/cms/core/src/main/java/org/apache/sling/cms/core/rewriter/ReferenceMappingTransformerFactory.java
new file mode 100644
index 0000000..e18482d
--- /dev/null
+++ b/cms/core/src/main/java/org/apache/sling/cms/core/rewriter/ReferenceMappingTransformerFactory.java
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+package org.apache.sling.cms.core.rewriter;
+
+import org.apache.sling.rewriter.Transformer;
+import org.apache.sling.rewriter.TransformerFactory;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.ConfigurationPolicy;
+import org.osgi.service.metatype.annotations.Designate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A TransformerFactory service instance for creating a Transformer to rewrite
+ * all of the links, images, etc which reference other content in the Sling
+ * repository.
+ */
+@Component(property = { "pipeline.type=referencemapping" }, service = {
+		TransformerFactory.class }, configurationPolicy = ConfigurationPolicy.REQUIRE)
+@Designate(ocd = ReferenceMappingTransformerConfig.class)
+public class ReferenceMappingTransformerFactory implements TransformerFactory {
+
+	private static final Logger log = LoggerFactory.getLogger(ReferenceMappingTransformerFactory.class);
+	private ReferenceMappingTransformerConfig config;
+
+	
+	@Activate
+    public void activate(ReferenceMappingTransformerConfig config) {
+        this.config = config;
+    }
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.sling.rewriter.TransformerFactory#createTransformer()
+	 */
+	@Override
+	public Transformer createTransformer() {
+		log.trace("createTransformer");
+		return new ReferenceMappingTransformer(config);
+	}
+
+}
diff --git a/cms/core/src/main/java/org/apache/sling/cms/reference/models/Search.java b/cms/core/src/main/java/org/apache/sling/cms/reference/models/Search.java
index 4d0d4e1..485c7d7 100644
--- a/cms/core/src/main/java/org/apache/sling/cms/reference/models/Search.java
+++ b/cms/core/src/main/java/org/apache/sling/cms/reference/models/Search.java
@@ -102,7 +102,7 @@ public class Search {
 
 		String term = Text.escapeIllegalXpathSearchChars(request.getParameter(TERM_PARAMETER)).replaceAll("'", "''");
 
-		String query = "SELECT parent.* FROM [sling:Page] AS parent INNER JOIN [nt:base] AS child ON ISDESCENDANTNODE(child,parent) WHERE ISDESCENDANTNODE(parent, '"
+		String query = "SELECT parent.* FROM [sling:Page] AS parent INNER JOIN [nt:base] AS child ON ISDESCENDANTNODE(child,parent) WHERE  (parent.[jcr:content/hideInSitemap] IS NULL OR parent.[jcr:content/hideInSitemap] <> true) AND ISDESCENDANTNODE(parent, '"
 				+ basePath + "') AND CONTAINS(child.*, '" + term + "')";
 		log.debug("Searching for pages with {} under {} with query: {}", term, basePath, query);
 		Iterator<Resource> res = request.getResourceResolver().findResources(query, Query.JCR_SQL2);
diff --git a/cms/docker/Dockerfile b/cms/docker/Dockerfile
index fd2f615..fb61d74 100644
--- a/cms/docker/Dockerfile
+++ b/cms/docker/Dockerfile
@@ -24,7 +24,7 @@ VOLUME /opt/sling/sling
 
 # Setup Sling CMS
 RUN mkdir -p /opt/sling
-RUN wget https://repository.apache.org/content/repositories/snapshots/org/apache/sling/org.apache.sling.cms.builder/1.0.0-SNAPSHOT/org.apache.sling.cms.builder-1.0.0-20180209.175110-7.jar -O /opt/sling/org.apache.sling.cms.jar
+RUN wget https://repository.apache.org/content/repositories/snapshots/org/apache/sling/org.apache.sling.cms.builder/1.0.0-SNAPSHOT/org.apache.sling.cms.builder-1.0.0-20180306.214948-9.jar
 ENV JAVA_OPTS -Xmx512m
 ENV SLING_OPTS ''
 
diff --git a/cms/ui/src/main/resources/jcr_root/apps/reference/components/pages/base/edit.json b/cms/ui/src/main/resources/jcr_root/apps/reference/components/pages/base/edit.json
index eda9de6..91e6f65 100644
--- a/cms/ui/src/main/resources/jcr_root/apps/reference/components/pages/base/edit.json
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/pages/base/edit.json
@@ -63,6 +63,30 @@
 			"name": "published@TypeHint",
 			"value": "Boolean"
 		},
+		"hideInSitemap": {
+			"jcr:primaryType": "nt:unstructured",
+			"sling:resourceType": "sling-cms/components/editor/fields/select",
+			"label": "Hide in Sitemap",
+			"name": "hideInSitemap",
+			"options": {
+				"no": {
+					"jcr:primaryType": "nt:unstructured",
+					"label": "No",
+					"value": "false"
+				},
+				"yes": {
+					"jcr:primaryType": "nt:unstructured",
+					"label": "Yes",
+					"value": "true"
+				}
+			}
+		},
+		"hideInSitemapTypeHint": {
+			"jcr:primaryType": "nt:unstructured",
+			"sling:resourceType": "sling-cms/components/editor/fields/hidden",
+			"name": "hideInSitemap@TypeHint",
+			"value": "Boolean"
+		},
 		"template": {
 			"jcr:primaryType": "nt:unstructured",
 			"sling:resourceType": "sling-cms/components/editor/fields/text",
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.cms.core.rewriter.ReferenceMappingTransformerConfig.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.cms.core.rewriter.ReferenceMappingTransformerConfig.json
new file mode 100644
index 0000000..1ad6736
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.cms.core.rewriter.ReferenceMappingTransformerConfig.json
@@ -0,0 +1,11 @@
+{
+	"jcr:primaryType": "sling:OsgiConfig",
+	"mappedAttributes": [
+		"action",
+		"href",
+		"src"
+	],
+	"enabledPaths": [
+		"/content"
+	]
+}
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/install/org.apache.sling.engine.impl.auth.SlingAuthenticator.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.engine.impl.auth.SlingAuthenticator.json
similarity index 100%
rename from cms/ui/src/main/resources/jcr_root/libs/sling-cms/install/org.apache.sling.engine.impl.auth.SlingAuthenticator.json
rename to cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.engine.impl.auth.SlingAuthenticator.json
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/install/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl.config b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl.config
similarity index 100%
rename from cms/ui/src/main/resources/jcr_root/libs/sling-cms/install/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl.config
rename to cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl.config
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-sling-cms.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-sling-cms.json
new file mode 100644
index 0000000..57b092f
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-sling-cms.json
@@ -0,0 +1,4 @@
+{
+	"jcr:primaryType": "sling:OsgiConfig",
+	"user.mapping": "org.apache.sling.rewriter=sling-readall"
+}
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/rewriter/reference-mapping-rewriter.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/rewriter/reference-mapping-rewriter.json
new file mode 100644
index 0000000..95d3008
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/rewriter/reference-mapping-rewriter.json
@@ -0,0 +1,38 @@
+{
+	"jcr:primaryType": "nt:unstructured",
+	"contentTypes": [
+		"text/html"
+	],
+	"enabled": true,
+	"extensions": [
+		"html"
+	],
+	"generatorType": "html-generator",
+	"order": 1000,
+	"paths": [
+		"/content"
+	],
+	"serializerType": "html-serializer",
+	"transformerTypes": [
+		"referencemapping"
+	],
+	"generator-html-generator": {
+		"jcr:primaryType": "nt:unstructured",
+		"includeTags": [
+			"A",
+			"AREA",
+			"AUDIO",
+			"BASE",
+			"EMBED",
+			"FORM",
+			"IFRAME",
+			"IMG",
+			"LINK",
+			"OBJECT",
+			"SCRIPT",
+			"SOURCE",
+			"TRACK",
+			"VIDEO"
+		]
+	}
+}
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
dklco@apache.org.