List of usage examples for com.liferay.portal.kernel.model Group getTypeSettingsProperties
public com.liferay.portal.kernel.util.UnicodeProperties getTypeSettingsProperties();
From source file:com.liferay.exportimport.internal.background.task.LayoutStagingBackgroundTaskExecutor.java
License:Open Source License
protected void initLayoutSetBranches(long userId, long sourceGroupId, long targetGroupId) throws PortalException { Group sourceGroup = GroupLocalServiceUtil.getGroup(sourceGroupId); if (!sourceGroup.hasStagingGroup()) { return;//from ww w . j a v a 2s . c om } 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); }
From source file:com.liferay.exportimport.internal.lifecycle.EventRemotePropagatorExportImportLifecycleListener.java
License:Open Source License
private boolean _eventNeedsToBePropagated(ExportImportLifecycleEvent exportImportLifecycleEvent) { if (!_propagatedEventTypes.contains(exportImportLifecycleEvent.getCode())) { return false; }//from w ww . ja va 2 s . c o m Optional<ExportImportConfiguration> exportImportConfigurationOptional = _getExportImportConfiguration( exportImportLifecycleEvent); Optional<Map<String, Serializable>> settingsMapOptional = exportImportConfigurationOptional .map(exportImportConfiguration -> exportImportConfiguration.getSettingsMap()); Serializable sourceGroupIdSerializable = settingsMapOptional .map(settingsMap -> settingsMap.get("sourceGroupId")).orElse(GroupConstants.ANY_PARENT_GROUP_ID); long sourceGroupId = GetterUtil.getLong(sourceGroupIdSerializable); Group sourceGroup = _groupLocalService.fetchGroup(sourceGroupId); if (Validator.isNull(sourceGroup) || !sourceGroup.isStagedRemotely()) { return false; } Serializable targetGroupIdSerializable = settingsMapOptional .map(settingsMap -> settingsMap.get("targetGroupId")).orElse(GroupConstants.ANY_PARENT_GROUP_ID); long targetGroupId = GetterUtil.getLong(targetGroupIdSerializable); Group targetGroup = _groupLocalService.fetchGroup(targetGroupId); UnicodeProperties typeSettings = sourceGroup.getTypeSettingsProperties(); String remoteGroupUUID = typeSettings.getProperty("remoteGroupUUID"); // If the target group can be found and the UUID's also match, then we // must not propagate the event because it means remote staging is // configured between two sites on the same portal instance if (Validator.isNotNull(remoteGroupUUID) && Validator.isNotNull(targetGroup) && StringUtil.equals(remoteGroupUUID, targetGroup.getUuid())) { return false; } return true; }
From source file:com.liferay.exportimport.staging.LayoutStagingImpl.java
License:Open Source License
@Override public boolean isBranchingLayoutSet(Group group, boolean privateLayout) { boolean isStagingGroup = false; if (group.isStagingGroup() && !group.isStagedRemotely()) { isStagingGroup = true;// w w w . ja va2s. c o m group = group.getLiveGroup(); } UnicodeProperties typeSettingsProperties = group.getTypeSettingsProperties(); if (typeSettingsProperties.isEmpty()) { return false; } boolean branchingEnabled = false; if (privateLayout) { branchingEnabled = GetterUtil.getBoolean(typeSettingsProperties.getProperty("branchingPrivate")); } else { branchingEnabled = GetterUtil.getBoolean(typeSettingsProperties.getProperty("branchingPublic")); } if (!branchingEnabled || !group.isStaged() || (!group.isStagedRemotely() && !isStagingGroup)) { return false; } Group stagingGroup = group; if (isStagingGroup) { stagingGroup = group.getStagingGroup(); } try { _layoutSetBranchLocalService.getMasterLayoutSetBranch(stagingGroup.getGroupId(), privateLayout); return true; } catch (PortalException pe) { // LPS-52675 if (_log.isDebugEnabled()) { _log.debug(pe, pe); } return false; } }
From source file:com.liferay.exportimport.staging.StagingImpl.java
License:Open Source License
@Override public String getRemoteSiteURL(Group stagingGroup, boolean privateLayout) throws PortalException { if (!stagingGroup.isStagedRemotely()) { return StringPool.BLANK; }//w w w. ja v a2 s. c o m PermissionChecker permissionChecker = PermissionThreadLocal.getPermissionChecker(); User user = permissionChecker.getUser(); UnicodeProperties typeSettingsProperties = stagingGroup.getTypeSettingsProperties(); HttpPrincipal httpPrincipal = new HttpPrincipal(buildRemoteURL(typeSettingsProperties), user.getLogin(), user.getPassword(), user.getPasswordEncrypted()); long remoteGroupId = GetterUtil.getLong(typeSettingsProperties.getProperty("remoteGroupId")); boolean secureConnection = GetterUtil.getBoolean(typeSettingsProperties.getProperty("secureConnection")); String groupDisplayURL = GroupServiceHttp.getGroupDisplayURL(httpPrincipal, remoteGroupId, privateLayout, secureConnection); try { URL remoteSiteURL = new URL(groupDisplayURL); String remoteAddress = typeSettingsProperties.getProperty("remoteAddress"); remoteSiteURL = new URL(remoteSiteURL.getProtocol(), remoteAddress, remoteSiteURL.getPort(), remoteSiteURL.getFile()); return remoteSiteURL.toString(); } catch (MalformedURLException murle) { throw new PortalException(murle); } }
From source file:com.liferay.exportimport.staging.StagingImpl.java
License:Open Source License
@Override public long publishToRemote(PortletRequest portletRequest) throws PortalException { ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY); User user = themeDisplay.getUser();//w ww . j av a2s .c o m long groupId = ParamUtil.getLong(portletRequest, "groupId"); Group group = _groupLocalService.getGroup(groupId); UnicodeProperties groupTypeSettingsProperties = group.getTypeSettingsProperties(); long remoteGroupId = ParamUtil.getLong(portletRequest, "remoteGroupId", GetterUtil.getLong(groupTypeSettingsProperties.getProperty("remoteGroupId"))); Map<String, Serializable> publishLayoutRemoteSettingsMap = null; String remoteAddress = null; int remotePort = 0; String remotePathContext = null; boolean secureConnection = false; boolean remotePrivateLayout = false; long exportImportConfigurationId = ParamUtil.getLong(portletRequest, "exportImportConfigurationId"); String name = ParamUtil.getString(portletRequest, "name"); if (exportImportConfigurationId > 0) { ExportImportConfiguration exportImportConfiguration = _exportImportConfigurationLocalService .fetchExportImportConfiguration(exportImportConfigurationId); if (exportImportConfiguration != null) { publishLayoutRemoteSettingsMap = exportImportConfiguration.getSettingsMap(); remoteAddress = MapUtil.getString(publishLayoutRemoteSettingsMap, "remoteAddress"); remotePort = MapUtil.getInteger(publishLayoutRemoteSettingsMap, "remotePort"); remotePathContext = MapUtil.getString(publishLayoutRemoteSettingsMap, "remotePathContext"); secureConnection = MapUtil.getBoolean(publishLayoutRemoteSettingsMap, "secureConnection"); remotePrivateLayout = MapUtil.getBoolean(publishLayoutRemoteSettingsMap, "remotePrivateLayout"); if (!Validator.isBlank(name)) { Map<String, String[]> parameterMap = (Map<String, String[]>) publishLayoutRemoteSettingsMap .get("parameterMap"); parameterMap.put("name", new String[] { name }); } } } if (publishLayoutRemoteSettingsMap == null) { boolean privateLayout = getPrivateLayout(portletRequest); Map<Long, Boolean> layoutIdMap = _exportImportHelper.getLayoutIdMap(portletRequest); Map<String, String[]> parameterMap = ExportImportConfigurationParameterMapFactory .buildParameterMap(portletRequest); remoteAddress = ParamUtil.getString(portletRequest, "remoteAddress", groupTypeSettingsProperties.getProperty("remoteAddress")); remotePort = ParamUtil.getInteger(portletRequest, "remotePort", GetterUtil.getInteger(groupTypeSettingsProperties.getProperty("remotePort"))); remotePathContext = ParamUtil.getString(portletRequest, "remotePathContext", groupTypeSettingsProperties.getProperty("remotePathContext")); secureConnection = ParamUtil.getBoolean(portletRequest, "secureConnection", GetterUtil.getBoolean(groupTypeSettingsProperties.getProperty("secureConnection"))); remotePrivateLayout = ParamUtil.getBoolean(portletRequest, "remotePrivateLayout"); publishLayoutRemoteSettingsMap = ExportImportConfigurationSettingsMapFactory .buildPublishLayoutRemoteSettingsMap(user.getUserId(), groupId, privateLayout, layoutIdMap, parameterMap, remoteAddress, remotePort, remotePathContext, secureConnection, remoteGroupId, remotePrivateLayout, user.getLocale(), user.getTimeZone()); } remoteAddress = stripProtocolFromRemoteAddress(remoteAddress); validateRemote(groupId, remoteAddress, remotePort, remotePathContext, secureConnection, remoteGroupId); ExportImportConfiguration exportImportConfiguration = null; if (Validator.isNotNull(name)) { exportImportConfiguration = _exportImportConfigurationLocalService.addDraftExportImportConfiguration( user.getUserId(), name, ExportImportConfigurationConstants.TYPE_PUBLISH_LAYOUT_REMOTE, publishLayoutRemoteSettingsMap); } else { exportImportConfiguration = _exportImportConfigurationLocalService.addDraftExportImportConfiguration( user.getUserId(), ExportImportConfigurationConstants.TYPE_PUBLISH_LAYOUT_REMOTE, publishLayoutRemoteSettingsMap); } return doCopyRemoteLayouts(exportImportConfiguration, remoteAddress, remotePort, remotePathContext, secureConnection, remotePrivateLayout); }
From source file:com.liferay.exportimport.staging.StagingImpl.java
License:Open Source License
@Override public void schedulePublishToRemote(PortletRequest portletRequest) throws PortalException { long groupId = ParamUtil.getLong(portletRequest, "groupId"); Group group = _groupLocalService.getGroup(groupId); UnicodeProperties groupTypeSettingsProperties = group.getTypeSettingsProperties(); boolean privateLayout = false; Map<Long, Boolean> layoutIdMap = null; Map<String, String[]> parameterMap = null; String remoteAddress = null;/* w w w . j a v a 2 s. c o m*/ int remotePort = 0; String remotePathContext = null; boolean secureConnection = false; boolean remotePrivateLayout = false; long exportImportConfigurationId = ParamUtil.getLong(portletRequest, "exportImportConfigurationId"); if (exportImportConfigurationId > 0) { ExportImportConfiguration exportImportConfiguration = _exportImportConfigurationLocalService .fetchExportImportConfiguration(exportImportConfigurationId); if (exportImportConfiguration != null) { Map<String, Serializable> settingsMap = exportImportConfiguration.getSettingsMap(); privateLayout = MapUtil.getBoolean(settingsMap, "privateLayout"); layoutIdMap = (Map<Long, Boolean>) settingsMap.get("layoutIdMap"); parameterMap = (Map<String, String[]>) settingsMap.get("parameterMap"); remoteAddress = MapUtil.getString(settingsMap, "remoteAddress"); remotePort = MapUtil.getInteger(settingsMap, "remotePort"); remotePathContext = MapUtil.getString(settingsMap, "remotePathContext"); secureConnection = MapUtil.getBoolean(settingsMap, "secureConnection"); remotePrivateLayout = MapUtil.getBoolean(settingsMap, "remotePrivateLayout"); } } if (parameterMap == null) { privateLayout = getPrivateLayout(portletRequest); layoutIdMap = _exportImportHelper.getLayoutIdMap(portletRequest); parameterMap = ExportImportConfigurationParameterMapFactory.buildParameterMap(portletRequest); remoteAddress = ParamUtil.getString(portletRequest, "remoteAddress", groupTypeSettingsProperties.getProperty("remoteAddress")); remotePort = ParamUtil.getInteger(portletRequest, "remotePort", GetterUtil.getInteger(groupTypeSettingsProperties.getProperty("remotePort"))); remotePathContext = ParamUtil.getString(portletRequest, "remotePathContext", groupTypeSettingsProperties.getProperty("remotePathContext")); secureConnection = ParamUtil.getBoolean(portletRequest, "secureConnection", GetterUtil.getBoolean(groupTypeSettingsProperties.getProperty("secureConnection"))); remotePrivateLayout = ParamUtil.getBoolean(portletRequest, "remotePrivateLayout"); } remoteAddress = stripProtocolFromRemoteAddress(remoteAddress); long remoteGroupId = ParamUtil.getLong(portletRequest, "remoteGroupId", GetterUtil.getLong(groupTypeSettingsProperties.getProperty("remoteGroupId"))); validateRemote(groupId, remoteAddress, remotePort, remotePathContext, secureConnection, remoteGroupId); ScheduleInformation scheduleInformation = getScheduleInformation(portletRequest, groupId, true); String name = ParamUtil.getString(portletRequest, "name"); _layoutService.schedulePublishToRemote(groupId, privateLayout, layoutIdMap, parameterMap, remoteAddress, remotePort, remotePathContext, secureConnection, remoteGroupId, remotePrivateLayout, null, null, scheduleInformation.getGroupName(), scheduleInformation.getCronText(), scheduleInformation.getStartDate(), scheduleInformation.getSchedulerEndDate(), name); }
From source file:com.liferay.layout.admin.web.internal.portlet.action.EditLayoutSetMVCActionCommand.java
License:Open Source License
protected void updateMergePages(ActionRequest actionRequest, long liveGroupId) throws Exception { boolean mergeGuestPublicPages = ParamUtil.getBoolean(actionRequest, "mergeGuestPublicPages"); Group liveGroup = _groupLocalService.getGroup(liveGroupId); UnicodeProperties typeSettingsProperties = liveGroup.getTypeSettingsProperties(); typeSettingsProperties.setProperty("mergeGuestPublicPages", String.valueOf(mergeGuestPublicPages)); _groupService.updateGroup(liveGroupId, liveGroup.getTypeSettings()); }
From source file:com.liferay.layout.admin.web.internal.portlet.action.EditLayoutSetMVCActionCommand.java
License:Open Source License
protected void updateRobots(ActionRequest actionRequest, long liveGroupId, boolean privateLayout) throws Exception { Group liveGroup = _groupLocalService.getGroup(liveGroupId); UnicodeProperties typeSettingsProperties = liveGroup.getTypeSettingsProperties(); String propertyName = "false-robots.txt"; if (privateLayout) { propertyName = "true-robots.txt"; }// w ww .j av a2s. c om String robots = ParamUtil.getString(actionRequest, "robots", liveGroup.getTypeSettingsProperty(propertyName)); typeSettingsProperties.setProperty(propertyName, robots); _groupService.updateGroup(liveGroup.getGroupId(), typeSettingsProperties.toString()); }
From source file:com.liferay.mentions.web.internal.servlet.taglib.ui.MentionsSitesFormNavigatorEntry.java
License:Open Source License
@Override public void include(HttpServletRequest request, HttpServletResponse response) throws IOException { Group liveGroup = (Group) request.getAttribute("site.liveGroup"); UnicodeProperties typeSettingsProperties = null; if (liveGroup != null) { typeSettingsProperties = liveGroup.getTypeSettingsProperties(); } else {/*w ww . j a va 2 s. co m*/ typeSettingsProperties = new UnicodeProperties(); } boolean groupMentionsEnabled = GetterUtil.getBoolean(typeSettingsProperties.getProperty("mentionsEnabled"), true); request.setAttribute(MentionsWebKeys.GROUP_MENTIONS_ENABLED, groupMentionsEnabled); super.include(request, response); }
From source file:com.liferay.site.admin.web.internal.portlet.SiteAdminPortlet.java
License:Open Source License
protected Group updateGroup(ActionRequest actionRequest) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); long userId = portal.getUserId(actionRequest); long liveGroupId = ParamUtil.getLong(actionRequest, "liveGroupId"); long parentGroupId = ParamUtil.getLong(actionRequest, "parentGroupSearchContainerPrimaryKeys", GroupConstants.DEFAULT_PARENT_GROUP_ID); Map<Locale, String> nameMap = null; Map<Locale, String> descriptionMap = null; int type = 0; String friendlyURL = null;/* ww w . j a va2 s . com*/ boolean inheritContent = false; boolean active = false; boolean manualMembership = true; int membershipRestriction = GroupConstants.DEFAULT_MEMBERSHIP_RESTRICTION; boolean actionRequestMembershipRestriction = ParamUtil.getBoolean(actionRequest, "membershipRestriction"); if (actionRequestMembershipRestriction && (parentGroupId != GroupConstants.DEFAULT_PARENT_GROUP_ID)) { membershipRestriction = GroupConstants.MEMBERSHIP_RESTRICTION_TO_PARENT_SITE_MEMBERS; } ServiceContext serviceContext = ServiceContextFactory.getInstance(Group.class.getName(), actionRequest); ServiceContextThreadLocal.pushServiceContext(serviceContext); Group liveGroup = null; if (liveGroupId <= 0) { // Add group nameMap = LocalizationUtil.getLocalizationMap(actionRequest, "name"); descriptionMap = LocalizationUtil.getLocalizationMap(actionRequest, "description"); type = ParamUtil.getInteger(actionRequest, "type"); friendlyURL = ParamUtil.getString(actionRequest, "friendlyURL"); manualMembership = ParamUtil.getBoolean(actionRequest, "manualMembership"); inheritContent = ParamUtil.getBoolean(actionRequest, "inheritContent"); active = ParamUtil.getBoolean(actionRequest, "active"); liveGroup = groupService.addGroup(parentGroupId, GroupConstants.DEFAULT_LIVE_GROUP_ID, nameMap, descriptionMap, type, manualMembership, membershipRestriction, friendlyURL, true, inheritContent, active, serviceContext); LiveUsers.joinGroup(themeDisplay.getCompanyId(), liveGroup.getGroupId(), userId); } else { // Update group liveGroup = groupLocalService.getGroup(liveGroupId); nameMap = LocalizationUtil.getLocalizationMap(actionRequest, "name", liveGroup.getNameMap()); descriptionMap = LocalizationUtil.getLocalizationMap(actionRequest, "description", liveGroup.getDescriptionMap()); type = ParamUtil.getInteger(actionRequest, "type", liveGroup.getType()); manualMembership = ParamUtil.getBoolean(actionRequest, "manualMembership", liveGroup.isManualMembership()); friendlyURL = ParamUtil.getString(actionRequest, "friendlyURL", liveGroup.getFriendlyURL()); inheritContent = ParamUtil.getBoolean(actionRequest, "inheritContent", liveGroup.getInheritContent()); active = ParamUtil.getBoolean(actionRequest, "active", liveGroup.getActive()); liveGroup = groupService.updateGroup(liveGroupId, parentGroupId, nameMap, descriptionMap, type, manualMembership, membershipRestriction, friendlyURL, inheritContent, active, serviceContext); if (type == GroupConstants.TYPE_SITE_OPEN) { List<MembershipRequest> membershipRequests = membershipRequestLocalService.search(liveGroupId, MembershipRequestConstants.STATUS_PENDING, QueryUtil.ALL_POS, QueryUtil.ALL_POS); for (MembershipRequest membershipRequest : membershipRequests) { membershipRequestService.updateStatus(membershipRequest.getMembershipRequestId(), themeDisplay.translate("your-membership-has-been-approved"), MembershipRequestConstants.STATUS_APPROVED, serviceContext); LiveUsers.joinGroup(themeDisplay.getCompanyId(), membershipRequest.getGroupId(), new long[] { membershipRequest.getUserId() }); } } } // Settings UnicodeProperties typeSettingsProperties = liveGroup.getTypeSettingsProperties(); String customJspServletContextName = ParamUtil.getString(actionRequest, "customJspServletContextName", typeSettingsProperties.getProperty("customJspServletContextName")); typeSettingsProperties.setProperty("customJspServletContextName", customJspServletContextName); typeSettingsProperties.setProperty("defaultSiteRoleIds", ListUtil.toString(getRoles(actionRequest), Role.ROLE_ID_ACCESSOR, StringPool.COMMA)); typeSettingsProperties.setProperty("defaultTeamIds", ListUtil.toString(getTeams(actionRequest), Team.TEAM_ID_ACCESSOR, StringPool.COMMA)); String[] analyticsTypes = PrefsPropsUtil.getStringArray(themeDisplay.getCompanyId(), PropsKeys.ADMIN_ANALYTICS_TYPES, StringPool.NEW_LINE); for (String analyticsType : analyticsTypes) { if (StringUtil.equalsIgnoreCase(analyticsType, "google")) { String googleAnalyticsId = ParamUtil.getString(actionRequest, "googleAnalyticsId", typeSettingsProperties.getProperty("googleAnalyticsId")); typeSettingsProperties.setProperty("googleAnalyticsId", googleAnalyticsId); } else { String analyticsScript = ParamUtil.getString(actionRequest, Sites.ANALYTICS_PREFIX + analyticsType, typeSettingsProperties.getProperty(analyticsType)); typeSettingsProperties.setProperty(Sites.ANALYTICS_PREFIX + analyticsType, analyticsScript); } } boolean trashEnabled = ParamUtil.getBoolean(actionRequest, "trashEnabled", GetterUtil.getBoolean(typeSettingsProperties.getProperty("trashEnabled"), true)); typeSettingsProperties.setProperty("trashEnabled", String.valueOf(trashEnabled)); int trashEntriesMaxAgeCompany = PrefsPropsUtil.getInteger(themeDisplay.getCompanyId(), PropsKeys.TRASH_ENTRIES_MAX_AGE); int trashEntriesMaxAgeGroup = ParamUtil.getInteger(actionRequest, "trashEntriesMaxAge"); if (trashEntriesMaxAgeGroup <= 0) { trashEntriesMaxAgeGroup = GetterUtil.getInteger( typeSettingsProperties.getProperty("trashEntriesMaxAge"), trashEntriesMaxAgeCompany); } if (trashEntriesMaxAgeGroup != trashEntriesMaxAgeCompany) { typeSettingsProperties.setProperty("trashEntriesMaxAge", String.valueOf(GetterUtil.getInteger(trashEntriesMaxAgeGroup))); } else { typeSettingsProperties.remove("trashEntriesMaxAge"); } int contentSharingWithChildrenEnabled = ParamUtil.getInteger(actionRequest, "contentSharingWithChildrenEnabled", GetterUtil.getInteger(typeSettingsProperties.getProperty("contentSharingWithChildrenEnabled"), Sites.CONTENT_SHARING_WITH_CHILDREN_DEFAULT_VALUE)); typeSettingsProperties.setProperty("contentSharingWithChildrenEnabled", String.valueOf(contentSharingWithChildrenEnabled)); UnicodeProperties formTypeSettingsProperties = PropertiesParamUtil.getProperties(actionRequest, "TypeSettingsProperties--"); typeSettingsProperties.putAll(formTypeSettingsProperties); // Virtual hosts LayoutSet publicLayoutSet = liveGroup.getPublicLayoutSet(); String publicVirtualHost = ParamUtil.getString(actionRequest, "publicVirtualHost", publicLayoutSet.getVirtualHostname()); layoutSetService.updateVirtualHost(liveGroup.getGroupId(), false, publicVirtualHost); LayoutSet privateLayoutSet = liveGroup.getPrivateLayoutSet(); String privateVirtualHost = ParamUtil.getString(actionRequest, "privateVirtualHost", privateLayoutSet.getVirtualHostname()); layoutSetService.updateVirtualHost(liveGroup.getGroupId(), true, privateVirtualHost); // Staging if (liveGroup.hasStagingGroup()) { Group stagingGroup = liveGroup.getStagingGroup(); friendlyURL = ParamUtil.getString(actionRequest, "stagingFriendlyURL", stagingGroup.getFriendlyURL()); groupService.updateFriendlyURL(stagingGroup.getGroupId(), friendlyURL); LayoutSet stagingPublicLayoutSet = stagingGroup.getPublicLayoutSet(); publicVirtualHost = ParamUtil.getString(actionRequest, "stagingPublicVirtualHost", stagingPublicLayoutSet.getVirtualHostname()); layoutSetService.updateVirtualHost(stagingGroup.getGroupId(), false, publicVirtualHost); LayoutSet stagingPrivateLayoutSet = stagingGroup.getPrivateLayoutSet(); privateVirtualHost = ParamUtil.getString(actionRequest, "stagingPrivateVirtualHost", stagingPrivateLayoutSet.getVirtualHostname()); layoutSetService.updateVirtualHost(stagingGroup.getGroupId(), true, privateVirtualHost); UnicodeProperties stagedGroupTypeSettingsProperties = stagingGroup.getTypeSettingsProperties(); stagedGroupTypeSettingsProperties.putAll(formTypeSettingsProperties); groupService.updateGroup(stagingGroup.getGroupId(), stagedGroupTypeSettingsProperties.toString()); } liveGroup = groupService.updateGroup(liveGroup.getGroupId(), typeSettingsProperties.toString()); // Layout set prototypes long privateLayoutSetPrototypeId = ParamUtil.getLong(actionRequest, "privateLayoutSetPrototypeId"); long publicLayoutSetPrototypeId = ParamUtil.getLong(actionRequest, "publicLayoutSetPrototypeId"); boolean privateLayoutSetPrototypeLinkEnabled = ParamUtil.getBoolean(actionRequest, "privateLayoutSetPrototypeLinkEnabled", privateLayoutSet.isLayoutSetPrototypeLinkEnabled()); boolean publicLayoutSetPrototypeLinkEnabled = ParamUtil.getBoolean(actionRequest, "publicLayoutSetPrototypeLinkEnabled", publicLayoutSet.isLayoutSetPrototypeLinkEnabled()); if ((privateLayoutSetPrototypeId == 0) && (publicLayoutSetPrototypeId == 0) && !privateLayoutSetPrototypeLinkEnabled && !publicLayoutSetPrototypeLinkEnabled) { long layoutSetPrototypeId = ParamUtil.getLong(actionRequest, "layoutSetPrototypeId"); int layoutSetVisibility = ParamUtil.getInteger(actionRequest, "layoutSetVisibility"); boolean layoutSetPrototypeLinkEnabled = ParamUtil.getBoolean(actionRequest, "layoutSetPrototypeLinkEnabled", layoutSetPrototypeId > 0); if (layoutSetVisibility == _LAYOUT_SET_VISIBILITY_PRIVATE) { privateLayoutSetPrototypeId = layoutSetPrototypeId; privateLayoutSetPrototypeLinkEnabled = layoutSetPrototypeLinkEnabled; } else { publicLayoutSetPrototypeId = layoutSetPrototypeId; publicLayoutSetPrototypeLinkEnabled = layoutSetPrototypeLinkEnabled; } } if (!liveGroup.isStaged() || liveGroup.isStagedRemotely()) { SitesUtil.updateLayoutSetPrototypesLinks(liveGroup, publicLayoutSetPrototypeId, privateLayoutSetPrototypeId, publicLayoutSetPrototypeLinkEnabled, privateLayoutSetPrototypeLinkEnabled); } else { SitesUtil.updateLayoutSetPrototypesLinks(liveGroup.getStagingGroup(), publicLayoutSetPrototypeId, privateLayoutSetPrototypeId, publicLayoutSetPrototypeLinkEnabled, privateLayoutSetPrototypeLinkEnabled); } themeDisplay.setSiteGroupId(liveGroup.getGroupId()); return liveGroup; }