incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1356373 - in /sling/trunk/bundles/servlets/compat: pom.xml src/main/java/org/apache/sling/servlets/compat/impl/JsonQueryServlet.java
Date Mon, 02 Jul 2012 17:41:52 GMT
Author: cziegeler
Date: Mon Jul  2 17:41:51 2012
New Revision: 1356373

URL: http://svn.apache.org/viewvc?rev=1356373&view=rev
Log:
SLING-2363 Replace JavaDoc SCR annotations with Java SCR annotations

Modified:
    sling/trunk/bundles/servlets/compat/pom.xml
    sling/trunk/bundles/servlets/compat/src/main/java/org/apache/sling/servlets/compat/impl/JsonQueryServlet.java

Modified: sling/trunk/bundles/servlets/compat/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/compat/pom.xml?rev=1356373&r1=1356372&r2=1356373&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/compat/pom.xml (original)
+++ sling/trunk/bundles/servlets/compat/pom.xml Mon Jul  2 17:41:51 2012
@@ -104,5 +104,9 @@
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
         </dependency>
+        <dependency>
+        	<groupId>org.apache.felix</groupId>
+        	<artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
     </dependencies>
 </project>

Modified: sling/trunk/bundles/servlets/compat/src/main/java/org/apache/sling/servlets/compat/impl/JsonQueryServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/compat/src/main/java/org/apache/sling/servlets/compat/impl/JsonQueryServlet.java?rev=1356373&r1=1356372&r2=1356373&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/compat/src/main/java/org/apache/sling/servlets/compat/impl/JsonQueryServlet.java
(original)
+++ sling/trunk/bundles/servlets/compat/src/main/java/org/apache/sling/servlets/compat/impl/JsonQueryServlet.java
Mon Jul  2 17:41:51 2012
@@ -24,6 +24,10 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.SlingException;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
@@ -40,19 +44,18 @@ import org.slf4j.LoggerFactory;
 /**
  * A SlingSafeMethodsServlet that renders the search results as JSON data
  *
- * @scr.component immediate="true" metatype="no"
- * @scr.service interface="javax.servlet.Servlet"
- *
- * @scr.property name="service.description" value="Default Query Servlet"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- *
  * Use this as the default query servlet for json get requests for Sling
- * @scr.property name="sling.servlet.resourceTypes"
- *               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"
  */
+@Component
+@Service(value=javax.servlet.Servlet.class)
+@Properties({
+    @Property(name="service.description", value="Default Query Servlet"),
+    @Property(name="service.vendor",value="The Apache Software Foundation"),
+    @Property(name="sling.servlet.resourceTypes", value="sling/servlet/default"),
+    @Property(name="sling.servlet.extensions", value="json"),
+    @Property(name="sling.servlet.selectors", value="query"),
+    @Property(name="sling.servlet.prefix", intValue=-1, propertyPrivate=true)
+})
 public class JsonQueryServlet extends SlingSafeMethodsServlet {
 
     private static final long serialVersionUID = 1L;
@@ -81,13 +84,13 @@ public class JsonQueryServlet extends Sl
     private static final String REP_EXCERPT = "rep:excerpt()";
 
     public static final String TIDY = "tidy";
-    
+
     private final JsonResourceWriter itemWriter;
 
     public JsonQueryServlet() {
         itemWriter = new JsonResourceWriter(null);
     }
-    
+
     /** True if our request wants the "tidy" pretty-printed format */
     protected boolean isTidy(SlingHttpServletRequest req) {
         for(String selector : req.getRequestPathInfo().getSelectors()) {
@@ -114,7 +117,7 @@ public class JsonQueryServlet extends Sl
     protected String getQueryType(SlingHttpServletRequest req) {
         return req.getParameter(QUERY_TYPE);
     }
-    
+
 
     /**
      * Retrieve the query statement from the request.
@@ -161,7 +164,7 @@ public class JsonQueryServlet extends Sl
 
             final JSONWriter w = new JSONWriter(resp.getWriter());
             w.setTidy(isTidy(req));
-            
+
             w.array();
 
             long count = -1;



Mime
View raw message