From 64f506515b93a273432067eb2b9f7b3a33aa1e55 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Carretero?=
 <frederic.carretero@veremes.com>
Date: Thu, 22 Nov 2018 11:01:24 +0100
Subject: [PATCH] =?UTF-8?q?T=C3=A9l=C3=A9chargement=20du=20fichier=20fmw?=
 =?UTF-8?q?=20d'un=20projet=20FME=20sur=20S3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 web_service/ws/Workspace.class.inc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/web_service/ws/Workspace.class.inc b/web_service/ws/Workspace.class.inc
index 267f7b48..d85b36b4 100755
--- a/web_service/ws/Workspace.class.inc
+++ b/web_service/ws/Workspace.class.inc
@@ -229,8 +229,11 @@ class Workspace extends GTF {
             $this->aFields = $this->getFields($this->aProperties['schema_gtf'], "v_workspace", "workspace_id");
             $this->getGroups();
             // Url vers le fichier fmw du projet.
-            if (!empty($this->aFields['fmw_file']))
-                $this->aFields['fmw_file_url'] = $this->aProperties['web_server_name'] . '/' . $this->aProperties['ws_data_alias'] . '/gtf/workspace/' . $this->aValues['my_vitis_id'] . '/fme/' . $this->aFields['fmw_file'];
+            if (!empty($this->aFields['fmw_file'])) {
+                $sFmwFileUrl = getFileUrlInWsDataDir('gtf', 'workspace', $this->aValues['my_vitis_id'], 'fme', $this->aFields['fmw_file']);
+                if ($sFmwFileUrl !== false)
+                    $this->aFields['fmw_file_url'] = $sFmwFileUrl;
+            }
         }
         // Formatage de la colonne "form_type".
         $sFile = $this->aProperties['workspace_dir'] . "/" . $this->aValues["my_vitis_id"] . '/form/Subform.json';
-- 
GitLab