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

Quick Search    Search Deep

com.RuntimeCollective.content.bean
Class SimpleContent  view SimpleContent download SimpleContent.java

java.lang.Object
  extended bycom.RuntimeCollective.content.bean.SimpleContent
All Implemented Interfaces:
Content, com.RuntimeCollective.webapps.bean.Duplicable, com.RuntimeCollective.webapps.bean.EntityBean, java.io.Serializable
Direct Known Subclasses:
ComplexContent, File, Image, Link, TextComponent

public class SimpleContent
extends java.lang.Object
implements Content

A basic implementation of Content, which you shouldn't instantiate as is, but subclass.

Version:
$Id: SimpleContent.java,v 1.25 2003/09/30 15:12:46 joe Exp $

Field Summary
protected  int Author_id
          The author
protected  java.util.Date CreationDate
          The creation date bean
static java.lang.String DATABASE_TABLE
          The name of the database table for this bean type.
protected  int id
          This SimpleContent's id
protected  java.util.Date LastModifiedDate
          The last modified date
protected  int LastModifierUser_id
          The last modifier user
 
Fields inherited from interface com.RuntimeCollective.webapps.bean.EntityBean
INTERFACE_BEAN, NULL_ID
 
Constructor Summary
SimpleContent()
          Construct a new blank SimpleContent, giving it a new unique ID.
SimpleContent(int id)
          Get a SimpleContent from the RuntimeDataSource, given an id.
 
Method Summary
 com.RuntimeCollective.webapps.bean.Duplicable customiseDuplicate(com.RuntimeCollective.webapps.bean.Duplicable duplicate)
          A method to customise (and save) a "raw" Duplicate, usually not called directly, but used by makeDuplicate(int).
 void delete()
          Delete this SimpleContent from the database.
 com.RuntimeCollective.webapps.bean.User getAuthor()
          Get the author
 java.util.Date getCreationDate()
          Get the creation date
 java.lang.String getDescription()
          Get the description
 int getId()
          Get the unique id of this SimpleContent.
 java.util.Date getLastModifiedDate()
          Get the last modified date
 com.RuntimeCollective.webapps.bean.User getLastModifierUser()
          Get the last modifier user
 java.lang.String getTitle()
          Get the title
 com.RuntimeCollective.webapps.bean.Duplicable makeDuplicate()
          The method to call when you want to create (and save) the duplicate of an object.
 com.RuntimeCollective.webapps.bean.Duplicable makeDuplicate(int duplicateId)
          The method to call when you want to create (and save) the duplicate of an object, while expliciting the id you want for the duplicate.
 void save()
          Save this SimpleContent to the database.
 void setAuthor(com.RuntimeCollective.webapps.bean.User author)
          Set the author
 void setCreationDate(java.util.Date date)
          Set the creation date
 void setDescription(java.lang.String description)
          Set the description.
 void setId(int id)
          Set the unique id of this SimpleContent.
 void setLastModifiedDate(java.util.Date date)
          Set the last modified date bean
 void setLastModifierUser(com.RuntimeCollective.webapps.bean.User user)
          Set the last modifier user
 void setTitle(java.lang.String title)
          Set the title.
 java.lang.Object viewFormat(java.lang.String format)
          Get the SimpleContent in a certain format.
 
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

id

protected int id
This SimpleContent's id


Author_id

protected int Author_id
The author


CreationDate

protected java.util.Date CreationDate
The creation date bean


LastModifiedDate

protected java.util.Date LastModifiedDate
The last modified date


LastModifierUser_id

protected int LastModifierUser_id
The last modifier user

Constructor Detail

SimpleContent

public SimpleContent()
              throws java.sql.SQLException
Construct a new blank SimpleContent, giving it a new unique ID.


SimpleContent

public SimpleContent(int id)
              throws java.sql.SQLException
Get a SimpleContent from the RuntimeDataSource, given an id.

Method Detail

setId

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

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

getId

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

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

save

public void save()
          throws java.sql.SQLException
Save this SimpleContent to the database.

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

delete

public void delete()
            throws java.sql.SQLException
Delete this SimpleContent from the database.

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

setAuthor

public void setAuthor(com.RuntimeCollective.webapps.bean.User author)
Set the author

Specified by:
setAuthor in interface Content

getAuthor

public com.RuntimeCollective.webapps.bean.User getAuthor()
Get the author

Specified by:
getAuthor in interface Content

setCreationDate

public void setCreationDate(java.util.Date date)
Set the creation date

Specified by:
setCreationDate in interface Content

getCreationDate

public java.util.Date getCreationDate()
Get the creation date

Specified by:
getCreationDate in interface Content

setLastModifiedDate

public void setLastModifiedDate(java.util.Date date)
Set the last modified date bean

Specified by:
setLastModifiedDate in interface Content

getLastModifiedDate

public java.util.Date getLastModifiedDate()
Get the last modified date

Specified by:
getLastModifiedDate in interface Content

setLastModifierUser

public void setLastModifierUser(com.RuntimeCollective.webapps.bean.User user)
Set the last modifier user

Specified by:
setLastModifierUser in interface Content

getLastModifierUser

public com.RuntimeCollective.webapps.bean.User getLastModifierUser()
Get the last modifier user

Specified by:
getLastModifierUser in interface Content

getTitle

public java.lang.String getTitle()
Get the title

Specified by:
getTitle in interface Content

setTitle

public void setTitle(java.lang.String title)
Set the title. NB: This does nothing.

Specified by:
setTitle in interface Content

getDescription

public java.lang.String getDescription()
Get the description

Specified by:
getDescription in interface Content

setDescription

public void setDescription(java.lang.String description)
Set the description. NB: This does nothing.

Specified by:
setDescription in interface Content

viewFormat

public java.lang.Object viewFormat(java.lang.String format)
Get the SimpleContent in a certain format.

Specified by:
viewFormat in interface Content

makeDuplicate

public com.RuntimeCollective.webapps.bean.Duplicable makeDuplicate()
The method to call when you want to create (and save) the duplicate of an object.

This will call makeDuplicate(int) with a fresh new id.

Specified by:
makeDuplicate in interface com.RuntimeCollective.webapps.bean.Duplicable

makeDuplicate

public com.RuntimeCollective.webapps.bean.Duplicable makeDuplicate(int duplicateId)
The method to call when you want to create (and save) the duplicate of an object, while expliciting the id you want for the duplicate.

To use with care, as obviously the bean using that id will be overwritten. It is "recommended" that the overwritten bean be of the same type as the object being duplicated.

Implementation-wise, this method will make a raw duplicate (ie clone itself by changing its own id), and then call the customiseDuplicate() method where class-specific code should reside.

Specified by:
makeDuplicate in interface com.RuntimeCollective.webapps.bean.Duplicable

customiseDuplicate

public com.RuntimeCollective.webapps.bean.Duplicable customiseDuplicate(com.RuntimeCollective.webapps.bean.Duplicable duplicate)
A method to customise (and save) a "raw" Duplicate, usually not called directly, but used by makeDuplicate(int).

This method will do additional processing of a "raw" Duplicate. This is most useful for class-specific logic, such as creating Duplicates of composed objects, and assigning those Duplicates to the "raw" Duplicate.

When subclassing a Duplicable class, you should override this method only, without changing the makeDuplicate methods.

Specified by:
customiseDuplicate in interface com.RuntimeCollective.webapps.bean.Duplicable