You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hey,
I notice that the api for delete page is deprecated
trashPage(AbstractPage page)
and the new api is :
trashPage(AbstractPage page, DeleteContext deleteContext)
Can anybody send an example how to get the object of "DeleteContext" (https://docs.atlassian.com/atlassian-confluence/6.1.0/com/atlassian/confluence/core/DeleteContext.html)
Thanks!
Hi,
I have not tried it myself yet, but I had a quick look at the DefaultDeleteContext class and it seems to provide some meta data about the delete operation such as if it is a bulk operation or if notifications should be suppressed.
In that case I think you could just do something like:
Page page = pageManager.getPage(65547);
pageManager.trashPage(page, DefaultDeleteContext.BULK_OPERATION);
or
pageManager.trashPage(page, DefaultDeleteContext.DEFAULT);
or
pageManager.trashPage(page, DefaultDeleteContext.SUPPRESS_NOTIFICATIONS);
Hey,
Thanks, it works!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.