Example usage for com.liferay.portal.kernel.portlet PortletRequestModel getThemeDisplayModel

List of usage examples for com.liferay.portal.kernel.portlet PortletRequestModel getThemeDisplayModel

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.portlet PortletRequestModel getThemeDisplayModel.

Prototype

public ThemeDisplayModel getThemeDisplayModel() 

Source Link

Usage

From source file:com.liferay.journal.util.impl.JournalUtil.java

License:Open Source License

public static Map<String, String> getTokens(long articleGroupId, PortletRequestModel portletRequestModel,
        ThemeDisplay themeDisplay) throws PortalException {

    Map<String, String> tokens = new HashMap<>();

    if (themeDisplay != null) {
        _populateTokens(tokens, articleGroupId, themeDisplay);
    } else if (portletRequestModel != null) {
        ThemeDisplayModel themeDisplayModel = portletRequestModel.getThemeDisplayModel();

        if (themeDisplayModel != null) {
            try {
                _populateTokens(tokens, articleGroupId, themeDisplayModel);
            } catch (Exception e) {
                if (_log.isWarnEnabled()) {
                    _log.warn(e, e);/*from  w w  w  .jav  a2s .c o m*/
                }
            }
        }
    }

    return tokens;
}