incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r810875 - in /sling/trunk/bundles/servlets: get/src/main/java/org/apache/sling/servlets/get/impl/ post/src/main/java/org/apache/sling/servlets/post/impl/
Date Thu, 03 Sep 2009 10:37:04 GMT
Author: fmeschbe
Date: Thu Sep  3 10:37:03 2009
New Revision: 810875

URL: http://svn.apache.org/viewvc?rev=810875&view=rev
Log:
SLING-1096 register SLING default servlets using the
last search path entry as the path prefix

Modified:
    sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/DefaultGetServlet.java
    sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/JsonQueryServlet.java
    sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java
    sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java

Modified: sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/DefaultGetServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/DefaultGetServlet.java?rev=810875&r1=810874&r2=810875&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/DefaultGetServlet.java
(original)
+++ sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/DefaultGetServlet.java
Thu Sep  3 10:37:03 2009
@@ -56,6 +56,7 @@
  * Use this as a default servlet for Sling
  * @scr.property name="sling.servlet.resourceTypes"
  *               value="sling/servlet/default" private="true"
+ * @scr.property name="sling.servlet.prefix" value="-1" type="Integer" private="true"
  *
  * Generic handler for all get requests
  * @scr.property name="sling.servlet.methods" value="GET" private="true"

Modified: sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/JsonQueryServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/JsonQueryServlet.java?rev=810875&r1=810874&r2=810875&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/JsonQueryServlet.java
(original)
+++ sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/JsonQueryServlet.java
Thu Sep  3 10:37:03 2009
@@ -56,6 +56,7 @@
  *               value="sling/servlet/default"
  * @scr.property name="sling.servlet.extensions" value="json"
  * @scr.property name="sling.servlet.selectors" value="query"
+ * @scr.property name="sling.servlet.prefix" value="-1" type="Integer" private="true"
  */
 public class JsonQueryServlet extends SlingSafeMethodsServlet {
 
@@ -198,7 +199,7 @@
         if (nodeRes == null) {
             return;
         }
-        
+
         itemWriter.dumpProperties(nodeRes, w, properties);
         
     }

Modified: sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java?rev=810875&r1=810874&r2=810875&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java
(original)
+++ sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java
Thu Sep  3 10:37:03 2009
@@ -57,6 +57,7 @@
  *
  * @scr.property name="sling.servlet.resourceTypes" value="sling:redirect"
  * @scr.property name="sling.servlet.methods" value="GET"
+ * @scr.property name="sling.servlet.prefix" value="-1" type="Integer" private="true"
  */
 public class RedirectServlet extends SlingSafeMethodsServlet {
 
@@ -180,7 +181,7 @@
         if (base.endsWith("/")) {
             base = base.concat(String.valueOf(Character.MAX_VALUE));
         }
-        
+
         String[] bParts = base.substring(1).split("/");
         String[] tParts = target.substring(1).split("/");
 

Modified: sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java?rev=810875&r1=810874&r2=810875&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java
(original)
+++ sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java
Thu Sep  3 10:37:03 2009
@@ -51,25 +51,26 @@
 
 /**
  * POST servlet that implements the sling client library "protocol"
- * 
+ *
  * @scr.component immediate="true" label="%servlet.post.name"
  *                description="%servlet.post.description"
  * @scr.service interface="javax.servlet.Servlet"
  * @scr.property name="service.description" value="Sling Post Servlet"
  * @scr.property name="service.vendor" value="The Apache Software Foundation"
- * 
+ *
  * Use this as the default servlet for POST requests for Sling
  * @scr.property name="sling.servlet.resourceTypes"
  *               value="sling/servlet/default" private="true"
  * @scr.property name="sling.servlet.methods" value="POST" private="true"
- * 
+ * @scr.property name="sling.servlet.prefix" value="-1" type="Integer" private="true"
+ *
  * Get all SlingPostProcessors
  * @scr.reference name="postProcessor"
  *                interface="org.apache.sling.servlets.post.SlingPostProcessor"
  *                cardinality="0..n" policy="dynamic"
- * @scr.reference name="postOperation" 
- * 					interface="org.apache.sling.servlets.post.SlingPostOperation" 
- * 					cardinality="0..n" 
+ * @scr.reference name="postOperation"
+ * 					interface="org.apache.sling.servlets.post.SlingPostOperation"
+ * 					cardinality="0..n"
  * 					policy="dynamic"
  */
 public class SlingPostServlet extends SlingAllMethodsServlet {
@@ -118,7 +119,7 @@
     private final Map<String, SlingPostOperation> postOperations = new HashMap<String,
SlingPostOperation>();
 
     private final List<ServiceReference> delayedPostProcessors = new ArrayList<ServiceReference>();
-    
+
     private final List<ServiceReference> postProcessors = new ArrayList<ServiceReference>();
 
     private SlingPostProcessor[] cachedPostProcessors = new SlingPostProcessor[0];
@@ -316,7 +317,7 @@
         dateParser = null;
         this.componentContext = null;
     }
-    
+
     protected void bindPostOperation(ServiceReference ref) {
     	synchronized ( this.delayedPostOperations ) {
 			if (this.componentContext == null) {
@@ -326,7 +327,7 @@
 			}
 		}
     }
-    
+
     protected void registerPostOperation(ServiceReference ref) {
     	String operationName = (String) ref.getProperty(SlingPostOperation.PROP_OPERATION_NAME);
 		SlingPostOperation operation = (SlingPostOperation) this.componentContext.locateService("postOperation",
ref);
@@ -334,7 +335,7 @@
 			this.postOperations.put(operationName, operation);
     	}
     }
-    
+
     protected void unbindPostOperation(ServiceReference ref) {
     	synchronized ( this.delayedPostOperations ) {
         	String operationName = (String) ref.getProperty(SlingPostOperation.PROP_OPERATION_NAME);



Mime
View raw message