Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-3585

JCR Browser should show all types

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Won't Do
    • Minor
    • None
    • None
    • admininterface
    • None
    • Yes

    Description

      When using the jcrbrowser tree to display a workspace that uses different node types, one has to subclass the treeConfiguration class to allow those types.

      Since MAGNOLIA-2950 (Magnolia 4.2), we could replace info.magnolia.module.admininterface.trees.JcrBrowserTreeConfiguration#prepareTree with the following code, we will display ALL nodes of that workspaces. (Note that this includes (mgnl:)MetaData as well as jcr:system nodes and its subnodes)

          @Override
          public void prepareTree(Tree tree, boolean browseMode, HttpServletRequest request) {
              super.prepareTree(tree, browseMode, request);
              tree.addItemType("nt:base", null, false);
      
              tree.addColumn(makeNodeTypeColumn(tree));
          }
      
          protected TreeColumn makeNodeTypeColumn(Tree tree) {
              final TreeColumn nodeType = TreeColumn.createColumn(tree, "Node type", new TreeColumnHtmlRenderer() {
                  public String renderHtml(TreeColumn treeColumn, Content content) {
                      try {
                          return content.getNodeType().getName();
                      } catch (RepositoryException e) {
                          log.error("Can't get node type for {}", content, e);
                          return "error: " + e.getMessage();
                      }
                  }
              });
              nodeType.setWidth(2);
              return nodeType;
          }
      

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                gjoseph Magnolia International
                Votes:
                2 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Task DoD