Class PortletHtmlContent
java.lang.Object
fr.paris.lutece.portal.business.portlet.Portlet
fr.paris.lutece.portal.business.portlet.PortletHtmlContent
- All Implemented Interfaces:
XmlContent
Base class of the portlets whose content is HTML, rendered with a FreeMarker template rather than through an XML/XSL transformation.
The template is the one chosen for the portlet among the PortletTemplate registered for its type in the back office; a portlet without a valid
template falls back on the default template given by the subclass. Subclasses build their model with createPortletModel() and render it with
renderTemplate(HttpServletRequest, String, Map).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringMark of the CSS classes hiding the portlet on the devices it must not be displayed onstatic final StringMark of the portlet itselfstatic final StringMark of the portlet identifierstatic final StringMark of the portlet name, present only when the title has to be displayedFields inherited from class fr.paris.lutece.portal.business.portlet.Portlet
FLAG_DISPLAY_ON_LARGE_DEVICE, FLAG_DISPLAY_ON_NORMAL_DEVICE, FLAG_DISPLAY_ON_SMALL_DEVICE, FLAG_DISPLAY_ON_XLARGE_DEVICE, STATUS_PUBLISHED, STATUS_UNPUBLISHEDFields inherited from interface fr.paris.lutece.portal.business.XmlContent
TAG_CHILD_PAGES_LIST, TAG_CURRENT_PAGE_ID, TAG_DISPLAY_ON_LARGE_DEVICE, TAG_DISPLAY_ON_NORMAL_DEVICE, TAG_DISPLAY_ON_SMALL_DEVICE, TAG_DISPLAY_ON_XLARGE_DEVICE, TAG_DISPLAY_PORTLET_TITLE, TAG_MENU, TAG_MENU_INDEX, TAG_MENU_LIST, TAG_MODE, TAG_PAGE, TAG_PAGE_DESCRIPTION, TAG_PAGE_ID, TAG_PAGE_IMAGE, TAG_PAGE_LEVEL, TAG_PAGE_NAME, TAG_PARENT_PAGE_ID, TAG_PLUGIN_NAME, TAG_PORTLET, TAG_PORTLET_ID, TAG_PORTLET_NAME, TAG_SUBLEVEL_INDEX, TAG_SUBLEVEL_MENU, TAG_SUBLEVEL_MENU_LIST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the Bootstrap display classes hiding the portlet on the devices it must not be displayed on, computed from the device display flagsabstract StringgetHtmlContent(jakarta.servlet.http.HttpServletRequest request) Returns the HTML content of the portletgetTemplatePath(String strDefaultTemplatePath) Returns the path of the FreeMarker template to render this portlet with : the template chosen for the portlet when it is valid, the given default otherwisegetXml(jakarta.servlet.http.HttpServletRequest request) This method should return the body of an Xml document providing the contentgetXmlDocument(jakarta.servlet.http.HttpServletRequest request) This method should return the whole Xml document providing the content (including the header)booleanCheck if the content of this portlet is generated by xml and xsl, or if it manage its own content generationMethods inherited from class fr.paris.lutece.portal.business.portlet.Portlet
canBeCachedForAnonymousUsers, canBeCachedForConnectedUsers, copy, getAcceptAlias, getColumn, getDateUpdate, getDeviceDisplayFlags, getDisplayPortletTitle, getHomeClassName, getId, getIdTemplate, getName, getOrder, getPageId, getPluginName, getPortletTypeId, getPortletTypeName, getRole, getStatus, getStyleId, getUrlCreation, getUrlUpdate, getXslFile, getXslParams, getXslSource, hasDeviceDisplayFlag, remove, setAcceptAlias, setColumn, setDateUpdate, setDeviceDisplayFlags, setDisplayPortletTitle, setHomeClassName, setId, setIdTemplate, setName, setOrder, setPageId, setPluginName, setPortletTypeId, setPortletTypeName, setRole, setStatus, setStyleId, setUrlCreation, setUrlUpdate
-
Field Details
-
MARK_PORTLET
Mark of the portlet itself- See Also:
-
MARK_PORTLET_ID
Mark of the portlet identifier- See Also:
-
MARK_PORTLET_NAME
Mark of the portlet name, present only when the title has to be displayed- See Also:
-
MARK_DEVICE_CLASS
Mark of the CSS classes hiding the portlet on the devices it must not be displayed on- See Also:
-
-
Constructor Details
-
PortletHtmlContent
public PortletHtmlContent()
-
-
Method Details
-
getHtmlContent
Returns the HTML content of the portlet- Overrides:
getHtmlContentin classPortlet- Parameters:
request- The HTTP request- Returns:
- the HTML content
-
getTemplatePath
Returns the path of the FreeMarker template to render this portlet with : the template chosen for the portlet when it is valid, the given default otherwise- Parameters:
strDefaultTemplatePath- the default template of the portlet type- Returns:
- the template path, relative to the WEB-INF/templates directory
- See Also:
-
getDeviceDisplayClass
Returns the Bootstrap display classes hiding the portlet on the devices it must not be displayed on, computed from the device display flags- Returns:
- the CSS classes, an empty string when the portlet is displayed on every device
-
getXml
This method should return the body of an Xml document providing the content- Parameters:
request- The HTTP Servlet Request- Returns:
- string The String
- Throws:
SiteMessageException- occurs when a site message need to be displayed
-
getXmlDocument
public String getXmlDocument(jakarta.servlet.http.HttpServletRequest request) throws SiteMessageException This method should return the whole Xml document providing the content (including the header)- Parameters:
request- The HTTP Servlet Request- Returns:
- string The String
- Throws:
SiteMessageException- occurs when a site message need to be displayed
-
isContentGeneratedByXmlAndXsl
public boolean isContentGeneratedByXmlAndXsl()Check if the content of this portlet is generated by xml and xsl, or if it manage its own content generation- Overrides:
isContentGeneratedByXmlAndXslin classPortlet- Returns:
- True if the content must be generated from XML and XSL, false if it must be generated by the
Portlet.getHtmlContent(HttpServletRequest request)method
-