[MGNLUI-1473] Workbench only shows node if the node type is an exact match Created: 29/May/13  Updated: 03/Jun/13  Resolved: 29/May/13

Status: Closed
Project: Magnolia UI
Component/s: framework, security app
Affects Version/s: None
Fix Version/s: 5.0

Type: Bug Priority: Neutral
Reporter: Tobias Mattsson Assignee: Tobias Mattsson
Resolution: Fixed Votes: 0
Labels: workbench
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
is causing MGNLUI-1479 Workbench does not display icon when ... Closed
dependency
is depended upon by MGNLUI-1282 As an admin, I should be able to set ... Closed
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:
Sprint: Beta 3

 Description   

Should support also showing sub types. Either always or it should be configurable.

This check in HierarchicalJcrContainer needs to be changed:

            ArrayList<Node> nodesWithMatchingTypes = new ArrayList<Node>();
            NodeIterator iterator = node.getNodes();
            final List<NodeTypeDefinition> nodeTypes = getWorkbenchDefinition().getNodeTypes();
            String currentNodeTypeName;
            while (iterator.hasNext()) {
                Node next = iterator.nextNode();
                currentNodeTypeName = next.getPrimaryNodeType().getName();
                for (NodeTypeDefinition current : nodeTypes) {
                    if (current.getName().equals(currentNodeTypeName)) {
                        nodesWithMatchingTypes.add(next);
                        break;
                    }
                }
            }

In 4.5 it was possible to set a type as strict:

    /**
     * Adds an itemType to the list of existing types and associates an icon with it.
     * The type can be specified as a strict, in which case only the items of given type will be displayed, but sub types will be ignored,
     * or non-strict in which case the items of sub types of given type will also be rendered.
     * @param type The item type
     * @param icon The icon used to display items of given type
     * @param strict Flag specifying whether or not to show also items of sub type of given type
     */
    public void addItemType(String type, String icon, boolean strict) {
        this.itemTypes.add(type);
        if (icon != null) {
            setIcon(type, icon);
        }
        if (strict) {
            strictTypes.add(type);
        } else {
            strictTypes.remove(type);
        }
    }


 Comments   
Comment by Jozef Chocholacek [ 29/May/13 ]

The ConfiguredNodeTypeDefinition.strict should be better set to false by default.

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