org.jasig.portlet.newsreader
Class NewsDefinition

java.lang.Object
  extended by org.jasig.portlet.newsreader.NewsDefinition
All Implemented Interfaces:
Comparable<NewsDefinition>
Direct Known Subclasses:
PredefinedNewsDefinition, UserDefinedNewsDefinition

public class NewsDefinition
extends Object
implements Comparable<NewsDefinition>

NewsDefinition represents the base class for news registrations. Information required to retrieve the news, such as the news's URL or important default system-wide configuration information may be stored in the parameters map. In order to add this news for a specific user, a NewsConfiguration referencing this news definition must be created.

Author:
Anthony Colebourne, Jen Bourey

Constructor Summary
NewsDefinition()
          Default constructor.
NewsDefinition(Long id, String className, String name)
           
 
Method Summary
 void addParameter(String name, String value)
          Add an individual news parameter.
 int compareTo(NewsDefinition def)
           
 String getClassName()
          Returns the name of the adapter class for this news which will determine how the news is retrieved.
 Long getId()
          Return the unique id of this news.
 String getName()
          Return the display name for this news.
 Map<String,String> getParameters()
          Return the map of news parameters.
 void setClassName(String className)
          Set the name of the adapter class for this news which will determine how the news is retrieved.
 void setId(Long id)
          Set the unique id for this news.
 void setName(String name)
          Set the display name for this news.
 void setParameters(Map<String,String> parameters)
          Set the map of news parameters.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NewsDefinition

public NewsDefinition()
Default constructor.


NewsDefinition

public NewsDefinition(Long id,
                      String className,
                      String name)
Method Detail

getId

public Long getId()
Return the unique id of this news.

Returns:

setId

public void setId(Long id)
Set the unique id for this news.

Parameters:
id -

getClassName

public String getClassName()
Returns the name of the adapter class for this news which will determine how the news is retrieved. This id must match a news adapter registered in the spring context files.

Returns:

setClassName

public void setClassName(String className)
Set the name of the adapter class for this news which will determine how the news is retrieved. This id must match a news adapter registered in the spring context files.

Parameters:
className -

getName

public String getName()
Return the display name for this news.

Returns:

setName

public void setName(String name)
Set the display name for this news.

Parameters:
name -

getParameters

public Map<String,String> getParameters()
Return the map of news parameters. These parameters can hold any extra information needed by the particular adapter used by this news, such as a URL.

Returns:
parameter map

setParameters

public void setParameters(Map<String,String> parameters)
Set the map of news parameters. These parameters can hold any extra information needed by the particular adapter used by this news, such as a URL.

Parameters:
parameters - parameter map

addParameter

public void addParameter(String name,
                         String value)
Add an individual news parameter. These parameters can hold any extra information needed by the particular adapter used by this news, such as a URL.

Parameters:
name - parameter name (key)
value - value to be stored

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(NewsDefinition def)
Specified by:
compareTo in interface Comparable<NewsDefinition>


Copyright © 2009-2013 Jasig. All Rights Reserved.