magnolia

Load module configuration file from FS magnolia 5.7.9


I need to understand under what conditions is a module configuration file loaded from the FileSystem (FS). Specifically I would like to know why is config.yaml file not loaded in the configuration? Here is my src/main/resources/<magnolia-module-name>/config.yamlaccording to the file module structure described here and here.

'config':
  'gitRepoDirectory': '/Users/asusti/jGit/'
  'tempVersionDirectory': '/Users/asusti/temp/'
  'excludes':
    'green': 'green'
    'red': 'red'

I exported this config file as yaml from the module config and copied it to file location described above.

I also tried with a config.yaml like this according to the example here:

gitRepoDirectory: /Users/asusti/jGit/
excludes:
   green: green
   red: red

For testing this I deleted the config content node from the config app under config/modules/<magnolia-module-name> and restarted the magnolia instance. What am I missing?

I am running magnolia 5.7.9.

UPDATE:

As suggested here I added the config.yaml to src/main/resources/mgnl-bootstrap/<magnolia-module-name>/config.modules.<magnolia-module-name>.config.yamlwith the following content.

'config':
  'gitRepoDirectory': '/Users/asusti/jGit/'
  'jcr:primaryType': 'mgnl:content'
  'excludes':
    'green': 'green'
    'red': 'red'

The config folder and the properties and node below do not install in config.

SOLUTION: For bootstrapping I found the document here According to this document:

All bootstrap files are only imported once!

    Webapp-based bootstrap files are imported during the first run of the webapp when the Magnolia instance gets installed.
    Module-based bootstrap files are imported during the installation of the module.

If you want to import bootstrap files on every start up of the Magnolia instance or of a module, you must use custom installation tasks which are executed by the Module version handler or Module start up classes.

Solution

  • I think it is because you are checking the wrong documentation. Please refer to 5.7 documentation from https://documentation.magnolia-cms.com/display/DOCS57/

    If I recall correctly, the feature is implemented from the 6.1 version.

    And the page you are looking for is the following: https://documentation.magnolia-cms.com/display/DOCS57/Module+configuration#Moduleconfiguration-ConfiguringinJCRvsYAML

    Notice the bean definition there.