org.kohsuke.jnt
Class JNNewsItems

java.lang.Object
  extended by org.kohsuke.jnt.JNNewsItems

public final class JNNewsItems
extends Object

java.net project news item section. TODO: add support for advanced news item options

Version:
$Revision: 1.10 $
Author:
Ryan Shoemaker, Bruno Souza

Method Summary
 void createNewsItem(Calendar date, String headline, String body, String imageUrl, String articleUrl)
          Submit a news item.
 void createNewsItem(String headline)
          Set the headline field of the news item.
 List<JNNewsItem> getNewsItems()
          Gets all announcements in this project as a List of JNNewsItems.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createNewsItem

public void createNewsItem(Calendar date,
                           String headline,
                           String body,
                           String imageUrl,
                           String articleUrl)
                    throws ProcessingException
Submit a news item. The only required parameter is headline.

Parameters:
date - Optional Calendar object representing the date the news item will be posted. if this parameter is null, the current date will be used and the news item will be posted immediately.
headline - The news item headline - must not be null, HTML markup allowed
body - Optional content for the body of the news message (HTML markup allowed and encouraged)
imageUrl - Optional image url field
articleUrl - Optional original article url
Throws:
ProcessingException - if anything is wrong with the parameter data or an error occurs during the form submission

createNewsItem

public void createNewsItem(String headline)
                    throws ProcessingException
Set the headline field of the news item. The headline is the only required field on the form. In this case, the news item will contain the specified headline and default to the current date.

Parameters:
headline - the headline
Throws:
ProcessingException

getNewsItems

public List<JNNewsItem> getNewsItems()
                              throws ProcessingException
Gets all announcements in this project as a List of JNNewsItems.

The returned list is sorted in the order of date; the latest announcement is the first entry.

Returns:
can be empty but never be null. Read-only.
Throws:
ProcessingException


Copyright © 2003-2008 Kohsuke Kawaguchi. All Rights Reserved.