skip to Main Content

We have a multi-tenancy website. We are trying to use social share components where the url needs to be shared. Since we have a dispatcher configured, we are picking up the domain from a context aware configuration. How do we use different domains for environments based on run-modes

I have tried to use different ca-config folder for each environment but this is not ideal.

3

Answers


  1. Sling context aware configurations don’t work on run modes. For your current requirement you should be using Externalizer service which works basis sling maps, request origin and OSGI configs based on what method you choose.

    https://helpx.adobe.com/in/experience-manager/6-3/sites/developing/using/externalizer.html

    https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/javadoc/com/day/cq/commons/Externalizer.html

    Login or Signup to reply.
  2. You can use Day CQ Link Externalizer which is available in the OSGI configurations, http://localhost:4502/system/console/configMgr.

    It is an OSGI service that allows you to programmatic-ally transform a resource path into an external and absolute URL. You can configure this configuration for different run modes

    Login or Signup to reply.
  3. You can also use a 2-step approach. 1st you create a Run-Mode dependent OSGi config. 2nd you use the built-in Override via OSGi configuration.

    See here: https://sling.apache.org/documentation/bundles/context-aware-configuration/context-aware-configuration-override.html#override-via-osgi-configuration

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search