|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xpn.xwiki.plugin.wikimanager.WikiManager
public final class WikiManager
Hidden toolkit use by the plugin API that make all the plugins actions.
| Field Summary | |
|---|---|
protected static org.slf4j.Logger |
LOGGER
The logging tool. |
| Constructor Summary | |
|---|---|
WikiManager(XWikiPluginMessageTool messageTool)
|
|
| Method Summary | |
|---|---|
boolean |
canCreateWiki(com.xpn.xwiki.XWikiContext context)
|
boolean |
canDeleteWiki(com.xpn.xwiki.XWikiContext context)
|
boolean |
canEditWiki(com.xpn.xwiki.XWikiContext context)
|
XWikiServer |
createNewWiki(XWikiServer userWikiSuperDoc,
boolean failOnExist,
String templateWikiName,
String packageName,
String comment,
com.xpn.xwiki.XWikiContext context)
Create new wiki. |
XWikiServer |
createNewWiki(XWikiServer userWikiSuperDoc,
boolean failOnExist,
String comment,
com.xpn.xwiki.XWikiContext context)
Create a new empty virtual wiki. |
XWikiServer |
createNewWikiFromPackage(XWikiServer userWikiSuperDoc,
String packageName,
boolean failOnExist,
String comment,
com.xpn.xwiki.XWikiContext context)
Create a new virtual wiki. |
XWikiServer |
createNewWikiFromTemplate(XWikiServer userWikiSuperDoc,
String templateWikiName,
boolean failOnExist,
String comment,
com.xpn.xwiki.XWikiContext context)
Create a new virtual wiki. |
void |
createWikiTemplate(XWikiServer wikiXObjectDocument,
String packageName,
String comment,
com.xpn.xwiki.XWikiContext context)
Create a template wiki. |
void |
deleteWiki(String wikiNameToDelete,
boolean deleteDatabase,
com.xpn.xwiki.XWikiContext context)
Delete an existing wiki. |
void |
deleteWikiAlias(String wikiNameToDelete,
int objectId,
com.xpn.xwiki.XWikiContext context)
Delete an existing wiki alias. |
List<Wiki> |
getAllWikis(com.xpn.xwiki.XWikiContext context)
Get all Wiki. |
com.xpn.xwiki.doc.XWikiDocument |
getDocument(String wikiName,
String fullname,
com.xpn.xwiki.XWikiContext context)
Encapsulate XWiki.getDocument(String, XWikiContext) adding wiki switch. |
XWikiPluginMessageTool |
getMessageTool(com.xpn.xwiki.XWikiContext context)
Get the XWikiPluginMessageTool to use with WikiManager. |
XWikiServer |
getWikiAlias(String wikiName,
int objectId,
boolean validate,
com.xpn.xwiki.XWikiContext context)
Get the wiki descriptor document. |
List<XWikiServer> |
getWikiAliasList(com.xpn.xwiki.XWikiContext context)
Get all the wikis descriptors documents. |
Wiki |
getWikiFromDocument(com.xpn.xwiki.doc.XWikiDocument document,
com.xpn.xwiki.XWikiContext context)
Get Wiki described by provided document. |
Wiki |
getWikiFromDocumentName(String documentFullName,
com.xpn.xwiki.XWikiContext context)
Get Wiki described by document with provided full name. |
Wiki |
getWikiFromName(String wikiName,
com.xpn.xwiki.XWikiContext context)
Get Wiki with provided name. |
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. |
boolean |
isWikiAliasExist(String wikiName,
int objectId,
com.xpn.xwiki.XWikiContext context)
Indicate of wiki descriptor document exist. |
List<com.xpn.xwiki.doc.XWikiDocument> |
searchDocuments(String wikiName,
String wheresql,
com.xpn.xwiki.XWikiContext context)
Encapsulate XWikiStoreInterface.searchDocuments(String, XWikiContext) adding wiki
switch. |
| 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 WikiManager(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 com.xpn.xwiki.doc.XWikiDocument getDocument(String wikiName,
String fullname,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
XWiki.getDocument(String, XWikiContext) adding wiki switch.
wikiName - the name of the wiki where to get the document.fullname - the full name of the document to get.context - the XWiki context.
fullname and wiki wikiName. If it does
not exist return new XWikiDocument.
com.xpn.xwiki.XWikiException - error when calling XWiki.getDocument(String, XWikiContext) .XWiki.getDocument(String, XWikiContext)
public List<com.xpn.xwiki.doc.XWikiDocument> searchDocuments(String wikiName,
String wheresql,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
XWikiStoreInterface.searchDocuments(String, XWikiContext) adding wiki
switch.
wikiName - the name of the wiki where to search for documents.wheresql - the conditions to add to HQL request.context - the XWiki context.
wheresql conditions. If nothing found return empty
List.
com.xpn.xwiki.XWikiException - error when searching for documents.XWikiStoreInterface.searchDocuments(String, XWikiContext)public boolean canCreateWiki(com.xpn.xwiki.XWikiContext context)
context - the XWiki context
public boolean canEditWiki(com.xpn.xwiki.XWikiContext context)
context - the XWiki context
public boolean canDeleteWiki(com.xpn.xwiki.XWikiContext context)
context - the XWiki context
public Wiki getWikiFromDocument(com.xpn.xwiki.doc.XWikiDocument document,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
Wiki described by provided document.
document - the wiki document descriptor.context - the XWiki context.
Wiki object.
com.xpn.xwiki.XWikiException - error when creating Wiki object.
public Wiki getWikiFromName(String wikiName,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
Wiki with provided name.
wikiName - the name of the wiki.context - the XWiki context.
Wiki object.
com.xpn.xwiki.XWikiException - error when getting document from wiki name.
public Wiki getWikiFromDocumentName(String documentFullName,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
Wiki described by document with provided full name.
documentFullName - the full name of the wiki document descriptor.context - the XWiki context.
Wiki object.
com.xpn.xwiki.XWikiException - error when getting document.
public List<Wiki> getAllWikis(com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
Wiki.
context - the XWiki context.
Wiki.
com.xpn.xwiki.XWikiException - error when getting wikis documents descriptors.
public XWikiServer createNewWikiFromPackage(XWikiServer userWikiSuperDoc,
String packageName,
boolean failOnExist,
String comment,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
userWikiSuperDoc - a wiki descriptor document from which the new wiki descriptor document will be created.packageName - the name of the attached XAR file to import in the new wiki.failOnExist - if true throw exception when wiki already exist. If false overwrite existing wiki.comment - the comment to use when saving descriptor document.context - the XWiki context.
com.xpn.xwiki.XWikiException - error when:
XWikiServerClass.WikiManagerException.ERROR_WM_XWIKINOTVIRTUAL : xwiki is not in virtual mode.WikiManagerException.ERROR_XWIKI_USERDOESNOTEXIST: provided user does not exists.XWikiException.ERROR_XWIKI_USER_INACTIVE: provided user is not active.WikiManagerException.ERROR_WM_WIKINAMEFORBIDDEN: provided wiki name can't be used to
create new wiki.WikiManagerException.ERROR_WM_WIKIALREADYEXISTS: wiki descriptor already exists.WikiManagerException.ERROR_WM_UPDATEDATABASE: error occurred when updating database.createNewWiki(XWikiServer, boolean, String, XWikiContext),
createNewWikiFromTemplate(XWikiServer, String, boolean, String, XWikiContext)
public XWikiServer createNewWikiFromTemplate(XWikiServer userWikiSuperDoc,
String templateWikiName,
boolean failOnExist,
String comment,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
userWikiSuperDoc - a wiki descriptor document from which the new wiki descriptor document will be created.templateWikiName - the of the wiki from where to copy document to the new wiki.failOnExist - if true throw exception when wiki already exist. If false overwrite existing wiki.comment - the comment to use when saving descriptor document.context - the XWiki context.
com.xpn.xwiki.XWikiException - error when:
XWikiServerClass.WikiManagerException.ERROR_WM_XWIKINOTVIRTUAL: xwiki is not in virtual mode.WikiManagerException.ERROR_XWIKI_USERDOESNOTEXIST: provided user does not exists.XWikiException.ERROR_XWIKI_USER_INACTIVE: provided user is not active.WikiManagerException.ERROR_WM_WIKINAMEFORBIDDEN: provided wiki name can't be used to
create new wiki.WikiManagerException.ERROR_WM_WIKIALREADYEXISTS: wiki descriptor already exists.WikiManagerException.ERROR_WM_UPDATEDATABASE: error occurred when updating database.createNewWiki(XWikiServer, boolean, String, XWikiContext),
createNewWikiFromPackage(XWikiServer, String, boolean, String, XWikiContext)
public XWikiServer createNewWiki(XWikiServer userWikiSuperDoc,
boolean failOnExist,
String comment,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
userWikiSuperDoc - a wiki descriptor document from which the new wiki descriptor document will be created.failOnExist - if true throw exception when wiki already exist. If false overwrite existing wiki.comment - the comment to use when saving descriptor document.context - the XWiki context.
com.xpn.xwiki.XWikiException - error when:
XWikiServerClass.WikiManagerException.ERROR_WM_XWIKINOTVIRTUAL: xwiki is not in virtual mode.WikiManagerException.ERROR_XWIKI_USERDOESNOTEXIST: provided user does not exists.XWikiException.ERROR_XWIKI_USER_INACTIVE: provided user is not active.WikiManagerException.ERROR_WM_WIKINAMEFORBIDDEN: provided wiki name can't be used to
create new wiki.WikiManagerException.ERROR_WM_WIKIALREADYEXISTS: wiki descriptor already exists.WikiManagerException.ERROR_WM_UPDATEDATABASE: error occurred when updating database.
public XWikiServer createNewWiki(XWikiServer userWikiSuperDoc,
boolean failOnExist,
String templateWikiName,
String packageName,
String comment,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
userWikiSuperDoc - a wiki descriptor document from which the new wiki descriptor document will be created.failOnExist - if true throw exception when wiki already exist. If false overwrite existing wiki.templateWikiName - the name of the wiki from where to copy document to the new wiki.packageName - the name of the attached XAR file to import in the new wiki.comment - the comment to use when saving descriptor document.context - the XWiki context.
com.xpn.xwiki.XWikiException - error when:
XWikiServerClass.WikiManagerException.ERROR_WM_XWIKINOTVIRTUAL: xwiki is not in virtual mode.WikiManagerException.ERROR_XWIKI_USERDOESNOTEXIST: provided user does not exists.WikiManagerException.ERROR_WM_WIKINAMEFORBIDDEN: provided wiki name can't be used to
create new wiki.WikiManagerException.ERROR_WM_WIKIALREADYEXISTS: wiki descriptor already exists.WikiManagerException.ERROR_WM_UPDATEDATABASE: error occurred when updating database.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 void deleteWiki(String wikiNameToDelete,
boolean deleteDatabase,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
wikiNameToDelete - the name of the wiki to delete.deleteDatabase - if true wiki's database is also removed.context - the XWiki context.
com.xpn.xwiki.XWikiException - error when:
public void deleteWikiAlias(String wikiNameToDelete,
int objectId,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
wikiNameToDelete - the name of the wiki to delete.objectId - the id of the XWiki object included in the document to manage.context - the XWiki context.
com.xpn.xwiki.XWikiException - error when:
public XWikiServer getWikiAlias(String wikiName,
int objectId,
boolean validate,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
wikiName - the name of the wiki.objectId - the id of the XWiki object included in the document to manage.validate - when wiki descriptor document does not exist :
WikiManagerException.ERROR_WM_WIKIDOESNOTEXISTS
context - the XWiki context.
com.xpn.xwiki.XWikiException - error when getting wiki descriptor document.
public List<XWikiServer> getWikiAliasList(com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
context - the XWiki context.
com.xpn.xwiki.XWikiException - error when:
XWikiDocument.XWikiServerClass unique instance.
public boolean isWikiAliasExist(String wikiName,
int objectId,
com.xpn.xwiki.XWikiContext context)
wikiName - the name of the wiki.objectId - the id of the XWiki object included in the document to manage.context - the XWiki context.
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.
public void createWikiTemplate(XWikiServer wikiXObjectDocument,
String packageName,
String comment,
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".
wikiXObjectDocument - a wiki descriptor document from which the new template wiki descriptor document will
be created.packageName - the name of the attached XAR file to import in the new template wiki.comment - the comment to use when saving descriptor document.context - the XWiki context.
com.xpn.xwiki.XWikiException - error when creating new wiki from XAR package.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||