Copy page - Override AEM 6.5 | Community
Skip to main content
Level 4
Mar 25, 2021 4:40 AM UTC
Solved

Copy page - Override AEM 6.5

I am trying to copy pages on the sites page using the copy option on the action bar - But whenever i try to copy the page it creates a new page if the page is existing - I am trying to come up with an ability to overwrite the file if it is existing and create a new one if the file is missing more.

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Bhuwan_B
Bhuwan_BAccepted solution
New Participant
Mar 25, 2021 6:15 AM UTC

6 replies

Bhuwan_B
Bhuwan_BAccepted solution
New Participant
Mar 25, 2021 6:15 AM UTC
AEMnewbieAuthor
Level 4
Mar 27, 2021 8:55 PM UTC
Thanks @bhuwan_b ..That post is really helpful
Translate
Asutosh_Jena_
New Participant
Mar 25, 2021 4:45 AM UTC

HI @aemnewbie 

AEM does not check for content while copying/moving the page. It just considers the name i.e. node name/page name.
Existing functionality itself checks if the node you are trying to copy already exists it will add 1,2,3, so on with the existing node name and add the copy.
If the page does not exist then it will copy the page as is. This is the OOTB functionality.

 

Thanks!

Translate
AEMnewbieAuthor
Level 4
Mar 25, 2021 4:51 AM UTC

@asutosh_jena_ Yes ! I get that i am trying to override that OOTB functionality such that it overrides the existing node ( Like update the existing node or delete and create a new one ) - When the copy already exists

/wcm/core/content/sites/jcr:content/actions/selection/copypage - I was referring to this path and see if any property addition here would prevent it from creating new nodes with number 1,2,3 - Then i tried looking at /libs/granite/ui/components/coral/foundation/collection/action - I noticed some actions in there like ignoreRel (Boolean) - tried adding this property in here /wcm/core/content/sites/jcr:content/actions/selection/copypage to see if that would make any difference it didnt -- I do see action and actionConfigName property in there but i wasnt sure where exactly i could find and code/reference related to those ..

 

or If you could point me to the location where i could find that OOTB code that could be helpful too

Translate