|
Clearspace API (2.5.29) Core Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DocumentPresenter
Similar to the DocumentBuilder interface, document presenters allow for organizing the fields of a document type into an optimal layout for display. A document presenter is generated at runtime if a new document presenter has not been created for a given document type, thus administrators do not have to create a document presenter for each document type they define.
As part of the default skin implementation there are 2 'magic' presenter names that if specified will override the autogenerated output, those being 'default' and 'print'. A document presenter template can be set for this template via the
setTemplate(String)
method. The document presenter template must be written in the free marker template language
(http://freemarker.sourceforge.net).
Document Presenter freemarker templates are given access to the following variables:DocumentField map DocumentFieldValue map Document object. This is
for more advanced usage.
| Method Summary | |
|---|---|
String |
getName()
Returns the identifying name of the document presenter. |
String |
getTemplate()
Returns the template used to display a document for a particular presenter. |
String |
getTransformedTemplate(Document document,
AuthToken auth,
Locale locale)
Applies the template to a Document and returns the results as a string |
boolean |
isDefaultTemplate()
Returns true if this presenter is the default presenter, false otherwise. |
void |
save()
Saves the state of this DocuementPresenter to the database |
void |
setName(String name)
Sets the identifying name of the document presenter. |
void |
setTemplate(String template)
Sets the template for this presenter. |
| Methods inherited from interface com.jivesoftware.community.JiveObject |
|---|
getID, getObjectType |
| Method Detail |
|---|
String getName()
void setName(String name)
throws UnauthorizedException
name - the name of the document presenter.
UnauthorizedException - if not an administrator.
String getTemplate()
throws PresenterTemplateException
PresenterTemplateException - if an error occurs retrieving the template
void setTemplate(String template)
throws UnauthorizedException
template - the template.
UnauthorizedException - if not an administrator.getTemplate()
String getTransformedTemplate(Document document,
AuthToken auth,
Locale locale)
throws PresenterTemplateException
Document and returns the results as a string
document - document to apply the template too.auth - the AuthToken of the page user.locale - the Locale to use when locating a template.
PresenterTemplateException - If there is a problem processing the template (such as the
template is malformed)
void save()
throws UnauthorizedException
UnauthorizedException - If the user is not allowed to modify this document presenterboolean isDefaultTemplate()
|
Clearspace Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||