Commit 6139c32c2434b5eec34def9edfed087712ea0718

Authored by Benjamin Renard
1 parent b4950fd0

Give the possibility to put header in a separate file (#6497)

src/InputOutput/IHMImpl/Params/DownloadImpl/IHMInputOutputParamsDownloadClass.php
... ... @@ -15,7 +15,7 @@ class IHMInputOutputParamsDownloadClass extends IHMInputOutputParamsAbstractClas
15 15 */
16 16 protected function unmarshallRequest($input)
17 17 {
18   - //{"nodeType":"download","type":"Download","downloadSrc":"0","structure":"2","sampling":600,"output":"",
  18 + //{"nodeType":"download","type":"Download","downloadSrc":"0","structure":"2","sampling":600,"separateInfoFile":false,"output":"",
19 19 // "header":"0","timesrc":"TimeTable","timeTables":[{"timeTableName":"rzerzer","id":"tt_1"},{"timeTableName":"sqsdq","id":"tt_0"}],
20 20 //"list":["dst"],"milli":false,"fileformat":"ASCII","timeformat":"YYYY-MM-DDThh:mm:ss","compression":"tar+gzip","leaf":true}
21 21  
... ... @@ -121,6 +121,9 @@ class IHMInputOutputParamsDownloadClass extends IHMInputOutputParamsAbstractClas
121 121 throw new Exception('Structure type not implemented.');
122 122 }
123 123  
  124 + //separateInfoFile
  125 + $downloadNode->setSeparateInfoFile(isset($input->separateInfoFile) ? $input->separateInfoFile : FALSE);
  126 +
124 127 //filecompressData : [['zip', 'zip'], ['tar+gzip', 'tar+gzip']],
125 128 $extension = "";
126 129 $resultFilePrefix = "";
... ...
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputDownloadNodeClass.php
... ... @@ -8,6 +8,7 @@ define ("REQUESTOUTPUTDOWNLOAD_FILEFORMAT", "fileFormat");
8 8 define ("REQUESTOUTPUTDOWNLOAD_FILENAME", "fileName");
9 9 define ("REQUESTOUTPUTDOWNLOAD_SAMPLING", "timeResolution");
10 10 define ("REQUESTOUTPUTDOWNLOAD_STRUCTURE", "outputStructure");
  11 +define ("REQUESTOUTPUTDOWNLOAD_SEPARATEINFOGILE", "separateInfoFile");
11 12 define ("REQUESTOUTPUTDOWNLOAD_PRECISION", "precision");
12 13  
13 14 define ("REQUESTOUTPUTDOWNLOADPARAM_NAME", "param");
... ... @@ -199,6 +200,18 @@ class RequestOutputDownloadNodeClass extends NodeClass
199 200 return (($node == NULL) ? RequestOutputDownloadStructureEnum::UNKNOWN : $node->getValue());
200 201 }
201 202  
  203 + public function setSeparateInfoFile($separateInfoFile)
  204 + {
  205 + $node = $this->getChildInstanceByName(REQUESTOUTPUTDOWNLOAD_STRUCTURE, true);
  206 + $node->setAttribute(REQUESTOUTPUTDOWNLOAD_SEPARATEINFOGILE, $separateInfoFile ? "true" : "false");
  207 + }
  208 +
  209 + public function getSeparateInfoFile()
  210 + {
  211 + $node = $this->getChildInstanceByName(REQUESTOUTPUTDOWNLOAD_STRUCTURE);
  212 + return (($node == NULL) ? FALSE : ($node->getAttribute(REQUESTOUTPUTDOWNLOAD_SEPARATEINFOGILE) == "true"));
  213 + }
  214 +
202 215 public function setPrecision($precision)
203 216 {
204 217 $this->setAttribute(REQUESTOUTPUTDOWNLOAD_PRECISION, $precision);
... ...