Page History
Devstatus | ||||
---|---|---|---|---|
| ||||
<to be reviewed> |
...
Ready to move to technical documentation.
|
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 name |
---|
...
old property | new property name | defined by Mixin |
---|---|---|
MetaData/mgnl:title | - | - |
MetaData/mgnl:creationdate | mgnl:created | mgnl:created |
<none> | mgnl:createdBy | mgnl:created |
MetaData/mgnl:templatetype | - | - |
MetaData/mgnl:lastaction | mgnl:lastActivated | mgnl:activatable |
MetaData/mgnl:activatorid | mgnl:lastActivatedBy | mgnl:activatable |
MetaData/mgnl:activated | mgnl:activationStatus | mgnl:activatable |
MetaData/mgnl:template | mgnl:template | mgnl:renderable |
MetaData/mgnl:authorid | mgnl:lastModifiedBy | mgnl:lastModified |
MetaData/mgnl:lastmodified | mgnl:lastModified | mgnl:lastModified |
MetaData/mgnl:comment | mgnl:comment | mgnl: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
<to be described>in next Sprint (s011) we'll add an InstallationTask migrating existing content to the new repository layout