[MAGNOLIA-6521] Module config via Light Module Created: 28/Jan/16  Updated: 14/Oct/21  Resolved: 31/Jan/19

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1

Type: Story Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Roman Kovařík
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: 0d
Time Spent: 5h 49m
Original Estimate: Not Specified

Attachments: File _config.yaml     File config.yaml    
Issue Links:
Problem/Incident
causes MAGNOLIA-7549 Arrays in beans in module configurat... Accepted
Relates
relates to MAGNOLIA-6532 JCR bootstrap imports without Maven M... Closed
causality
is causing MGNLEESOLR-135 Magnolia 6.1 DataIndexer not initial... Closed
is causing MAGNOLIA-7636 "Bean Property is Skipped" Error Closed
is causing MAGNOLIA-7878 Decoration mechanism fails Closed
dependency
depends upon MAGNOLIA-7432 Draft concept for component configura... Closed
depends upon MAGNOLIA-7444 Definition app problems in modules co... Closed
is depended upon by MGNLUI-4765 Make Find Bar configurable via YAML Closed
relation
is related to MAGNOLIA-7636 "Bean Property is Skipped" Error Closed
is related to MAGNOLIA-6379 Changing properties of a JCR based de... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: LD Backlog
Sprint: Foundation 3, Foundation 4, Foundation 5
Story Points: 5

 Description   

A light module should be able to supply the configuration which is typically stored in the "config" folder directly under a modules configuration in the config app.

For example:
In AdminCentral configuration app:
"/modules/tours/config"

This could possibly be implemented so: the module descriptor can also specify the configuration that is typically supplied by JCR in the /modules/modulename/config node.

Additionally, a 2nd module must be able to decorate this configuration via yaml files that it provides.



 Comments   
Comment by Jan Haderka [ 09/Feb/16 ]

Decoration - yes.
own config - why would light module need one? This configuration was typically for admins to be able to steer behaviour of java-implemented features. Since there are no java classes, there is no need for such configuration. For the templates, you might as easily keep all the configuration in one ftl include file that you add to the templates that you use which makes it easy and transparent for frontend developer to know where whatever configuration he wants is and how to access it (or rename or delete or whatever).

Comment by Christopher Zimmermann [ 17/Feb/16 ]

Light modules will be able to supply groovy classes.
Config would allow configuration of how those classes work, and could also be used in templates.

Comment by Roman Kovařík [ 17/Jan/19 ]

There is already a working PoC for this, see  MAGNOLIA-7432.

Comment by Hieu Nguyen Duc [ 21/Feb/19 ]

QAed on "magnolia-enterprise-pro-demo-bundle-6.0.1-20190220.091844-362-tomcat-bundle.zip".

 

Case 1:

+ Start the instance

+ Put config.yaml into "modules/dam-app" with "previewConfig.iconStyleName" set to "icon-paid"

+ The value is applied correctly in M5's DAM app but Definitions app doesn't show the correct new value

=> Definitions app issue or file resource shouldn't override JCR resource?

 

Case 2: (continue from case1)

+ Delete JCR node "/modules/dam-app/config"

+ Restart the instance

=> DAM app and Definitions app show correctly

 

Case 3: (continue from case2)

+ Put _config.yaml (remove the underscore) to "modules/damAppDecoration/decorations/dam-app/"

=> DAM app and Definitions app show correctly

 

Comment by Roman Kovařík [ 17/Apr/19 ]

I guess that's wrong. Should be: /light-module/decorations/<target-module-name>/config.yaml

This follow decoration pattern for any registry so both version would work, see
https://documentation.magnolia-cms.com/display/DOCS61/Definition+decoration#Definitiondecoration-Definitiondecoratorfilelocation

  it's not possible to add a new module configuration at runtime

More precisely: "it's not possible to add a new module at runtime".
It's of course possible to change any existing module configuration at runtime.

 

 

Generated at Mon Feb 12 04:15:18 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.