public static UnicodeProperties getProperties( HttpServletRequest request, String prefix) { UnicodeProperties properties = new UnicodeProperties(true); Map<String, String[]> parameterMap = request.getParameterMap(); for (String param : parameterMap.keySet()) { if (param.startsWith(prefix)) { String key = param.substring( prefix.length(), param.length() - 2); String value = request.getParameter(param); properties.setProperty(key, value); } } return properties; }
/** * @deprecated As of Judson (7.1.x) */ @Deprecated protected String getNewTypeSettings( String typeSettings, String oldRootPortletId, String newRootPortletId, List<String> columnIds, boolean exactMatch) { UnicodeProperties typeSettingsProperties = new UnicodeProperties(true); typeSettingsProperties.fastLoad(typeSettings); return getNewTypeSettings( typeSettings, oldRootPortletId, newRootPortletId, exactMatch); }
public static UnicodeProperties getProperties( ServiceContext serviceContext, String prefix) { UnicodeProperties properties = new UnicodeProperties(true); Map<String, Serializable> attributes = serviceContext.getAttributes(); for (String param : attributes.keySet()) { if (param.startsWith(prefix)) { String key = param.substring( prefix.length(), param.length() - 2); String value = ParamUtil.getString(serviceContext, param); properties.setProperty(key, value); } } return properties; }
public static UnicodeProperties getProperties( PortletRequest portletRequest, String prefix) { UnicodeProperties properties = new UnicodeProperties(true); Map<String, String[]> parameterMap = portletRequest.getParameterMap(); for (String param : parameterMap.keySet()) { if (param.startsWith(prefix)) { String key = param.substring( prefix.length(), param.length() - 2); String[] values = portletRequest.getParameterValues(param); String value = StringUtil.merge(values); properties.setProperty(key, value); } } return properties; }
protected Date getLayoutSetLastPublishDate(long groupId) throws Exception { try (PreparedStatement ps = connection.prepareStatement( "select settings_ from LayoutSet where groupId = ?")) { ps.setLong(1, groupId); try (ResultSet rs = ps.executeQuery()) { while (rs.next()) { UnicodeProperties settingsProperties = new UnicodeProperties(true); settingsProperties.load(rs.getString("settings_")); String lastPublishDateString = settingsProperties.getProperty("last-publish-date"); if (Validator.isNotNull(lastPublishDateString)) { return new Date( GetterUtil.getLong(lastPublishDateString)); } } return null; } } }
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(); }
properties = new UnicodeProperties();
boolean exactMatch) { UnicodeProperties typeSettingsProperties = new UnicodeProperties(true);
private static LocalRepository _addPortletRepository( long groupId, ServiceContext serviceContext) throws PortalException { Repository repository = RepositoryLocalServiceUtil.fetchRepository( groupId, TempFileEntryUtil.class.getName(), StringPool.BLANK); if (repository != null) { return RepositoryProviderUtil.getLocalRepository( repository.getRepositoryId()); } Group group = GroupLocalServiceUtil.getGroup(groupId); User user = UserLocalServiceUtil.getDefaultUser(group.getCompanyId()); long classNameId = PortalUtil.getClassNameId( "com.liferay.portal.repository.temporaryrepository." + "TemporaryFileEntryRepository"); UnicodeProperties typeSettingsProperties = new UnicodeProperties(); boolean dlAppHelperEnabled = DLAppHelperThreadLocal.isEnabled(); try { DLAppHelperThreadLocal.setEnabled(false); repository = RepositoryLocalServiceUtil.addRepository( user.getUserId(), groupId, classNameId, DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, TempFileEntryUtil.class.getName(), StringPool.BLANK, StringPool.BLANK, typeSettingsProperties, true, serviceContext); return RepositoryProviderUtil.getLocalRepository( repository.getRepositoryId()); } finally { DLAppHelperThreadLocal.setEnabled(dlAppHelperEnabled); } }
public static UnicodeProperties getProperties( PortletRequest portletRequest, String prefix) { UnicodeProperties properties = new UnicodeProperties(true); for (String param : portletRequest.getParameterMap().keySet()) { if (param.startsWith(prefix) && !param.endsWith(")Checkbox")) { String key = param.substring( prefix.length(), param.length() - 1); String value = portletRequest.getParameter(param); properties.setProperty(key, value); } } return properties; }
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); }
article.getResourcePrimKey()); UnicodeProperties typeSettingsProperties = new UnicodeProperties();
UnicodeProperties typeSettingsProperties = new UnicodeProperties();