Jetspeed 2
  1. Jetspeed 2
  2. JS2-530

MenuElementImpl.getMetadata does not return the defined data

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-FINAL
    • Fix Version/s: 2.1
    • Component/s: PSML
    • Labels:
      None

      Description

      Following PSML given in folder.metadata:

      <?xml version="1.0" encoding="iso-8859-1"?>
      <folder>
      <title>Assistant</title>
      <metadata name="title" xml:lang="de">Assistant</metadata>

      <metadata name="priority">20</metadata>

      </folder>

      When I know try to get the metadata when rendering the navigation in a MenuElementImpl object representing this folder, you always get null returned.

      Following code causes the bug in MenuElementImpl:
      public GenericMetadata getMetadata()
      {
      // return node metadata
      if (node != null)
      {
      GenericMetadata metadata = node.getMetadata();
      if ((metadata != null) && ((metadata.getFields() == null) || metadata.getFields().isEmpty()))

      { return metadata; }

      }
      return null;
      }

      The inner if statement returns false, if elements are in the collection. But that is not good, becaus so you get null returned, if there are fields in the colleciton.

      The inner if statement should be something like:
      if ((metadata != null) && (metadata.getFields() != null) && !metadata.getFields().isEmpty()))

      Best Regards
      Robert Schmelzerr

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Ate Douma
            Reporter:
            Robert Schmelzer
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development