Uploaded image for project: 'Hippo Repository'
  1. Hippo Repository
  2. REPO-1836

getDisplayName() returns wrong value for virtual node

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.1.0, 5.0.3
    • Labels:
      None
    • Similar issues:
    • Processed by team:
      Platform
    • Sprint:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: