com.xmlserv.app.news
Class News

java.lang.Object
  |
  +--com.xmlserv.app.news.News

public class News
extends java.lang.Object

Encapsulates News articles.


Constructor Summary
News(java.sql.Connection con, int id)
          Load an article identified by its ID.
News(int author)
          Create an empty article
 
Method Summary
 void addImage(int imageId)
           
 void addLink(int linkId)
           
 void clearImages()
           
 void clearLinks()
           
 void createRevision()
          Create a revision of this article, setting the curent article id as the parent.
 void delete(java.sql.Connection con)
           
 void delImage(int imageId)
           
 void delLink(int linkId)
           
 int getAuthor()
           
 java.lang.String getContent()
           
 int getContentgroup()
           
 java.lang.String getFreigabetstamp()
           
 int getId()
           
 java.lang.String getLastchange()
           
 int getParent()
           
 java.lang.String getRubrik()
           
 java.lang.String getSchlagworte()
           
 java.lang.String getSubtitel()
           
 java.lang.String getTitel()
           
 boolean isFreigegeben()
           
 boolean isXhtml()
           
static org.jdom.Element list(java.sql.Connection con, SecurityManager securityManager, SecurityManager.User user, boolean withContent, boolean freigegeben)
          List all articles for the given users rolegroup.
static org.jdom.Element list(java.sql.Connection con, SecurityManager securityManager, SecurityManager.User user, int contentgroup, boolean withContent, boolean freigegeben)
          List all articles in the given ContentGroup.
static org.jdom.Element listRevisions(java.sql.Connection con, SecurityManager securityManager, SecurityManager.User user, int articleid)
          List all parents and revisions of the given article.
 void save(java.sql.Connection con)
           
 void setContent(java.lang.String content)
           
 void setContentgroup(int contentgroup)
           
 void setFreigabetstamp(java.lang.String freigabetstamp)
           
 void setFreigegeben(boolean freigegeben)
           
 void setLastchange(java.lang.String lastchange)
           
 void setRubrik(java.lang.String rubrik)
           
 void setSchlagworte(java.lang.String schlagworte)
           
 void setSubtitel(java.lang.String subtitel)
           
 void setTitel(java.lang.String titel)
           
 void setXhtml(boolean xhtml)
           
 org.jdom.Element toElement(java.sql.Connection con, SecurityManager securityManager, SecurityManager.User user, boolean withContent)
           
 org.jdom.Element toElement(java.sql.Connection con, SecurityManager securityManager, SecurityManager.User user, boolean withContent, boolean forceHtml)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

News

public News(int author)
Create an empty article

News

public News(java.sql.Connection con,
            int id)
     throws XMLServException
Load an article identified by its ID.
Method Detail

toElement

public org.jdom.Element toElement(java.sql.Connection con,
                                  SecurityManager securityManager,
                                  SecurityManager.User user,
                                  boolean withContent)
                           throws XMLServException
Parameters:
securityManager - Used to add user info for author.
withContent - If true include content subtag (holding the textual contents if this article) and the image ssociations.

toElement

public org.jdom.Element toElement(java.sql.Connection con,
                                  SecurityManager securityManager,
                                  SecurityManager.User user,
                                  boolean withContent,
                                  boolean forceHtml)
                           throws XMLServException

list

public static org.jdom.Element list(java.sql.Connection con,
                                    SecurityManager securityManager,
                                    SecurityManager.User user,
                                    int contentgroup,
                                    boolean withContent,
                                    boolean freigegeben)
                             throws XMLServException
List all articles in the given ContentGroup.
Parameters:
freigegeben - If true, list only articles with freigegeben=true, otherwise list all.

list

public static org.jdom.Element list(java.sql.Connection con,
                                    SecurityManager securityManager,
                                    SecurityManager.User user,
                                    boolean withContent,
                                    boolean freigegeben)
                             throws XMLServException
List all articles for the given users rolegroup.
Parameters:
freigegeben - If true, list only articles with freigegeben=true, otherwise list all.

listRevisions

public static org.jdom.Element listRevisions(java.sql.Connection con,
                                             SecurityManager securityManager,
                                             SecurityManager.User user,
                                             int articleid)
                                      throws XMLServException
List all parents and revisions of the given article.

save

public void save(java.sql.Connection con)
          throws XMLServException

createRevision

public void createRevision()
Create a revision of this article, setting the curent article id as the parent. Subsequent saving will not modify the original article, but save a new one.

delete

public void delete(java.sql.Connection con)
            throws XMLServException

getId

public int getId()

getParent

public int getParent()

getTitel

public java.lang.String getTitel()

setTitel

public void setTitel(java.lang.String titel)

getSubtitel

public java.lang.String getSubtitel()

setSubtitel

public void setSubtitel(java.lang.String subtitel)

getAuthor

public int getAuthor()

isXhtml

public boolean isXhtml()

setXhtml

public void setXhtml(boolean xhtml)

isFreigegeben

public boolean isFreigegeben()

setFreigegeben

public void setFreigegeben(boolean freigegeben)

getFreigabetstamp

public java.lang.String getFreigabetstamp()

setFreigabetstamp

public void setFreigabetstamp(java.lang.String freigabetstamp)

getLastchange

public java.lang.String getLastchange()

setLastchange

public void setLastchange(java.lang.String lastchange)

getRubrik

public java.lang.String getRubrik()

setRubrik

public void setRubrik(java.lang.String rubrik)

getContentgroup

public int getContentgroup()

setContentgroup

public void setContentgroup(int contentgroup)

getSchlagworte

public java.lang.String getSchlagworte()

setSchlagworte

public void setSchlagworte(java.lang.String schlagworte)

getContent

public java.lang.String getContent()

setContent

public void setContent(java.lang.String content)

addImage

public void addImage(int imageId)

delImage

public void delImage(int imageId)

clearImages

public void clearImages()

addLink

public void addLink(int linkId)

delLink

public void delLink(int linkId)

clearLinks

public void clearLinks()