ドキュメントAEM GuidesAEM Guides ドキュメント

一括有効化の完了イベントハンドラー

最終更新日: 2024年7月18日
  • トピック:
  • 一括アクティベーションイベントハンドラー

作成対象:

  • 経験者
  • 開発者

Experience Manager Guidesは com/adobe/fmdita/replication/complete 一括有効化プロセスの完了後、操作を実行するために使用されるイベントを公開します。 このイベントは、一括アクティベーションプロセスが完了するたびにトリガーされます。 例えば、マップのAEM サイトプリセットの一括有効化を実行した場合、このイベントは有効化プロセスの終了後に呼び出されます。

このイベントで使用可能なプロパティを読み取り、さらに処理を行うには、AEM イベントハンドラーを作成する必要があります。

イベントの詳細は、以下で説明します。

イベント名:

com/adobe/fmdita/replication/complete

パラメーター:

名前種類説明
pathStringこのイベントをトリガーしたファイルのパス。
例えば、/content/output/sites/ditamap1-ditamap などです。
JSON 配列としてシリアル化されたパスのリストです。
messageType文字列メッセージのタイプ。
可能なオプション : REPLICATION
action文字列これは、実行されるアクションです。
可能なオプション : BulkReplicate
user文字列操作を開始したユーザー。
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
11125c99-e1a1-4369-b5d7-fb3098b9b178