Uploaded image for project: '[Read Only] - Hippo Repository'
  1. [Read Only] - Hippo Repository
  2. REPO-1836

getDisplayName() returns wrong value for virtual node

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 5.1.0, 5.0.3
    • None
    • None
    • Platform 167

    Description

      org.hippoecm.repository.impl.NodeDecorator#getDisplayName()
      

      in case of virtual node if statement:

      if(parent.isNodeType(HippoNodeType.NT_HANDLE && parent.isNodeType(HippoNodeType.NT_NAMED)
      

      fails so node name is returned.

      Quick fix would be to use canonical node in case we hit virtual node ( see below), but I am not familiar with repository code base and implications of such a change

        @Override
          public String getDisplayName() throws RepositoryException {
              Node node = this;
              if (isVirtual()) {
                  node = getCanonicalNode();
              }
              if (!isNodeType(HippoNodeType.NT_NAMED)) {
                  Node parent = node.getParent();
                  if (parent.isNodeType(HippoNodeType.NT_HANDLE) && parent.isNodeType(HippoNodeType.NT_NAMED)) {
                      node = parent;
                  } else {
                      return getName();
                  }
              }
              return node.getProperty(HippoNodeType.HIPPO_NAME).getString();
          }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mmilicevic Marijan Milicevic
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: