Highlighted

Upgrading a sling servlet from CQ 5.5 to AEM 6.2

bhavanij4849392

28-05-2018

Hi,

I have this old Pdf generation service which was written for cq 5.5. The service is based on a servlet written for 5.5. The issue is the servlet bundle seems to be active. on 6.2 But i am not able to invoke the servlet. i have no experience working on CQ 5.5.

I think the servlet needs to be rewritten completely. below is the servlet header.  In 5.5 the servlet path is actually under the /apps folder.

Also the source code is loaded in the apps folder and the transformation xsl is referenced from the /apps/src folder. The servlet is also bundled in a jar with the name - com.pdfservice.PDFService.

@SlingServlet(paths = { "/apps/csr/services/PdfBuilder.pdf" }, methods = { "GET" }, metatype = true)

@Properties( {

        @Property(name = "service.pid", value = "com.pdfservice.Service", propertyPrivate = false),

        @Property(name = "service.description", value = "A servlet used for generating PDFs from CQ5 templates.", propertyPrivate = false),

        @Property(name = "service.vendor", value = " Test Group- stp@testGroup.com", propertyPrivate = false) })

public class Service extends SlingAllMethodsServlet {

  private static final String XSL_PATH = "apps/csr/src/com.pdfservice.PDFService/src/issue-builder-transformation.xsl";

Can anyone please help on how to upgrade the servlet for compatibility with AEM 6.2.

Thanks,

Bhavani

Replies