portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Schmelzer (JIRA)" <jetspeed-...@portals.apache.org>
Subject [jira] Created: (JS2-530) MenuElementImpl.getMetadata does not return the defined data
Date Thu, 11 May 2006 09:36:04 GMT
MenuElementImpl.getMetadata does not return the defined data

         Key: JS2-530
         URL: http://issues.apache.org/jira/browse/JS2-530
     Project: Jetspeed 2
        Type: Bug

  Components: PSML  
    Versions: 2.0-FINAL    
    Reporter: Robert Schmelzer

Following PSML given in folder.metadata:

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


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

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org

View raw message