diff --git a/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php b/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php index c401697..2dffe00 100644 --- a/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php +++ b/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php @@ -578,7 +578,14 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass //Param if (!$isTTCat) { - $paramInfo = $this->paramManager->addExistingParam($paramData->{'paramid'}, $this->paramsData, isset($paramData->{'template_args'}) ? $paramData->{'template_args'} : NULL); + $template_args = isset($paramData->{'template_args'}) ? $paramData->{'template_args'} : NULL; + if (isset($paramData->{'snapshots'})) { + // ANR TEMPETE - Inject snapshots in template_args + if (!isset($paramData->{'template_args'})) + $template_args = (Object)array(); + $template_args->{'snapshots'} = $paramData->{'snapshots'}; + } + $paramInfo = $this->paramManager->addExistingParam($paramData->{'paramid'}, $this->paramsData, $template_args); } else { $paramInfo = $this->paramManager->addTTCatParam($paramData->{'paramid'}, $this->paramsData); } diff --git a/src/InputOutput/IHMImpl/Tools/IHMImpexParamClass.php b/src/InputOutput/IHMImpl/Tools/IHMImpexParamClass.php index 604bdf8..d8aee92 100644 --- a/src/InputOutput/IHMImpl/Tools/IHMImpexParamClass.php +++ b/src/InputOutput/IHMImpl/Tools/IHMImpexParamClass.php @@ -25,7 +25,7 @@ class IHMImpexParamClass extends IHMParamTemplateClass if (!file_exists($this->filePath)) throw new Exception("no RemoteParams File ".$this->filePath); - $this->dom->load($this->filePath); + @$this->dom->load($this->filePath); } @@ -139,13 +139,19 @@ class IHMImpexParamClass extends IHMParamTemplateClass * */ public function getImpexFullParamId($param_id, $templateArgs = NULL) { - + if (!$templateArgs) return $param_id; $fullParamId = $param_id; - foreach ($templateArgs as $key => $value) - $fullParamId .= "_".$value; + foreach ($templateArgs as $key => $value) { + if ($key == 'snapshots') { + $fullParamId .= "_".md5(serialize($value)); + } + else { + $fullParamId .= "_".$value; + } + } return $fullParamId; } @@ -313,4 +319,4 @@ class IHMImpexParamClass extends IHMParamTemplateClass return $paramNode->getAttribute('units'); } -} \ No newline at end of file +} diff --git a/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php b/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php index 9c428f0..b0e46df 100644 --- a/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php +++ b/src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php @@ -324,7 +324,7 @@ class IHMParamManagerClass { if (!isset($this->paramImpexMgr)) $this->paramImpexMgr = new ImpexParamManager(); - + $parameterID = $this->paramImpexMgr->getImpexFullParamId($param, $templateArgs); $requestNodes = $paramsData->getRequestNodes(); @@ -337,11 +337,11 @@ class IHMParamManagerClass $timesNode = $requestNodes[0]->getTimesNode(); $intervals = $timesNode->getIntervals(); $originFile = IHMConfigClass::getUserWSPath().$parameterID.".xml"; - + if (!file_exists($originFile)) { - // create IMPEX parameter info and data + // create IMPEX parameter info and data $res = $this->paramImpexMgr->createImpexParameter($param, $intervals, $templateArgs); - + if (!$res["success"]) throw new Exception('Error to create IMPEX parameter : '.$res["message"]); -- libgit2 0.21.2