|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xpn.xwiki.plugin.wikimanager.WikiCopy
public final class WikiCopy
Utility classe used to fill a newly created wiki.
| Field Summary | |
|---|---|
protected static org.slf4j.Logger |
LOGGER
The logging tool. |
| Constructor Summary | |
|---|---|
WikiCopy(XWikiPluginMessageTool messageTool)
|
|
| Method Summary | |
|---|---|
void |
copyWiki(String sourceWiki,
String targetWiki,
String comment,
com.xpn.xwiki.XWikiContext context)
Copy all documents from sourceWiki wiki to targetWiki wiki. |
XWikiPluginMessageTool |
getMessageTool(com.xpn.xwiki.XWikiContext context)
Get the XWikiPluginMessageTool to use with WikiManager. |
XWikiServer |
getWikiTemplateAlias(String wikiName,
int objectId,
com.xpn.xwiki.XWikiContext context,
boolean validate)
Get template wiki descriptor document. |
List<XWikiServer> |
getWikiTemplateAliasList(com.xpn.xwiki.XWikiContext context)
Get all the templates wikis descriptors documents. |
void |
importPackage(String packageName,
String targetWiki,
com.xpn.xwiki.XWikiContext context)
Import XAR package into wiki. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.slf4j.Logger LOGGER
| Constructor Detail |
|---|
public WikiCopy(XWikiPluginMessageTool messageTool)
messageTool - the message tool| Method Detail |
|---|
public XWikiPluginMessageTool getMessageTool(com.xpn.xwiki.XWikiContext context)
XWikiPluginMessageTool to use with WikiManager.
context - the XWiki context.
public void copyWiki(String sourceWiki,
String targetWiki,
String comment,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
sourceWiki wiki to targetWiki wiki.
It also take care of ApplicationManager descriptors "documents to include" and "documents to link".
sourceWiki - the wiki from where to copy documents and get lists of "document to link" and "documents to
copy".targetWiki - the wiki where to copy documents.comment - the comment to use when saving documents.context - the XWiki context.
com.xpn.xwiki.XWikiException - error when:
public void importPackage(String packageName,
String targetWiki,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
packageName - the name of the attached package file.targetWiki - the name of the wiki where to install loaded XWikiDocument from XAR package.context - the XWiki context.
com.xpn.xwiki.XWikiException - error when:
WikiManagerException.ERROR_WM_XWIKINOTVIRTUAL: xwiki is not in virtual mode.WikiManagerException.ERROR_WM_PACKAGEDOESNOTEXISTS: attached package does not exists.WikiManagerException.ERROR_WM_PACKAGEIMPORT: package loading failed.WikiManagerException.ERROR_WM_PACKAGEINSTALL: loaded package insertion into database
failed.
public XWikiServer getWikiTemplateAlias(String wikiName,
int objectId,
com.xpn.xwiki.XWikiContext context,
boolean validate)
throws com.xpn.xwiki.XWikiException
A template wiki is a wiki which the XWiki.XWikiServerClass "visibility" field is set to "template".
wikiName - the name of the template wiki.objectId - the id of the XWiki object included in the document to manage.context - the XWiki context.validate - when wiki descriptor document does not exist :
WikiManagerException.ERROR_WM_WIKIDOESNOTEXISTS
com.xpn.xwiki.XWikiException - error when:
XWikiServerClass unique instance.
public List<XWikiServer> getWikiTemplateAliasList(com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
A template wiki is a wiki which the XWiki.XWikiServerClass "visibility" field is set to "template".
context - the XWiki context.
XWikiServer.
com.xpn.xwiki.XWikiException - eeor when:
XWikiServerClass unique instance.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||