Example usage for com.liferay.portal.kernel.model PortletPreferencesIds PortletPreferencesIds

List of usage examples for com.liferay.portal.kernel.model PortletPreferencesIds PortletPreferencesIds

Introduction

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

Prototype

public PortletPreferencesIds(long companyId, long ownerId, int ownerType, long plid, 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) {// w ww . j  a va 2s.  c om

    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);
}