How to deploy and access the OSGi suite from REST in Adobe CQ?

I have an OSGi bundle (running under Felix) using Jersey and providing a RESTful resource. All this works fine, and I can call the service through my browser and get a JSON response.

Now, what I would like to do is deploy the same package in Adobe CQ and access the resource through CQ (for example, / mycq / services / my-service).

Any pointers on how to deploy existing OSGi packages in CQ and, more specifically, β€œaccess” the Jersey REST resource in the bundle?

+4
source share
2 answers

The Maven Sling plugin allows you to deploy an OSGi package for a local or remote executable CQ instance.

Source: OSGi Package Deployment

+2
source

Apache Stanbol uses Jersey in the OSGi environment, which is pretty similar to the Apache Sling on which CQ5 is based. Seeing how integrated Jersey is can help.

https://issues.apache.org/jira/browse/SLING-2192 also has some experimental code that can help.

Note that Sling expects to capture all the URI space that is needed specifically for access control, so some bridge code is probably needed.

0
source

Source: https://habr.com/ru/post/1440872/


All Articles