Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-6044

ImportUUIDBehavior in ModuleBootstrapTask

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Neutral Neutral
    • None
    • 5.3.6
    • modulemechanism
    • None

      When using the ModuleBootstrapTask I don't have the possiblity to tell it, what should happen if there's a conflict with the UUIDs. So far I always created my own Task that is basically the same as the ModuleBootstrapTask, but it takes an int as parameter in the constructor which is then passed on to BootstrapResourcesTask as ImportUUIDBehavior:

      
      package ch.screenconcept.nobel.setup;
      
      import info.magnolia.module.InstallContext;
      import info.magnolia.module.delta.BootstrapResourcesTask;
      
      public class CustomBootstrapTask extends BootstrapResourcesTask {
      	public CustomBootstrapTask(int importBehavior) {
      		super("Bootstrap", "Bootstraps the necessary module repository content.", importBehavior);
      	}
      
      	/**
      	 * Accepts any resource under "/mgnl-bootstrap/moduleName" including any
      	 * subfolders.
      	 */
      	@Override
      	protected boolean acceptResource(InstallContext ctx, String resourceName) {
      		final String moduleName = ctx.getCurrentModuleDefinition().getName();
      		return resourceName.startsWith("/mgnl-bootstrap/" + moduleName + "/")
      				&& resourceName.endsWith(".xml");
      	}
      }
      

      I was wondering if it wouldn't make sense to add a constructor to ModuleBootstrapTask, allowing devs to specify the behavior on UUID conflicts. Because as it is installation or update of the module just fails and it's quite annoying to fix the xml in order for the update to work. Unfortunately, if multiple people work on a project, those conflicts happen from time to time.

        Acceptance criteria

              Unassigned Unassigned
              lhaensenberger Lea Hänsenberger
              ben gruber, Lea Hänsenberger, Pascal Kuster
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD