Example usage for com.liferay.portal.kernel.model LayoutTypePortlet isPortletEmbedded

List of usage examples for com.liferay.portal.kernel.model LayoutTypePortlet isPortletEmbedded

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.model LayoutTypePortlet isPortletEmbedded.

Prototype

public boolean isPortletEmbedded(String portletId);

Source Link

Usage

From source file:com.liferay.portlet.configuration.web.internal.portlet.PortletConfigurationPortlet.java

License:Open Source License

protected PortletPreferences getPortletPreferences(ThemeDisplay themeDisplay, String portletId,
        String settingsScope) {/*from  w w w. ja v a2 s  . c o  m*/

    Layout layout = themeDisplay.getLayout();

    if (!layout.isSupportsEmbeddedPortlets()) {
        return null;
    }

    LayoutTypePortlet layoutTypePortlet = (LayoutTypePortlet) layout.getLayoutType();

    if (!layoutTypePortlet.isPortletEmbedded(portletId)) {
        return null;
    }

    PortletPreferencesIds portletPreferencesIds = new PortletPreferencesIds(themeDisplay.getCompanyId(),
            layout.getGroupId(), PortletKeys.PREFS_OWNER_TYPE_LAYOUT, PortletKeys.PREFS_PLID_SHARED, portletId);

    return _portletPreferencesLocalService.getPreferences(portletPreferencesIds);
}