Hi Pascal, Does it work with http://extensions.xwiki.org/xwiki/bin/view/Extension/Remove+Document+History ? Thanks -Vincent On 8 Jul 2014 at 10:29:13, Pascal BASTIEN ([email protected](mailto:[email protected])) wrote:
Hello, I need some help with my velocity script. I try to remove history of pages on a space. This code work well for a page:
{{velocity}} $xwiki.getDocument('BacASable.TestPage3').getDocument().resetArchive($context.context) {{/velocity}}
but my script fail when I launch this one to remove history of all BacASable space Page
{{velocity}} #foreach ($docName in $xwiki.getSpaceDocsName("BacASable")) $xwiki.getDocument("BacASable.$docName").getDocument().resetArchive($context.context) * history of "BacASable.$docName" removed #end {{/velocity}}
I obtain this error:
Caused by: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.xpn.xwiki.doc.rcs.XWikiRCSNodeInfo#com.xpn.xwiki.doc.rcs.XWikiRCSNodeId@2ff3ff58[docId=9026427162423984573,version=4.1]] Any ideas what's I'm doing wrong? Thxs
Note: deletion of WebHome history doessn't work: $xwiki.getDocument('BacASable.WebHome').getDocument().resetArchive($context.context)
Pascal B (on Xwiki 6.0)