Skip to main content
Siva_Sogalapalli
Community Advisor
Community Advisor
October 11, 2017
Beantwortet

How to get Custom defined Run mode?

  • October 11, 2017
  • 3 Antworten
  • 1966 Ansichten

Hi All,

We have defined custom run mode for our AEM server like dev.publish. I'm using below code to get run mode.

  @Reference
  private SlingSettingsService slingSettingsService;

  slingSettingsService.getRunModes() is giving Set of Run modes including default like [crx3, author, samplecontent, dev.publish, crx3tar], but we need only custom run mode.

But is there a way where I can get only custom defined run mode (i.e. dev.publish)?

Quick response would be more helpful..

Thanks

Siva

Dieses Thema wurde für Antworten geschlossen.
Beste Antwort von joerghoh

Specifically for you:

  AEM coding pattern: Run-mode specific code | Things on a content management system

:-)

Jörg

3 Antworten

joerghoh
Adobe Employee
Adobe Employee
October 11, 2017

Hi,

when you check in your code if a specific runmode is set, you are doing it wrong. Rather use an OSGI configuration property and use the runmode-based configuration to configure it. And then just use this configuration.

(And to answer your question: No, that is not possible. )

Jörg

October 12, 2017

alternatively, you can check your run mode using :

slingSettingsService.getRunModes().contains("dev.publish");

joerghoh
Adobe Employee
joerghohAdobe EmployeeAntwort
Adobe Employee
October 12, 2017