Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-1473

Workbench only shows node if the node type is an exact match

XMLWordPrintable

      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);
              }
          }
      

        Acceptance criteria

              tmattsson Tobias Mattsson
              tmattsson Tobias Mattsson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD