org.liquidsite.app.template
Class LiquidSiteBean

java.lang.Object
  extended byorg.liquidsite.app.template.TemplateBean
      extended byorg.liquidsite.app.template.LiquidSiteBean

public class LiquidSiteBean
extends TemplateBean

A LiquidSite template bean. This class is used to insert the "liquidsite" namespace into the template data model.


Method Summary
 int countDocuments(java.lang.String path)
          Returns the number of documents in the specified section and any subsections.
 DocumentBean findDocument(java.lang.String path)
          Returns the document corresponding to the specified path.
 java.util.ArrayList findDocuments(java.lang.String path, int offset, int count)
          Returns all documents in the specified section path.
 java.util.ArrayList findDocuments(java.lang.String path, java.lang.String sorting, int offset, int count)
          Returns all document in the specified section path.
 SectionBean findSection(java.lang.String path)
          Returns the section corresponding to the specified path.
 UserBean findUser(java.lang.String name)
          Returns the user corresponding to the specified name.
 UserBean findUserByEmail(java.lang.String email)
          Returns the user corresponding to the specified email address.
 java.lang.String getDate()
          Returns the build date.
 DocumentBean getDoc()
          Returns the document bean.
 ForumBean getForum()
          Returns the forum bean.
 PluginBean getPlugin()
          Returns the plugin bean.
 RequestBean getRequest()
          Returns the request bean.
 SectionBean getSection()
          Returns the section bean.
 SessionBean getSession()
          Returns the user session bean.
 SiteBean getSite()
          Returns the site bean.
 TopicBean getTopic()
          Returns the topic bean.
 UserBean getUser()
          Returns the user bean for the current user.
 UtilBean getUtil()
          Returns the utility bean.
 java.lang.String getVersion()
          Returns the build version name.
 java.lang.String linkTo(java.lang.String path)
          Returns a relative link to an object in the same site.
 boolean mailTo(java.lang.String receiver, java.lang.String subject, java.lang.String text)
          Sends an email to the specified receiver.
 boolean mailToGroup(java.lang.String receiver, java.lang.String subject, java.lang.String text)
          Sends an email to all members of a group.
 
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, toString, wait, wait, wait
 

Method Detail

getVersion

public java.lang.String getVersion()
Returns the build version name.

Returns:
the build version name

getDate

public java.lang.String getDate()
Returns the build date.

Returns:
the build date

getPlugin

public PluginBean getPlugin()
Returns the plugin bean.

Returns:
the plugin bean

getRequest

public RequestBean getRequest()
Returns the request bean.

Returns:
the request bean

getSession

public SessionBean getSession()
Returns the user session bean.

Returns:
the user session bean

getSite

public SiteBean getSite()
Returns the site bean.

Returns:
the site bean

getSection

public SectionBean getSection()
Returns the section bean.

Returns:
the section bean

getDoc

public DocumentBean getDoc()
Returns the document bean.

Returns:
the document bean

getForum

public ForumBean getForum()
Returns the forum bean.

Returns:
the forum bean

getTopic

public TopicBean getTopic()
Returns the topic bean.

Returns:
the topic bean

getUser

public UserBean getUser()
Returns the user bean for the current user.

Returns:
the user bean for the current user

getUtil

public UtilBean getUtil()
Returns the utility bean.

Returns:
the utility bean

linkTo

public java.lang.String linkTo(java.lang.String path)
Returns a relative link to an object in the same site. If the specified path starts with '/' it is assumed to be relative to the site root directory, otherwise it is assumed to be relative to the page directory. Note that the page directory is NOT always an empty string (consider dynamic pages linked to sections). If the specified path contains a full URL (with "http://" or another protocol), the same URL will be returned.

Parameters:
path - the site- or page-relative link path
Returns:
the path relative to the request path

mailTo

public boolean mailTo(java.lang.String receiver,
                      java.lang.String subject,
                      java.lang.String text)
Sends an email to the specified receiver. The email will not be sent immediately, but rather queued in the outgoing mail queue.

Parameters:
receiver - the message recipient address
subject - the message subject line
text - the message text
Returns:
true if the mail could be queued correctly, or false otherwise

mailToGroup

public boolean mailToGroup(java.lang.String receiver,
                           java.lang.String subject,
                           java.lang.String text)
Sends an email to all members of a group. The email will not be sent immediately, but rather queued in the outgoing mail queue.

Parameters:
receiver - the message recipient group name
subject - the message subject line
text - the message text
Returns:
true if the mail could be queued correctly, or false otherwise

countDocuments

public int countDocuments(java.lang.String path)
Returns the number of documents in the specified section and any subsections.

Parameters:
path - the section path
Returns:
the number of documents found

findDocument

public DocumentBean findDocument(java.lang.String path)
Returns the document corresponding to the specified path.

Parameters:
path - the document (and section) path
Returns:
the document found, or an empty document if not found

findDocuments

public java.util.ArrayList findDocuments(java.lang.String path,
                                         int offset,
                                         int count)
Returns all documents in the specified section path. All documents in subsections will also be returned. The documents will be ordered by the publication online date.

Parameters:
path - the section path
offset - the number of documents to skip
count - the maximum number of documents
Returns:
a list of the documents found (as document beans)

findDocuments

public java.util.ArrayList findDocuments(java.lang.String path,
                                         java.lang.String sorting,
                                         int offset,
                                         int count)
Returns all document in the specified section path. All documents in subsections will also be returned. The documents will be ordered by the specified sort order.

Parameters:
path - the section path
sorting - the sorting information
offset - the number of documents to skip
count - the maximum number of documents
Returns:
a list of the documents found (as document beans)

findSection

public SectionBean findSection(java.lang.String path)
Returns the section corresponding to the specified path.

Parameters:
path - the section path
Returns:
the section found, or an empty section if not found

findUser

public UserBean findUser(java.lang.String name)
Returns the user corresponding to the specified name.

Parameters:
name - the user name
Returns:
the user found, or an empty user if not found

findUserByEmail

public UserBean findUserByEmail(java.lang.String email)
Returns the user corresponding to the specified email address.

Parameters:
email - the user email address
Returns:
the user found, or an empty user if not found