com.xpn.xwiki.tool.backup
Class Importer

java.lang.Object
  extended by com.xpn.xwiki.tool.backup.AbstractPackager
      extended by com.xpn.xwiki.tool.backup.Importer

public class Importer
extends AbstractPackager

Import a set of XWiki documents into an existing database.

Version:
$Id: Importer.java 20863 2009-06-05 15:14:23Z vmassol $

Constructor Summary
Importer()
           
 
Method Summary
 void importDocuments(java.io.File sourceDirectory, java.lang.String databaseName, java.io.File hibernateConfig)
          Import documents defined in an XML file located in the passed document definition directory into a database defined by its passed name and by an Hibernate configuration file.
 
Methods inherited from class com.xpn.xwiki.tool.backup.AbstractPackager
createXWikiContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Importer

public Importer()
Method Detail

importDocuments

public void importDocuments(java.io.File sourceDirectory,
                            java.lang.String databaseName,
                            java.io.File hibernateConfig)
                     throws java.lang.Exception
Import documents defined in an XML file located in the passed document definition directory into a database defined by its passed name and by an Hibernate configuration file.

Note: I would have liked to call this method "import" but it's a reserved keyword... Strange that it's not allowed for method names though.

Parameters:
sourceDirectory - the directory where the package.xml file is located and where the documents to import are located
databaseName - some database name (TODO: find out what this name is really)
hibernateConfig - the Hibernate config fill containing the database definition (JDBC driver, username and password, etc)
Throws:
java.lang.Exception - if the import failed for any reason


Copyright © 2004-2011 XWiki. All Rights Reserved.