com.xpn.xwiki.plugin.applicationmanager
Class ApplicationPackager

java.lang.Object
  extended by com.xpn.xwiki.plugin.applicationmanager.ApplicationPackager

public class ApplicationPackager
extends Object

Provide method to install export applications.

Since:
1.9
Version:
$Id: 150ad6f51044ad4f7973409fb1381665d68667a3 $

Constructor Summary
ApplicationPackager()
          Default constructor.
ApplicationPackager(XWikiPluginMessageTool messageTool)
           
 
Method Summary
 void exportApplicationXAR(String appName, boolean recurse, boolean withDocHistory, XWikiContext context)
          Export an application into XAR using Packaging plugin.
 XWikiPluginMessageTool getMessageTool(XWikiContext context)
          Deprecated. 
 void importApplication(XWikiDocument packageDoc, String packageName, String comment, XWikiContext context)
          Import attached application XAR into current wiki and do all actions needed to installation an application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationPackager

public ApplicationPackager(XWikiPluginMessageTool messageTool)
Parameters:
messageTool - the message tool

ApplicationPackager

public ApplicationPackager()
Default constructor.

Method Detail

getMessageTool

@Deprecated
public XWikiPluginMessageTool getMessageTool(XWikiContext context)
Deprecated. 

Get the XWikiPluginMessageTool to use with ApplicationManager.

Parameters:
context - the XWiki context.
Returns:
a translated strings manager.

exportApplicationXAR

public void exportApplicationXAR(String appName,
                                 boolean recurse,
                                 boolean withDocHistory,
                                 XWikiContext context)
                          throws XWikiException,
                                 IOException
Export an application into XAR using Packaging plugin.

Parameters:
appName - the name of the application to export.
recurse - indicate if dependencies applications has to be included in the package.
withDocHistory - indicate if history of documents is exported.
context - the XWiki context.
Throws:
XWikiException - error when :
  • getting application descriptor document to export.
  • or getting application's documents to export.
  • or when apply export.
IOException - error when apply export.

importApplication

public void importApplication(XWikiDocument packageDoc,
                              String packageName,
                              String comment,
                              XWikiContext context)
                       throws XWikiException
Import attached application XAR into current wiki and do all actions needed to installation an application. See #reloadApplication(XWikiApplication, String, XWikiContext) for more.

Parameters:
packageDoc - the document where package to import is attached.
packageName - the name of the attached XAR file to import.
comment - a comment used update XWiki.XWikiPreferences.
context - the XWiki context.
Throws:
XWikiException - error when :
  • getting attached package file.
  • or load package in memory.
  • or installing loaded document in database
  • or apply application initialization for each application descriptor document.


Copyright © 2004-2013 XWiki. All Rights Reserved.