@Override public com.liferay.portal.kernel.util.UnicodeProperties getTypeSettingsProperties() { return _group.getTypeSettingsProperties(); }
public static RatingsType getRatingsType( long companyId, long groupId, String className) throws PortalException { RatingsType defaultRatingsType = getDefaultRatingsType(className); if (defaultRatingsType != null) { String propertyKey = RatingsDataTransformerUtil.getPropertyKey( className); PortletPreferences companyPortletPreferences = PrefsPropsUtil.getPreferences(companyId); String value = companyPortletPreferences.getValue( propertyKey, defaultRatingsType.getValue()); Group group = GroupLocalServiceUtil.getGroup(groupId); UnicodeProperties groupTypeSettings = group.getTypeSettingsProperties(); value = groupTypeSettings.getProperty(propertyKey, value); return RatingsType.parse(value); } return null; }
private void _setGroupTypeSetting(long groupId, String key, String value) { Group group = _groupLocalService.fetchGroup(groupId); if (group == null) { return; } UnicodeProperties typeSettingsProperties = group.getTypeSettingsProperties(); if (Validator.isNotNull(value)) { typeSettingsProperties.setProperty(key, value); } else { typeSettingsProperties.remove(key); } group.setTypeSettingsProperties(typeSettingsProperties); group.setTypeSettings(typeSettingsProperties.toString()); _groupLocalService.updateGroup(group); }
@Override public long getRemoteLayoutPlid(long userId, long stagingGroupId, long plid) throws PortalException { Group stagingGroup = _groupLocalService.fetchGroup(stagingGroupId); User user = _userLocalService.fetchUser(userId); HttpPrincipal httpPrincipal = new HttpPrincipal( _stagingURLHelper.buildRemoteURL( stagingGroup.getTypeSettingsProperties()), user.getLogin(), user.getPassword(), user.isPasswordEncrypted()); Layout layout = _layoutLocalService.fetchLayout(plid); return LayoutServiceHttp.getLayoutPlid( httpPrincipal, layout.getUuid(), stagingGroup.getRemoteLiveGroupId(), layout.isPrivateLayout()); }
@Override public boolean isRemoteLayoutHasPortletId( long userId, long stagingGroupId, long plid, String portletId) { Group stagingGroup = _groupLocalService.fetchGroup(stagingGroupId); User user = _userLocalService.fetchUser(userId); try { HttpPrincipal httpPrincipal = new HttpPrincipal( _stagingURLHelper.buildRemoteURL( stagingGroup.getTypeSettingsProperties()), user.getLogin(), user.getPassword(), user.isPasswordEncrypted()); return LayoutServiceHttp.hasPortletId( httpPrincipal, plid, portletId); } catch (PortalException pe) { if (_log.isWarnEnabled()) { _log.warn( StringBundler.concat( "Unable to determine if remote layout ", plid, " contains portlet ", portletId), pe); } } return false; }
protected void initLayoutSetBranches( long userId, long sourceGroupId, long targetGroupId) throws PortalException { Group sourceGroup = GroupLocalServiceUtil.getGroup(sourceGroupId); if (!sourceGroup.hasStagingGroup()) { return; } LayoutSetBranchLocalServiceUtil.deleteLayoutSetBranches( targetGroupId, false, true); LayoutSetBranchLocalServiceUtil.deleteLayoutSetBranches( targetGroupId, true, true); UnicodeProperties typeSettingsProperties = sourceGroup.getTypeSettingsProperties(); boolean branchingPrivate = GetterUtil.getBoolean( typeSettingsProperties.getProperty("branchingPrivate")); boolean branchingPublic = GetterUtil.getBoolean( typeSettingsProperties.getProperty("branchingPublic")); ServiceContext serviceContext = new ServiceContext(); serviceContext.setUserId(userId); StagingLocalServiceUtil.checkDefaultLayoutSetBranches( userId, sourceGroup, branchingPublic, branchingPrivate, false, serviceContext); }
stagingGroup.getTypeSettingsProperties()), user.getLogin(), user.getPassword(), user.isPasswordEncrypted());