AEM run mode in Adaptive form | Community
Skip to main content
Level 3
December 3, 2024
Solved

AEM run mode in Adaptive form

  • December 3, 2024
  • 2 replies
  • 704 views

Hello ,

 

How to get the run mode in Adaptive form using rule editor.

Is it good idea to expose this values at client side , by having a call to custom  AEM servlet in rule editor

 

Please provide input

 

Regards,

Srinivas

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 LavanyaJeevakan

Hi Srinivas,

I had one such requirement, (though not a runmode to be fetched in a rule editor) , but some configuration properties based on the run mode to be fetched. These configuration properties were saved as per individual run modes in respective OSGI configs, which were fetched in clientlibs via clientside requests like Ajax or Fetch (HTTP requests), and the resultant data(JSON in my case) got utilized in scripts, be it in rule editor or in clientlib.

Likewise, if a configuration property denoting the runmode can be saved in respective OSGIconfig JSON files, then runmode, can be obtained via aforementioned approach.

Only caveat, in my opinion is the exposure of these obtained data in browser's network tab plus a network call made. However, if those runmodes can be represented by your custom abbreviations, then this approach can work.

 

Hopefully, this helps!

2 replies

Vijay_Katoch
Community Advisor
Community Advisor
December 3, 2024
Level 3
December 3, 2024

Hello @vijay_katoch ,

 

As I would want to check this at rule editor , so calling this as part as servlet  call is that good enough.

 

As in the above URL , you mentioned they are suggesting it as hidden variable

 

Please suggest.

 

Regards,

Srinivas

LavanyaJeevakanAccepted solution
December 4, 2024

Hi Srinivas,

I had one such requirement, (though not a runmode to be fetched in a rule editor) , but some configuration properties based on the run mode to be fetched. These configuration properties were saved as per individual run modes in respective OSGI configs, which were fetched in clientlibs via clientside requests like Ajax or Fetch (HTTP requests), and the resultant data(JSON in my case) got utilized in scripts, be it in rule editor or in clientlib.

Likewise, if a configuration property denoting the runmode can be saved in respective OSGIconfig JSON files, then runmode, can be obtained via aforementioned approach.

Only caveat, in my opinion is the exposure of these obtained data in browser's network tab plus a network call made. However, if those runmodes can be represented by your custom abbreviations, then this approach can work.

 

Hopefully, this helps!