morciuch    2003/06/30 11:57:58

  Modified:    src/java/org/apache/jetspeed/portal/portlets/viewprocessor
                        RSSViewProcessor.java
  Log:
  Enhanced the exception handling for cases when rss contains no title and/or 
description.
  
  Revision  Changes    Path
  1.3       +17 -10    
jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/viewprocessor/RSSViewProcessor.java
  
  Index: RSSViewProcessor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/viewprocessor/RSSViewProcessor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RSSViewProcessor.java     2 May 2003 22:38:13 -0000       1.2
  +++ RSSViewProcessor.java     30 Jun 2003 18:57:58 -0000      1.3
  @@ -114,22 +114,29 @@
   
           channel = list.item(0);
   
  -        Node tn = getNode(channel, "title");
  +        Node tn = getNode( channel, "title" );
   
  -        if (tn == null)
  +        if ( tn == null ) {
  +            throw new PortletException( ERROR_NOT_VALID );
  +        } 
  +        else 
           {
  -            throw new PortletException(ERROR_NOT_VALID);
  -        }
  -        else
  -        {
  -            title = tn.getFirstChild().getNodeValue();
  +            Node fc = tn.getFirstChild();
  +            if (fc != null)
  +            {
  +                title = fc.getNodeValue();
  +            }
           }
   
  -        Node dn = getNode(channel, "description");
  +        Node dn = getNode( channel, "description" );
   
  -        if (dn != null)
  +        if ( dn != null ) 
           {
  -            description = dn.getFirstChild().getNodeValue();
  +            Node fc = dn.getFirstChild();
  +            if (fc != null)
  +            {
  +                description = fc.getNodeValue();
  +            }
           }
   
           portlet.setTitle(title);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to