com.sdm.quasar.client.showcase.jsf.data
Class ArticleRegistry

java.lang.Object
  extended bycom.sdm.quasar.client.showcase.jsf.data.ArticleRegistry
All Implemented Interfaces:
java.io.Serializable

public class ArticleRegistry
extends java.lang.Object
implements java.io.Serializable

Registers and manages articles

Author:
Erika Buchholz
See Also:
Serialized Form

Method Summary
 boolean addArticle(Article article)
          Adds an article to the article list.
 boolean addComment(Article article, java.lang.String comment)
          Adds a comment to an article.
 Article getArticle(java.lang.String name, java.lang.String category)
           
 java.util.List getArticles()
           
static ArticleRegistry getInstance()
           
 boolean removeArticle(Article article)
          Removes an article from the article list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ArticleRegistry getInstance()

addArticle

public boolean addArticle(Article article)
Adds an article to the article list.

Parameters:
article - the article to save

getArticles

public java.util.List getArticles()
Returns:
a List of existing articles

getArticle

public Article getArticle(java.lang.String name,
                          java.lang.String category)
Parameters:
name -
category -
Returns:
a specific article or null

removeArticle

public boolean removeArticle(Article article)
Removes an article from the article list.

Parameters:
article - the article to remove

addComment

public boolean addComment(Article article,
                          java.lang.String comment)
Adds a comment to an article.

Parameters:
article - the article to save