Implemented in 4.2 Data 1.4
Official Documentation Available
This topic is now covered in Hierarchical types/data
.
Conference call of 30.July.2009
Decisions taken:
- Berts module will be used and merged into the data module
- no extra main menu points
- the node type hierarchy is directly defined in the node type definition tree
- root path: only the top most type can have a root path defined
- new item: in the case that multiple types can be added a selection dialog similar to the one use for adding paragraphs is used.
- context menu: items can only be grayed out but not hidden, we won't change that now
- complex strucutes: not yet supported, the already existing multiple references field can be used
Schedule (only vaguely defined)
- start can maybe start end of August
- a release could be targeted in September
- would be 1.4 version together with versioning and workflow integration
First prototyping by Jan
This page is about the possible extension to data module that is in no way finalized nor supported at the moment. Use at your own risk.
This extension allows for creation and maintenance of multiple different types under the same hierarchy in Data Module as well as using any of the types as a parent/child for any other type existing in same hierarchy.
Current version of the Data module with the extension to support multiple mixed type hierarchies is in the sandbox at http://svn.magnolia-cms.com/svn/community/sandbox/magnolia-module-data-multitype/
The sandbox branch of code is a replacement for Data Module version 1.3.x, is such it works against Magnolia 4.1.x.
=== Installation
- install the module build from the sandbox (just replace your current m-m-data-1.3.jar with the snapshot you build)
- create two different types (let's call them
typeAandtypeB) and use the same rootFolder (say/mytypes) for them - logout/login to get the submenu entries displayed.
- go to
config:/modules/data/trees/typeAand addconfigurationClassnodeData and set it toinfo.magnolia.module.data.trees.MultiTypeDataAdminTreeConfig - go to
config:/modules/data/dialogs/typeAand change value ofclasstoinfo.magnolia.module.data.dialogs.TypeSelectDataDialog - go to
data:typeAand if you click onNewItemthe selection dialog will popup letting you choose from eithertypeAitem ortypeB... click on desired type, clickOKand continue as usual. you should be able to nest the entries as well (e.g. havetypeAentry with a child entry oftypeBand so on)
=== The changes in classes:
- info.magnolia.module.data.dialogs.TypeSelectDataDialog (new)
- info.magnolia.module.data.trees.MultiTypeDataAdminTreeConfig (new)
- info.magnolia.module.data.trees.GenericDataAdminTree (modified)
... you see there wasn't much work necessary to get this started ... there might be more work involved to smooth out all the rough edges
=== What could/should be improved:
- the configuration class should be added to the tree automatically, some for the dialog (might need to add another checkbox to the type creation dialog. Something like "allow multiple types" or similar.
- possibility to define some constrains (like the pot entry could be only
typeAandtypeBortypeCcan have as a parent onlytypeA, ortypeAcan't have any other type as a parent, etc. - the trees again, since you can use the
data:typeAto edit all types that share given rootPath, there is really no need for another tree for justdata:typeB - surely you can think of some more
Discussion with Bert Leunis his prototype
Jan Haderka and Bert Leunis had a deeper email discussion about the topic. I attached the summarizing email by Bert as a PDF document (contains screen shots)