public class StaticPageSection extends Object implements Orderable
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_ORDER
The default order value
|
Constructor and Description |
---|
StaticPageSection(String id)
Create a new section.
|
Modifier and Type | Method and Description |
---|---|
void |
addContentTemplateParameter(String key,
Object value)
Add a parameter that is
Required for rendering the content template |
String |
getContent(Locale locale,
javax.servlet.http.HttpServletRequest request)
The localized content.
|
String |
getContentTemplateName()
The name of the template for rendering the content.
|
Map<String,Object> |
getContentTemplateParameter() |
String |
getId() |
int |
getOrder() |
String |
getShortTitle(Locale locale,
javax.servlet.http.HttpServletRequest request)
Return the localized short title
|
String |
getTitle(Locale locale,
javax.servlet.http.HttpServletRequest request)
Return the localized title
|
boolean |
isContentTemplate() |
boolean |
isShortTitleAvailable() |
void |
setContent(LocalizedMessage content,
boolean needsRequest)
Set the content.
|
void |
setContentMessageKey(String contentMessageKey)
Set the message key which should be used to resolve the localized content
|
void |
setContentTemplateName(String contentTemplateName)
Set the name/id of a template that should be rendered as the content of the section
|
void |
setOrder(int order)
Set a custom order.
|
void |
setShortTitle(LocalizedMessage shortTitle,
boolean needsRequest)
Set a shorter version of the title which could for instance be shown in a menu.
|
void |
setShortTitleMessageKey(String shortTitleMessageKey)
Set the message key for resolving a localized shorter version of the title which could for
instance be shown in a menu.
|
void |
setTitle(LocalizedMessage title,
boolean needsRequest)
Set the title of the section.
|
void |
setTitleMessageKey(String titleMessageKey)
Set the message key for resolving a localized title of the section.
|
public static final int DEFAULT_ORDER
public void addContentTemplateParameter(String key, Object value)
Required
for rendering the content templatekey
- the key of the parametersvalue
- the valuepublic String getContent(Locale locale, javax.servlet.http.HttpServletRequest request)
locale
- the current localerequest
- the current requestpublic String getContentTemplateName()
public Map<String,Object> getContentTemplateParameter()
public String getId()
public int getOrder()
public String getShortTitle(Locale locale, javax.servlet.http.HttpServletRequest request)
locale
- the locale to use for internationalizationrequest
- the current request#getTitle(Locale)
if no short title
is setpublic String getTitle(Locale locale, javax.servlet.http.HttpServletRequest request)
locale
- the locale to use for internationalizationrequest
- the current requestpublic boolean isContentTemplate()
public boolean isShortTitleAvailable()
public void setContent(LocalizedMessage content, boolean needsRequest)
setContentMessageKey(String)
but if also a content template is set, the template
will be used.content
- the localizable contentneedsRequest
- whether the localized message needs the request object to create the message. If
true the request will be passed as argument to the toString method of the
localized messagepublic void setContentMessageKey(String contentMessageKey)
contentMessageKey
- the message key of the contentpublic void setContentTemplateName(String contentTemplateName)
contentTemplateName
- the name of the template to renderpublic void setOrder(int order)
order
- the order to setpublic void setShortTitle(LocalizedMessage shortTitle, boolean needsRequest)
setShortTitleMessageKey(String)
.shortTitle
- the short titleneedsRequest
- whether the localized message needs the request object to create the message. If
true the request will be passed as argument to the toString method of the
localized messagepublic void setShortTitleMessageKey(String shortTitleMessageKey)
shortTitleMessageKey
- the message key of the short titlepublic void setTitle(LocalizedMessage title, boolean needsRequest)
setTitleMessageKey(String)
.title
- the title of the sectionneedsRequest
- whether the localized message needs the request object to create the message. If
true the request will be passed as argument to the toString method of the
localized messagepublic void setTitleMessageKey(String titleMessageKey)
titleMessageKey
- the message key of the titleCopyright © 2019 Communote team. All rights reserved.