CQ5.3: So aktivieren Sie einen bestimmten Replikationsagenten

Frage

Wie aktiviere ich programmgesteuerte Seiten nur für bestimmte Replikationsagenten?

Antwort, Auflösung

Sie können ein ReplicationOptions [2] Objekt mit einem AgentFilter [2] erstellen:

 ReplicationOptions opts = new ReplicationOptions(); opts.setFilter(new AgentFilter(){ public boolean isIncluded(final Agent agent) { return "expectedAgentId".equals(agent.getId()); } }); 

Verwenden Sie anschließend die Replikationsmethode des Replicators [3]:

 /** * Löst eine neue Replikation mit angegebenen Optionen aus. * * @param session user session * @param type The type of replication * @param path The path specified the content to be replicated * @param options Additional replication options * @throws ReplicationException if an error occurs */ void replicate(Session session, ReplicationActionType type, String path, ReplicationOptions options) 

Gilt für

CQ5.x

Quellennachweis

[1] http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/replication/ReplicationOptions.html
[2] http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/replication/AgentFilter.html
[3] http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/replication/Replicator.html

 

Andere verwandte Artikel:

Adobe-Logo

Bei Ihrem Konto anmelden