Expand my Community achievements bar.

AEM move page event

Avatar

Level 2

Hi,

I am searching how to correctly handle Move (Rename) page event in AEM 6.3.
In my particular case - if page is moved, I need to move appropriate DAM folder accordingly new page path. So I definitely need to know source and target page path.

I know that it is possible with JCR Listeners, but as it is not recommended low level approach with long living session I would like to avoid it.
Sling Handlers will divide this event to 2 independent events  - remove and add, that is not good cause here I don't know source and target.

Maybe there is another appropriate way to do it?

Thanks.

5 Replies

Avatar

Administrator

AFAIK, if you move DAM folder or Web page then all the references and will be automatically adjusted and republished.

Can you please help me understand what exactly is your use case?

~kautuk



Kautuk Sahni

Avatar

Level 2

Hey kautuksahi,
in our case we dynamically create DAM folders for every page, like:
/content/dam/<pagePath>/componentA/<images>
And then we dynamically extract Image under specific DAM folder on specific page and show image in ComponentA for example.
It is done via code so no direct references in Page Properties present, but with this approach we save a lot of Content Editors time

Avatar

Community Advisor

Why do you need to do this if you already have your images in your DAM. ? I am pretty confused here

Avatar

Level 2

Sometimes pages are moved or renamed. After this we could not extract DAM image on page automatically cause dam path and page path are totally different. So we want to move (rename) dam folder automatically when appropriate page is moved (renamed)

For example, we have page: /content/project/page1

and DAM structure: /content/dam/project/page1/componentA/img

On page1 in ComponentA we automatically extract /content/dam/project/page1/componentA/img cause we definitely know our DAM path rule (/content/dam/<pagePath>/componentA/img).

If page is renamed (to /content/project/page2) and DAM path is the same - we couldn't extract correct image cause we don't know new page path. That's why we want to move DAM folder as well (/content/dam/project/page2/componentA/img)

Avatar

Level 3

Hi svitlanab794551

Which solution did you find? I have a very similar problem. I have noticed that a listener receives among others a list containing a pair of events after a page has been moved - one of type ADDED and the second one of type REMOVED. This pair of events contains the source and target paths. All other events are received as separate events by the listener according to my tests and only this one pair is received as a pair and not as separate events. I wonder if anyone else solved this problem and can confirm that a listener will receive always such a pair of events in one list only in case of a moved page.