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

ImportUUIDBehavior in ModuleBootstrapTask

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Neutral
    • Resolution: Unresolved
    • Affects Version/s: 5.3.6
    • Fix Version/s: None
    • Component/s: modulemechanism
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            lhaensenberger Lea Hänsenberger
            Visible to:
            ben gruber, Lea Hänsenberger, Pascal Kuster
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: