use of de.ii.xtraplatform.store.domain.entities.ValidationResult.MODE in project ldproxy by interactive-instruments.
the class FeaturesFormatHtml method onStartup.
@Override
public ValidationResult onStartup(OgcApi api, MODE apiValidation) {
// no additional operational checks for now, only validation; we can stop, if no validation is requested
if (apiValidation == MODE.NONE)
return ValidationResult.of();
ImmutableValidationResult.Builder builder = ImmutableValidationResult.builder().mode(apiValidation);
Map<String, FeatureSchema> featureSchemas = providers.getFeatureSchemas(api.getData());
// get HTML configurations to process
Map<String, FeaturesHtmlConfiguration> htmlConfigurationMap = api.getData().getCollections().entrySet().stream().map(entry -> {
final FeatureTypeConfigurationOgcApi collectionData = entry.getValue();
final FeaturesHtmlConfiguration config = collectionData.getExtension(FeaturesHtmlConfiguration.class).orElse(null);
if (Objects.isNull(config))
return null;
return new AbstractMap.SimpleImmutableEntry<>(entry.getKey(), config);
}).filter(Objects::nonNull).collect(ImmutableMap.toImmutableMap(Map.Entry::getKey, Map.Entry::getValue));
Map<String, Collection<String>> keyMap = htmlConfigurationMap.entrySet().stream().map(entry -> new AbstractMap.SimpleImmutableEntry<>(entry.getKey(), entry.getValue().getTransformations().keySet())).collect(ImmutableMap.toImmutableMap(Map.Entry::getKey, Map.Entry::getValue));
for (Map.Entry<String, Collection<String>> stringCollectionEntry : featuresCoreValidator.getInvalidPropertyKeys(keyMap, featureSchemas).entrySet()) {
for (String property : stringCollectionEntry.getValue()) {
builder.addStrictErrors(MessageFormat.format("A transformation for property ''{0}'' in collection ''{1}'' is invalid, because the property was not found in the provider schema.", property, stringCollectionEntry.getKey()));
}
}
Set<String> codelists = entityRegistry.getEntitiesForType(Codelist.class).stream().map(Codelist::getId).collect(Collectors.toUnmodifiableSet());
for (Map.Entry<String, FeaturesHtmlConfiguration> entry : htmlConfigurationMap.entrySet()) {
String collectionId = entry.getKey();
for (Map.Entry<String, List<PropertyTransformation>> entry2 : entry.getValue().getTransformations().entrySet()) {
String property = entry2.getKey();
for (PropertyTransformation transformation : entry2.getValue()) {
builder = transformation.validate(builder, collectionId, property, codelists);
}
}
}
return builder.build();
}
use of de.ii.xtraplatform.store.domain.entities.ValidationResult.MODE in project ldproxy by interactive-instruments.
the class CapabilityCrs method onStartup.
@Override
public ValidationResult onStartup(OgcApi api, MODE apiValidation) {
Optional<CrsConfiguration> crsConfiguration = api.getData().getExtension(CrsConfiguration.class).filter(ExtensionConfiguration::isEnabled);
if (crsConfiguration.isEmpty()) {
return ValidationResult.of();
}
EpsgCrs defaultCrs = api.getData().getExtension(FeaturesCoreConfiguration.class).map(FeaturesCoreConfiguration::getDefaultEpsgCrs).orElse(OgcCrs.CRS84);
EpsgCrs providerCrs = featuresCoreProviders.getFeatureProvider(api.getData()).flatMap(featureProvider2 -> featureProvider2.getData().getNativeCrs()).orElse(OgcCrs.CRS84);
EpsgCrs lastCrs = null;
try {
lastCrs = defaultCrs;
crsTransformerFactory.getTransformer(providerCrs, defaultCrs);
for (EpsgCrs crs : crsConfiguration.get().getAdditionalCrs()) {
lastCrs = crs;
crsTransformerFactory.getTransformer(providerCrs, crs);
}
} catch (Throwable e) {
return ImmutableValidationResult.builder().mode(apiValidation).addErrors(String.format("Could not find transformation for %s -> %s: %s", providerCrs.toHumanReadableString(), lastCrs.toHumanReadableString(), e.getMessage())).build();
}
try {
lastCrs = defaultCrs;
crsTransformerFactory.getTransformer(defaultCrs, providerCrs);
for (EpsgCrs crs : crsConfiguration.get().getAdditionalCrs()) {
lastCrs = crs;
crsTransformerFactory.getTransformer(crs, providerCrs);
}
} catch (Throwable e) {
return ImmutableValidationResult.builder().mode(apiValidation).addErrors(String.format("Could not find transformation for %s -> %s: %s", lastCrs.toHumanReadableString(), providerCrs.toHumanReadableString(), e.getMessage())).build();
}
return ValidationResult.of();
}
use of de.ii.xtraplatform.store.domain.entities.ValidationResult.MODE in project ldproxy by interactive-instruments.
the class CapabilityTiles method onStartup.
@Override
public ValidationResult onStartup(OgcApi api, MODE apiValidation) {
// since building block / capability components are currently always enabled,
// we need to test, if the TILES module is enabled for the API and stop, if not
OgcApiDataV2 apiData = api.getData();
if (!apiData.getExtension(TilesConfiguration.class).map(ExtensionConfiguration::isEnabled).orElse(false)) {
return ValidationResult.of();
}
try {
SQLiteJDBCLoader.initialize();
} catch (Exception e) {
return ImmutableValidationResult.builder().mode(apiValidation).addStrictErrors(MessageFormat.format("Could not load SQLite: {}", e.getMessage())).build();
}
if (apiValidation == MODE.NONE) {
return ValidationResult.of();
}
ImmutableValidationResult.Builder builder = ImmutableValidationResult.builder().mode(apiValidation);
for (Map.Entry<String, TilesConfiguration> entry : apiData.getCollections().entrySet().stream().filter(entry -> entry.getValue().getEnabled() && entry.getValue().getExtension(TilesConfiguration.class).isPresent()).map(entry -> new AbstractMap.SimpleImmutableEntry<>(entry.getKey(), entry.getValue().getExtension(TilesConfiguration.class).get())).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)).entrySet()) {
String collectionId = entry.getKey();
TilesConfiguration config = entry.getValue();
Optional<FeatureSchema> schema = providers.getFeatureSchema(apiData, apiData.getCollections().get(collectionId));
List<String> featureProperties = schema.isPresent() ? schemaInfo.getPropertyNames(schema.get(), false, false) : ImmutableList.of();
List<String> formatLabels = extensionRegistry.getExtensionsForType(TileFormatExtension.class).stream().filter(formatExtension -> formatExtension.isEnabledForApi(apiData)).map(format -> format.getMediaType().label()).collect(Collectors.toUnmodifiableList());
List<String> tileEncodings = config.getTileEncodingsDerived();
if (Objects.isNull(tileEncodings)) {
builder.addStrictErrors(MessageFormat.format("No tile encoding has been specified in the TILES module configuration of collection ''{0}''.", collectionId));
} else {
for (String encoding : config.getTileEncodingsDerived()) {
if (!formatLabels.contains(encoding)) {
builder.addStrictErrors(MessageFormat.format("The tile encoding ''{0}'' is specified in the TILES module configuration of collection ''{1}'', but the format does not exist.", encoding, collectionId));
}
}
}
formatLabels = extensionRegistry.getExtensionsForType(TileSetFormatExtension.class).stream().filter(formatExtension -> formatExtension.isEnabledForApi(apiData)).map(format -> format.getMediaType().label()).collect(Collectors.toUnmodifiableList());
for (String encoding : config.getTileSetEncodings()) {
if (!formatLabels.contains(encoding)) {
builder.addStrictErrors(MessageFormat.format("The tile set encoding ''{0}'' is specified in the TILES module configuration of collection ''{1}'', but the format does not exist.", encoding, collectionId));
}
}
List<Double> center = config.getCenterDerived();
if (center.size() != 0 && center.size() != 2)
builder.addStrictErrors(MessageFormat.format("The center has been specified in the TILES module configuration of collection ''{1}'', but the array length is ''{0}'', not 2.", center.size(), collectionId));
Map<String, MinMax> zoomLevels = config.getZoomLevelsDerived();
for (Map.Entry<String, MinMax> entry2 : zoomLevels.entrySet()) {
String tileMatrixSetId = entry2.getKey();
Optional<TileMatrixSet> tileMatrixSet = tileMatrixSetRepository.get(tileMatrixSetId).filter(tms -> config.getTileMatrixSets().contains(tms.getId()));
if (tileMatrixSet.isEmpty()) {
builder.addStrictErrors(MessageFormat.format("The configuration in the TILES module of collection ''{0}'' references a tile matrix set ''{1}'' that is not available in this API.", collectionId, tileMatrixSetId));
} else {
if (tileMatrixSet.get().getMinLevel() > entry2.getValue().getMin()) {
builder.addStrictErrors(MessageFormat.format("The configuration in the TILES module of collection ''{0}'' for tile matrix set ''{1}'' is specified to start at level ''{2}'', but the minimum level of the tile matrix set is ''{3}''.", collectionId, tileMatrixSetId, entry2.getValue().getMin(), tileMatrixSet.get().getMinLevel()));
}
if (tileMatrixSet.get().getMaxLevel() < entry2.getValue().getMax()) {
builder.addStrictErrors(MessageFormat.format("The configuration in the TILES module of collection ''{0}'' for tile matrix set ''{1}'' is specified to end at level ''{2}'', but the maximum level of the tile matrix set is ''{3}''.", collectionId, tileMatrixSetId, entry2.getValue().getMax(), tileMatrixSet.get().getMaxLevel()));
}
if (entry2.getValue().getDefault().isPresent()) {
Integer defaultLevel = entry2.getValue().getDefault().get();
if (defaultLevel < entry2.getValue().getMin() || defaultLevel > entry2.getValue().getMax()) {
builder.addStrictErrors(MessageFormat.format("The configuration in the TILES module of collection ''{0}'' for tile matrix set ''{1}'' specifies a default level ''{2}'' that is outside of the range [ ''{3}'' : ''{4}'' ].", tileMatrixSetId, defaultLevel, entry2.getValue().getMin(), entry2.getValue().getMax()));
}
}
}
}
if (config.getTileProvider() instanceof TileProviderFeatures) {
Map<String, MinMax> zoomLevelsCache = config.getZoomLevelsCacheDerived();
if (Objects.nonNull(zoomLevelsCache)) {
for (Map.Entry<String, MinMax> entry2 : zoomLevelsCache.entrySet()) {
String tileMatrixSetId = entry2.getKey();
MinMax zoomLevelsTms = getZoomLevels(apiData, tileMatrixSetId);
if (Objects.isNull(zoomLevelsTms)) {
builder.addStrictErrors(MessageFormat.format("The cache in the TILES module of collection ''{0}'' references a tile matrix set ''{1}'' that is not configured for this API.", collectionId, tileMatrixSetId));
} else {
if (zoomLevelsTms.getMin() > entry2.getValue().getMin()) {
builder.addStrictErrors(MessageFormat.format("The cache in the TILES module of collection ''{0}'' for tile matrix set ''{1}'' is specified to start at level ''{2}'', but the minimum level is ''{3}''.", collectionId, tileMatrixSetId, entry2.getValue().getMin(), zoomLevelsTms.getMin()));
}
if (zoomLevelsTms.getMax() < entry2.getValue().getMax()) {
builder.addStrictErrors(MessageFormat.format("The cache in the TILES module of collection ''{0}'' for tile matrix set ''{1}'' is specified to end at level ''{2}'', but the maximum level is ''{3}''.", collectionId, tileMatrixSetId, entry2.getValue().getMax(), zoomLevelsTms.getMax()));
}
}
}
}
Map<String, MinMax> seeding = config.getSeedingDerived();
if (Objects.nonNull(seeding)) {
for (Map.Entry<String, MinMax> entry2 : seeding.entrySet()) {
String tileMatrixSetId = entry2.getKey();
MinMax zoomLevelsTms = getZoomLevels(apiData, tileMatrixSetId);
if (Objects.isNull(zoomLevelsTms)) {
builder.addStrictErrors(MessageFormat.format("The seeding in the TILES module of collection ''{0}'' references a tile matrix set ''{1}'' that is not configured for this API.", collectionId, tileMatrixSetId));
} else {
if (zoomLevelsTms.getMin() > entry2.getValue().getMin()) {
builder.addStrictErrors(MessageFormat.format("The seeding in the TILES module of collection ''{0}'' for tile matrix set ''{1}'' is specified to start at level ''{2}'', but the minimum level is ''{3}''.", collectionId, tileMatrixSetId, entry2.getValue().getMin(), zoomLevelsTms.getMin()));
}
if (zoomLevelsTms.getMax() < entry2.getValue().getMax()) {
builder.addStrictErrors(MessageFormat.format("The seeding in the TILES module of collection ''{0}'' for tile matrix set ''{1}'' is specified to end at level ''{2}'', but the maximum level is ''{3}''.", collectionId, tileMatrixSetId, entry2.getValue().getMax(), zoomLevelsTms.getMax()));
}
}
}
}
final Integer limit = Objects.requireNonNullElse(config.getLimitDerived(), 0);
if (limit < 1) {
builder.addStrictErrors(MessageFormat.format("The feature limit in the TILES module must be a positive integer. Found in collection ''{1}'': {0}.", limit, collectionId));
}
final Map<String, List<PredefinedFilter>> filters = config.getFiltersDerived();
if (Objects.nonNull(filters)) {
for (Map.Entry<String, List<PredefinedFilter>> entry2 : filters.entrySet()) {
String tileMatrixSetId = entry2.getKey();
MinMax zoomLevelsCfg = getZoomLevels(apiData, config, tileMatrixSetId);
if (Objects.isNull(zoomLevelsCfg)) {
builder.addStrictErrors(MessageFormat.format("The filters in the TILES module of collection ''{0}'' references a tile matrix set ''{0}'' that is not configured for this API.", collectionId, tileMatrixSetId));
} else {
for (PredefinedFilter filter : entry2.getValue()) {
if (zoomLevelsCfg.getMin() > filter.getMin()) {
builder.addStrictErrors(MessageFormat.format("A filter in the TILES module of collection ''{0}'' for tile matrix set ''{1}'' is specified to start at level ''{2}'', but the minimum level is ''{3}''.", collectionId, tileMatrixSetId, filter.getMin(), zoomLevelsCfg.getMin()));
}
if (zoomLevelsCfg.getMax() < filter.getMax()) {
builder.addStrictErrors(MessageFormat.format("A filter in the TILES module of collection ''{0}'' for tile matrix set ''{1}'' is specified to end at level ''{2}'', but the maximum level is ''{3}''.", collectionId, tileMatrixSetId, filter.getMax(), zoomLevelsCfg.getMax()));
}
if (filter.getFilter().isPresent()) {
// try to convert the filter to CQL2-text
String expression = filter.getFilter().get();
FeatureTypeConfigurationOgcApi collectionData = apiData.getCollections().get(collectionId);
final Map<String, String> filterableFields = queryParser.getFilterableFields(apiData, collectionData);
final Map<String, String> queryableTypes = queryParser.getQueryableTypes(apiData, collectionData);
try {
queryParser.getFilterFromQuery(ImmutableMap.of("filter", expression), filterableFields, ImmutableSet.of("filter"), queryableTypes, Cql.Format.TEXT);
} catch (Exception e) {
builder.addErrors(MessageFormat.format("A filter ''{0}'' in the TILES module of collection ''{1}'' for tile matrix set ''{2}'' is invalid. Reason: {3}", expression, collectionId, tileMatrixSetId, e.getMessage()));
}
}
}
}
}
}
final Map<String, List<Rule>> rules = config.getRulesDerived();
if (Objects.nonNull(rules)) {
for (Map.Entry<String, List<Rule>> entry2 : rules.entrySet()) {
String tileMatrixSetId = entry2.getKey();
MinMax zoomLevelsCfg = getZoomLevels(apiData, config, tileMatrixSetId);
if (Objects.isNull(zoomLevelsCfg)) {
builder.addStrictErrors(MessageFormat.format("The rules in the TILES module of collection ''{0}'' references a tile matrix set ''{0}'' that is not configured for this API.", collectionId, tileMatrixSetId));
} else {
for (Rule rule : entry2.getValue()) {
if (zoomLevelsCfg.getMin() > rule.getMin()) {
builder.addStrictErrors(MessageFormat.format("A rule in the TILES module of collection ''{0}'' for tile matrix set ''{1}'' is specified to start at level ''{2}'', but the minimum level is ''{3}''.", collectionId, tileMatrixSetId, rule.getMin(), zoomLevelsCfg.getMin()));
}
if (zoomLevelsCfg.getMax() < rule.getMax()) {
builder.addStrictErrors(MessageFormat.format("A rule in the TILES module of collection ''{0}'' for tile matrix set ''{1}'' is specified to end at level ''{2}'', but the maximum level is ''{3}''.", collectionId, tileMatrixSetId, rule.getMax(), zoomLevelsCfg.getMax()));
}
for (String property : rule.getProperties()) {
if (!featureProperties.contains(property)) {
builder.addErrors(MessageFormat.format("A rule in the TILES module of collection ''{0}'' for tile matrix set ''{1}'' references property ''{2}'' that is not part of the feature schema.", collectionId, tileMatrixSetId, property));
}
}
for (String property : rule.getGroupBy()) {
if (!featureProperties.contains(property)) {
builder.addErrors(MessageFormat.format("A rule in the TILES module of collection ''{0}'' for tile matrix set ''{1}'' references group-by property ''{2}'' that is not part of the feature schema.", collectionId, tileMatrixSetId, property));
}
}
}
}
}
}
}
}
return builder.build();
}
use of de.ii.xtraplatform.store.domain.entities.ValidationResult.MODE in project ldproxy by interactive-instruments.
the class EndpointRoutesPost method computeDefinition.
@Override
protected ApiEndpointDefinition computeDefinition(OgcApiDataV2 apiData) {
Optional<RoutingConfiguration> config = apiData.getExtension(RoutingConfiguration.class);
Optional<RoutesConfiguration> routesConfig = providers.getFeatureProviderOrThrow(apiData).getData().getExtension(RoutesConfiguration.class);
ImmutableApiEndpointDefinition.Builder definitionBuilder = new ImmutableApiEndpointDefinition.Builder().apiEntrypoint("routes").sortPriority(ApiEndpointDefinition.SORT_PRIORITY_ROUTES_POST);
String path = "/routes";
HttpMethods method = HttpMethods.POST;
List<OgcApiQueryParameter> queryParameters = getQueryParameters(extensionRegistry, apiData, path, method);
List<ApiHeader> headers = getHeaders(extensionRegistry, apiData, path, method);
String operationSummary = "compute a route";
String description = String.format("This creates a new route. The payload of the request specifies the definition of the new route.\n\n" + (config.map(RoutingConfiguration::supportsIntermediateWaypoints).orElse(false) ? "A route is defined by two or more `waypoints`, which will be visited in the order in which they are provided. " : "A route is defined by two `waypoints`, the start and end location of the route. ") + "If the coordinates are in a coordinate reference system that is not WGS 84 longitude/latitude, " + "the URI of the coordinate reference system must be provided in a member `coordRefSys` in the waypoints object.\n\n" + "A preference how the route should be optimized can be specified (`preference`). The default value is `%s`. Valid values are:\n\n" + String.join("", routesConfig.map(RoutesConfiguration::getPreferences).map(Map::entrySet).orElseThrow().stream().map(entry -> String.format("* `%s`: %s\n", entry.getKey(), entry.getValue().getLabel())).collect(Collectors.toUnmodifiableList())) + "\n" + "The mode of transportation can be specified (`mode`). The default value is `%s`. Valid values are:\n\n" + String.join("", routesConfig.map(RoutesConfiguration::getModes).map(Map::entrySet).orElseThrow().stream().map(entry -> String.format("* `%s`: %s\n", entry.getKey(), entry.getValue())).collect(Collectors.toUnmodifiableList())) + "\n" + "In addition, some flags can be provided in `additionalFlags` to alter the computation of the route:\n\n" + String.join("", config.map(RoutingConfiguration::getAdditionalFlags).map(Map::entrySet).orElseThrow().stream().map(entry -> String.format("* `%s`: %s\n", entry.getKey(), entry.getValue().getLabel())).collect(Collectors.toUnmodifiableList())) + "\n" + "An optional `name` for the route may be provided.\n\n" + (config.map(RoutingConfiguration::supportsHeightRestrictions).orElse(false) ? "An optional vehicle height in meter may be provided (`height_m`).\n\n" : "") + (config.map(RoutingConfiguration::supportsWeightRestrictions).orElse(false) ? "An optional vehicle weight in metric tons may be provided (`weight_t`).\n\n" : "") + (config.map(RoutingConfiguration::supportsObstacles).orElse(false) ? "An optional multi-polygon geometry of areas that should be avoided may be provided (`obstacles`).\n\n" : ""), config.map(RoutingConfiguration::getDefaultPreference).orElseThrow(), config.map(RoutingConfiguration::getDefaultMode).orElseThrow());
Optional<String> operationDescription = Optional.of(description);
ImmutableOgcApiResourceData.Builder resourceBuilder = new ImmutableOgcApiResourceData.Builder().path(path);
Map<MediaType, ApiMediaTypeContent> requestContent = getRequestContent(config);
Map<MediaType, ApiMediaTypeContent> responseContent = getContent(apiData, "/routes", method);
ApiOperation operation = addOperation(apiData, method, OPERATION_TYPE.PROCESS, requestContent, responseContent, queryParameters, headers, path, operationSummary, operationDescription, Optional.empty(), TAGS);
if (operation != null)
resourceBuilder.putOperations(method.toString(), operation);
definitionBuilder.putResources(path, resourceBuilder.build());
return definitionBuilder.build();
}
use of de.ii.xtraplatform.store.domain.entities.ValidationResult.MODE in project ldproxy by interactive-instruments.
the class FeaturesFormatGeoJson method onStartup.
@Override
public ValidationResult onStartup(OgcApi api, MODE apiValidation) {
// no additional operational checks for now, only validation; we can stop, if no validation is requested
if (apiValidation == MODE.NONE)
return ValidationResult.of();
ImmutableValidationResult.Builder builder = ImmutableValidationResult.builder().mode(apiValidation);
Map<String, FeatureSchema> featureSchemas = providers.getFeatureSchemas(api.getData());
// get GeoJSON configurations to process
Map<String, GeoJsonConfiguration> geoJsonConfigurationMap = api.getData().getCollections().entrySet().stream().map(entry -> {
final FeatureTypeConfigurationOgcApi collectionData = entry.getValue();
final GeoJsonConfiguration config = collectionData.getExtension(GeoJsonConfiguration.class).orElse(null);
if (Objects.isNull(config))
return null;
return new AbstractMap.SimpleImmutableEntry<>(entry.getKey(), config);
}).filter(Objects::nonNull).collect(ImmutableMap.toImmutableMap(Map.Entry::getKey, Map.Entry::getValue));
for (Map.Entry<String, GeoJsonConfiguration> entry : geoJsonConfigurationMap.entrySet()) {
String collectionId = entry.getKey();
GeoJsonConfiguration config = entry.getValue();
if (config.getNestedObjectStrategy() == GeoJsonConfiguration.NESTED_OBJECTS.FLATTEN && config.getMultiplicityStrategy() != GeoJsonConfiguration.MULTIPLICITY.SUFFIX) {
builder.addStrictErrors(MessageFormat.format("The GeoJSON Nested Object Strategy ''FLATTEN'' in collection ''{0}'' cannot be combined with the Multiplicity Strategy ''{1}''.", collectionId, config.getMultiplicityStrategy()));
} else if (config.getNestedObjectStrategy() == GeoJsonConfiguration.NESTED_OBJECTS.NEST && config.getMultiplicityStrategy() != GeoJsonConfiguration.MULTIPLICITY.ARRAY) {
builder.addStrictErrors(MessageFormat.format("The GeoJSON Nested Object Strategy ''FLATTEN'' in collection ''{0}'' cannot be combined with the Multiplicity Strategy ''{1}''.", collectionId, config.getMultiplicityStrategy()));
}
List<String> separators = ImmutableList.of(".", "_", ":", "/");
if (!separators.contains(config.getSeparator())) {
builder.addStrictErrors(MessageFormat.format("The separator ''{0}'' in collection ''{1}'' is invalid, it must be one of {2}.", config.getSeparator(), collectionId, separators));
}
}
Map<String, Collection<String>> keyMap = geoJsonConfigurationMap.entrySet().stream().map(entry -> new AbstractMap.SimpleImmutableEntry<>(entry.getKey(), entry.getValue().getTransformations().keySet())).collect(ImmutableMap.toImmutableMap(Map.Entry::getKey, Map.Entry::getValue));
for (Map.Entry<String, Collection<String>> stringCollectionEntry : featuresCoreValidator.getInvalidPropertyKeys(keyMap, featureSchemas).entrySet()) {
for (String property : stringCollectionEntry.getValue()) {
builder.addStrictErrors(MessageFormat.format("A transformation for property ''{0}'' in collection ''{1}'' is invalid, because the property was not found in the provider schema.", property, stringCollectionEntry.getKey()));
}
}
Set<String> codelists = entityRegistry.getEntitiesForType(Codelist.class).stream().map(Codelist::getId).collect(Collectors.toUnmodifiableSet());
for (Map.Entry<String, GeoJsonConfiguration> entry : geoJsonConfigurationMap.entrySet()) {
String collectionId = entry.getKey();
for (Map.Entry<String, List<PropertyTransformation>> entry2 : entry.getValue().getTransformations().entrySet()) {
String property = entry2.getKey();
for (PropertyTransformation transformation : entry2.getValue()) {
builder = transformation.validate(builder, collectionId, property, codelists);
}
}
}
return builder.build();
}
Aggregations