...
| Code Block |
|---|
LocalPackage pkg = service.getPackage("package_to_install");
Task task = pkg.getInstallTask();
ValidationStatus status = task.validate();
if (status.hasErrors()) {
// install task cannot be run. show errors to the user
} else if(status.hasWarnings()) {
// task can be run but there are warnings. show warnings to the user and let it decide whether or not to run the install task
} else {
try {
task.run(userPrefs);
} catch (Throwabe t) {
// if an error occurred do the rollback.
task.rollback();
}
}
// show install result to the user.
if (task.isRestartRequired()) {
// ask user to restart
}
|
Using Ant to Install
When using ant you must define two ant scripts: the install.xml and uninstall.xml files.
...
- all the system properties in the running JVM.
- package.id: The Package identifier.
- package.name: The Package name.
- package.version: The Package version.
- package.root: The root folder of the package (the folder containing the exploded zip).
- env.server.home: Since 5.4.3. The Nuxeo server home. ($NUXEO_HOME).env.home: The Nuxeo Runtime Environment home. ($NUXEO_HOME/server/default/data/NXRuntime on JBoss, $NUXEO_HOME/nxserver on Tomcat).
- env.ear: JBoss only. The nuxeo.ear directory ($NUXEO_HOME/server/default/deploy/nuxeo.ear).
- env.lib: The Nuxeo lib directory (nuxeo.ear/lib on JBoss, $NUXEO_HOME/nxserver/lib on Tomcat).
- env.syslib: The host application lib directory ($NUXEO_HOME/lib).
- env.bundles: The Nuxeo bundles directory (nuxeo.ear/bundles on JBoss, $NUXEO_HOME/nxserver/bundles on Tomcat).
- env.config: The Nuxeo config directory (nuxeo.ear/config on JBoss, $NUXEO_HOME/nxserver/config on Tomcat).
- env.templates: Since 5.4.3. The configuration templates directory. ($NUXEO_HOME/templates).env.hostapp.name: The host application name (Tomcat or JBoss)
- env.hostapp.version: The host application version (e.g. Tomcat or JBoss version)
- sys.timestamp: The timestamp when the install task was created - a string in the format "yyMMddHHmmss".