[xwiki-users] Programmatically delete documents without putting them in recycle bin
Hi, I'd like to know if there is a way to delete a document (in velocity or groovy) without putting in in recycle bin ? (equivalent of "shift-delete"). I have to regularly delete (for tests) documents with heavy attachments, and it's quite long ... And I don't care about retrieving them later. Thanks, Jeremie
To be clearer, I know that I could do this by executing appropriate SQL delete requests, but it's ugly and I wanted to know if some internal API is able to do so. 2010/2/1 Jeremie BOUSQUET <[email protected]>
Hi,
I'd like to know if there is a way to delete a document (in velocity or groovy) without putting in in recycle bin ? (equivalent of "shift-delete").
I have to regularly delete (for tests) documents with heavy attachments, and it's quite long ... And I don't care about retrieving them later.
Thanks, Jeremie
On 02/01/2010 03:01 PM, Jeremie BOUSQUET wrote:
Hi,
I'd like to know if there is a way to delete a document (in velocity or groovy) without putting in in recycle bin ? (equivalent of "shift-delete").
I have to regularly delete (for tests) documents with heavy attachments, and it's quite long ... And I don't care about retrieving them later.
You can do it if you have programming rights, with: $xwiki.getXWiki().deleteDocument($doc.getDocument(), false, $context.context) -- Sergiu Dumitriu http://purl.org/net/sergiu/
Thanks, it works ! :) Best regards, Jeremie 2010/2/2 Sergiu Dumitriu <[email protected]>
On 02/01/2010 03:01 PM, Jeremie BOUSQUET wrote:
Hi,
I'd like to know if there is a way to delete a document (in velocity or groovy) without putting in in recycle bin ? (equivalent of "shift-delete").
I have to regularly delete (for tests) documents with heavy attachments, and it's quite long ... And I don't care about retrieving them later.
You can do it if you have programming rights, with:
$xwiki.getXWiki().deleteDocument($doc.getDocument(), false, $context.context)
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (2)
-
Jeremie BOUSQUET -
Sergiu Dumitriu