1 Reply Latest reply on May 27, 2013 5:02 PM by Sham HC

    Extending ProfileImages.java for custom selectors

    Mshajiahmed Level 4

      I am trying to extend ProfileImages servlet from /libs/foundation/src/impl/src/main/java/com/day/cq/wcm/foundation/profile/impl/ProfileIma ges.java

      and bundling as an OSGI service.

      I have the following annotations




          resourceTypes = {"nt:file"},

          methods = {"GET"},

          selectors = {"adjust","adjust.small"},

          extensions = {"res", "jpg", "png", "gif"}



      I see my service in bundles and Services in OSGI console. However it is not doing as ProfileImages servlet used to do

      ProfileImages create the thumbnail if we invoke the following URL

      http://localhost:4502/content/dam/geometrixx/portraits/scott_reynolds.jpg.prof.thumbnail.1 00.100.jpg

      If my servlet is invoke, I should get the same response

      http://localhost:4502/content/dam/geometrixx/portraits/scott_reynolds.jpg.adjust.small.100 .100.jpg

      However I am getting is 404 which is from the DefaultGetServlet

      It seems that Sling servet is not able to resolve my servlet

      One thing I need to know is how to get my service updated in

      Apache Sling Servlet Resolverorg.apache.sling.servlets.resolver


      My servlet is doing the same thing as the following service in  sling servlet resolver


      Service ID 843    Types: org.apache.sling.api.resource.ResourceProvider

      Description: ServletResourceProvider for Servlets at [/libs/foundation/components/primary/nt/file/prof/thumbnail.gif.servlet, /libs/foundation/components/primary/nt/file/prof.gif.servlet, /libs/foundation/components/primary/nt/file/prof/thumbnail.res.servlet, /libs/foundation/components/primary/nt/file/prof.jpg.servlet, /libs/foundation/components/primary/nt/file/prof.png.servlet, /libs/foundation/components/primary/nt/file/prof/thumbnail.png.servlet, /libs/foundation/components/primary/nt/file/prof/thumbnail.jpg.servlet, /libs/foundation/components/primary/nt/file/prof.res.servlet]



      My service should be listed in sling resolver  with id and something like

      ...../adjust.small.jpg.servlet, ..../adjust.res.servlet

      Is there any configurations I have to do to get my service in  over resource resolver?