|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.liquidsite.app.template.BeanContext
A template bean context. This class holds contains references to common objects used by all beans. It also contains several utility methods to simplify the code in the various beans.
| Method Summary | |
int |
countContent(ContentSelector selector)
Counts the number of content objects matching a content selector. |
int |
countDocuments(ContentSection section)
Counts the number of documents under the specified section (and subsections). |
int |
countDocuments(java.lang.String path)
Counts the number of documents under the specified absolute path. |
User |
createUser(java.lang.String name)
Creates a new user with the specified name in the current environment domain. |
Content[] |
findContent(ContentSelector selector)
Finds a set of content objects with a content selector. |
Content |
findContent(int id)
Finds a content object from a specified content id. |
Content |
findContent(java.lang.Object parent,
java.lang.String path)
Finds a content object from a relative path. |
Content |
findContent(java.lang.String path)
Finds a content object from an absolute path. |
DocumentBean |
findDocument(java.lang.Object parent,
java.lang.String path)
Finds a document corresponding to the specified relative path. |
DocumentBean |
findDocument(java.lang.String path)
Finds a document corresponding to the specified absolute path. |
java.util.ArrayList |
findDocuments(ContentSection section,
java.lang.String sorting,
int offset,
int count)
Finds all documents under the specified section (and subsections). |
java.util.ArrayList |
findDocuments(java.lang.String path,
java.lang.String sorting,
int offset,
int count)
Finds all documents under the specified absolute path. |
ForumBean |
findForum(ContentSection section,
java.lang.String name)
Finds a named forum in a section. |
Group |
findGroup(java.lang.String name)
Finds a specified group. |
SectionBean |
findSection(java.lang.Object parent,
java.lang.String path)
Finds a section corresponding to the specified relative path. |
SectionBean |
findSection(java.lang.String path)
Finds a section corresponding to the specified absolute path. |
UserBean |
findUser(java.lang.String name)
Finds a specified user. |
UserBean |
findUserByEmail(java.lang.String email)
Finds a specified user by email address. |
java.lang.String |
getContentPath(Content content)
Returns the absolute path to a content object. |
java.lang.String |
getMimeType()
Returns the response content MIME type. |
java.lang.String |
getRelativePath(java.lang.String basePath)
Returns the relative path to a specified base path. |
Request |
getRequest()
Returns the request object. |
java.lang.String |
getSitePath()
Returns the relative path to the site root directory. |
boolean |
sendMail(Group receiver,
java.lang.String subject,
java.lang.String text)
Sends an email to all the members in a group. |
boolean |
sendMail(java.lang.String receiver,
java.lang.String subject,
java.lang.String text)
Sends an email to the specified receiver. |
void |
setMimeType(java.lang.String mimeType)
Sets the response content MIME type. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public java.lang.String getMimeType()
public void setMimeType(java.lang.String mimeType)
mimeType - the new MIME typepublic Request getRequest()
public java.lang.String getSitePath()
public java.lang.String getRelativePath(java.lang.String basePath)
basePath - the absolute base path
public java.lang.String getContentPath(Content content)
content - the content object
public int countContent(ContentSelector selector)
throws ContentException
selector - the content selector
ContentException - if the database couldn't be accessed
properlypublic int countDocuments(java.lang.String path)
path - the section path
public int countDocuments(ContentSection section)
section - the parent section
public Content findContent(int id)
throws ContentException,
ContentSecurityException
id - the content identifier
ContentException - if the database couldn't be accessed
properly
ContentSecurityException - if the content couldn't be
read by the current user
public Content findContent(java.lang.String path)
throws ContentException,
ContentSecurityException
path - the content path (from the domain root)
ContentException - if the database couldn't be accessed
properly
ContentSecurityException - if the content couldn't be
read by the current user
public Content findContent(java.lang.Object parent,
java.lang.String path)
throws ContentException,
ContentSecurityException
parent - the parent domain or sectionpath - the content path (relative to the parent)
ContentException - if the database couldn't be accessed
properly
ContentSecurityException - if the content couldn't be
read by the current user
public Content[] findContent(ContentSelector selector)
throws ContentException
selector - the content selector
ContentException - if the database couldn't be accessed
properlypublic DocumentBean findDocument(java.lang.String path)
path - the document (and section) path
public DocumentBean findDocument(java.lang.Object parent,
java.lang.String path)
parent - the parent domain or sectionpath - the document (and section) path
public java.util.ArrayList findDocuments(java.lang.String path,
java.lang.String sorting,
int offset,
int count)
path - the section pathsorting - the sorting informationoffset - the number of documents to skipcount - the maximum number of documents
public java.util.ArrayList findDocuments(ContentSection section,
java.lang.String sorting,
int offset,
int count)
section - the parent sectionsorting - the sorting informationoffset - the number of documents to skipcount - the maximum number of documents
public ForumBean findForum(ContentSection section,
java.lang.String name)
section - the parent sectionname - the forum name
public SectionBean findSection(java.lang.String path)
path - the section path
public SectionBean findSection(java.lang.Object parent,
java.lang.String path)
parent - the parent domain or sectionpath - the section path
public UserBean findUser(java.lang.String name)
name - the user name, or "" for the current user
public UserBean findUserByEmail(java.lang.String email)
email - the user email address
public Group findGroup(java.lang.String name)
name - the group name
public User createUser(java.lang.String name)
name - the login name
public boolean sendMail(java.lang.String receiver,
java.lang.String subject,
java.lang.String text)
receiver - the message recipient addresssubject - the message subject linetext - the message text
public boolean sendMail(Group receiver,
java.lang.String subject,
java.lang.String text)
receiver - the message recipient groupsubject - the message subject linetext - the message text
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||