[MGNLUI-1267] HierarchicalJcrContainer should be provided by IOC - Filtered properties should be changeable Created: 29/Apr/13  Updated: 26/Jun/13  Resolved: 26/Jun/13

Status: Closed
Project: Magnolia UI
Component/s: app framework, content app, framework, tree/list
Affects Version/s: 5.0
Fix Version/s: 5.0

Type: Bug Priority: Major
Reporter: Christian Ringele Assignee: Unassigned
Resolution: Not an issue Votes: 0
Labels: ioc
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File PageApp-BrowserSubapp.png     PNG File PageApp-DataViewSubapp.png    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

The use case (see print screens):
I created a new sub app in the pages app, for displaying former JCRBrowser alike all data. For this I created an new action "View JCR Browser" where it opens the page in the subapp "Jcr Data View".
I had to use this approach, cause you can't register different tree content views in one workspace behaving differently (different columns, different display of properties etc).
There I was easily capable of changing that it displays:

  • Area and Component nodes
  • All properties and its values
  • An extra column displaying the jcrPrimaryType
  • Adapting the template columns that it displays the jcrPrimaryType where no template (RenderableDefinition) is defined in the meta data.

Not the next step I tried to achieve, the use case I can't implement:

  • Displaying all the meta data properties.
    (The next idea would have been, having the meta data properties not editable, but all other properties are editable. That could be decided on the prefix they have.)

The problem:
The class info.magnolia.ui.workbench.tree.HierarchicalJcrContainer defines hard coded in the method info.magnolia.ui.workbench.tree.HierarchicalJcrContainer.getChildren(Item) what properties should be filtered. Using some inject-able Filter object would make that more flexible.
No matter, thought I extend this class and just override (even if cumbersome, just for try out) that method.

The problem there is, that the class info.magnolia.ui.workbench.tree.TreeViewImpl allocated the Container not by IOC, but by 'new'. Ok, lets override the receiving class of the container and override this one, just allocating there my Container class in: info.magnolia.ui.workbench.tree.TreeViewImpl.buildTreeTable(Container, WorkbenchDefinition, ComponentProvider)
But this method is private.

-> Cant do it without copying the complete TreeViewImpl class just to change that line of code

 this.container = new HierarchicalJcrContainer(workbench);


 Comments   
Comment by Christian Ringele [ 29/Apr/13 ]

By the way, the impl is located in:
https://git.magnolia-cms.com/gitweb/?p=training/sandbox.git;a=tree;f=training-module-jcr-browser;h=6b5c3815d00ffb79afeaf74fb5f40c06859f2678;hb=HEAD

Comment by Tobias Mattsson [ 26/Jun/13 ]

It is now possible to use a custom container by extending TreePresenter and overriding the createContainer() method. For an example see how this is done in the security app.

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