Need to reset page properties when copied page using siteadmin or sidekick or crxde | Community
Skip to main content
rama_krishna11
Level 2
October 16, 2015
Solved

Need to reset page properties when copied page using siteadmin or sidekick or crxde

  • October 16, 2015
  • 15 replies
  • 2867 views

Actually for this I have created event handler. Using page event modifications able to reset page properties. When we copy page, that time page event treated as "Page Created". But "Page Created" event triggered by 3 ways.

1. copy page 2. create new page 3. install new content using package manager

my requirement don't want to work for 3rd point(install new content using package manager)

Or any better approach for copy event.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

Hi,

I don't think, that this is possible that easy. Because on a Sling or JCR event handle you only see the effect of the activity: a new page is being created. The only way to achieve this is to intercept the commands given on the UI (and disallow the use of CRXDE for authors!) and change the target page accordingly. You could this with a filter, which checks if this request is a relevant one you need to handle and then react accordingly.

But I think, that you take the wrong route. Is it possible to handle the occurrence of a duplicate on a certain property? Or maybe revisiting the whole requirement, as it looks a bit strange for me.

Jörg

15 replies

Lokesh_Shivalingaiah
Level 10
October 16, 2015

pretty interesting usecase !! but OOB, i dont think it exists today as all of these operations are operated based on the jcr events !

edubey
Level 10
October 16, 2015

One way could be to create a service which reset this page properties.

Now override OOTB copy functionality to make use of this service. You don't have to write full copy code again, rather make sure that this service method gets executes when copy operations performed. I feel there are very less chance that people will copy page using crxde, so implement this in sidekick and siteadmin.

smacdonald2008
Level 10
October 16, 2015

At the JCR level - AEM does not care how  the node was created. It fires when the node is changed or created - no matter how it created - as you know. 

I am still looking for the solution here. 

rama_krishna11
Level 2
October 16, 2015

how to make a call to service in siteadmin js or side kick js.

rama_krishna11
Level 2
October 19, 2015

Thanks to all