[xwiki-devs] Export/Import batch mode
I would like to execute an export of all/some of the wiki pages in a batch mode (ex. with a script and a java program). In the same way I would like to execute an import. Is there an easy way to do this? Looking forward in the xwiki sources I found two classes that seem to do what I want: * com.xpn.xwiki.tool.backup.ExporterMain * com.xpn.xwiki.tool.backup.ImporterMain Both classes are in the maven plugin called xwiki-packager-plugin. Is there any documentation that explain how use that plugin? thanks, Lorenzo
Hi, I doubt there is any java level documentation on import/export but you can look at some good examples of how to use packager plugin : - com.xpn.xwiki.web.ExportAction#exportXAR(XWikiContext) - com.xpn.xwiki.web.ImportAction#render(XWikiContext) On Mon, May 5, 2008 at 3:19 PM, Lorenzo Manzoni <[email protected]> wrote:
I would like to execute an export of all/some of the wiki pages in a batch mode (ex. with a script and a java program). In the same way I would like to execute an import. Is there an easy way to do this?
Looking forward in the xwiki sources I found two classes that seem to do what I want:
* com.xpn.xwiki.tool.backup.ExporterMain * com.xpn.xwiki.tool.backup.ImporterMain
Both classes are in the maven plugin called xwiki-packager-plugin. Is there any documentation that explain how use that plugin?
thanks, Lorenzo _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
Lorenzo Manzoni wrote:
I would like to execute an export of all/some of the wiki pages in a batch mode (ex. with a script and a java program). In the same way I would like to execute an import. Is there an easy way to do this?
Looking forward in the xwiki sources I found two classes that seem to do what I want:
* com.xpn.xwiki.tool.backup.ExporterMain * com.xpn.xwiki.tool.backup.ImporterMain
Both classes are in the maven plugin called xwiki-packager-plugin. Is there any documentation that explain how use that plugin?
You could also write a Groovy script that uses the com.xpn.xwiki.plugin.packager plugin. -- Sergiu Dumitriu http://purl.org/net/sergiu/
On Mon, May 5, 2008 at 11:46 AM, Sergiu Dumitriu <[email protected]> wrote:
You could also write a Groovy script that uses the com.xpn.xwiki.plugin.packager plugin.
Yes, something like : <% import com.xpn.xwiki.doc.XWikiAttachment; def importer = context.context.getWiki().getPluginApi("package", rcontext) def packDoc = rcontext.getWiki().getDocument("xwiki:XWiki.Import", rcontext) XWikiAttachment packFile = packDoc.getAttachment("myarchive.xar") importer.Import(packFile.getContent(rcontext)) importer.setWithVersions(false) importer.install() %> -- Jean-Vincent Drean
participants (4)
-
Jean-Vincent Drean -
Lorenzo Manzoni -
Sergiu Dumitriu -
Thomas Mortagne