Search in sources :

Example 6 with InstallException

use of org.xwiki.extension.InstallException in project xwiki-platform by xwiki.

the class XarExtensionHandler method installInternal.

private void installInternal(LocalExtension newLocalExtension, String wiki, Request request) throws InstallException {
    try {
        initializePagesIndex(request);
        initJobPackageConfiguration(request, true);
    } catch (Exception e) {
        throw new InstallException("Failed to initialize extension plan index", e);
    }
    // import xar into wiki (add new version when the page already exists)
    PackageConfiguration configuration = createPackageConfiguration(newLocalExtension, request, wiki);
    try {
        this.packager.importXAR("Install extension [" + newLocalExtension + "]", new File(newLocalExtension.getFile().getAbsolutePath()), configuration);
    } catch (Exception e) {
        throw new InstallException("Failed to import xar for extension [" + newLocalExtension + "]", e);
    }
}
Also used : PackageConfiguration(org.xwiki.extension.xar.internal.handler.packager.PackageConfiguration) InstallException(org.xwiki.extension.InstallException) File(java.io.File) ComponentLookupException(org.xwiki.component.manager.ComponentLookupException) ExtensionException(org.xwiki.extension.ExtensionException) IOException(java.io.IOException) UninstallException(org.xwiki.extension.UninstallException) InstallException(org.xwiki.extension.InstallException) XarException(org.xwiki.xar.XarException)

Aggregations

InstallException (org.xwiki.extension.InstallException)6 InstalledExtension (org.xwiki.extension.InstalledExtension)2 File (java.io.File)1 IOException (java.io.IOException)1 ComponentLookupException (org.xwiki.component.manager.ComponentLookupException)1 Extension (org.xwiki.extension.Extension)1 ExtensionException (org.xwiki.extension.ExtensionException)1 LocalExtension (org.xwiki.extension.LocalExtension)1 ResolveException (org.xwiki.extension.ResolveException)1 UninstallException (org.xwiki.extension.UninstallException)1 ExtensionHandler (org.xwiki.extension.handler.ExtensionHandler)1 InstallRequest (org.xwiki.extension.job.InstallRequest)1 DefaultExtensionPlanTree (org.xwiki.extension.job.plan.internal.DefaultExtensionPlanTree)1 LocalExtensionRepositoryException (org.xwiki.extension.repository.LocalExtensionRepositoryException)1 PackageConfiguration (org.xwiki.extension.xar.internal.handler.packager.PackageConfiguration)1 DocumentReference (org.xwiki.model.reference.DocumentReference)1 XarException (org.xwiki.xar.XarException)1