0

To resolve problem mentioned in subject I wrote following code:

String link = externalizer.publishLink(resolverFactory.getAdministrativeResourceResolver(null),"");

I cannot check it because I have only author machine but following code will executes only on publishers.

On production we have several publisher.I want to get different results for every publisher.

Will my code work on publishers?

gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
  • You can easily also start a publish instance to test your code: http://docs.adobe.com/docs/en/cq/current/getting_started/download_and_startworking.html (Installing Instances of Adobe Experience Manager) – Thomas Feb 26 '15 at 10:38
  • I cannot reproduce situation locally when I have several publishers. Locally on publisher, I got **http://localhost:4503/** -I don't want to see localhost - I want to see hostname – gstackoverflow Feb 26 '15 at 10:43

1 Answers1

0

Have you defined sling:osgiConfig for the pid - com.day.cq.commons.impl.ExternalizerImpl? You could configure this in OSGi console [1] directly as well.

In the configuration, you could supply dns name like 'publish http://www.example.com'

In case of multiple domain names for multiple publish instances, define sling:osgiConfig nodes for this service and attach it to 'run modes' of those publish instances. This should work.

On side note - Externalizer service is generally used for non-HTML content like email, etc. In HTML, you could use relative urls.

[1] http://localhost:4502/system/console/configMgr

Sivaramvt
  • 83
  • 1
  • 4