[GitHub] [sling-org-apache-sling-servlets-resolver] cziegeler commented on a change in pull request #9: SLING-9365: add merging resource provider for servlets.

2020-04-28 Thread GitBox


cziegeler commented on a change in pull request #9:
URL: 
https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/9#discussion_r417073596



##
File path: 
src/main/java/org/apache/sling/servlets/resolver/internal/resource/MergingServletResourceProvider.java
##
@@ -0,0 +1,166 @@
+/*

Review comment:
   Is this still needed?





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [sling-org-apache-sling-servlets-resolver] cziegeler commented on a change in pull request #9: SLING-9365: add merging resource provider for servlets.

2020-04-28 Thread GitBox


cziegeler commented on a change in pull request #9:
URL: 
https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/9#discussion_r417073182



##
File path: 
src/main/java/org/apache/sling/servlets/resolver/internal/ScriptResourceDecorator.java
##
@@ -0,0 +1,98 @@
+/*
+ * 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.servlets.resolver.internal;
+
+import java.util.Iterator;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceDecorator;
+import org.apache.sling.api.resource.ResourceResolver;
+import 
org.apache.sling.servlets.resolver.internal.resource.MergingServletResourceProvider;
+import org.apache.sling.spi.resource.provider.ResolveContext;
+import org.apache.sling.spi.resource.provider.ResourceContext;
+import org.apache.sling.spi.resource.provider.ResourceProvider;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+
+@Component
+public class ScriptResourceDecorator implements ResourceDecorator {
+private final MergingServletResourceProvider provider;
+
+@Activate
+public ScriptResourceDecorator(@Reference MergingServletResourceProvider 
provider) {
+this.provider = provider;
+}
+
+@Override
+public Resource decorate(Resource resource) {
+String path = resource.getPath();

Review comment:
   This probably can be optimized to decorate only for certain paths





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [sling-org-apache-sling-servlets-resolver] cziegeler commented on a change in pull request #9: SLING-9365: add merging resource provider for servlets.

2020-04-28 Thread GitBox


cziegeler commented on a change in pull request #9:
URL: 
https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/9#discussion_r417072772



##
File path: 
src/main/java/org/apache/sling/servlets/resolver/internal/ResolverConfig.java
##
@@ -58,4 +58,9 @@
 @AttributeDefinition(name = "Default Extensions", description = "The list 
of extensions for which the default behavior "
 + "will be used. This means that the last path segment of the 
resource type can be used as the script name.")
 String[] servletresolver_defaultExtensions() default "html";
+
+@AttributeDefinition(name = "Mount Internal", description = "Should 
servlets be mounted internally and not as a resource provider. If true,"

Review comment:
   Is this description still accurate? (And I assume the title/description 
of the jira issue need updates as well)





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org