Example usage for com.liferay.portal.kernel.service LayoutTemplateLocalServiceUtil getContent

List of usage examples for com.liferay.portal.kernel.service LayoutTemplateLocalServiceUtil getContent

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.service LayoutTemplateLocalServiceUtil getContent.

Prototype

public static String getContent(String layoutTemplateId, boolean standard, String themeId) 

Source Link

Document

NOTE FOR DEVELOPERS: Never modify or reference this interface directly.

Usage

From source file:com.liferay.application.list.taglib.display.context.logic.PanelAppContentHelper.java

License:Open Source License

public void writeContent(Writer writer) throws Exception {
    ThemeDisplay themeDisplay = _getThemeDisplay();

    String layoutTemplateId = "max";

    if (themeDisplay.isStatePopUp()) {
        layoutTemplateId = "pop_up";
    }/*  ww  w  .j  ava 2s.  com*/

    Theme theme = themeDisplay.getTheme();

    String velocityTemplateId = theme.getThemeId() + LayoutTemplateConstants.STANDARD_SEPARATOR
            + layoutTemplateId;

    String content = LayoutTemplateLocalServiceUtil.getContent(layoutTemplateId, true, theme.getThemeId());

    if (Validator.isNotNull(velocityTemplateId) && Validator.isNotNull(content)) {

        HttpServletRequest request = getOriginalHttpServletRequest(_request);

        StringBundler sb = RuntimePageUtil.getProcessedTemplate(request, _response, getPortletId(),
                new StringTemplateResource(velocityTemplateId, content));

        if (sb != null) {
            sb.writeTo(writer);
        }
    }
}