[MGNLREST-678] Support Norsu Content Store to generate Hierarchical Structure responses Created: 19/Apr/23  Updated: 11/May/23  Resolved: 03/May/23

Status: Closed
Project: Magnolia REST Framework
Component/s: None
Affects Version/s: None
Fix Version/s: 3.0.0

Type: New Feature Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Canh Nguyen
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Issue Links:
Cloners
clones MGNLREST-669 Spike: Develop a Solution for Convert... Closed
is cloned by PAGES-1138 CLONE - Support Norsu Content Store t... Closed
causality
is causing MGNLREST-683 DOC: SaaS: Support Norsu Content Stor... Open
supersession
supersedes PAGES-1052 Make it possible to retrieve subpages... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLREST-670 Implementation Sub-task Completed Canh Nguyen  
MGNLREST-671 Review Sub-task Completed Robert Šiška  
MGNLREST-672 Pre-Integration QA Sub-task Completed Robert Šiška  
MGNLREST-673 QA Sub-task Completed Dai Ha  
Template:
Acceptance criteria:
Empty
Documentation update required:
Yes
Date of First Response:
Epic Link: SaaS Migration - DevX
Sprint: DevX 36
Story Points: 3
Team: DeveloperX
Work Started:
Approved:
Yes

 Description   

As a Magnolia client developer, I want to have a possibility to get via API a hierarchical structure of Pages  so I can work with the content without having to "build the tree" in client code.

Context & Problems (from: https://wiki.magnolia-cms.com/pages/viewpage.action?spaceKey=DEVINT&title=Norsu+Content+Delivery+concerns)

Getting a tree of content.

The API has changed in a major way from JCR, there is no way to retrieve a tree/heirarchy of content (with multiple page nodes).

One would assume that since the content is treated as hierarchical in the UI apps, it should be also returned in the content delivery endpoint as such.

Norsu returns a flat list, but each item has a path property, so the front end can reassemble the tree structure if needed. It's just extra work.

 

Acceptance Criteria: 

The API should allow for retrieval of hierarchical structure of Pages and Sitemaps.

The hierarchical structure should accurately represent the page structure and ordering, including parent-child relationships.

The API should be secure, with appropriate access controls and authentication.

 

To Determine

When to return tree.

Format for the tree -see:

https://wiki.magnolia-cms.com/display/DEVINT/Proposal+for+Delivery+Heirarcy

 



 Comments   
Comment by Christopher Zimmermann [ 03/May/23 ]

canh.nguyen Can you please provide a summary of the changes introduced in this ticket so that the Documentation team knows what to document?

Comment by Canh Nguyen [ 08/May/23 ]

Here is the summary:

  • All APIs have depth query parameter
  • Read node API has default depth=0 to reduce the response body
  • Get children and query nodes APIs use depth configuration the endpoint definition as default to reduce the response body

https://docs.magnolia-cms.com/headless/api/delivery.html#_methods

Comment by Christopher Zimmermann [ 09/May/23 ]

Thanks canh.nguyen . Was there also some change in how the children are included? Like that they are returned either in "nodes" in one context but returned as "children" in another context?

Comment by Canh Nguyen [ 10/May/23 ]

Sorry, I forgot to mention. Only Read Node API with depth is greater than 0 will return hierarchical structure. The backward compatibility JSON structure will include children as node properties and the property names are appeared in "@nodes" array. "children" is a new property of the new JSON data. But I realized that we should use "@children" to avoid naming conflict if content types have "children" property.

Comment by Christopher Zimmermann [ 10/May/23 ]

Thank you - and in which cases will the @children node be included?

Comment by Canh Nguyen [ 11/May/23 ]

$type: pagesDeliveryEndpoint_v2 will produce old data structure, and $type: deliveryEndpoint_v2 will produce the new data structure that has @children.

Generated at Mon Feb 12 07:02:08 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.