org.liquidsite.app.template
Class ContentBean

java.lang.Object
  extended byorg.liquidsite.app.template.TemplateBean
      extended byorg.liquidsite.app.template.ContentBean
Direct Known Subclasses:
DocumentBean, DocumentFileBean, ForumBean, PostBean, SectionBean, SiteBean, TopicBean

public abstract class ContentBean
extends TemplateBean

A content template bean. This class is used as the base class for all the template beans accessing content objects, such as documents, sections and files.


Method Summary
protected  Content getContent()
          Returns the encapsulated content object.
 java.util.Date getCreated()
          Returns the content creation date.
 java.util.Date getDate()
          Returns the content revision date.
 int getId()
          Returns the content identifier.
 LockBean getLock()
          Returns the content lock.
 java.lang.String getName()
          Returns the content name.
 boolean getOnline()
          Returns the content online flag.
 ContentBean getParent()
          Returns the parent content bean.
 java.lang.String getPath()
          Returns the full content path.
 int getRevision()
          Returns the content revision number.
 UserBean getUser()
          Returns the content revision author.
 boolean hasAccess(java.lang.String permission)
          Checks if the current user has a specified access permission.
 java.lang.String toString()
          Returns a string description of this bean.
 
Methods inherited from class org.liquidsite.app.template.TemplateBean
getContext, getContextRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

toString

public java.lang.String toString()
Returns a string description of this bean. The description will contain the content name.

Returns:
a string description of this bean

getContent

protected Content getContent()
Returns the encapsulated content object.

Returns:
the encapsulated content object, or null if the content doesn't exist

getId

public int getId()
Returns the content identifier.

Returns:
the content identifier, or zero (0) if the content doesn't exist

getName

public java.lang.String getName()
Returns the content name.

Returns:
the content name, or an empty string if the content doesn't exist

getPath

public java.lang.String getPath()
Returns the full content path.

Returns:
the content path, or an empty string if the content doesn't exist

getParent

public ContentBean getParent()
Returns the parent content bean. If there is no content parent section, an emtpy section bean will be returned.

Returns:
the parent content, or an empty section if no parent exists

getRevision

public int getRevision()
Returns the content revision number.

Returns:
the content revision number, or zero (0) if the content doesn't exist

getCreated

public java.util.Date getCreated()
Returns the content creation date.

Returns:
the content creation date, or the current date and time if the content doesn't exist

getDate

public java.util.Date getDate()
Returns the content revision date.

Returns:
the content revision date, or the current date and time if the content doesn't exist

getUser

public UserBean getUser()
Returns the content revision author.

Returns:
the content revision user bean, or an empty user if the content doesn't exist

getOnline

public boolean getOnline()
Returns the content online flag.

Returns:
the content online flag, or the false if the content doesn't exist

getLock

public LockBean getLock()
Returns the content lock.

Returns:
the content lock object, or an empty lock if the content doesn't exist

hasAccess

public boolean hasAccess(java.lang.String permission)
Checks if the current user has a specified access permission. The permission names accepted are "read", "write", "publish" and "admin". Any other names will default to false.

Parameters:
permission - the permission name to check for
Returns:
true if the user has the specified permission, or false otherwise