Implemented in 5.0 Alpha1

Ready to move to technical documentation. Unable to locate Jira server for this macro. It may be due to Application Link configuration.

The Motivation

Until M5 Magnolia stored MetaData on a separate subnode - among others this

  • made complex queries (JCR_SQL2/JQOM) more complicated (if not outright impossible) as one had to use joins to access MetaData (e.g. for sorting by values in metadata)
    • some of the joins are extremely slow
  • doubled the amount of nodes in repo
  • forced to treat MetaData separately in Java
  • made exported xml harder to read
  • duplicated properties like jcr:created and jcr:createdBy

The Implementation 

The properties hosted on the MetaData subnode are replaced by several fine grained mixins. Property names got consolidated.

New Mixins

[mgnl:lastModified]
  MIXIN

  • mgnl:lastModified (DATE)
  • mgnl:lastModifiedBy (STRING)

[mgnl:activatable]
  MIXIN

  • mgnl:lastActivated (DATE)
  • mgnl:lastActivatedBy (STRING)
  • mgnl:activationStatus (STRING)

[mgnl:renderable]
  MIXIN

  • mgnl:template (STRING)

[mgnl:created]
  MIXIN

  • mgnl:created (DATE)
  • mgnl:createdBy (STRING)

[mgnl:versionable]
  MIXIN

  • mgnl:comment (STRING)

 

Mapping
old property namenew property namedefined by Mixin
MetaData/mgnl:title--
MetaData/mgnl:creationdatemgnl:createdmgnl:created
<none>mgnl:createdBymgnl:created
MetaData/mgnl:templatetype--
MetaData/mgnl:lastactionmgnl:lastActivatedmgnl:activatable
MetaData/mgnl:activatoridmgnl:lastActivatedBymgnl:activatable
MetaData/mgnl:activatedmgnl:activationStatusmgnl:activatable
MetaData/mgnl:templatemgnl:templatemgnl:renderable
MetaData/mgnl:authoridmgnl:lastModifiedBymgnl:lastModified
MetaData/mgnl:lastmodifiedmgnl:lastModifiedmgnl:lastModified
MetaData/mgnl:commentmgnl:commentmgnl:versionable

Convenience

In order easily see what custom nodeType defines what properties we created info.magnolia.jcr.util.NodeTypes.

It hosts a proper inner class for each node type together with the constants for all it's properties and some convenience methods.

Backwards Compatibility

  • info.magnolia.cms.core.MetaData has been adapted to be fully backwards compatible
    • If you have code still using the MetaData type and the old property names, we'll internally map these to the new property names on the workingNode. 

Migration

Bootstrap files

  • We still support Bootstrap files containing MetaData subsides
    • info.magnolia.importexport.postprocessors.MetaDataImportPostProcessor will take care of moving the contained properties to the workingNode and rename to the new structure

Repositories

  • in next Sprint (s011) we'll add an InstallationTask migrating existing content to the new repository layout

     

 

1 Comment

  1. To do: This documentation should go to a new node type reference page in Magnolia 5.3 documentation