Hello All - Is there a way to configure the externalizer for multiple publish domains? We have 4 domains in our project and would like to maintain the externalizer config based on run-modes. In the externalizer config it says, we need to specify publish followed by domain to specify the configs. i.e
publish www.example1.com
publish www.example2.com
publish www.example3.com
publish www.example4.com
How can I specify the configs. Since all are different domains.
com.day.cq.commons.impl.ExternalizerImpl
Views
Replies
Total Likes
Have you explored context-aware configuration for your problem? I believe you should be able to create separate configs for different paths of your repository.
Hi @aemninja,
I tried using the different domains but when try to call them using externalizer api then it is throwing error that
error: cannot find the symbol:
[ERROR] variable PUBLISH_CA
[ERROR] location: interface Externalizer
This is the piece of code that I am using :
externalizer.externalLink(resolver, Externalizer.PUBLISH_CA, "/my/page") + ".html";
can you please help me here.
Thanks,
Pavan
Views
Replies
Total Likes
Hi @mayank_saklech1 ,
I tried using the different domains but when try to call them using externalizer api then it is throwing error that
error: cannot find the symbol:
[ERROR] variable PUBLISH_CA
[ERROR] location: interface Externalizer
This is the piece of code that I am using :
externalizer.externalLink(resolver, Externalizer.PUBLISH_CA, "/my/page") + ".html";
can you please help me here.
Thanks,
Pavan
Views
Replies
Total Likes
Hi @aemninja
You can define it in the OOTB configuration.i.e., with com.day.cq.commons.impl.ExternalizerImpl.xml and add the domain names. In your code you can read the configuration by passing the domain name.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:OsgiConfig"
externalizer.domains="[author http://localhost:4502,publish http://localhost:4503,website1 https://www.website1.com,website2 https://www.website2.com]"/>
Thanks!
This Doesn't actually work, not sure if there is any other customization needed on AEM on cloud.
Views
Replies
Total Likes
@aemninja Once you define various domains in externalizer, you would be able to refer those in the code as below:
String myExternalizedUrl = externalizer.externalLink(resolver, Externalizer.LOCAL, "/my/page") + ".html";
Do we need to add this logic to very component?
Views
Replies
Total Likes