Hi,
I have added one class that implements EventHandler for ReplicationAction.EVENT_TOPIC , I publish the content from Author and that same time I get call in my event handler class, here I want to know server details like, scheme, server name and server port, can any one guide me how I can achieve this.
Let me explain my requirements, I am publishing the content from Author and when get call in event handler I call GraphiQL(http://localhost:4502/content/graphiql.html.) for data and that data I am indexing in solr. I can get solr server details but not http://localhost:4502/. SO I need this http://localhost:4502/ in event handler class.
Thanks,
Solved! Go to Solution.
Views
Replies
Total Likes
@kumamanish Please let the domain name and other details from the Externalizer Service
To define a domain mapping for the Externalizer service:
Navigate to the configuration manager via Tools, then Web Console, or enter https://<host>:<port>/system/console/configMgr.
Click Day CQ Link Externalizer to open the configuration dialog box.
Define a domain mapping: a mapping consists of a unique name that can be used in the code to reference the domain, a space and the domain:
<unique-name> [scheme://]server[:port][/contextpath], where:
For example: production https://my.production.instance
The following mapping names are predefined and must always be set as AEM relies on them:
Code snippet for getting the value from externalized service
Hope this helps!
Thanks
@kumamanish Please let the domain name and other details from the Externalizer Service
To define a domain mapping for the Externalizer service:
Navigate to the configuration manager via Tools, then Web Console, or enter https://<host>:<port>/system/console/configMgr.
Click Day CQ Link Externalizer to open the configuration dialog box.
Define a domain mapping: a mapping consists of a unique name that can be used in the code to reference the domain, a space and the domain:
<unique-name> [scheme://]server[:port][/contextpath], where:
For example: production https://my.production.instance
The following mapping names are predefined and must always be set as AEM relies on them:
Code snippet for getting the value from externalized service
Hope this helps!
Thanks
Awesome @ShaileshBassi , finally I got author link by using externalizer.authorLink(resourceResolver, ""). At last of link I am adding asset path for my requirements.
Appreciated your help.
Hi @kumamanish
You can get the Protocal, Servername and Serverport from CQ Link Externalizer configration. Create local OSGi configration as shown below in the screen shot and also you need use the externalizer and use below code
String publishUrl = externalizer.publishLink(resolver, payloadPath + CommonConstants.SUFFIX_HTML);
If the domain is different from the current server, You can put the other domain in a different configration seperatly.
Thank you so much @Jagadeesh_Prakash , definitely it helped me and will help me in future if we use different domains.
Views
Likes
Replies
Views
Likes
Replies