一括アクティブ化完了イベントハンドラー
Experience Manager Guidesは、一括アクティベーションプロセスの完了後に操作を実行するために使用されるcom/adobe/fmdita/replication/complete イベントを公開します。 このイベントは、一括アクティベーションプロセスが完了するたびにトリガーされます。 例えば、マップのAEM サイトプリセットの一括アクティベーションを実行する場合、このイベントはアクティベーションプロセスの終了後に呼び出されます。
AEM イベントハンドラーを作成して、このイベントで使用可能なプロパティを読み取り、さらに処理を行う必要があります。
イベントの詳細は以下で説明します。
イベント名:
com/adobe/fmdita/replication/complete
パラメーター:
名前
種類
説明
path文字列
このイベントをトリガーしたファイルのパス。
例:
これは、JSON配列としてシリアル化されたパスのリストです。
例:
/content/output/sites/ditamap1-ditamap。これは、JSON配列としてシリアル化されたパスのリストです。
messageType文字列
メッセージの種類。
可能なオプション :
可能なオプション :
REPLICATIONaction文字列
これが実行されたアクションです。
可能なオプション :
可能なオプション :
BulkReplicateuser文字列
操作を開始したユーザー。
result文字列
一括アクティベーションの結果。 シリアル化されたJSON オブジェクトです:
{"success":boolean,"code":integer,"message":"" }agentId文字列
レプリケーションで使用されるagentId。 例えば、
"publish" のように指定します。importMode文字列
アクティベーションで使用される読み込みモード。 使用可能なオプションは次のとおりです:
REPLACE, MERGE, UPDATE。イベントリスナーの例:
@Component(service = EventHandler.class,
immediate = true,
property = {
EventConstants.EVENT_TOPIC + "=" + "com/adobe/fmdita/replication/complete",
})
public class SampleEventHandler implements EventHandler {
protected final Logger log = LoggerFactory.getLogger(this.getClass());
@Override
public void handleEvent(final Event event) {
Map<String, String> properties = new HashMap<>();
properties.put("paths", (String) event.getProperty("paths"));
properties.put("messageType", (String) event.getProperty("messageType"));
properties.put("action", (String) event.getProperty("action"));
properties.put("result", (String) event.getProperty("result"));
properties.put("user", (String) event.getProperty("user"));
properties.put("agentId", (String) event.getProperty("agentId"));
properties.put("importMode", (String) event.getProperty("importMode"));
String eventTopic = event.getTopic();
log.debug("eventTopic {}", eventTopic);
for(Map.Entry entry:properties.entrySet()) {
log.debug(entry.getKey() + " : " + entry.getValue());
}
}
}
recommendation-more-help
experience-manager-guides-help-product-guide