You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2020/03/13 07:29:18 UTC

[sling-org-apache-sling-servlets-annotations] branch feature/paths-strict-metaannotation created (now aa285ae)

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

kwin pushed a change to branch feature/paths-strict-metaannotation
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-servlets-annotations.git.


      at aa285ae  enrich javadoc

This branch includes the following new commits:

     new af30df2  SLING-9055 use meta annotation for property sling.servlet.paths-strict
     new aa285ae  enrich javadoc

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[sling-org-apache-sling-servlets-annotations] 01/02: SLING-9055 use meta annotation for property sling.servlet.paths-strict

Posted by kw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch feature/paths-strict-metaannotation
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-servlets-annotations.git

commit af30df2cc035d1c3d69bc66c9ab58247471f6b1e
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Fri Mar 13 08:25:28 2020 +0100

    SLING-9055 use meta annotation for property sling.servlet.paths-strict
---
 .../annotations/SlingServletPathsStrict.java       |  8 +-----
 .../annotations/SlingServletPaths_Strict.java      | 29 ++++++++++++++++++++++
 2 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/sling/servlets/annotations/SlingServletPathsStrict.java b/src/main/java/org/apache/sling/servlets/annotations/SlingServletPathsStrict.java
index 9cae955..be4a968 100644
--- a/src/main/java/org/apache/sling/servlets/annotations/SlingServletPathsStrict.java
+++ b/src/main/java/org/apache/sling/servlets/annotations/SlingServletPathsStrict.java
@@ -42,6 +42,7 @@ import org.osgi.service.component.annotations.ComponentPropertyType;
     version="1.1")
 
 @ComponentPropertyType
+@SlingServletPaths_Strict
 public @interface SlingServletPathsStrict {
     /**
      * Prefix for every property being generated from the annotations elements (as defined in OSGi 7 Compendium, 112.8.2.1)
@@ -64,13 +65,6 @@ public @interface SlingServletPathsStrict {
      */
     String[] paths();
 
-    /** Activate the strict resolution mode. Must be set to true
-     *  (which is the default) for the other options besides "paths"
-     *  to be taken into account.
-     * @return the "strict" option value
-     */
-    boolean paths_strict() default true;
-
     /**
      * One or more request URL selectors supported by the servlet. If specified,
      * all selectors must match for the servlet to be selected.
diff --git a/src/main/java/org/apache/sling/servlets/annotations/SlingServletPaths_Strict.java b/src/main/java/org/apache/sling/servlets/annotations/SlingServletPaths_Strict.java
new file mode 100644
index 0000000..1579718
--- /dev/null
+++ b/src/main/java/org/apache/sling/servlets/annotations/SlingServletPaths_Strict.java
@@ -0,0 +1,29 @@
+/*
+ * 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.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+/**
+ * Marker meta-annotation to activate the strict resolution mode. 
+ * Only supposed to be used on the {@link SlingServletPathsStrict} to set the property correctly without allowing to modify it
+ */
+@Target(ElementType.ANNOTATION_TYPE)
+@interface SlingServletPaths_Strict {
+
+}


[sling-org-apache-sling-servlets-annotations] 02/02: enrich javadoc

Posted by kw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch feature/paths-strict-metaannotation
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-servlets-annotations.git

commit aa285aee6b6463445e2c98e703d04c5dd48fbd19
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Fri Mar 13 08:27:53 2020 +0100

    enrich javadoc
---
 .../java/org/apache/sling/servlets/annotations/SlingServletPaths.java | 1 +
 .../apache/sling/servlets/annotations/SlingServletPathsStrict.java    | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/servlets/annotations/SlingServletPaths.java b/src/main/java/org/apache/sling/servlets/annotations/SlingServletPaths.java
index 5e25134..effe315 100644
--- a/src/main/java/org/apache/sling/servlets/annotations/SlingServletPaths.java
+++ b/src/main/java/org/apache/sling/servlets/annotations/SlingServletPaths.java
@@ -29,6 +29,7 @@ import org.osgi.service.component.annotations.ComponentPropertyType;
  * @see <a href="https://sling.apache.org/documentation/the-sling-engine/servlets.html">Sling Servlets</a>
  * @see ServletResolverConstants
  * @see <a href="https://github.com/apache/felix/blob/trunk/tools/org.apache.felix.scr.annotations/src/main/java/org/apache/felix/scr/annotations/sling/SlingServlet.java">Felix SCR annotation</a>
+ * @see SlingServletPathsStrict
  */
 @ComponentPropertyType
 public @interface SlingServletPaths {
diff --git a/src/main/java/org/apache/sling/servlets/annotations/SlingServletPathsStrict.java b/src/main/java/org/apache/sling/servlets/annotations/SlingServletPathsStrict.java
index be4a968..c9c0f43 100644
--- a/src/main/java/org/apache/sling/servlets/annotations/SlingServletPathsStrict.java
+++ b/src/main/java/org/apache/sling/servlets/annotations/SlingServletPathsStrict.java
@@ -23,7 +23,8 @@ import org.osgi.service.component.annotations.ComponentPropertyType;
  * Component Property Type (as defined by OSGi DS 1.4) for Sling Servlets.
  * 
  * Takes care of writing the relevant service properties as being used by the Sling Servlet Resolver ({@link ServletResolverConstants})
- * to register the annotated servlet component as Sling servlet for a specific path, using the SLING-8110 strict mode which
+ * to register the annotated servlet component as Sling servlet for a specific path, using the strict mode 
+ * (defined in <a href="https://issues.apache.org/jira/browse/SLING-8110">SLING-8110</a>) which
  * optionally takes into account the request's extension, selectors and HTTP method.
  * 
  * Preferably register Sling servlets by resource type ({@link SlingServletResourceTypes}) though 
@@ -33,6 +34,7 @@ import org.osgi.service.component.annotations.ComponentPropertyType;
  * @see <a href="https://sling.apache.org/documentation/the-sling-engine/servlets.html">Sling Servlets</a>
  * @see ServletResolverConstants
  * @see <a href="https://github.com/apache/felix/blob/trunk/tools/org.apache.felix.scr.annotations/src/main/java/org/apache/felix/scr/annotations/sling/SlingServlet.java">Felix SCR annotation</a>
+ * @see SlingServletPaths
  */
 
 /** Using this requires the SLING-8110 strict mode */