From b0f5b3750f4654e7bab1232e8b2b1b49aabf287f Mon Sep 17 00:00:00 2001 From: Orka Arnest CRUZE Date: Thu, 27 Jun 2024 16:41:45 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20racine=20du=20endpoint=20dans=20la=20m?= =?UTF-8?q?=C3=A9tadonn=C3=A9e=20#452?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EntrepotApi/CartesMetadataApiService.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Services/EntrepotApi/CartesMetadataApiService.php b/src/Services/EntrepotApi/CartesMetadataApiService.php index 0a614aa2..bb777ca9 100644 --- a/src/Services/EntrepotApi/CartesMetadataApiService.php +++ b/src/Services/EntrepotApi/CartesMetadataApiService.php @@ -11,7 +11,6 @@ use App\Entity\CswMetadata\CswStyleFile; use App\Exception\AppException; use App\Exception\CartesApiException; -use App\Services\CapabilitiesService; use App\Services\CswMetadataHelper; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\HttpFoundation\Response; @@ -31,7 +30,6 @@ public function __construct( private MetadataApiService $metadataApiService, private ConfigurationApiService $configurationApiService, private CswMetadataHelper $cswMetadataHelper, - private CapabilitiesService $capabilitiesService, private CartesServiceApiService $cartesServiceApiService, ) { } @@ -264,7 +262,8 @@ private function getMetadataLayers(string $datastoreId, string $datasheetName): switch ($configuration['type']) { case ConfigurationTypes::WFS: - $subLayers = $this->getWfsSubLayers($configuration, $offering, $serviceEndpoint['endpoint']['urls'][0]['url']); + $endpointUrl = $serviceEndpoint['endpoint']['urls'][0]['url']; + $subLayers = $this->getWfsSubLayers($configuration, $offering, $endpointUrl); $layers = array_merge($layers, $subLayers); break; @@ -272,9 +271,9 @@ private function getMetadataLayers(string $datastoreId, string $datasheetName): case ConfigurationTypes::WMSVECTOR: $layerName = $offering['layer_name']; $endpointType = 'OGC:WMS'; - $getCapUrl = $this->capabilitiesService->getGetCapUrl($serviceEndpoint['endpoint']['urls'][0]['url'], $offering['urls'][0]['url'], 'WMS'); + $endpointUrl = $serviceEndpoint['endpoint']['urls'][0]['url']; - $layers[] = new CswMetadataLayer($layerName, $endpointType, $getCapUrl, $offering['_id']); + $layers[] = new CswMetadataLayer($layerName, $endpointType, $endpointUrl, $offering['_id']); break; case ConfigurationTypes::WMTSTMS: @@ -309,9 +308,8 @@ private function getWfsSubLayers(array $configuration, array $offering, string $ $relationLayers = array_map(function ($relation) use ($offering, $serviceEndpointUrl) { $layerName = sprintf('%s:%s', $offering['layer_name'], $relation['native_name']); $endpointType = 'OGC:WFS'; - $getCapUrl = $this->capabilitiesService->getGetCapUrl($serviceEndpointUrl, $offering['urls'][0]['url'], 'WFS'); - return new CswMetadataLayer($layerName, $endpointType, $getCapUrl, $offering['_id']); + return new CswMetadataLayer($layerName, $endpointType, $serviceEndpointUrl, $offering['_id']); }, $configRelations); return $relationLayers;