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