Components: introduce dependency injection (MAGNOLIA-2569)

[MAGNOLIA-3538] Restore or drop support for module properties (name, moduleDefinition, moduleNode, configNode) Created: 01/Feb/11  Updated: 23/Jun/14  Resolved: 18/Oct/11

Status: Closed
Project: Magnolia
Component/s: core, modulemechanism
Affects Version/s: None
Fix Version/s: 4.5

Type: Sub-task Priority: Neutral
Reporter: Magnolia International Assignee: Magnolia International
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Date of First Response:

 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);
                    }
                }


 Comments   
Comment by Tobias Mattsson [ 18/Oct/11 ]

This functionality has been restored.

Generated at Mon Feb 12 03:47:25 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.