List of usage examples for com.liferay.portal.kernel.model LayoutSet getSettingsProperties
public com.liferay.portal.kernel.util.UnicodeProperties getSettingsProperties();
From source file:com.liferay.exportimport.test.ExportImportDateUtilTest.java
License:Open Source License
protected void updateLastPublishDate(LayoutSet layoutSet, Date lastPublishDate) throws Exception { UnicodeProperties settingsProperties = layoutSet.getSettingsProperties(); settingsProperties.setProperty("last-publish-date", String.valueOf(lastPublishDate.getTime())); LayoutSetLocalServiceUtil.updateSettings(layoutSet.getGroupId(), layoutSet.isPrivateLayout(), settingsProperties.toString()); }
From source file:com.liferay.layout.admin.web.internal.portlet.action.EditLayoutSetMVCActionCommand.java
License:Open Source License
@Override protected void doProcessAction(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); long layoutSetId = ParamUtil.getLong(actionRequest, "layoutSetId"); long liveGroupId = ParamUtil.getLong(actionRequest, "liveGroupId"); long stagingGroupId = ParamUtil.getLong(actionRequest, "stagingGroupId"); boolean privateLayout = ParamUtil.getBoolean(actionRequest, "privateLayout"); LayoutSet layoutSet = _layoutSetLocalService.getLayoutSet(layoutSetId); updateLogo(actionRequest, liveGroupId, stagingGroupId, privateLayout); updateLookAndFeel(actionRequest, themeDisplay.getCompanyId(), liveGroupId, stagingGroupId, privateLayout, layoutSet.getSettingsProperties()); updateMergePages(actionRequest, liveGroupId); updateRobots(actionRequest, liveGroupId, privateLayout); updateSettings(actionRequest, liveGroupId, stagingGroupId, privateLayout, layoutSet.getSettingsProperties()); }
From source file:com.liferay.layout.internal.exportimport.data.handler.StagedLayoutSetStagedModelDataHandler.java
License:Open Source License
protected void updateLastMergeTime(PortletDataContext portletDataContext, Set<Layout> modifiedLayouts) throws PortalException { String layoutsImportMode = MapUtil.getString(portletDataContext.getParameterMap(), PortletDataHandlerKeys.LAYOUTS_IMPORT_MODE, PortletDataHandlerKeys.LAYOUTS_IMPORT_MODE_MERGE_BY_LAYOUT_UUID); if (!layoutsImportMode.equals(PortletDataHandlerKeys.LAYOUTS_IMPORT_MODE_CREATED_FROM_PROTOTYPE)) { return;// w w w. j a v a 2 s .c om } // Last merge time is updated only if there aren not any modified // layouts Map<Long, Layout> layouts = (Map<Long, Layout>) portletDataContext .getNewPrimaryKeysMap(Layout.class + ".layout"); long lastMergeTime = System.currentTimeMillis(); for (Layout layout : layouts.values()) { layout = _layoutLocalService.getLayout(layout.getPlid()); if (modifiedLayouts.contains(layout)) { continue; } UnicodeProperties typeSettingsProperties = layout.getTypeSettingsProperties(); typeSettingsProperties.setProperty(Sites.LAST_MERGE_TIME, String.valueOf(lastMergeTime)); _layoutLocalService.updateLayout(layout); } // The layout set may be stale because LayoutUtil#update(layout) // triggers LayoutSetPrototypeLayoutModelListener and that may have // updated this layout set LayoutSet layoutSet = _layoutSetLocalService.getLayoutSet(portletDataContext.getGroupId(), portletDataContext.isPrivateLayout()); UnicodeProperties settingsProperties = layoutSet.getSettingsProperties(); String mergeFailFriendlyURLLayouts = settingsProperties.getProperty(Sites.MERGE_FAIL_FRIENDLY_URL_LAYOUTS); if (Validator.isNull(mergeFailFriendlyURLLayouts)) { settingsProperties.setProperty(Sites.LAST_MERGE_TIME, String.valueOf(lastMergeTime)); _layoutSetLocalService.updateLayoutSet(layoutSet); } }