Get all documents from a java app.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Get all documents from a java app.

Jacco Steur
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 [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Get all documents from a java app.

zuzur
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 <[hidden email]> 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 [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws