Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.RuntimeCollective.publication.bean
Class Publication  view Publication download Publication.java

java.lang.Object
  extended bycom.RuntimeCollective.publication.bean.Publication
All Implemented Interfaces:
com.RuntimeCollective.webapps.bean.EntityBean, java.io.Serializable

public class Publication
extends java.lang.Object
implements com.RuntimeCollective.webapps.bean.EntityBean

A Publication object, to which users can subscribe. It has a name, an internal name, and a sitenode.

Version:
$Id: Publication.java,v 1.6 2003/09/30 15:12:52 joe Exp $

Field Summary
static java.lang.String AND_PUBLIC_ID
           
static java.lang.String DATABASE_TABLE
          The name of the database table for this bean type.
static java.lang.String DELETE_FROM
           
static java.lang.String ESC
           
protected  int id
          This Publication's id
protected  java.lang.String InternalName
          The internal name of this Internalation
static java.lang.String ORDER_BY_ID
           
protected  java.lang.String PublicName
          The public name of this Publication
static java.lang.String SELECT_DATA
           
static java.lang.String SELECT_ID
           
static java.lang.String SELECT_ID_FROM
           
protected  int SiteNodeId
          The SiteNode where the Issues of this Publication are published.
static java.lang.String T_WHERE_ID
           
static java.lang.String WHERE_ID
           
static java.lang.String WHERE_INT_NAME
           
static java.lang.String WHERE_SNID
           
static java.lang.String WHERE_SUBSEEID
           
 
Fields inherited from interface com.RuntimeCollective.webapps.bean.EntityBean
INTERFACE_BEAN, NULL_ID
 
Constructor Summary
Publication()
          Construct a new blank Publication, giving it a new unique ID.
Publication(int id)
          Get a Publication from the RuntimeDataSource, given an id.
 
Method Summary
 void delete()
          Delete this Publication from the database.
static java.util.List getAllPublicationsSortedByPublicName()
          Get the List of all Publications, sorted by PublicName.
 java.util.List getCurrentSubscribers()
          Get a list of all current Subscribers to the Publication.
 int getId()
          Get the unique id of this Publication.
 java.lang.String getInternalName()
          Get the internal name.
 int getLastIssueId()
          Get the id of the latest issue of this Publication, that is, get the id of the most-recently-going-live approved child under this Publication's SiteNode (non-recursive).
 com.RuntimeCollective.sitemap.bean.SiteNode getOrCreateSiteNode()
          Get the SiteNode, creating one if necessary.
static Publication getPublicationForInternalName(java.lang.String internalName)
          Get a Publication from its internal name
static Publication getPublicationForSiteNodeId(int siteNodeId)
          Get a Publication from its SiteNode's id
 java.lang.String getPublicName()
          Get the public name.
 com.RuntimeCollective.sitemap.bean.SiteNode getSiteNode()
          Get the SiteNode.
 Subscription getSubscriptionForUser(com.RuntimeCollective.webapps.bean.User user)
          Get the Subscription for a User to this Publication.
static java.util.List getUnsubscribedPublicationsForUser(com.RuntimeCollective.webapps.bean.User user)
          Get a list (poss.
 boolean hasCurrentSubscription(com.RuntimeCollective.webapps.bean.User user)
          Checks whether a User has a current subscription for this Publication, This reads from the db every time.
 void save()
          Save this Publication to the database.
 void setId(int id)
          Set the unique id of this Publication.
 void setInternalName(java.lang.String internalName)
          Set the internal name.
 void setPublicName(java.lang.String publicName)
          Set the public name.
 void setSiteNode(com.RuntimeCollective.sitemap.bean.SiteNode siteNode)
          Set the SiteNode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATABASE_TABLE

public static final java.lang.String DATABASE_TABLE
The name of the database table for this bean type.

See Also:
Constant Field Values

DELETE_FROM

public static java.lang.String DELETE_FROM

WHERE_ID

public static java.lang.String WHERE_ID

SELECT_DATA

public static java.lang.String SELECT_DATA

T_WHERE_ID

public static java.lang.String T_WHERE_ID

SELECT_ID

public static java.lang.String SELECT_ID

WHERE_INT_NAME

public static java.lang.String WHERE_INT_NAME

WHERE_SNID

public static java.lang.String WHERE_SNID

WHERE_SUBSEEID

public static java.lang.String WHERE_SUBSEEID

AND_PUBLIC_ID

public static java.lang.String AND_PUBLIC_ID

ESC

public static java.lang.String ESC

ORDER_BY_ID

public static java.lang.String ORDER_BY_ID

SELECT_ID_FROM

public static java.lang.String SELECT_ID_FROM

id

protected int id
This Publication's id


SiteNodeId

protected int SiteNodeId
The SiteNode where the Issues of this Publication are published.


PublicName

protected java.lang.String PublicName
The public name of this Publication


InternalName

protected java.lang.String InternalName
The internal name of this Internalation

Constructor Detail

Publication

public Publication()
Construct a new blank Publication, giving it a new unique ID.


Publication

public Publication(int id)
Get a Publication from the RuntimeDataSource, given an id.

Method Detail

setId

public void setId(int id)
Set the unique id of this Publication.

Specified by:
setId in interface com.RuntimeCollective.webapps.bean.EntityBean

getId

public int getId()
Get the unique id of this Publication.

Specified by:
getId in interface com.RuntimeCollective.webapps.bean.EntityBean

save

public void save()
Save this Publication to the database.

Specified by:
save in interface com.RuntimeCollective.webapps.bean.EntityBean

delete

public void delete()
Delete this Publication from the database.

Specified by:
delete in interface com.RuntimeCollective.webapps.bean.EntityBean

setSiteNode

public void setSiteNode(com.RuntimeCollective.sitemap.bean.SiteNode siteNode)
Set the SiteNode.


getSiteNode

public com.RuntimeCollective.sitemap.bean.SiteNode getSiteNode()
Get the SiteNode.


getOrCreateSiteNode

public com.RuntimeCollective.sitemap.bean.SiteNode getOrCreateSiteNode()
                                                                throws com.RuntimeCollective.publication.PublicationException
Get the SiteNode, creating one if necessary. Newly created SiteNodes will have the same Name and SectioName as the Publication's PublicName, will be a child of the first Root SiteNode, and will be saved; that process will *not* save the Publication, hence a risk of losing the mapping.


getPublicName

public java.lang.String getPublicName()
Get the public name.


setPublicName

public void setPublicName(java.lang.String publicName)
Set the public name.


getInternalName

public java.lang.String getInternalName()
Get the internal name.


setInternalName

public void setInternalName(java.lang.String internalName)
Set the internal name.


getLastIssueId

public int getLastIssueId()
Get the id of the latest issue of this Publication, that is, get the id of the most-recently-going-live approved child under this Publication's SiteNode (non-recursive).


getPublicationForInternalName

public static Publication getPublicationForInternalName(java.lang.String internalName)
Get a Publication from its internal name


getPublicationForSiteNodeId

public static Publication getPublicationForSiteNodeId(int siteNodeId)
Get a Publication from its SiteNode's id


getCurrentSubscribers

public java.util.List getCurrentSubscribers()
Get a list of all current Subscribers to the Publication. This will ignore archived TrackedUser. // FIXME: It doesn't ignore archived SimpleUsers, it should.


hasCurrentSubscription

public boolean hasCurrentSubscription(com.RuntimeCollective.webapps.bean.User user)
Checks whether a User has a current subscription for this Publication, This reads from the db every time.


getSubscriptionForUser

public Subscription getSubscriptionForUser(com.RuntimeCollective.webapps.bean.User user)
Get the Subscription for a User to this Publication. This reads from the db every time.


getUnsubscribedPublicationsForUser

public static java.util.List getUnsubscribedPublicationsForUser(com.RuntimeCollective.webapps.bean.User user)
Get a list (poss. empty) of the Publications to which a User is *not* currently subscribed, sorted by PublicName.


getAllPublicationsSortedByPublicName

public static java.util.List getAllPublicationsSortedByPublicName()
Get the List of all Publications, sorted by PublicName.