Liferay 7.0-ce-m3

com.liferay.portlet.portletdisplaytemplate.util
Class PortletDisplayTemplateUtil

java.lang.Object
  extended by com.liferay.portlet.portletdisplaytemplate.util.PortletDisplayTemplateUtil

public class PortletDisplayTemplateUtil
extends Object


Constructor Summary
PortletDisplayTemplateUtil()
           
 
Method Summary
static DDMTemplate fetchDDMTemplate(long groupId, String displayStyle)
          Returns the portlet display template's DDM template matching the group and display style stored in the portlet configuration.
static long getDDMTemplateGroupId(long groupId)
          Returns the group ID of the portlet display template's DDM template.
static String getDDMTemplateUuid(String displayStyle)
          Returns the UUID of the portlet display template's DDM template from the display style stored in the portlet configuration.
static PortletDisplayTemplate getPortletDisplayTemplate()
           
static long getPortletDisplayTemplateDDMTemplateId(long groupId, String displayStyle)
          Returns the primary key of the portlet display template's DDM template matching the group and the display style stored in the portlet configuration.
static List<TemplateHandler> getPortletDisplayTemplateHandlers()
          Returns the portlet display template handlers.
static Map<String,TemplateVariableGroup> getTemplateVariableGroups(String language)
          Returns the portlet display template's map of script variable groups for which hints are displayed in the template editor palette.
static String renderDDMTemplate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, long ddmTemplateId, List<?> entries)
          Returns the result of rendering the DDM template with the entries in the page context.
static String renderDDMTemplate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, long ddmTemplateId, List<?> entries, Map<String,Object> contextObjects)
          Returns the result of rendering the DDM template with the entries in the page context and template context.
 void setPortletDisplayTemplate(PortletDisplayTemplate portletDisplayTemplate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortletDisplayTemplateUtil

public PortletDisplayTemplateUtil()
Method Detail

fetchDDMTemplate

public static DDMTemplate fetchDDMTemplate(long groupId,
                                           String displayStyle)
Returns the portlet display template's DDM template matching the group and display style stored in the portlet configuration.

Parameters:
groupId - the primary key of the group
displayStyle - the display style stored in the portlet configuration
Returns:
the portlet display template's DDM template matching the group and the display style stored in the portlet configuration

getDDMTemplateGroupId

public static long getDDMTemplateGroupId(long groupId)
Returns the group ID of the portlet display template's DDM template.

Parameters:
groupId - the primary key of the group
Returns:
the group ID of the portlet display template's DDM template

getDDMTemplateUuid

public static String getDDMTemplateUuid(String displayStyle)
Returns the UUID of the portlet display template's DDM template from the display style stored in the portlet configuration.

Parameters:
displayStyle - the display style stored in the portlet configuration
Returns:
the UUID of the portlet display template's DDM template from the display style stored in the portlet configuration

getPortletDisplayTemplate

public static PortletDisplayTemplate getPortletDisplayTemplate()

getPortletDisplayTemplateDDMTemplateId

public static long getPortletDisplayTemplateDDMTemplateId(long groupId,
                                                          String displayStyle)
Returns the primary key of the portlet display template's DDM template matching the group and the display style stored in the portlet configuration.

Parameters:
groupId - the primary key of the group
displayStyle - the display style stored in the portlet configuration
Returns:
the primary key of the portlet display template's DDM template matching the group and the display style stored in the portlet configuration

getPortletDisplayTemplateHandlers

public static List<TemplateHandler> getPortletDisplayTemplateHandlers()
Returns the portlet display template handlers.

Returns:
the portlet display template handlers

getTemplateVariableGroups

public static Map<String,TemplateVariableGroup> getTemplateVariableGroups(String language)
Returns the portlet display template's map of script variable groups for which hints are displayed in the template editor palette.

Parameters:
language - the portlet display template's scripting language. Acceptable values for the FreeMarker, Velocity, or XSL languages are TemplateConstants.LANG_TYPE_FTL, TemplateConstants.LANG_TYPE_VM, or TemplateConstants.LANG_TYPE_XSL, respectively.
Returns:
the portlet display template's map of script variable groups for which hints are displayed in the template editor palette
See Also:
TemplateHandler.getTemplateVariableGroups(long, String, Locale)

renderDDMTemplate

public static String renderDDMTemplate(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response,
                                       long ddmTemplateId,
                                       List<?> entries)
                                throws Exception
Returns the result of rendering the DDM template with the entries in the page context.

Parameters:
request - the request with which the template is rendered.
response - the response with which the template is rendered.
ddmTemplateId - the primary key of the DDM template
entries - the entries that are rendered in the template
Returns:
the result of rendering the DDM template with the entries in the page context
Throws:
Exception - if the DDM template could not be rendered

renderDDMTemplate

public static String renderDDMTemplate(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response,
                                       long ddmTemplateId,
                                       List<?> entries,
                                       Map<String,Object> contextObjects)
                                throws Exception
Returns the result of rendering the DDM template with the entries in the page context and template context.

Parameters:
request - the request with which the template is rendered.
response - the response with which the template is rendered.
ddmTemplateId - the primary key of the DDM template
entries - the entries that are rendered in the template
contextObjects - the map of objects defining the context in which the template is rendered
Returns:
the result of rendering the DDM template with the entries in the page context and template context
Throws:
Exception - if the DDM template could not be rendered

setPortletDisplayTemplate

public void setPortletDisplayTemplate(PortletDisplayTemplate portletDisplayTemplate)

Liferay 7.0-ce-m3