jcrDatasource: Unable to sortBy jcrName

171 views
Skip to first unread message

peterw...@gmail.com

unread,
Jun 1, 2021, 3:54:42 PM6/1/21
to user...@magnolia-cms.com

Hi everyone,

 

I tried to work with the newly introduced jcrDatasource property “sortBy” to sort by node name (aka jcrName). To my suprise, this isn’t going to work, because this special configuration case is not handled in info.magnolia.ui.contentapp.JcrQueryBuilder#orderBy. Are there other ways to sort by node name which I didn’t recognize?

 

Roman Kovařík

unread,
Jun 2, 2021, 1:16:39 AM6/2/21
to Magnolia User Mailing List, peterw...@gmail.com
Hi Peter,

The content created via the app should have a corresponding JcrDatasourceDefinition#nodeNameProperty, which is by default jcrName (but e.g. name in pages app).
Such property is created when an item is created or renamed so it's possible to sort by it. 
Was the content created externally without this property or could the actual problem be the fact that the JCR query is used only in the list view but you want this to work in the tree view?

Roman

peterw...@gmail.com

unread,
Jun 2, 2021, 6:48:32 AM6/2/21
to user...@magnolia-cms.com

Hi Roman,

 

thank you for your answer.

 

You’re right, the content was created in a custom app without a dialog field for handling the jcrName.

 

This is because handling of the node name in Magnolia is error-prone and we try to avoid this whenever possible:

 

  • For example, categorization-app does not handle node names correctly when using actions duplicate or copy&paste.
  • Editors do not recognize the change of node name in the category dialog after those actions and are confused about the change of publication status from published to modified when save the dialog.
  • When deriving/aggegating node names by other properties, implementation is often too costly to synchronize property with node name in all use cases.

 

I was just wondering, why sorting by Name(node) is not implemented for sortBy, but for com.vaadin.data.provider.Query#getSortOrders() in the same method info.magnolia.ui.contentapp.JcrQueryBuilder#orderBy – and wanted to make sure I’m not missing an important piece of code.

 

Yes, I’m aware that this is used only in list view.

 

 

Peter

--
You received this message because you are subscribed to the Google Groups "Magnolia User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to user-list+...@magnolia-cms.com.
To view this discussion on the web, visit https://groups.google.com/a/magnolia-cms.com/d/msgid/user-list/3dab4f5f-de72-4f8a-8807-2797a8c36f94n%40magnolia-cms.com.

Roman Kovařík

unread,
Jun 2, 2021, 6:59:55 AM6/2/21
to Magnolia User Mailing List, peterw...@gmail.com
Aha OK, you'r right.
As it's already implemented for manual column filtering, then it should be pretty easy to use it for preconfigured filtering as well. It was probably just forgotten.
Feel free to create a a ticket in MGNLUI project.

To unsubscribe from this group and stop receiving emails from it, send an email to user-list+unsubscribe@magnolia-cms.com.

Reply all
Reply to author
Forward
0 new messages