@@ -60,11 +60,11 @@ public class Setting { | |||
this.isDefault = true; | |||
} | |||
public static Setting createForDto(PropertyDto propertyDto, List<PropertyDto> propertyDtoSetValues, @Nullable PropertyDefinition definition){ | |||
public static Setting createFromDto(PropertyDto propertyDto, List<PropertyDto> propertyDtoSetValues, @Nullable PropertyDefinition definition){ | |||
return new Setting(propertyDto, propertyDtoSetValues, definition); | |||
} | |||
public static Setting createForDefinition(PropertyDefinition definition){ | |||
public static Setting createFromDefinition(PropertyDefinition definition){ | |||
return new Setting(definition); | |||
} | |||
@@ -55,7 +55,7 @@ public class SettingsFinder { | |||
List<PropertyDto> properties = dbClient.propertiesDao().selectGlobalPropertiesByKeys(dbSession, keys); | |||
List<PropertyDto> propertySets = dbClient.propertiesDao().selectGlobalPropertiesByKeys(dbSession, getPropertySetKeys(properties)); | |||
return properties.stream() | |||
.map(property -> Setting.createForDto(property, getPropertySets(property.getKey(), propertySets, null), definitions.get(property.getKey()))) | |||
.map(property -> Setting.createFromDto(property, getPropertySets(property.getKey(), propertySets, null), definitions.get(property.getKey()))) | |||
.collect(Collectors.toList()); | |||
} | |||
@@ -76,7 +76,7 @@ public class SettingsFinder { | |||
String componentUuid = uuidsById.get(componentId); | |||
String propertyKey = propertyDto.getKey(); | |||
settingsByUuid.put(componentUuid, | |||
Setting.createForDto(propertyDto, getPropertySets(propertyKey, propertySets, componentId), definitions.get(propertyKey))); | |||
Setting.createFromDto(propertyDto, getPropertySets(propertyKey, propertySets, componentId), definitions.get(propertyKey))); | |||
} | |||
return settingsByUuid; | |||
} |
@@ -111,7 +111,8 @@ public class ValuesAction implements SettingsWsAction { | |||
checkAdminPermission(component); | |||
Set<String> keys = new HashSet<>(valuesRequest.getKeys()); | |||
Map<String, String> keysToDisplayMap = getKeysToDisplayMap(keys); | |||
return new ValuesResponseBuilder(loadSettings(dbSession, component, keysToDisplayMap.keySet()), component, keysToDisplayMap).build(); | |||
List<Setting> settings = loadSettings(dbSession, component, keysToDisplayMap.keySet()); | |||
return new ValuesResponseBuilder(settings, component, keysToDisplayMap).build(); | |||
} finally { | |||
dbClient.closeSession(dbSession); | |||
} | |||
@@ -157,7 +158,7 @@ public class ValuesAction implements SettingsWsAction { | |||
return propertyDefinitions.getAll().stream() | |||
.filter(definition -> keys.contains(definition.key())) | |||
.filter(defaultProperty -> !isEmpty(defaultProperty.defaultValue())) | |||
.map(Setting::createForDefinition) | |||
.map(Setting::createFromDefinition) | |||
.collect(Collectors.toList()); | |||
} | |||
@@ -130,6 +130,7 @@ | |||
and p.resource_id=#{componentId} | |||
</if> | |||
and p.user_id is null | |||
order by p.id | |||
</select> | |||
<select id="selectByKeysAndComponentIds" parameterType="map" resultType="ScrapProperty"> |