Remote JCR Session from Standalone Java program for AEM Cloud Instance | Community
Skip to main content
Level 3
March 24, 2022
Solved

Remote JCR Session from Standalone Java program for AEM Cloud Instance

  • March 24, 2022
  • 2 replies
  • 1555 views

Hi All,

Is it possible to get a JCR session from a standalone Java program for an AEM instance running in a cloud? We have a usecase where we need to manipulate properties of hundreds of assets under a folder tree based on the parent folder name (such as pdfs, photos) etc. I was thinking about writing a java program to recursively crawl down the folder and inspect various nodes under the main folder and manipulate it as needed. I can get the jcrsession running AEM SDK in local machine but I am skeptical that it will work for the AEM instance running in the cloud as I would not have access to /crx/server node.

Anyone has attempted to do this before? I would greatly appreciate any helpful pointers.

 

Thanks,

SKM_AEM

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

No, JCR remoting is not possible with AEM CS.

2 replies

Anmol_Bhardwaj
Community Advisor
Community Advisor
March 25, 2022

Hi @skmaem ,
What you are trying to achieve can be done in 2 ways:

1. Write the code in Java and trigger it based on a servlet. This way you can push the code to cloud and then simply trigger the code on hit of the servlet, when you want to.

2. Write a groovy script, and run it in the groovy console. This would not need any code changes to be pushed. Although, you can push the script through code and then run it in the groovy console.

 

https://hashimkhan.in/aem-adobecq5-code-templates/groovy-script/ 

skmAemAuthor
Level 3
March 28, 2022

Hi @anmol_bhardwaj ,

 

Thanks for the reply. I will look into the servlet route as I am not familiar with Groovy. I wish there was a way to get a AEM/sling/jcr session from a standalone Java program for better debugging/tracing.

 

Thanks again!

-SKM

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
March 29, 2022

No, JCR remoting is not possible with AEM CS.