Hi again,
Would like to ask if there would be a function in replication preprocessor that could check/return a value if the current page/resource is being published to Preview or Publish environment?
Views
Replies
Total Likes
Hi @LyonMartin,
I think you can try to get the information which agent is used, base on agent Id that can be retrieved from ReplicationAction object. So in preprocessor implementation it should be possible like this:
public void preprocess(ReplicationAction replicationAction, ReplicationOptions replicationOptions) throws ReplicationException {
String agentId = replicationAction.getConfig().getAgentId();
}
In general in cloud setup you have agent with publish id that represents publish tier, and preview id for preview publish. Both are mentioned in the official documentation:
so, when I tried to test the snippet, config seems null even on the replicationAction itself.
therefore I got a null pointer when calling the "agentId()"
And on the side note: can we also setup a Publish to preview on local AEM?
Thanks!
@LyonMartin Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
Views
Likes
Replies