Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

How to add currentpage path in ResourceChangeListener.PATHS?

Avatar

Level 2

I am writing the ResourceChangeListener . I want current page path at  ResourceChangeListener.PATHS. 
PFB snippet where I want currentpage's path.
@component(immediate = true, service = ResourceChangeListener.class, enabled = true, property = {
"process.label = JSON Event Handler",
ResourceChangeListener.PATHS
+ "=CURRENTPAGEPATH",
ResourceChangeListener.CHANGES + "=ADDED", ResourceChangeListener.CHANGES + "=CHANGED" })

4 Replies

Avatar

Community Advisor

As per the documentation you need to provide the path. Please see below

 

Array of paths or glob patterns - required.

A path is either absolute or relative. If it's a relative path, the relative path will be appended to all search paths of the resource resolver.

If the whole tree of all search paths should be observed, the special value . should be used.

A glob pattern must start with the glob: prefix (e.g. glob:**/*.html). The following rules are used to interpret glob patterns:

  • The * character matches zero or more characters of a name component without crossing directory boundaries.
  • The ** characters match zero or more characters crossing directory boundaries.
  • If the pattern is relative (does not start with a slash), the relative path will be appended to all search paths of the resource resolver.

Avatar

Level 2

@Saravanan_Dharmaraj yes but I want to handle the event for component's dialog change and that component will present at all the pages. That's why I want current page path.