/** * @deprecated As of Wilberforce (7.0.x), replaced by {@link #toString} */ @Deprecated public String toSortedString() { return toString(); }
protected String getNewTypeSettings( String typeSettings, String oldPropertyId, String newPropertyId) { UnicodeProperties typeSettingsProperties = new UnicodeProperties(true); typeSettingsProperties.fastLoad(typeSettings); String value = typeSettingsProperties.remove(oldPropertyId); if (value != null) { typeSettingsProperties.setProperty(newPropertyId, value); } return typeSettingsProperties.toString(); }
public static void clearLastPublishDate(long groupId, boolean privateLayout) throws PortalException { LayoutSet layoutSet = LayoutSetLocalServiceUtil.getLayoutSet( groupId, privateLayout); UnicodeProperties settingsProperties = layoutSet.getSettingsProperties(); settingsProperties.remove(_LAST_PUBLISH_DATE); LayoutSetLocalServiceUtil.updateSettings( groupId, privateLayout, settingsProperties.toString()); }
public static void updateLastPublishDate( long groupId, boolean privateLayout, DateRange dateRange, Date lastPublishDate) throws PortalException { LayoutSet layoutSet = LayoutSetLocalServiceUtil.getLayoutSet( groupId, privateLayout); Date originalLastPublishDate = getLastPublishDate(layoutSet); if (!isValidDateRange(dateRange, originalLastPublishDate)) { return; } if (lastPublishDate == null) { lastPublishDate = new Date(); } UnicodeProperties settingsProperties = layoutSet.getSettingsProperties(); settingsProperties.setProperty( _LAST_PUBLISH_DATE, String.valueOf(lastPublishDate.getTime())); LayoutSetLocalServiceUtil.updateSettings( layoutSet.getGroupId(), layoutSet.isPrivateLayout(), settingsProperties.toString()); }
return typeSettingsProperties.toString();
private Layout _createAssetDisplayLayout(long groupId) throws PortalException { Group group = _groupLocalService.fetchGroup(groupId); long defaultUserId = _userLocalService.getDefaultUserId( group.getCompanyId()); Locale locale = LocaleUtil.getSiteDefault(); Map<Locale, String> nameMap = new HashMap<>(); nameMap.put(locale, "Asset Display Page"); UnicodeProperties typeSettingsProperties = new UnicodeProperties(); typeSettingsProperties.put("visible", Boolean.FALSE.toString()); ServiceContext serviceContext = ServiceContextThreadLocal.getServiceContext(); serviceContext.setAttribute( "layout.instanceable.allowed", Boolean.TRUE); return _layoutLocalService.addLayout( defaultUserId, groupId, false, 0, nameMap, null, null, null, null, "asset_display", typeSettingsProperties.toString(), true, new HashMap<>(), serviceContext); }
@Override public void deleteLastImportSettings(Group liveGroup, boolean privateLayout) throws PortalException { List<Layout> layouts = _layoutLocalService.getLayouts( liveGroup.getGroupId(), privateLayout); for (Layout layout : layouts) { UnicodeProperties typeSettingsProperties = layout.getTypeSettingsProperties(); Set<String> keys = new HashSet<>(); for (String key : typeSettingsProperties.keySet()) { if (key.startsWith("last-import-")) { keys.add(key); } } if (keys.isEmpty()) { continue; } for (String key : keys) { typeSettingsProperties.remove(key); } _layoutLocalService.updateLayout( layout.getGroupId(), layout.isPrivateLayout(), layout.getLayoutId(), typeSettingsProperties.toString()); } }
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); }
expandoColumn.getTypeSettingsProperties(); typeSettingsElement.addCDATA(typeSettingsProperties.toString());