Class NewsDefinition

java.lang.Object
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.
Since:
5.1.1
Author:
Anthony Colebourne, Jen Bourey
  • Constructor Details

    • NewsDefinition

      public NewsDefinition()
      Default constructor.
    • NewsDefinition

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

      Constructor for NewsDefinition.

      Parameters:
      id - a Long object
      className - a String object
      name - a String object
  • Method Details

    • getId

      public Long getId()
      Return the unique id of this news.
      Returns:
      a Long object
    • setId

      public void setId(Long id)
      Set the unique id for this news.
      Parameters:
      id - a Long object
    • 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:
      a String object
    • 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 - a String object
    • getName

      public String getName()
      Return the display name for this news.
      Returns:
      a String object
    • setName

      public void setName(String name)
      Set the display name for this news.
      Parameters:
      name - a String object
    • isPredefined

      public boolean isPredefined()

      isPredefined.

      Returns:
      a boolean
    • 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>