Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

As simple as calling repositoryManager.loadWorkspace(repositoryName, workspace);

Module installation notes

Current status

Previously Magnolia crashed when failed to install any module. This has a reason and could not be easily fixed. However by refactoring module installation and startup now we can handle this. A note on module installation and startup is that if we failed on installing a root module which has few dependent modules, all dependent modules will be affected. In this context when we support end user to install their custom modules, this should not heavily affect Magnolia platform provided ones.

Implementation

Just prevent exception propagation by catch it here and by it pass to continue running:

Code Block
    protected void installOrUpdateModule(ModuleAndDeltas moduleAndDeltas, InstallContextImpl ctx) {
        final ModuleDefinition moduleDef = moduleAndDeltas.getModule();
        final List<Delta> deltas = moduleAndDeltas.getDeltas();
        ctx.setCurrentModule(moduleDef);
        log.debug("Install/update for {} is starting: {}", moduleDef, moduleAndDeltas);
        // viet fix continue running after fail install
        try {
            applyDeltas(moduleDef, deltas, ctx);
        } catch (Exception e) {
            log.error("Install module {} failed {}.", moduleDef.getName(), e.getMessage(), e);
        }
        log.debug("Install/update for {} has finished", moduleDef, moduleAndDeltas);
    }

Verify the result

As a result you'll find this, which not block Magnolia from continue running (I've tried with Contacts module like below):

Image Added