Main Content

Magnolia Community Forums: Get help with Magnolia: Modeling parent child relationships in Content App

  • dandonov
    Full name: Dian Andonov
    Posts: 3
    Last post: Mar 7, 2017 4:53:35 PM
    Registered on: Nov 4, 2016
    Modeling parent child relationships in Content App
    #1 by dandonov on Mar 7, 2017 4:53:35 PM


    my company has been using Magnolia CMS for multiple years. Recently we started utilizing the content applications framework modeling our data in custom applications for each content type. We are looking to model an application for structured questions and answers in a parent child relationship. The treeview in a content applicaiton presents nicely a parent and the assigned children underneath. However when you search and find a parent, the searchview presents only the parent item item found and not the associated children records.
    Looking at the implementation it feel awkward to extend the Lucene search, view presenter and content connector to add the associated records in the resulting listview.
    Furthermore since all components such as the ContentConnector get preconfigured in the yaml descriptor of the application, they are completely stateful in terms of the query that has been executed in against the JCR and which "rootPath" has been queried. We tried to model the children in a separate nodeType so when a query is passed to the children's customized BrowserSubApp ideally loads the children of the queried parent.
    What is Magnolia's support and recommended of implementing a Q and A application ( in terms of content app ) ? Is there a module or a SubApp that can facilitate searches of parents that return the children as well in the resulting view?

  • mgeljic
    Full name: Mikaël Geljić
    Posts: 70
    Last post: Sep 22, 2017 4:11:20 PM
    Re: Modeling parent child relationships in Content App
    #2 by mgeljic on Mar 8, 2017 8:11:23 AM

    Hi Dian,

    The 'hideInList' property under node-type definitions tells our Vaadin Container how to build the search query.
    It is false by default, so presumably you are currently seeing results from both types, but in a flat list, i.e. without the hierarchy/relationship.

    Unfortunately this is how the search view works in Magnolia—it's built on top of a flat list-view at the moment. In other words, it cannot act like a filter for the tree-view (arguably).

    That said, you can also implement such a filter and configure it under workbench > contentTools (in fact, the search-box is a content tool added by default).
    The typical approach is then to fire an event in order to update the TreePresenter (or instruct it to update the Container).

    Here's an example from our JCR Browser app:


You don't have the permission to post on this thread

Sign in

To login on this forum, you can use your Magnolia Forge, Support or Partner account, or, below, your Google, Yahoo! or OpenID account. If you have trouble logging in, or any other sort of issue, please let us know in the Meta forum, on the user-list, or simply by email at forum-admin at magnolia-cms dot com.

* Required

... or sign in with:

  • icon http://{your-openid-url}
  • icon
  • icon