Renaming Spaces and moving pages between spaces
Hi, Is there a way to rename an entire space with all references updated? Or, is there a way to move a number of pages from one space to another with all references updated? In our experimental XWiki installation we dropped all pages into Main. Now, I intend to structure the site a little differend and I would like to move a number of pages from one space to another or rename an entire space. I am happy to do this also in a xar if there are tools, scripts etc. available to support me with a consistent replacing. Regards, Gunter ------------------------------------------------------------------------------- Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. -------------------------------------------------------------------------------
On Apr 17, 2007, at 6:30 PM, Gunter Leeb wrote:
Hi,
Is there a way to rename an entire space with all references updated? Or, is there a way to move a number of pages from one space to another with all references updated?
Yes that's easy. The API is: $xwiki.getDocument("Space.Page").rename("NewSpace.Page") Then you need to iterate over all documents of a given space. You can have a look at the delete space code snippet and replace the deletion by the rename. http://www.xwiki.org/xwiki/bin/view/Code/DeleteSpaceSnippet Once you figure it out it would be nice if you could add this code snippet in the Code Zone on xwiki.org :) Hope it helps, -Vincent
In our experimental XWiki installation we dropped all pages into Main. Now, I intend to structure the site a little differend and I would like to move a number of pages from one space to another or rename an entire space.
I am happy to do this also in a xar if there are tools, scripts etc. available to support me with a consistent replacing.
Regards,
Gunter
participants (2)
-
Gunter Leeb -
Vincent Massol