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

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

Introduction

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

Prototype

String THEME_DISPLAY

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

Click Source Link

Usage

From source file:com.liferay.asset.publisher.web.display.context.AssetPublisherDisplayContext.java

License:Open Source License

public Long getCompanyId() {
    if (_companyId != null) {
        return _companyId;
    }// w  ww .ja va2  s  . c  o m

    ThemeDisplay themeDisplay = (ThemeDisplay) _request.getAttribute(WebKeys.THEME_DISPLAY);

    _companyId = themeDisplay.getCompanyId();

    return _companyId;
}

From source file:com.liferay.asset.publisher.web.display.context.AssetPublisherDisplayContext.java

License:Open Source License

public long getDisplayStyleGroupId() {
    if (_displayStyleGroupId != null) {
        return _displayStyleGroupId;
    }/*from ww w. j a  va 2 s . co m*/

    ThemeDisplay themeDisplay = (ThemeDisplay) _request.getAttribute(WebKeys.THEME_DISPLAY);

    _displayStyleGroupId = GetterUtil.getLong(_portletPreferences.getValue("displayStyleGroupId", null),
            themeDisplay.getScopeGroupId());

    return _displayStyleGroupId;
}

From source file:com.liferay.asset.publisher.web.display.context.AssetPublisherDisplayContext.java

License:Open Source License

public long[] getGroupIds() {
    if (_groupIds != null) {
        return _groupIds;
    }//from  w w w .jav a  2 s.  c o  m

    ThemeDisplay themeDisplay = (ThemeDisplay) _request.getAttribute(WebKeys.THEME_DISPLAY);

    _groupIds = AssetPublisherUtil.getGroupIds(_portletPreferences, themeDisplay.getScopeGroupId(),
            themeDisplay.getLayout());

    return _groupIds;
}

From source file:com.liferay.asset.publisher.web.display.context.AssetPublisherDisplayContext.java

License:Open Source License

public Layout getLayout() {
    if (_layout != null) {
        return _layout;
    }//from www  .ja  va  2s. c o m

    ThemeDisplay themeDisplay = (ThemeDisplay) _request.getAttribute(WebKeys.THEME_DISPLAY);

    _layout = themeDisplay.getLayout();

    return _layout;
}

From source file:com.liferay.asset.publisher.web.display.context.AssetPublisherDisplayContext.java

License:Open Source License

public Locale getLocale() {
    if (_locale != null) {
        return _locale;
    }// w  ww  . j a  v  a2s.c  om

    ThemeDisplay themeDisplay = (ThemeDisplay) _request.getAttribute(WebKeys.THEME_DISPLAY);

    _locale = themeDisplay.getLocale();

    return _locale;
}

From source file:com.liferay.asset.publisher.web.display.context.AssetPublisherDisplayContext.java

License:Open Source License

public String getRSSName() {
    if (_rssName != null) {
        return _rssName;
    }// www  . j  av  a  2  s. c  o  m

    ThemeDisplay themeDisplay = (ThemeDisplay) _request.getAttribute(WebKeys.THEME_DISPLAY);

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    _rssName = _portletPreferences.getValue("rssName", portletDisplay.getTitle());

    return _rssName;
}

From source file:com.liferay.asset.publisher.web.display.context.AssetPublisherDisplayContext.java

License:Open Source License

public Long getScopeGroupId() {
    if (_scopeGroupId != null) {
        return _scopeGroupId;
    }/*from   w w  w.  j a v a 2  s  .com*/

    ThemeDisplay themeDisplay = (ThemeDisplay) _request.getAttribute(WebKeys.THEME_DISPLAY);

    _scopeGroupId = themeDisplay.getScopeGroupId();

    return _scopeGroupId;
}

From source file:com.liferay.asset.publisher.web.display.context.AssetPublisherDisplayContext.java

License:Open Source License

public TimeZone getTimeZone() {
    if (_timeZone != null) {
        return _timeZone;
    }//w w w .j  a  v a  2 s  .c  o m

    ThemeDisplay themeDisplay = (ThemeDisplay) _request.getAttribute(WebKeys.THEME_DISPLAY);

    _timeZone = themeDisplay.getTimeZone();

    return _timeZone;
}

From source file:com.liferay.asset.publisher.web.display.context.AssetPublisherDisplayContext.java

License:Open Source License

public Long getUserId() {
    if (_userId != null) {
        return _userId;
    }/*from  w  w  w.ja va 2  s  . c o  m*/

    ThemeDisplay themeDisplay = (ThemeDisplay) _request.getAttribute(WebKeys.THEME_DISPLAY);

    _userId = themeDisplay.getUserId();

    return _userId;
}

From source file:com.liferay.asset.publisher.web.display.context.AssetPublisherDisplayContext.java

License:Open Source License

public AssetEntry incrementViewCounter(AssetEntry assetEntry) throws PortalException {

    // Dynamically created asset entries are never persisted so incrementing
    // the view counter breaks

    if ((assetEntry == null) || assetEntry.isNew() || !assetEntry.isVisible()
            || !isEnableViewCountIncrement()) {

        return assetEntry;
    }//from  w ww  . j a v  a 2  s.com

    if (isEnablePermissions()) {
        return AssetEntryServiceUtil.incrementViewCounter(assetEntry.getClassName(), assetEntry.getClassPK());
    } else {
        ThemeDisplay themeDisplay = (ThemeDisplay) _request.getAttribute(WebKeys.THEME_DISPLAY);

        return AssetEntryLocalServiceUtil.incrementViewCounter(themeDisplay.getUserId(),
                assetEntry.getClassName(), assetEntry.getClassPK());
    }
}