Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

In Event Handler, how to exclude the specific folder in path.

Avatar

Avatar
Validate 1
Level 2
aravindS
Level 2

Likes

4 likes

Total Posts

39 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 3
View profile

Avatar
Validate 1
Level 2
aravindS
Level 2

Likes

4 likes

Total Posts

39 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 3
View profile
aravindS
Level 2

04-10-2018

In Event Handler, how to exclude the specific folder in path.

Example: my path is "/content", after triggered the event handler my event path shouldn't contain the folder like "version".

Help me how to resolve this.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,260 likes

Total Posts

3,140 posts

Correct Reply

886 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,260 likes

Total Posts

3,140 posts

Correct Reply

886 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

05-10-2018

Hi,

With JCR events it is not possible. Either you swicth to Sling events or check path while act on event.

Answers (4)

Answers (4)

Avatar

Avatar
Validate 1
Level 2
aravindS
Level 2

Likes

4 likes

Total Posts

39 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 3
View profile

Avatar
Validate 1
Level 2
aravindS
Level 2

Likes

4 likes

Total Posts

39 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 3
View profile
aravindS
Level 2

04-10-2018

Hi Arun,

     In my case i need to restrict the path starting itself (before triggering the event).

Thanks,

Aravind

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,260 likes

Total Posts

3,140 posts

Correct Reply

886 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,260 likes

Total Posts

3,140 posts

Correct Reply

886 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

04-10-2018

Hi,

For this you can't do while listening to event but restrict path while eating on event.

Please check.

Event listener for patterned path

Avatar

Avatar
Validate 1
Level 2
aravindS
Level 2

Likes

4 likes

Total Posts

39 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 3
View profile

Avatar
Validate 1
Level 2
aravindS
Level 2

Likes

4 likes

Total Posts

39 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 3
View profile
aravindS
Level 2

04-10-2018

final String[] types = { "nt:unstructured"};

                 final String path = "/content/dam/assets"; // define the path

                 observationManager.addEventListener(this, Event.PROPERTY_CHANGED, path, true, null, null, false);

in that path i need to restrict one folder like "versions"

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,260 likes

Total Posts

3,140 posts

Correct Reply

886 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,260 likes

Total Posts

3,140 posts

Correct Reply

886 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

04-10-2018

If you are using Sling Events then you can do with the help of Event_Filter and add exclude pattern

EventConstants.EVENT_FILTER prop­er­ty takes LDAP fil­ter syn­tax, and has a path attribute, so we can do e.g. (path=/content/my/root/*) or even (path=/content/my/root/*/myNode).

http://blogs.adobe.com/experiencedelivers/experience-management/using_event_filtersforhandlingjcreve...

LDAP Filter Syntax

For JCR Events, you can't filter path based on regEx while listening events but can do while acting(onEvent)

aem63app-repo/SampleJCREvent.java at master · arunpatidar02/aem63app-repo · GitHub