Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-7882

Enable different configuration for publics and authors

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Neutral Neutral
    • None
    • None
    • None
    • None

      As a developer, I want to be able to provide configuration to just the author or the public, so that I can handle the different needs of the different systems.

      Currently when a developer provides yaml configuration in a light module, it is typically applied to both the author and the public instances. But sometimes there is configuration that should only be supplied to one system or the other, for example a virtualURI mapping.

      While it is true that each system could point to its own resources (or 'light-modules') directory, and that a developer could deploy different yaml configuration files to each of them - in practice this would be difficult to do and maintain. 

      We require an easier and more transparent and maintainable way to achieve this.

      Bigger Picture

      A related need is to provide different configuration to differnet 'environments' like dev, integration, production. When considering a solution to the author/public issue - consider this too and find a way that would at least be compatible with the environments issue, and at best be a solution to it as well. 
      See: https://jira.magnolia-cms.com/browse/MAGNOLIA-7883

      Context

      During free trials development there was the need to apply different configures on publics and author in order to don't show a 404 page when accessing SPA demo.

      The issue has been solved with work arounds but we would like to raise the attention to provide the option.

      Discussion about: https://magnolia-cms.slack.com/archives/C010SQYMGGP/p1595230252240700 

      Description by Topher

      In developing the freetrials demo we have a common scenario where we want different configuration on the Author and Public instance. We need to do this with no Java modules, only light development. 

      This case was that we want the root url of the Author to redirect to AdminCentral login, whereas we want the root url of the Public to redirect to one of the pages in the website. 

      Ideally we would have liked to provide a mapping configuration via a YAML definition or YAML decoration file. But this was not possible as all YAML definition files are picked up by the Author and Public and applied to both. 

      A workaround would be to have the Author and Public point to different light module directories, and then to supply the mapping decoration only on the public one. But this would be very difficult to maintain and understand.

       

      We needed to resort to importing bootstrap files rather then the preferred YAML decoration.

      Our solution was only possible because of the recent enhancement in content-importer-1.0.3. https://jira.magnolia-cms.com/browse/MGNLCI-22 brings a new property `magnolia.content.bootstrap.pattern' which takes a 'glob' pattern, and only imports files which match the glob.

      We configured this property differently on the Author and Public instances:

      Author:

      magnolia.content.bootstrap.pattern=
      Unknown macro:
      Unknown macro: {common,author}
      Unknown macro: {/,}
      */.{xml,yaml}

      Public:

      magnolia.content.bootstrap.pattern=
      Unknown macro:
      Unknown macro: {common,public}
      */.{xml,yaml}

       

      Then, in the repository we supplied a 'content-importer' directory with 3 subdirectories 'common', 'author', 'public'.

      Most of the content & configuration to be imported was in the 'common' directory.

      The one mapping configuration we only wanted on the Public instance was in the 'public' directory.

       

      Demo/Review of the approach implemented: https://magnolia-cms.zoom.us/rec/share/1NxyE7bSpz9IaInc0G-HZvQhOYPpT6a80CBI86IFz0-uE3kVdmN9wFuyV6jP3O7n  

        Acceptance criteria

              Unassigned Unassigned
              dlopez David Lopez
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: