Example usage for com.liferay.portal.kernel.theme PortletDisplay getPortletSetup

List of usage examples for com.liferay.portal.kernel.theme PortletDisplay getPortletSetup

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.theme PortletDisplay getPortletSetup.

Prototype

public PortletPreferences getPortletSetup() 

Source Link

Usage

From source file:com.liferay.portlet.configuration.sharing.web.internal.portlet.configuration.icon.FacebookPortletConfigurationIcon.java

License:Open Source License

@Override
public String getURL(PortletRequest portletRequest, PortletResponse portletResponse) {

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

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    PortletPreferences portletSetup = portletDisplay.getPortletSetup();

    String lfrFacebookAPIKey = portletSetup.getValue("lfrFacebookApiKey", StringPool.BLANK);

    return "http://www.facebook.com/add.php?api_key=" + lfrFacebookAPIKey + "&ref=pd";
}

From source file:com.liferay.portlet.configuration.sharing.web.internal.portlet.configuration.icon.FacebookPortletConfigurationIcon.java

License:Open Source License

@Override
public boolean isShow(PortletRequest portletRequest) {
    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    PortletPreferences portletSetup = portletDisplay.getPortletSetup();

    String lfrFacebookAPIKey = portletSetup.getValue("lfrFacebookApiKey", StringPool.BLANK);
    String lfrFacebookCanvasPageURL = portletSetup.getValue("lfrFacebookCanvasPageUrl", StringPool.BLANK);
    boolean facebookShowAddAppLink = GetterUtil
            .getBoolean(portletSetup.getValue("lfrFacebookShowAddAppLink", null), true);

    if (Validator.isNull(lfrFacebookCanvasPageURL) || Validator.isNull(lfrFacebookAPIKey)) {

        facebookShowAddAppLink = false;/*from   ww  w  .  j  a  v  a2s.c om*/
    }

    if (facebookShowAddAppLink) {
        return true;
    }

    return false;
}

From source file:com.liferay.portlet.configuration.sharing.web.internal.portlet.configuration.icon.IGooglePortletConfigurationIcon.java

License:Open Source License

@Override
public boolean isShow(PortletRequest portletRequest) {
    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    PortletPreferences portletSetup = portletDisplay.getPortletSetup();

    boolean lfrIgoogleShowAddAppLink = GetterUtil
            .getBoolean(portletSetup.getValue("lfrIgoogleShowAddAppLink", StringPool.BLANK));

    if (lfrIgoogleShowAddAppLink) {
        return true;
    }//from  w w w.  ja v  a2s .c  o  m

    return false;
}

From source file:com.liferay.portlet.configuration.sharing.web.internal.portlet.configuration.icon.NetvibesPortletConfigurationIcon.java

License:Open Source License

@Override
public boolean isShow(PortletRequest portletRequest) {
    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    PortletPreferences portletSetup = portletDisplay.getPortletSetup();

    boolean lfrNetvibesShowAddAppLink = GetterUtil
            .getBoolean(portletSetup.getValue("lfrNetvibesShowAddAppLink", StringPool.BLANK));

    if (lfrNetvibesShowAddAppLink) {
        return true;
    }/*w ww . j av a  2  s . c  o m*/

    return false;
}

From source file:com.liferay.portlet.configuration.sharing.web.internal.portlet.configuration.icon.WidgetPortletConfigurationIcon.java

License:Open Source License

@Override
public boolean isShow(PortletRequest portletRequest) {
    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    PortletPreferences portletSetup = portletDisplay.getPortletSetup();

    boolean lfrWidgetShowAddAppLink = GetterUtil.getBoolean(
            portletSetup.getValue("lfrWidgetShowAddAppLink", null), PropsValues.THEME_PORTLET_SHARING_DEFAULT);

    if (lfrWidgetShowAddAppLink) {
        return true;
    }//from w  w w . j  av  a  2  s .  c  o m

    return false;
}