org.locomotive.module.graffiti
Class Tag
java.lang.Object
|
+--org.locomotive.module.graffiti.Tag
- public class Tag
- extends java.lang.Object
Tag - an individual graffiti message.
Its fields mirror the columns in the db table, loco_graffiti_tags.
You can store a Tag by overwriting the oldest row in the table.
This class also contains static methods for db manipulation.
Constructor Summary |
Tag(java.sql.Connection conn,
java.lang.String author,
java.lang.String text)
saves this Tag into the db table loco_graffiti_rows. |
Method Summary |
java.lang.String |
getAuthor()
returns the author of the Tag |
java.sql.Timestamp |
getInsTime()
returns the Date the Tag was created. |
java.lang.String |
getText()
returns the text of the Tag. |
static Tag[] |
loadAllTags(java.sql.Connection conn)
loads in all rows from the db, sorted by date in desc order. |
static void |
prepopulate(java.sql.Connection conn)
This is called from the init() method of the graffitiWallHandler to
make sure the graffitiWall has a few entries to start out
with. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Tag
public Tag(java.sql.Connection conn,
java.lang.String author,
java.lang.String text)
throws java.sql.SQLException
- saves this Tag into the db table loco_graffiti_rows.
the db should only contain maxRows so it will delete
older ones if they exist.
getInsTime
public java.sql.Timestamp getInsTime()
- returns the Date the Tag was created.
getAuthor
public java.lang.String getAuthor()
- returns the author of the Tag
getText
public java.lang.String getText()
- returns the text of the Tag.
loadAllTags
public static Tag[] loadAllTags(java.sql.Connection conn)
throws java.sql.SQLException
- loads in all rows from the db, sorted by date in desc order.
if there are no rows in the table, an array of zero length
(Tag[0]) is returned.
prepopulate
public static void prepopulate(java.sql.Connection conn)
throws java.sql.SQLException
- This is called from the init() method of the graffitiWallHandler to
make sure the graffitiWall has a few entries to start out
with. Will insert the following line up to ten times in
the graffiti wall: 'this is an example tag' from 'anon'
- See Also:
GenericHandler.init(org.locomotive.server.Log)