Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-2569 Components: introduce dependency injection
  3. MAGNOLIA-3538

Restore or drop support for module properties (name, moduleDefinition, moduleNode, configNode)

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Neutral
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.5
    • Component/s: core, modulemechanism
    • Labels:
      None
    • Magnolia Release:
      4.5

      Description

      With MAGNOLIA-2569, I (temporarily) dropped support for the above properties.

      This was essentially implement using the snippet below, and calls to info.magnolia.module.ModuleManagerImpl#populateModuleInstance 1) before starting the module up, and 2) in the EventListener attached to this module by ModuleManagerImpl

      If we need to revive support for this, we should consider using a specific interface (or several), and/or annotations.

                      // Prepare properties for module instances; if the bean has "moduleDefinition",
                      // "name", "moduleNode" or "configNode" properties, they will be populated accordingly.
                      final Map<String, Object> moduleProperties = new HashMap<String, Object>();
                      moduleProperties.put("moduleDefinition", moduleDefinition);
                      moduleProperties.put("name", moduleName);
      
                      if (modulesParentNode.hasContent(moduleName)) {
                          final Content moduleNode = new SystemContentWrapper(modulesParentNode.getChildByName(moduleName));
                          moduleNodes.add(moduleNode);
                          moduleProperties.put("moduleNode", moduleNode);
                          if (moduleNode.hasContent("config")) {
                              final Content configNode = new SystemContentWrapper(moduleNode.getContent("config"));
                              moduleProperties.put("configNode", configNode);
                          }
                      }
      

        Attachments

          Activity

            People

            Assignee:
            gjoseph Magnolia International
            Reporter:
            gjoseph Magnolia International
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response: