Ad

Magnolia 6.0 Do UpdateTasks Of MyModule At Least

currently i use a simple ModuleVersionHandler like this :

public class MyModule extends DefaultModuleVersionHandler {

public MyModule() {
    DeltaBuilder v60 = DeltaBuilder.update(".0.0", "Update to 6.0 and new configuration settings.");
    v60.addTask(new BootstrapSingleModuleResource("Module configuration","Default configuration for myModule web.","config.modules.myModule.xml"));
    register(v60);
}


@Override
protected List<Task> getExtraInstallTasks(InstallContext installContext) {
    List<Task> extraTasks = new ArrayList<Task>();
    extraTasks.add(new NewPropertyTask("SiteDefault","Set Default Site Task", RepositoryConstants.CONFIG, "/modules/site/config/site", "extends" , "/modules/myModule/config/myModule/"));
    return extraTasks;
}

}

my problem is, if i deploy it in cleared workspaces @Tomcat or Wildfly the update will be processing at first so in that case it will fail because the magnolia nodePath /modules/site/config/site will not exist.

if i rewirte as example into NodeDelegateTasks to do a check before and create the path by myself or something else that build the node path and set the extends property, the following magnolia install tasks will overwrite my tasks. it fells like that the magnolia installation Tasks will remove previous node that will match with /modules/site/*

How can i tell Magnolia to do myModule tasks at least or after the init install of magnolia ?

Kind regards

Ad

Answer

You could either add a build-dependency through Maven/Gradle like @bradley-andersen suggested or only add the module as an install-dependency in your Module Descriptor XML like this:

<dependencies>
 <dependency>
  <name>core</name>
 <version>3.6.0/*</version>
</dependency>

See magnolia documentation for further info about the module descriptor: https://documentation.magnolia-cms.com/display/DOCS60/XML-based+module+descriptor#XML-basedmoduledescriptor-Moduledependencies

Ad
source: stackoverflow.com
Ad