[DOCU-1349] How to get items in natural order with the REST delivery endpoint Created: 28/Feb/18 Updated: 16/May/18 Resolved: 16/May/18 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Neutral |
| Reporter: | Christopher Zimmermann | Assignee: | Martin Drápela |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Template: |
|
||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||
| Task DoR: |
Empty
|
||||||||||||
| Documentation update required: |
Yes
|
||||||||||||
| Date of First Response: | |||||||||||||
| Sprint: | Docu Sprint 48, Docu Sprint 49, Docu Sprint 50 | ||||||||||||
| Story Points: | 0.5 | ||||||||||||
| Description |
|
The only way to definitely get items in natural order is to use a "readNode" to get a parent item and all the children will be listed in natural order. This should be clearly documented. It should also be documented that if you supply no parameters or path - then the QUERY is used, not the READNODE. It should be documented that when the QUERY is used with no ordering paramaters - than the "nagtural" repositories order will be used. But that this unfortunately often does not reflect the order in the app. There should be some information about JCR indexing etc. See forum posts linked here: https://jira.magnolia-cms.com/browse/MGNLREST-169?focusedCommentId=156550&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-156550
It might be possible to do this on items in the root by requesting the root node - but im not sure. After a ticket is fixed it may be possible to get items from the "query" but it depends on a bug being fixed and on strange JCR behaviour as mentioned in linked ticket. See comments on: https://jira.magnolia-cms.com/browse/MGNLREST-169 |
| Comments |
| Comment by Christopher Zimmermann [ 28/Feb/18 ] |
|
Note that there is an existing limitation i that you (apparently) can not get readNode from the ROOT: |
| Comment by Christoph Meier [ 14/May/18 ] |
|
mdrapela - I have reviewd. Note the following:
I anyway could not completely follow your text
I am still not sure about the order when using no query params, no path and not using @nodes . I was asking dai.ha and he checks for me with the VN Core team. (He also was not fully sure at first sight).
|
| Comment by Christoph Meier [ 14/May/18 ] |
|
After having discussed the whoe thing with hieu.nguyen -I have realized, that we actually have no 3 "sub resources"
There is indeed a new public method. In docs we mention this as the @nodes handle.
And we should clarify the point concerning how things are ordered, of no orderBy param is used.
But the request |
| Comment by Hieu Nguyen Duc [ 14/May/18 ] |
|
cmeier Sorry, I meant readNode has no order for properties because they are written manually. For child nodes, they're returned in natural order. |
| Comment by Christopher Zimmermann [ 14/May/18 ] |
|
"Get children" basically means using the "@nodes" handle right? If so, wouldnt it make sense to include that as a part of "Read node" or directly underneath it, since it behaves almost the same as "Read node"? - Its kind of a special way to use "Read node". |