Would it be possible to retrieve all the XWiki documents from a java app using the XWiki api. Does anybody have a code snippet of what that would look like? Thanks. Jacco.
Would a groovy script make it for you ? like (again, from Mr "Wizard" Ludovic) : package xwiki.export; import com.xpn.xwiki.*; import com.xpn.xwiki.plugin.packaging.*; println "Starting export" basedir = "."; context = new com.xpn.xwiki.XWikiContext(); context.setUser("XWiki.superadmin"); config = new XWikiConfig(); config.put("xwiki.store.class", "com.xpn.xwiki.store.XWikiHibernateStore"); config.put("xwiki.store.hibernate.path", basedir + "/hibernate.cfg.xml"); config.put("xwiki.store.hibernate.updateschema", "1"); config.put("xwiki.virtual", "1"); println "Starting xwiki" xwiki = new XWiki(config, context) context.setWiki(xwiki); store = xwiki.getHibernateStore(); sfactory = store.injectCustomMappingsInSessionFactory(context); if (sfactory) store.setSessionFactory(sfactory); db = "xwiki" println("Export database " + db) context.setDatabase(db); println "Creating package" pack = new Package() pack.setWithVersions(false) println "Adding documents" pack.addAllWikiDocuments(context) println "Exporting documents" pack.exportToDir(new File(basedir + "/../src/xwiki/"), context) println "Finished." ... If not, this gives you an idea of the API anyway. Erwan On 11/26/05, Jacco Steur <[email protected]> wrote:
Would it be possible to retrieve all the XWiki documents from a java app using the XWiki api. Does anybody have a code snippet of what that would look like?
Thanks.
Jacco.
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
participants (2)
-
Erwan Arzur -
Jacco Steur