[MAGNOLIA-3051] Ideas for improvements: drop the metadata node Created: 01/Feb/10  Updated: 02/Dec/13  Resolved: 02/Dec/13

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

Type: Improvement Priority: Major
Reporter: Fabrizio Giustina Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
duplicate
duplicates MAGNOLIA-4640 MetaData as mixin 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)
Date of First Response:

 Description   

Just a thought for the future: the metadata node is there just to hold a few properties that could better stay in the actual node. All the properties are already prefixed by "mgnl:" so they can be filtered easily when needed. Why not removing metadata nodes at all?

This will bring a bunch of small nice effects:

  • reduce (to half) the number of nodes in the repository, improving performances (now every time a node is read, also its metadata node is fetched).
  • being able to sort properly on metadatas! A jcr query for sorting on the creation date can be incredibly/unnecessary hard now (try getting all the nodes with "a" in the title sorted by creation date... pretty evil)
  • (minor) smaller/more readable xml files for bootstrap

We can easily keep APIs as they are now, since the MetaData class could just fetch the same properties from the main node.
It will require a single-line change in the constructor, from:

this.node = workingNode.getNode(DEFAULT_META_NODE))

to:

this.node = workingNode;

I don't think metadatas are accessed directly in different ways, so updating the APIs as described is probably enough. Redefining the nodetypes declaration and adding a filter for xml import should complete the work.



 Comments   
Comment by Magnolia International [ 02/Feb/10 ]

That's something we've been wanting to do for a while too. API-wise, it should indeed be fine, although there are places where MetaData is accessed as a regular node (at least with tests) - but worst case that should be workaround-able via code too. The one thing that holds us back is updates. And time.
The tree and other related classes would probably need to be adapted too.

Generated at Mon Feb 12 03:42:42 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.