You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2020/04/28 22:20:48 UTC
[GitHub] [sling-org-apache-sling-servlets-resolver] karlpauls opened a new pull request #9: SLING-9365: add merging resource provider for servlets.
karlpauls opened a new pull request #9:
URL: https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/9
----------------------------------------------------------------
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:
users@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.
Posted by GitBox <gi...@apache.org>.
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:
users@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.
Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-servlets-resolver] karlpauls commented on pull request #9: SLING-9365: add merging resource provider for servlets.
Posted by GitBox <gi...@apache.org>.
karlpauls commented on pull request #9:
URL: https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/9#issuecomment-620885757
@cziegeler PTAL
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-servlets-resolver] sonarcloud[bot] commented on pull request #9: SLING-9365: add merging resource provider for servlets.
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #9:
URL: https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/9#issuecomment-620904312
SonarCloud Quality Gate failed.
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=9&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B.png' alt='B' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=9&resolved=false&types=BUG) [3 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=9&resolved=false&types=BUG)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=9&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=9&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=9&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=9&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=9&resolved=false&types=SECURITY_HOTSPOT) to review)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=9&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=9&resolved=false&types=CODE_SMELL) [30 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=9&resolved=false&types=CODE_SMELL)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0.png' alt='10.4%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=9&metric=new_coverage&view=list) [10.4% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=9&metric=new_coverage&view=list)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=9&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-servlets-resolver&pullRequest=9&metric=new_duplicated_lines_density&view=list)
----------------------------------------------------------------
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:
users@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.
Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org