On 04/08/2014 11:35 AM, Marius Dumitru Florea wrote:
On Tue, Apr 8, 2014 at 6:21 PM, coldserenity <[email protected]> wrote:
Hi,
We are keeping record of daily team progress in XWiki which is basically a plain document with table listing all active tasks and their changing statuses. Each day we copy notes from previous day by "copy XWiki document" action. This has one major drawback: current version of the document is 2500 which means each day we create new document with 2.5K history versions.
Is there a simple (without scripting) way to delete history?
a) for single document
/xwiki/bin/deleteversions/Sandbox/Foo?rev1=1.1&rev2=3.1
In one click on a link :) (you can of course generate the link with a script that fills in the right version range, which I hard-coded).
There's also /xwiki/bin/reset/Sandbox/Foo, but by default it will require two clicks, one for opening the confirmation page and one for confirming the action. You can generate a link that also includes the confirmation: [[Reset history>>path:$doc.getURL("reset", "confirm=1&form_token=$!{services.csrf.getToken()}")]] The problem with both these links is that they they don't reset the version to 1.1, the document will still have version 2500.1, just that there won't be any 1.1 to 2499.1 versions in the history. You can write a Groovy script or a Java component that can clean up the history on a bunch of documents, including resetting the version to 1.1, but that's a bit harder and requires working with the internal XWikiDocument and XWikiDocumentArchive.
Hope this helps, Marius
b) for set of documents with common parent
Regards, Roman
PS: this is the reason for opening http://jira.xwiki.org/browse/XWIKI-10126
-- Sergiu Dumitriu http://purl.org/net/sergiu