|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xpn.xwiki.api.Api
com.xpn.xwiki.plugin.PluginApi<ApplicationManagerPlugin>
com.xpn.xwiki.plugin.applicationmanager.ApplicationManagerPluginApi
public class ApplicationManagerPluginApi
Plugin for managing applications: installation, export, creation. The plugin uses the concept of an Application Descriptor describing an application (its version, the documents it contains, the translations, etc).
ApplicationManagerPlugin
Field Summary | |
---|---|
static String |
CONTEXT_LASTERRORCODE
Field name of the last error code inserted in context. |
static String |
CONTEXT_LASTEXCEPTION
Field name of the last api exception inserted in context. |
protected static org.slf4j.Logger |
LOGGER
The logging tool. |
Fields inherited from class com.xpn.xwiki.api.Api |
---|
context |
Constructor Summary | |
---|---|
ApplicationManagerPluginApi(ApplicationManagerPlugin plugin,
XWikiContext context)
Create an instance of the Application Manager plugin user api. |
Method Summary | |
---|---|
int |
createApplication(XWikiApplication appXObjectDocument,
boolean failOnExist)
Create a new application descriptor base on provided application descriptor. |
XWikiApplication |
createApplicationDocument()
Create empty application document. |
int |
deleteApplication(String appName)
Delete an application descriptor document. |
int |
exportApplicationXAR(String appName)
Export an application into XAR using Packaging plugin. |
int |
exportApplicationXAR(String appName,
boolean recurse,
boolean withDocHistory)
Export an application into XAR using Packaging plugin. |
XWikiApplication |
getApplicationDocument(String appName)
Get the application descriptor document of the provided application name. |
List<XWikiApplication> |
getApplicationDocumentList()
Get all applications descriptors documents. |
XWikiExceptionApi |
getDefaultException()
|
XWikiMessageTool |
getMessageTool()
Deprecated. |
XWikiApplication |
getRootApplication()
Get the current wiki root application. |
int |
importApplication(String packageName)
Import attached application XAR into current wiki and do all actions needed to installation an application. |
void |
logError(String errorMessage,
XWikiException e)
Log error and store details in the context. |
int |
reloadAllApplications()
Reload all xwiki applications. |
int |
reloadApplication(String appName)
Reload xwiki application. |
Methods inherited from class com.xpn.xwiki.plugin.PluginApi |
---|
getInternalPlugin, getProtectedPlugin, setPlugin |
Methods inherited from class com.xpn.xwiki.api.Api |
---|
convert, convert, convert, convertAttachments, getXWikiContext, hasAccessLevel, hasAdminRights, hasProgrammingRights, hasWikiAdminRights |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CONTEXT_LASTERRORCODE
public static final String CONTEXT_LASTEXCEPTION
protected static final org.slf4j.Logger LOGGER
Constructor Detail |
---|
public ApplicationManagerPluginApi(ApplicationManagerPlugin plugin, XWikiContext context)
plugin
- the entry point of the Application Manager plugin.context
- the XWiki context.Method Detail |
---|
public XWikiExceptionApi getDefaultException()
@Deprecated public XWikiMessageTool getMessageTool()
public void logError(String errorMessage, XWikiException e)
errorMessage
- error message.e
- the catched exception.public XWikiApplication createApplicationDocument() throws XWikiException
XWikiException
- all error that does not caused by user of this method.public int createApplication(XWikiApplication appXObjectDocument, boolean failOnExist) throws XWikiException
appXObjectDocument
- the user application descriptor from which new descriptor will be created.failOnExist
- if true fail if the application descriptor to create already exists.
CONTEXT_LASTERRORCODE
field and
exception in context's CONTEXT_LASTEXCEPTION
field.
Error codes can be :
XWikiExceptionApi.ERROR_NOERROR
: method succeed with no error.XWikiException.ERROR_XWIKI_ACCESS_DENIED
: context's user don't have rights to do this
action.ApplicationManagerException.ERROR_AM_APPDOCALREADYEXISTS
: application descriptor already
exists.XWikiException
- all error that does not caused by user of this method.public int deleteApplication(String appName) throws XWikiException
appName
- the name of the application.
CONTEXT_LASTERRORCODE
field and
exception in context's CONTEXT_LASTEXCEPTION
field.
Error codes can be :
XWikiExceptionApi.ERROR_NOERROR
: action finished with no error.
XWikiException.ERROR_XWIKI_ACCESS_DENIED
: context's user don't have rights to do this
action.
ApplicationManagerException.ERROR_AM_DOESNOTEXIST
: provided application does not exist.
XWikiException
- all error that does not caused by user of this method.public List<XWikiApplication> getApplicationDocumentList() throws XWikiException
XWikiException
- all error that does not caused by user of this method.public XWikiApplication getApplicationDocument(String appName) throws XWikiException
appName
- the name of the application.
CONTEXT_LASTERRORCODE
field and exception in context's CONTEXT_LASTEXCEPTION
field.
Error codes can be :
ApplicationManagerException.ERROR_AM_DOESNOTEXIST
: provided application does not exist.
XWikiException
- all error that does not caused by user of this method.public int exportApplicationXAR(String appName) throws XWikiException, IOException
appName
- the name of the application to export.
CONTEXT_LASTERRORCODE
field and
exception in context's CONTEXT_LASTEXCEPTION
field.
Error codes can be :
XWikiExceptionApi.ERROR_NOERROR
: action finished with no error.
ApplicationManagerException.ERROR_AM_DOESNOTEXIST
: provided application does not exist.
XWikiException
- all error that does not caused by user of this method.
IOException
- all error that does not caused by user of this method.public int exportApplicationXAR(String appName, boolean recurse, boolean withDocHistory) throws XWikiException, IOException
appName
- the name of the application.recurse
- if true include all dependencies applications into XAR.withDocHistory
- if true export with documents history.
CONTEXT_LASTERRORCODE
field and
exception in context's CONTEXT_LASTEXCEPTION
field.
Error codes can be :
XWikiExceptionApi.ERROR_NOERROR
: action finished with no error.
ApplicationManagerException.ERROR_AM_DOESNOTEXIST
: provided application does not exist.
XWikiException
- all error that does not caused by user of this method.
IOException
- all error that does not caused by user of this method.public int importApplication(String packageName) throws XWikiException
reloadApplication(String)
for more.
packageName
- the name of the attached XAR file to import.
CONTEXT_LASTERRORCODE
field and
exception in context's CONTEXT_LASTEXCEPTION
field.
Error codes can be :
XWikiExceptionApi.ERROR_NOERROR
: action finished with no error.
XWikiException.ERROR_XWIKI_ACCESS_DENIED
: context's user don't have rights to do this
action.
ApplicationManagerException.ERROR_AM_DOESNOTEXIST
: provided application does not exist.
XWikiException
- all error that does not caused by user of this method.public int reloadApplication(String appName) throws XWikiException
appName
- the name of the application to reload.
CONTEXT_LASTERRORCODE
field and
exception in context's CONTEXT_LASTEXCEPTION
field.
Error codes can be :
XWikiExceptionApi.ERROR_NOERROR
: action finished with no error.
XWikiException.ERROR_XWIKI_ACCESS_DENIED
: context's user don't have rights to do this
action.
ApplicationManagerException.ERROR_AM_DOESNOTEXIST
: provided application does not exist.
XWikiException
- all error that does not caused by user of this method.public int reloadAllApplications() throws XWikiException
XWikiExceptionApi.ERROR_NOERROR
: action finished with no error.
XWikiException.ERROR_XWIKI_ACCESS_DENIED
: context's user don't have rights to do this
action.
XWikiException
- all error that does not caused by user of this method.public XWikiApplication getRootApplication() throws XWikiException
XWikiException
- all error that does not caused by user of this method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |