public class Importer extends Object
Constructor and Description |
---|
Importer(OldCoreHelper oldCoreHelper) |
Modifier and Type | Method and Description |
---|---|
void |
importDocuments(File sourceDirectory,
String wikiId)
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.
|
void |
importDocuments(File sourceDirectory,
String wikiId,
String importUser)
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.
|
int |
importXAR(File file,
String importUser,
XWikiContext context) |
public Importer(OldCoreHelper oldCoreHelper)
oldCoreHelper
- various tools to manipulate oldcore APIspublic void importDocuments(File sourceDirectory, String wikiId) throws Exception
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.
sourceDirectory
- the directory where the package.xml file is located and where the documents to import are
locatedwikiId
- id of the wiki into which to import the documents (e.g. xwiki
)Exception
- if the import failed for any reasonpublic void importDocuments(File sourceDirectory, String wikiId, String importUser) throws Exception
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.
sourceDirectory
- the directory where the package.xml file is located and where the documents to import are
locatedwikiId
- id of the wiki into which to import the documents (e.g. xwiki
)importUser
- optionally the user under which to perform the import (useful for example when importing pages
that need to have Programming Rights and the page author is not the same as the importing user)Exception
- if the import failed for any reasonpublic int importXAR(File file, String importUser, XWikiContext context) throws XWikiException, IOException
file
- the XAR file to importimportUser
- optionally the user under which to perform the import (useful for example when importing pages
that need to have Programming Rights and the page author is not the same as the importing user)context
- the XWiki contextXWikiException
- failed to import the XAR fileIOException
- failed to parse the XAR fileCopyright © 2004–2017 XWiki. All rights reserved.