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

[sling-org-apache-sling-servlets-annotations] branch master updated: SLING-8170 - Allow Sling servlets to declare a resource super type

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

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


The following commit(s) were added to refs/heads/master by this push:
     new e6040fc  SLING-8170 - Allow Sling servlets to declare a resource super type
e6040fc is described below

commit e6040fc2f30519acb911a106ca0cc295776ca506
Author: Radu Cotescu <17...@users.noreply.github.com>
AuthorDate: Thu Dec 13 17:58:06 2018 +0100

    SLING-8170 - Allow Sling servlets to declare a resource super type
---
 pom.xml                                            |  2 +-
 .../annotations/SlingServletResourceTypes.java     | 23 ++++++++++++++++------
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/pom.xml b/pom.xml
index 959c104..ba27645 100644
--- a/pom.xml
+++ b/pom.xml
@@ -58,7 +58,7 @@
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.api</artifactId>
             <!-- https://issues.apache.org/jira/browse/SLING-6249, only for link in javadoc -->
-            <version>2.16.0</version>
+            <version>2.18.5-SNAPSHOT</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
diff --git a/src/main/java/org/apache/sling/servlets/annotations/SlingServletResourceTypes.java b/src/main/java/org/apache/sling/servlets/annotations/SlingServletResourceTypes.java
index 053d66e..a69f07f 100644
--- a/src/main/java/org/apache/sling/servlets/annotations/SlingServletResourceTypes.java
+++ b/src/main/java/org/apache/sling/servlets/annotations/SlingServletResourceTypes.java
@@ -22,7 +22,7 @@ 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 resource type.
- * 
+ *
  * @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>
@@ -43,18 +43,29 @@ public @interface SlingServletResourceTypes {
      * @return the resource type(s)
      */
     String[] resourceTypes();
-    
+
+    /**
+     * The resource super type from which the servlet inherits (value is "sling.servlet.resourceSuperType").
+     *
+     * <p>In order for this property to be taken into consideration, the {@code org.apache.sling.servlets.resolver} bundle needs to be
+     * deployed on the system, version 2.5.0 or above.
+     *
+     * @return the resource super type
+     * @see ServletResolverConstants#SLING_SERVLET_RESOURCE_SUPER_TYPE
+     */
+    String resourceSuperType();
+
     /**
      * One ore more request URL selectors supported by the servlet. The
      * selectors must be configured in the order as they would be specified in the URL that
      * is as a list of dot-separated strings such as <em>print.a4</em>.
-     * In case this is not empty the first selector(s) (i.e. the one on the left in the URL) must match, 
+     * In case this is not empty the first selector(s) (i.e. the one on the left in the URL) must match,
      * otherwise the servlet is not executed. After that may follow arbitrarily many non-registered selectors.
      * @return the selector(s)
      * @see ServletResolverConstants#SLING_SERVLET_SELECTORS
      */
     String[] selectors() default {};
-    
+
     /**
      * The request URL extensions supported by the servlet.
      * <p>
@@ -63,9 +74,9 @@ public @interface SlingServletResourceTypes {
      * @see ServletResolverConstants#SLING_SERVLET_EXTENSIONS
      */
     String[] extensions() default {};
-    
+
     /**
-     * The request methods supported by the servlet. The value may be one of the HTTP 
+     * The request methods supported by the servlet. The value may be one of the HTTP
      * methods or "*" for all methods.
      * <p>
      * If this is not set (i.e. empty array) it is assumed to be {@code GET} and {@code HEAD}.