org.liquidsite.app.template
Class TopicBean

java.lang.Object
  extended byorg.liquidsite.app.template.ContentBean
      extended byorg.liquidsite.app.template.TopicBean

public class TopicBean
extends ContentBean

A topic template bean. This class is used to access topics from the template data model.


Method Summary
 PostBean findPost(int id)
          Returns a specified post in this topic.
 java.util.ArrayList findPosts(int offset, int count)
          Returns all posts in this topic.
 PostBean getFirst()
          Returns the first post in this topic.
 PostBean getLast()
          Returns the last post in this topic.
 boolean getLocked()
          Returns the topic locked flag.
 int getPostCount()
          Returns the number of posts in this topic.
 java.lang.String getSubject()
          Returns the topic subject.
 java.lang.String getSubjectSource()
          Returns the unprocessed topic subject.
 
Methods inherited from class org.liquidsite.app.template.ContentBean
getContent, getContext, getCreated, getDate, getId, getLock, getName, getOnline, getParent, getPath, getRevision, getUser, hasAccess, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getSubject

public java.lang.String getSubject()
Returns the topic subject.

Returns:
the topic subject, or an empty string if the topic doesn't exist

getSubjectSource

public java.lang.String getSubjectSource()
Returns the unprocessed topic subject.

Returns:
the unprocessed topic subject, or an empty string if the topic doesn't exist

getLocked

public boolean getLocked()
Returns the topic locked flag.

Returns:
the topic locked flag, or true if the topic doesn't exist

getFirst

public PostBean getFirst()
Returns the first post in this topic. The posts are ordered in creation date order.

Returns:
the first post in this topic, or an empty post if the topic doesn't exist

getLast

public PostBean getLast()
Returns the last post in this topic. The posts are ordered in creation date order.

Returns:
the last post in this topic, or an empty post if the topic doesn't exist

getPostCount

public int getPostCount()
Returns the number of posts in this topic.

Returns:
the number of posts in this topic

findPost

public PostBean findPost(int id)
Returns a specified post in this topic. The post content identifier must be specified.

Parameters:
id - the post content identifier
Returns:
the post found (as a post bean), or an empty post if not found

findPosts

public java.util.ArrayList findPosts(int offset,
                                     int count)
Returns all posts in this topic. At most the specified number of posts will be returned. The posts will be ordered by creation date.

Parameters:
offset - the number of post to skip
count - the maximum number of posts
Returns:
a list of the posts found (as post beans)