On Jan 26, 2012, at 8:52 AM, Marius Dumitru Florea wrote:
You could write a script that:
1. selects all documents created by a given user (first input parameter)
2. for each document, sets the creator to a different user (second
input parameter) using API that requires programming rights.
Of course, the page that hosts this script (either Velocity or Groovy)
needs to be saved by an user that has programming rights, and you also
need to hide this page from simple users.
Here's a short Velocity snippet that changes document creator:
----------8<----------
#set($publicDocument = $xwiki.getDocument('SomeSpace.SomePage'))
#set($protectedDocument = $publicDocument.getDocument())
#set($discard = $protectedDocument.setCreator("XWiki.NewCreator"))
heheā¦ my script is better since you're using a deprecated API here ;)
-Vincent
PS:
#set($discard = $publicDocument.save("Changed
document creator."))
---------->8----------
Hope this helps,
Marius
On Thu, Jan 26, 2012 at 8:54 AM, Hamster <teunham(a)hotmail.com> wrote:
-shameless bump-
So "Copy Page" is the prefered way?
--
View this message in context:
http://xwiki.475771.n2.nabble.com/Change-Page-Owner-tp7219422p7226177.html
Sent from the XWiki- Users mailing list archive at
Nabble.com.
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users