cogMigrates user pages written in XWiki Syntax 1.0 into XWiki Syntax 2.0
Developed by

Vincent Massol

0 Votes
LicenseGNU Lesser General Public License 2.1


This conversion allows to benefit from the new WYSIWYG editor from the user pages.

In order to execute, create a new page in your wiki (in XWiki Syntax 2.0) and copy the following content, then follow the instructions:

#set ($userPages = $xwiki.searchDocuments(", BaseObject obj where = doc.fullName and obj.className='XWiki.XWikiUsers' and doc.syntaxId='xwiki/1.0'", 0, 0))
#if ($request.confirm == "1")
  #foreach ($userPage in $userPages)
    #if ($userDoc.getContent().trim().equals('#includeForm("XWiki.XWikiUserSheet")'))
      #set ($dummy = $userDoc.setSyntaxId("xwiki/2.0"))
      #set ($dummy = $userDoc.setContent('{{include document="XWiki.XWikiUserSheet"/}}'))
      #set ($dummy = $"Migrated to XWiki Syntax 2.0", true))
     * [[$userPage]] migrated
     * [[$userPage]] not migrated (it had extra content). You need to migrate this page manually.
  #if ($userPages.size() > 0)
   The following users need to converted to XWiki Syntax 2.0:
    #foreach ($userPage in $userPages)
     * [[$userPage]]

    [[Start migration>>?confirm=1]]
   All user pages are in XWiki Syntax 2.0. No migration needed.

Prerequisites & Installation Instructions

Copy the code snippet to a page and save it.

Created by Vincent Massol on 2010/04/07 17:02

Get Connected