adobe / adobe/aio-lib-java

`aem` `aio-aem-events-osgi-mapping` Need fine grain control on AEM events that which path to send event to Adobe IO and support regex expression

オープン
#124 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
7
フォーク
22
PR マージ指標
30日以内にマージされた PR はありません

説明

### Expected Behaviour
The OSGI configuration present in AEM should support regex filter path and thus in my case use case is to send events to adobe IO only when asset uploaded in AEM is of type PDF.

For this Adobe I/O Events' OSGI Event Mapping should support regex expression in OSGI JCR Path Filter Field

![image](https://user-images.githubusercontent.com/84485159/185665594-19f76b71-2f66-4dee-b156-c5f276a70589.png)

### Actual Behaviour
In this specific use cases only event should only be passed from AEM when the path matches the regex expression

### Reproduce Scenario (including but not limited to)

#### Steps to Reproduce

#### Platform and Version

#### Sample Code that illustrates the problem
https://github.com/adobe/aio-lib-java/blob/main/aem/events_osgi_mapping/src/main/java/com/adobe/aio/aem/event/osgimapping/eventhandler/AdobeIoEventHandler.java#L118

Above code needs to be changed to support regex rather than just checking startsWith

To support current use case of startsWith
String pdfPath = "/content/dam/daiuyijava.pdf";
String regex = "/content/dam/([^/]+)";
Pattern pt = Pattern.compile(regex) ;
Matcher mt = pt.matcher(pdfPath);
System.out.println(mt.matches());

To support more fine grain cases for example only send event when it is a PDF asset
String pdfPath = "/content/dam/daiuyijava.pdf";
String regex = "/content/dam/([^/]+)+\\.(pdf|PDF)";
Pattern pt = Pattern.compile(regex) ;
Matcher mt = pt.matcher(pdfPath);
System.out.println(mt.matches());

#### Logs taken while reproducing problem

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Issue で示されているエントリーポイントである AdobeIoEventHandler.java の 118 行目付近から開始し、現在 OSGi JCR Path Filter が startsWith でどのようにチェックされているかを追跡します。正規表現によるマッチングが現在のプレフィックス動作とどのように共存すべきかを定義し、そのうえで、設定された式が一致した場合にのみ一致するパスがイベントを送信することを、PDF の例も含めて確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
backend
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。