The Packaging class offers SDK openings for deploying your solutions with more flexibility.
In an XML file, you define calls to Java extensions. The extension's call can be launched :
The XML packaging definition file must be deployed on the custom/packaging folder. Its name must be unique on the VDoc server. This XML definition file provides all the necessary information to launch the extension.
The packaging element can contain the following children elements :
Element | Description |
name | the name of the application, ex: VDoc. |
version | the current version of the application. |
startup | it's used to launch the extension at every startup of VDoc. |
install | it's used to launch the extension for a new installation. |
migration | it's used to launch the extension during a migration. |
XML example
Error during retrieving content skip as ignoreDownloadError activated.
It's a child element for the startup, install and migration elements. It defines the developed extension that will be executed.
The extension element contains the following attributes:
Attribute | Description |
name | the class name. |
runOnce | used with startup element, it launches the extension once. |
critical | if a critical error occurs, the startup is stopped. |
XML example
Error during retrieving content skip as ignoreDownloadError activated.
The param element is a child of the extension element. It's used to pass parameters to the developed extension.
The param element contains the following attributes:
Attribute | Description |
name | the name of the parameter. |
value | the value of the parameter. |
XML example
Error during retrieving content skip as ignoreDownloadError activated.
A runtime class is a Java class that will be called by the framework at the startup of VDoc. A runtime class must extend the com.axemble.vdoc.sdk.packaging.extensions.BaseTaskExtension class.
By creating a packaging runtime class you need to implement the execute() method:
A runtime class is declared as follow:
public class LaunchCmdTaskExtension extends BaseTaskExtension { /** * @see com.axemble.vdoc.sdk.packaging.extensions.BaseTaskExtension#execute(java.util.Map) */ @Override protected void execute(Map<String, String> parameters) throws Exception { String command = parameters.get("Name of the parameter"); ... } }
The following example shows how to mount a network drive at startup of VDoc.
public class LaunchCmdTaskExtension extends BaseTaskExtension { /** the default class logger */ private static final com.axemble.vdoc.sdk.utils.Logger LOG = com.axemble.vdoc.sdk.utils.Logger.getLogger(LaunchCmdTaskExtension.class); /** * @see com.axemble.vdoc.sdk.packaging.extensions.BaseTaskExtension#execute(java.util.Map) */ @Override protected void execute(Map<String, String> parameters) throws Exception { String command = parameters.get("command"); Runtime.getRuntime().exec(command); } }