deleting only child pages using curl in cq5 | Community
Skip to main content
cquser_cquser
Level 2
October 16, 2015
Solved

deleting only child pages using curl in cq5

  • October 16, 2015
  • 3 replies
  • 1272 views

I am trying to delete only child pages using curl in CQ5 with this command

curl -X DELETE http://%HOSTAUTHOR%:%PORTAUTHOR%/content/a/b/c/d/e/f/g/ -u %USER%:%PASSWORD%

I want only the pages under /content/a/b/c/d/e/f/g/ to be deleted and not the 'g' page. But the parent page also gets deleted.

Trying

curl -X DELETE %HOSTAUTHOR%:%PORTAUTHOR%/content/a/b/c/d/e/f/g/* -u %USER%:%PASSWORD%

does not delete anything

and trying

curl -X DELETE %HOSTAUTHOR%:%PORTAUTHOR%/content/a/b/c/d/e/f/g -u %USER%:%PASSWORD%

deletes the 'g' page as well.

Can anybody help me in writing the correct syntax so that only the pages under /content/a/b/c/d/e/f/g/ get deleted and not the whole 'g' page as well?

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 cquser_cquser

Hi Jeeshan,

 

Thanks for you reply. The mentioned method

$ curl -F":operation=delete" -F":applyTo=/content/*" http://host/content/sample

 

deletes the '/content/' page's jcr:content node as well. Looking for a way in which the child pages are deleted and the parent page's jcr:content node remains intact.

Thanks

3 replies

cquser_cquser
cquser_cquserAuthorAccepted solution
Level 2
October 16, 2015

Hi Jeeshan,

 

Thanks for you reply. The mentioned method

$ curl -F":operation=delete" -F":applyTo=/content/*" http://host/content/sample

 

deletes the '/content/' page's jcr:content node as well. Looking for a way in which the child pages are deleted and the parent page's jcr:content node remains intact.

Thanks

smacdonald2008
Level 10
October 16, 2015
cquser_cquser
Level 2
October 16, 2015

The info that I got was that using the apply:To parameter; multiple nodes can be deleted.

As mentioned here https://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html

But it deletes parent page's jcr:content node as well. Is there a way that only the child pages get deleted and not the parent page' jcr:content node using curl? Its mentioned here

http://stackoverflow.com/questions/31240397/deleting-only-child-pages-using-curl-in-cq5

that regex or globbing is not supported; still; if anyone knows how to achieve this; will help a lot.

 

Thanks