Example usage for com.liferay.portal.kernel.util PrefsParamUtil getBoolean

List of usage examples for com.liferay.portal.kernel.util PrefsParamUtil getBoolean

Introduction

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

Prototype

public static boolean getBoolean(PortletPreferences preferences, PortletRequest portletRequest, String param,
            boolean defaultValue) 

Source Link

Usage

From source file:com.liferay.announcements.web.internal.display.context.DefaultAnnouncementsDisplayContext.java

License:Open Source License

@Override
public boolean isCustomizeAnnouncementsDisplayed() {
    Group scopeGroup = _announcementsRequestHelper.getScopeGroup();

    return PrefsParamUtil.getBoolean(_announcementsRequestHelper.getPortletPreferences(),
            _announcementsRequestHelper.getRequest(), "customizeAnnouncementsDisplayed", !scopeGroup.isUser());
}

From source file:com.liferay.docs.formnavextensionportlet.MyAppCompanySettingsFormNavigatorEntry.java

License:Open Source License

@Override
public void include(HttpServletRequest request, HttpServletResponse response) throws IOException {

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

    PortletPreferences companyPortletPreferences = PrefsPropsUtil.getPreferences(themeDisplay.getCompanyId(),
            true);/*from  ww w.  j  a  va  2 s  . c  om*/

    boolean companyMyAppFeatureEnabled = PrefsParamUtil.getBoolean(companyPortletPreferences, request,
            "myAppFeatureEnabled", true);

    request.setAttribute(MyAppWebKeys.COMPANY_MY_APP_FEATURE_ENABLED, companyMyAppFeatureEnabled);

    super.include(request, response);
}

From source file:com.liferay.dynamic.data.lists.web.internal.display.context.DDLDisplayContext.java

License:Open Source License

public boolean isEditable() {
    if (isAdminPortlet()) {
        return true;
    }/*from   w  w  w.j av a 2 s.  com*/

    return PrefsParamUtil.getBoolean(_ddlRequestHelper.getPortletPreferences(),
            _ddlRequestHelper.getRenderRequest(), "editable", true);
}

From source file:com.liferay.mentions.web.internal.servlet.taglib.ui.MentionsCompanySettingsFormNavigatorEntry.java

License:Open Source License

@Override
public void include(HttpServletRequest request, HttpServletResponse response) throws IOException {

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

    PortletPreferences companyPortletPreferences = PrefsPropsUtil.getPreferences(themeDisplay.getCompanyId(),
            true);//from w ww.jav a  2 s  .c o  m

    boolean companyMentionsEnabled = PrefsParamUtil.getBoolean(companyPortletPreferences, request,
            "mentionsEnabled", true);

    request.setAttribute(MentionsWebKeys.COMPANY_MENTIONS_ENABLED, companyMentionsEnabled);

    super.include(request, response);
}

From source file:com.liferay.mentions.web.internal.servlet.taglib.ui.MentionsSitesFormNavigatorEntry.java

License:Open Source License

@Override
public boolean isVisible(User user, Object formModelBean) {
    ServiceContext serviceContext = ServiceContextThreadLocal.getServiceContext();

    ThemeDisplay themeDisplay = serviceContext.getThemeDisplay();

    HttpServletRequest request = themeDisplay.getRequest();

    PortletPreferences companyPortletPreferences = PrefsPropsUtil.getPreferences(themeDisplay.getCompanyId(),
            true);/*from w  w  w .j  a v a2  s . c  om*/

    return PrefsParamUtil.getBoolean(companyPortletPreferences, request, "mentionsEnabled", true);
}