[MAGNOLIA-6683] Offer YAML as alternative format for JCR bootstraps beside XML and revise export/import operations Created: 31/May/16  Updated: 22/Aug/22  Resolved: 28/Apr/17

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

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

Attachments: XML File dam.10-las-vegas-strip.jpg.xml     File dam.demo-project.img.logos.magnolia-logo-44.yaml     XML File tours.magnolia-travels.Vietnam--Tradition-and-Today-document-view-with-multi-values.xml     File website.sportstation-37.yaml     File website.sportstation.json     XML File website.sportstation.xml    
Issue Links:
Relates
relates to MAGNOLIA-7118 YAML import uses platform encoding in... Closed
relates to MAGNOLIA-6532 JCR bootstrap imports without Maven M... Closed
relates to MAGNOLIA-7022 Restore filtering of unwanted namespa... Closed
relates to MAGNOLIA-7124 Allow partial boostrapping of non-mod... Closed
relates to MAGNOLIA-7735 Magnolia won't start if .yaml export ... Closed
causality
dependency
depends upon PAGES-131 Use new JCR export dialog Closed
is depended upon by DOCU-1009 Document changes for JCR export in 5.4.4 Closed
is depended upon by JCRTOOLS-41 Add YAML import/export format support Closed
is depended upon by MAGNOLIA-7238 Ability to filter metadata properties... Closed
is depended upon by MGNLUI-4179 JCR Export improvements Closed
duplicate
is duplicated by MGNLCI-17 Allow to use YAML as bootstrap format Closed
relation
is related to MAGNOLIA-7098 special characters can sometimes lead... Closed
is related to MGNLDEMO-214 Demonstrate YAML bootstrap format 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:
Sprint: Kromeriz 93
Story Points: 13

 Description   

Support a simple YAML format for JCR Repository bootstrap files. Support this format wherever the "jcr system view" xml bootstrap files are supported now.

Reasons:
The "jcr system view" xml format is difficult to work with in typical team source control cases, such as diffing and merging.
The xml format is hard to read and perform manual edits on which is not an uncommon task in project development.
A yaml format would enable easier creation of jcr import files from other data sources.

Rollout:
Current step is only making the export and import available, and exposing export feature in the
jcrTools app - Exporter tab. Probably as an additional dropdown or radio button:
*XML
*YAML

Future steps will be (Probably in next major release 5.6)

  • make it the default export format from within all apps.
  • implement property filtering to make the bootstraps slimmer.
  • Replace our own bootstrap files with YAML format.

Note:
This is different from https://jira.magnolia-cms.com/browse/MAGNOLIA-6532 which is specifically about bootstrap support in light modules - but does not talk about the format.



 Comments   
Comment by Pierre Sandrin [ 14/Jun/16 ]

I tried to do it with the decorations feature, but i think you can't decorate things in '/modules/ui-admincentral/config'. Right?
I looks like because the 'Download as YAML' action is greyed out.

Comment by Christopher Zimmermann [ 07/Jul/16 ]

Yeah - that won't work. You can only decorate things handled by definition registries - like templates, dialogs, apps. See:
https://documentation.magnolia-cms.com/display/DOCS/Definition+decoration

Comment by Mikaël Geljić [ 20/Feb/17 ]

Hi there,

As you pointed out czimmermann, the JCR System View is hard to work with.

May I also remind that JCR specifies the Document View, specifically providing a human-readable serialization. This should be fairly easy to work with, diff/merge.

This format is legit bootstrap and works in Magnolia / Jackrabbit out of the box.

<?xml version="1.0" encoding="UTF-8"?>
<magnolia xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:mgnl="http://www.magnolia.info/jcr/mgnl"
  jcr:primaryType="mgnl:folder">
  <mika
    jcr:primaryType="mgnl:contact"
    email="test@magnolia-cms.com"
    firstName="Mikaël"
    lastName="Geljić" />
  <stephen
    jcr:primaryType="mgnl:contact"
    email="test3@magnolia-cms.com"
    firstName="Stephen"
    lastName="Nguyen" />
  ...
</magnolia>
Comment by Ilgun Ilgun [ 17/Mar/17 ]

I have attached a document view xml file called 'tours.magnolia-travels.Vietnam--Tradition-and-Today-document-view-with-multi-values.xml'.
This is the counter part of this issue which is tackled with DEV-457. There we made document-view to support multi-values and therefore a lightweight human-readable bootstrap file as mgeljic mentioned above.

Comment by Roman Kovařík [ 17/Mar/17 ]

ilgun could you please attach an export without filtered jcr/mgnl properties and export of an asset? We might want to filter some properties (this could be configurable) but you usually need at least the UUID which is used to create links to a content.

Comment by Antti Hietala [ 20/Mar/17 ]

Attached website.sportstation.xml export in Document View. Includes mgnl: properties.

Comment by Christopher Zimmermann [ 23/Mar/17 ]

PM recommendation. YAML instead of JCR document view. https://wiki.magnolia-cms.com/display/PMTEAM/Bootstraps+-+YAML+vs+XML+Document+View

Comment by Christopher Zimmermann [ 23/Mar/17 ]

avongunten UX recommendation request for
"Current step is only making the export and import available, and exposing export feature in the
jcrTools app - Exporter tab. Probably as an additional dropdown or radio button:
*XML
*YAML
"

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

Reopened: YAML bootstrap files are filtered because of the extension

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

For the release notes:

  • the implementation of the import and export command /modules/ui-admincentral/default/ has been replaced
    • added filtering support for the export command
      • all mgnl properties are filtered out for the config workspace by default (/modules/ui-admincentral/commands/default/export/filters/config)
        • you might want to remove/adjust this config if you intent using the activation status/modification dates in the config workspace
  • added support for YAML bootstrap format
Comment by Antonín Juran [ 24/Apr/17 ]

Exception is thrown when importing website.travel.yaml:
ERROR nolia.ui.dialog.formdialog.FormDialogPresenterImpl: An error occurred while executing an action.
info.magnolia.ui.api.action.ActionExecutionException: while scanning a plain scalar
in 'reader', line 29, column 24:
jcr:mixinTypes: [mgnl:hasVariant]
^
found unexpected ':'
in 'reader', line 29, column 28:
jcr:mixinTypes: [mgnl:hasVariant]
^
Please check http://pyyaml.org/wiki/YAMLColonInFlowContext for details.

at info.magnolia.ui.dialog.action.SaveImportDialogAction.executeCommand(SaveImportDialogAction.java:176)
at info.magnolia.ui.dialog.action.SaveImportDialogAction.execute(SaveImportDialogAction.java:111)
at info.magnolia.ui.api.action.AbstractActionExecutor.execute(AbstractActionExecutor.java:62)
at info.magnolia.ui.dialog.BaseDialogPresenter.executeAction(BaseDialogPresenter.java:211)
at info.magnolia.ui.dialog.BaseDialogPresenter.onActionFired(BaseDialogPresenter.java:201)
at info.magnolia.ui.dialog.actionarea.renderer.DefaultEditorActionRenderer$DefaultActionView$1.buttonClick(DefaultEditorActionRenderer.java:75)

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