[MAGNOLIA-6321] Avoid dependencies to MgnlContext, Content API and others in NodeUtil, NodeTypes, ... Created: 24/Jul/15  Updated: 15/Dec/17

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

Type: Task Priority: Critical
Reporter: Magnolia International Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:
Epic Link: jcr-util core-split
Story Points: 21

 Description   

In attempting to split out magnolia-jcr-utils out of magnolia-core, which should be a library of utilities that are as Magnolia-agnostic as possible, the following was highlighted:

  • info.magnolia.jcr.util.NodeUtil has dependencies on MgnlContext, Content (that's the old content api we've been trying to get rid of), PermissionUtil. It also has dependencies on DateUtil and OrderedProperties; while debatable, those could be extracted elsewhere or are probably easier to remove.
  • other classes of the info.magnolia.jcr.util package have these dependencies as well as to e.g info.magnolia.link, which seems completely out of place.
  • info.magnolia.jcr.util.NodeTypes is Magnolia-specific but represents our basic node types, which are relatively neutral. It could probably remain in magnolia-jcr-util, but we might want to either change its package and/or revise the description of the module slightly.

Patches:
https://git.magnolia-cms.com/users/ejervidalo/repos/core-split-scripts/browse/patches/0001-MAGNOLIA-6321-remove-dependency-to-Context-Path-and-.patch
https://git.magnolia-cms.com/users/ejervidalo/repos/core-split-scripts/browse/patches/0002-MAGNOLIA-6321-remove-dependency-to-MgnlContext-from-.patch



 Comments   
Comment by Espen Jervidalo [ 06/Oct/15 ]

Here's a summary of what I found based on the current status of the core-split scripts on magnolia-jcr-util. Apart from what already is in the the description the split between versioning, core and jcr-util is still problematic and needs better refinement.

  • info.magnolia.jcr.decoration.AbstractContentDecorator#wrapVersionManager needs
    info.magnolia.jcr.wrapper.DelegateVersionManagerWrapper still in core. Only jcr-dependencies. Should go to ‘magnolia-versioning’ I guess?
  • info.magnolia.jcr.decoration.ContentDecoratorVersionHistoryWrapper needs VersionUtil which is in magnolia-versioning
    VersionUtil needs NodeUtil which is in core still, but should pbly go to jcr-util.. -> so .. cyclic
    VersionUtil needs VersionNode which needs NodeTypes, Components
  • info.magnolia.jcr.inheritance.InheritanceContentDecorator
    needs NodeUtil, which should be part of jcr-util, depends on MgnlContext (shouldn’t) and Permissionutil (shouldn’t)
  • and all the failing classes in info.magnolia.jcr.wrapper|predicate fail due to NodeTypes or NodeUtil
Generated at Mon Feb 12 04:13:24 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.