0
votes

Is there a way to connect JCR/CRX(AEM) remotely apart from RMI/WEBDAV/JNDI? WEBDAV & RMI are not recommended to be open in PROD environment so I don't want to take that route in spite of a working solution.

Options explored which doesn't seem to fit my use case:

  1. SLING API - sling.apache.org/documentation/development/repository-based-development.html
  2. OAK API - github.com/davidegiannella/adaptTo16
  3. REST/JSON - adapt.to/2016/en/schedule/remote-resources.html . Will work for a direct resource access but not for querying or CRUD operations.
  4. JCR API- http://experience-aem.blogspot.com/2015/05/aem-6-sp2-accessing-crx-remotely-using-jcr-remoting-davex.html or https://wiki.apache.org/jackrabbit/RemoteAccess

Any pointers?

1
what is your use-case? Why do you need remote access to AEM instance and that too prod environment?Ameesh Trikha
AEM content will be used as a knowledge hub and other apps in the ecosystem will query the content. Unfortunately, we are not in a position to re-architect the infrastructure which hosts apps in both DMZ & non DMZ.user7027991
@user7027991 I wonder how you connect to an Oak server via JCR in the first place. Does work for Jackrabbit2, but not sure how it works for Oak. Added the question on SO here: stackoverflow.com/questions/40191705/… Not sure if it's the same what you are looking for. It's not AEM/CQ5 related.Mathias Conradt

1 Answers

1
votes

Given that Apache Sling is very good at exposing resources via HTTP, my first option would be to use the Sling Get Servlet to get resources as JSON.

For instance, accessing http://localhost:8080/content.json will get you a JSON rendering of the resource at /content.

If you want to get more data in you can specify the number of children to traverse down the hierarchy using a selector. http://localhost:8080/content.2.json will give you the properties of content and those of the children and grand-children.

If that is not enough for you, you can always create a custom servlet and perform the rendering there.