Java 类com.liferay.portal.kernel.util.PortletKeys 实例源码

项目:ch-inofix-data-manager    文件:MeasurementImportController.java   
protected PortletPreferences getPortletPreferences(long groupId)
        throws PortalException {

    long ownerId = groupId;
    int ownerType = PortletKeys.PREFS_OWNER_TYPE_GROUP;
    long plid = 0;
    PortletPreferences preferences = null;

    try {

        com.liferay.portal.kernel.model.PortletPreferences portletPreferences = _portletPreferencesLocalService
                .getPortletPreferences(ownerId, ownerType, plid,
                        ch.inofix.data.constants.PortletKeys.DATA_MANAGER);

        preferences = PortletPreferencesFactoryUtil
                .fromDefaultXML(portletPreferences.getPreferences());

    } catch (NoSuchPortletPreferencesException e) {
        _log.warn(e.getMessage());
    }

    return preferences;

}
项目:ch-inofix-data-manager    文件:MeasurementIndexer.java   
protected PortletPreferences getPreferences(long groupId)
        throws PortalException {

    long ownerId = groupId;
    int ownerType = PortletKeys.PREFS_OWNER_TYPE_GROUP;
    long plid = 0;

    com.liferay.portal.kernel.model.PortletPreferences portletPreferences = _portletPreferencesLocalService
            .getPortletPreferences(ownerId, ownerType, plid,
                    ch.inofix.data.constants.PortletKeys.DATA_MANAGER);

    PortletPreferences preferences = PortletPreferencesFactoryUtil
            .fromDefaultXML(portletPreferences.getPreferences());

    return preferences;

}
项目:liferay-blade-samples    文件:BladeActionDisplayContext.java   
/**
 * Read settings from page Documents And Media portlet "Show Actions" portlet configuration.<br/>
 * But for Documents And Media admin portlet, it will always be true.
 */
private boolean _showAction() throws SettingsException {
    PortletDisplay portletDisplay = _themeDisplay.getPortletDisplay();

    String portletName = portletDisplay.getPortletName();

    if (portletName.equals(PortletKeys.DOCUMENT_LIBRARY_ADMIN)) {
        return true;
    }

    Settings settings = SettingsFactoryUtil.getSettings(
        new PortletInstanceSettingsLocator(
            _themeDisplay.getLayout(), portletDisplay.getId()));

    TypedSettings typedSettings = new TypedSettings(settings);

    return typedSettings.getBooleanValue("showActions");
}
项目:liferay-blade-samples    文件:BladeActionDisplayContext.java   
/**
 * Read settings from page Documents And Media portlet "Show Actions" portlet configuration.<br/>
 * But for Documents And Media admin portlet, it will always be true.
 */
private boolean _showAction() throws SettingsException {
    PortletDisplay portletDisplay = _themeDisplay.getPortletDisplay();

    String portletName = portletDisplay.getPortletName();

    if (portletName.equals(PortletKeys.DOCUMENT_LIBRARY_ADMIN)) {
        return true;
    }

    Settings settings = SettingsFactoryUtil.getSettings(
        new PortletInstanceSettingsLocator(
            _themeDisplay.getLayout(), portletDisplay.getId()));

    TypedSettings typedSettings = new TypedSettings(settings);

    return typedSettings.getBooleanValue("showActions");
}
项目:liferay-blade-samples    文件:BladeActionDisplayContext.java   
/**
 * Read settings from page Documents And Media portlet "Show Actions" portlet configuration.<br/>
 * But for Documents And Media admin portlet, it will always be true.
 */
private boolean _showAction() throws SettingsException {
    PortletDisplay portletDisplay = _themeDisplay.getPortletDisplay();

    String portletName = portletDisplay.getPortletName();

    if (portletName.equals(PortletKeys.DOCUMENT_LIBRARY_ADMIN)) {
        return true;
    }

    Settings settings = SettingsFactoryUtil.getSettings(
        new PortletInstanceSettingsLocator(
            _themeDisplay.getLayout(), portletDisplay.getId()));

    TypedSettings typedSettings = new TypedSettings(settings);

    return typedSettings.getBooleanValue("showActions");
}
项目:liferay-7-workspace    文件:PrivacyUtil.java   
public static PortletPreferences getPrivacyAdminSettings(
    long companyId, long groupId) {

    return PortletPreferencesLocalServiceUtil.getPreferences(
        companyId, groupId, PortletKeys.PREFS_OWNER_TYPE_GROUP, 0,
        PrivacyPortletKeys.PRIVACY_ADMIN);
}
项目:liferay-db-setup-core    文件:SetupPages.java   
private static void removeAllPortlets(final long runasUser,
                                      final LayoutTypePortlet layoutTypePortlet, final Layout layout) {
    List<Portlet> portlets = null;
    try {
        portlets = layoutTypePortlet.getAllPortlets();
    } catch (SystemException e1) {
        e1.printStackTrace();
    }
    if (portlets != null) {
        for (Portlet portlet : portlets) {

            String portletId = portlet.getPortletId();

            try {
                if (layoutTypePortlet.hasPortletId(portletId)) {
                    LOG.debug("Removing portlet " + portletId);
                    layoutTypePortlet.removePortletId(runasUser, portletId);
                    String rootPortletId = PortletConstants.getRootPortletId(portletId);
                    LOG.debug("Root portletId: " + rootPortletId);
                    ResourceLocalServiceUtil.deleteResource(layout.getCompanyId(),
                            rootPortletId, ResourceConstants.SCOPE_INDIVIDUAL,
                            PortletPermissionUtil.getPrimaryKey(layout.getPlid(), portletId));
                    LayoutLocalServiceUtil.updateLayout(layout.getGroupId(), layout.isPrivateLayout(),
                            layout.getLayoutId(), layout.getTypeSettings());
                    List<PortletPreferences> list = PortletPreferencesLocalServiceUtil
                            .getPortletPreferences(PortletKeys.PREFS_OWNER_TYPE_LAYOUT,
                                    layout.getPlid(), portletId);
                    for (PortletPreferences p : list) {
                        PortletPreferencesLocalServiceUtil.deletePortletPreferences(p);
                    }
                }
            } catch (PortalException | SystemException e) {
                e.printStackTrace();
            }
        }
    }
}