Example usage for com.liferay.portal.kernel.util WebKeys PAGE_BOTTOM

List of usage examples for com.liferay.portal.kernel.util WebKeys PAGE_BOTTOM

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util WebKeys PAGE_BOTTOM.

Prototype

String PAGE_BOTTOM

To view the source code for com.liferay.portal.kernel.util WebKeys PAGE_BOTTOM.

Click Source Link

Usage

From source file:com.commsen.liferay.portlet.customglobalmarkup.CustomGlobalMarkupPortlet.java

License:Open Source License

public void doView(RenderRequest renderRequest, RenderResponse renderResponse)
        throws IOException, PortletException {

    // get and prepare code to be added to header section
    List<Markup> topMarkups = null;
    try {//from w  ww  . java 2  s  . co m
        topMarkups = MarkupLocalServiceUtil.getActiveTopMarkups(PortalUtil.getScopeGroupId(renderRequest));
    } catch (PortalException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (SystemException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    if (topMarkups != null && !topMarkups.isEmpty()) {
        StringBundler sb = (StringBundler) renderRequest.getAttribute(WebKeys.PAGE_TOP);
        if (sb == null)
            sb = new StringBundler();
        for (Markup markup : topMarkups) {
            sb.append(markup.getMarkup()).append("\n");
        }
        renderRequest.setAttribute(WebKeys.PAGE_TOP, sb);
    }

    // get and prepare code to be added to the bottom of the page
    List<Markup> bottomMarkups = null;
    try {
        bottomMarkups = MarkupLocalServiceUtil
                .getActiveBottomMarkups(PortalUtil.getScopeGroupId(renderRequest));
    } catch (PortalException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (SystemException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    if (bottomMarkups != null && !bottomMarkups.isEmpty()) {
        StringBundler sb = (StringBundler) renderRequest.getAttribute(WebKeys.PAGE_BOTTOM);
        if (sb == null)
            sb = new StringBundler();
        for (Markup markup : bottomMarkups) {
            sb.append(markup.getMarkup()).append("\n");
        }
        renderRequest.setAttribute(WebKeys.PAGE_BOTTOM, sb);
    }
}

From source file:com.liferay.taglib.util.HtmlBottomTag.java

License:Open Source License

public HtmlBottomTag() {
    super(WebKeys.PAGE_BOTTOM);
}