Search in sources :

Example 1 with DefaultExtensionPlanTree

use of org.xwiki.extension.job.plan.internal.DefaultExtensionPlanTree in project xwiki-platform by xwiki.

the class FlavorSearchJob method tryInstallExtension.

/**
 * Try to install the provided extension and update the plan if it's working.
 *
 * @param extensionId the extension version to install
 * @param namespace the namespace where to install the extension
 * @return true if the installation would succeed, false otherwise
 */
private Extension tryInstallExtension(ExtensionId extensionId, String namespace) {
    DefaultExtensionPlanTree currentTree = new DefaultExtensionPlanTree();
    try {
        installExtension(extensionId, namespace, currentTree);
        // Cleanup
        this.extensionsNodeCache.clear();
        return currentTree.get(0).getAction().getExtension();
    } catch (InstallException e) {
        this.logger.debug("Can't install extension [{}] on namespace [{}].", extensionId, namespace, e);
    }
    return null;
}
Also used : DefaultExtensionPlanTree(org.xwiki.extension.job.plan.internal.DefaultExtensionPlanTree) InstallException(org.xwiki.extension.InstallException)

Aggregations

InstallException (org.xwiki.extension.InstallException)1 DefaultExtensionPlanTree (org.xwiki.extension.job.plan.internal.DefaultExtensionPlanTree)1