Liferay 7.0-ce-m6

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)
          Deprecated. As of 7.0.0, replaced by getPortletDisplayTemplateDDMTemplate(long, long, String)
static long getDDMTemplateGroupId(long groupId)
          Returns the group ID of the portlet display template's DDM template.
static String getDDMTemplateKey(String displayStyle)
          Returns the template key of the portlet display template's DDM template from the display style stored in the portlet configuration.
static String getDDMTemplateUuid(String displayStyle)
          Deprecated. As of 7.0.0, replaced by getDDMTemplateKey(String)
static DDMTemplate getDefaultPortletDisplayTemplateDDMTemplate(long groupId, long classNameId)
          Returns the default portlet display template's DDM template that's associated with the class name ID.
static String getDisplayStyle(String ddmTemplateKey)
          Returns the display style that's associated with the template key of the portlet display template's DDM template.
static PortletDisplayTemplate getPortletDisplayTemplate()
           
static DDMTemplate getPortletDisplayTemplateDDMTemplate(long groupId, long classNameId, String displayStyle)
          Returns the portlet display template's DDM template that's associated with the class name ID and that matches the group and display style stored in the portlet configuration.
static DDMTemplate getPortletDisplayTemplateDDMTemplate(long groupId, long classNameId, String displayStyle, boolean useDefault)
          Returns the portlet display template's DDM template that's associated with the class name ID and that matches the group and display style stored in the portlet configuration.
static long getPortletDisplayTemplateDDMTemplateId(long groupId, String displayStyle)
          Deprecated. As of 7.0.0, replaced by getPortletDisplayTemplateDDMTemplate(long, long, String)
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, DDMTemplate ddmTemplate, 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, DDMTemplate ddmTemplate, List<?> entries, Map<String,Object> contextObjects)
          Returns the result of rendering the DDM template with the entries in the page context and template context.
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

@Deprecated
public static DDMTemplate fetchDDMTemplate(long groupId,
                                                      String displayStyle)
Deprecated. As of 7.0.0, replaced by getPortletDisplayTemplateDDMTemplate(long, long, String)

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

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

getDDMTemplateKey

public static String getDDMTemplateKey(String displayStyle)
Returns the template key 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 template key of the portlet display template's DDM template

getDDMTemplateUuid

@Deprecated
public static String getDDMTemplateUuid(String displayStyle)
Deprecated. As of 7.0.0, replaced by getDDMTemplateKey(String)

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

getDefaultPortletDisplayTemplateDDMTemplate

public static DDMTemplate getDefaultPortletDisplayTemplateDDMTemplate(long groupId,
                                                                      long classNameId)
Returns the default portlet display template's DDM template that's associated with the class name ID.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name of the model the display style is related to
Returns:
the default portlet display template's DDM template

getDisplayStyle

public static String getDisplayStyle(String ddmTemplateKey)
Returns the display style that's associated with the template key of the portlet display template's DDM template.

Parameters:
ddmTemplateKey - the template key of the portlet display template's DDM template
Returns:
the display style stored in the portlet configuration

getPortletDisplayTemplate

public static PortletDisplayTemplate getPortletDisplayTemplate()

getPortletDisplayTemplateDDMTemplate

public static DDMTemplate getPortletDisplayTemplateDDMTemplate(long groupId,
                                                               long classNameId,
                                                               String displayStyle)
Returns the portlet display template's DDM template that's associated with the class name ID and that matches the group and display style stored in the portlet configuration.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name of the model the display style is related to
displayStyle - the display style stored in the portlet configuration
Returns:
the portlet display template's DDM template

getPortletDisplayTemplateDDMTemplate

public static DDMTemplate getPortletDisplayTemplateDDMTemplate(long groupId,
                                                               long classNameId,
                                                               String displayStyle,
                                                               boolean useDefault)
Returns the portlet display template's DDM template that's associated with the class name ID and that matches the group and display style stored in the portlet configuration. Optionally returns the default portlet display template's DDM template that's associated with the class name ID if none are found for the given parameters.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name of the model the display style is related to
displayStyle - the display style stored in the portlet configuration
useDefault - whether to return the default portlet display template's DDM template that's associated with the class name ID if none are found for the given parameters.
Returns:
the portlet display template's DDM template

getPortletDisplayTemplateDDMTemplateId

@Deprecated
public static long getPortletDisplayTemplateDDMTemplateId(long groupId,
                                                                     String displayStyle)
Deprecated. As of 7.0.0, replaced by getPortletDisplayTemplateDDMTemplate(long, long, String)

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

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, java.util.Locale)

renderDDMTemplate

public static String renderDDMTemplate(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response,
                                       DDMTemplate ddmTemplate,
                                       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
ddmTemplate - the DDM template
entries - the entries that are rendered in the template
Returns:
the result of rendering the DDM template
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,
                                       DDMTemplate ddmTemplate,
                                       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
ddmTemplate - 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
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)
                                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
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
Throws:
Exception - if the DDM template could not be rendered

setPortletDisplayTemplate

public void setPortletDisplayTemplate(PortletDisplayTemplate portletDisplayTemplate)

Liferay 7.0-ce-m6