Copy page - Override AEM 6.5 | Community
Skip to main content
Level 4
March 25, 2021
Solved

Copy page - Override AEM 6.5

  • March 25, 2021
  • 2 replies
  • 2691 views

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.

2 replies

Asutosh_Jena_
Community Advisor
Community Advisor
March 25, 2021

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!

AEMnewbieAuthor
Level 4
March 25, 2021

@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

Bhuwan_B
Community Advisor
Bhuwan_BCommunity AdvisorAccepted solution
Community Advisor
March 25, 2021
AEMnewbieAuthor
Level 4
March 27, 2021
Thanks @bhuwan_b ..That post is really helpful