Commit 1ff81371f13cc271052d319bfe83879038f621ab
1 parent
0904976e
Exists in
master
and in
48 other branches
RM7926 - Evol - Choix du format du temps dans les catalogues et TT
Showing
4 changed files
with
434 additions
and
389 deletions
Show diff stats
src/InputOutput/IHMImpl/TimeTables/IHMInputOutputConvertTTClass.php
1 | -<?php | |
2 | - | |
3 | -/** | |
4 | - * @class IHMInputOutputConvertTTClass | |
5 | - * @brief | |
6 | - * @details | |
7 | -*/ | |
8 | -class IHMInputOutputConvertTTClass implements InputOutputInterface | |
9 | -{ | |
10 | - private $processData = NULL; | |
11 | - | |
12 | - | |
13 | - /* | |
14 | - * @brief Constructor | |
15 | - */ | |
16 | - function __construct() | |
17 | - { | |
18 | - | |
19 | - } | |
20 | - | |
21 | - /* | |
22 | - * @brief translate input data from AMDA IHM to AMDA_Integration module for a tt process request | |
23 | - */ | |
24 | - public function getInputData($input, $function, $requestId="") | |
25 | - { | |
26 | - if (isset($this->processData)) | |
27 | - unset($this->processData); | |
28 | - | |
29 | - $processData = new TTRequestDataClass(); | |
30 | - $processData->setInputFileName($input['inputFile']); | |
31 | - switch ($input['inputFormat']) { | |
32 | - case 'ASCII': | |
33 | - $processData->setInputFileFormat(TTRequestFileFormatEnum::ASCII); | |
34 | - break; | |
35 | - case 'VOTABLE': | |
36 | - $processData->setInputFileFormat(TTRequestFileFormatEnum::VOTABLE); | |
37 | - break; | |
38 | - case 'INTERNAL': | |
39 | - $processData->setInputFileFormat(TTRequestFileFormatEnum::INTERNAL); | |
40 | - break; | |
41 | - default: | |
42 | - throw new Exception('Unknown input format'); | |
43 | - } | |
44 | - $processData->setOutputDir($input['outputDir']); | |
45 | - $processData->setOutputFileFormat(TTRequestFileFormatEnum::INTERNAL); | |
46 | - $processData->setOutputFileName($input['outputFileName']); | |
47 | - $processData->setType($function); | |
48 | - $processData->setCmd("ttConversion"); | |
49 | - | |
50 | - $this->processData = $processData; | |
51 | - | |
52 | - return $this->processData; | |
53 | - } | |
54 | - | |
55 | - /* | |
56 | - * @brief translate output data from AMDA_Integration module to AMDA IHM request | |
57 | - */ | |
58 | - public function getOutput($data) | |
59 | - { | |
60 | - $result = array('success' => $data->getSuccess()); | |
61 | - if ($result['success']) { | |
62 | - $result['file'] = $data->getOutputDir()."/".$data->getOutputFileName(); | |
63 | - } | |
64 | - return $result; | |
65 | - } | |
66 | -} | |
67 | - | |
68 | -?> | |
1 | +<?php | |
2 | + | |
3 | +/** | |
4 | + * @class IHMInputOutputConvertTTClass | |
5 | + * @brief | |
6 | + * @details | |
7 | +*/ | |
8 | +class IHMInputOutputConvertTTClass implements InputOutputInterface | |
9 | +{ | |
10 | + private $processData = NULL; | |
11 | + | |
12 | + | |
13 | + /* | |
14 | + * @brief Constructor | |
15 | + */ | |
16 | + function __construct() | |
17 | + { | |
18 | + | |
19 | + } | |
20 | + | |
21 | + /* | |
22 | + * @brief translate input data from AMDA IHM to AMDA_Integration module for a tt process request | |
23 | + */ | |
24 | + public function getInputData($input, $function, $requestId="") | |
25 | + { | |
26 | + if (isset($this->processData)) | |
27 | + unset($this->processData); | |
28 | + | |
29 | + $processData = new TTRequestDataClass(); | |
30 | + $processData->setInputFileName($input['inputFile']); | |
31 | + switch ($input['inputFormat']) { | |
32 | + case 'ASCII': | |
33 | + $processData->setInputFileFormat(TTRequestFileFormatEnum::ASCII); | |
34 | + break; | |
35 | + case 'VOTABLE': | |
36 | + $processData->setInputFileFormat(TTRequestFileFormatEnum::VOTABLE); | |
37 | + break; | |
38 | + case 'INTERNAL': | |
39 | + $processData->setInputFileFormat(TTRequestFileFormatEnum::INTERNAL); | |
40 | + break; | |
41 | + default: | |
42 | + throw new Exception('Unknown input format'); | |
43 | + } | |
44 | + $processData->setOutputDir($input['outputDir']); | |
45 | + $processData->setOutputFileFormat(TTRequestFileFormatEnum::INTERNAL); | |
46 | + $processData->setOutputFileName($input['outputFileName']); | |
47 | + $processData->setOutputTimeFormat($input['outputTimeFormat']); | |
48 | + $processData->setType($function); | |
49 | + $processData->setCmd("ttConversion"); | |
50 | + | |
51 | + $this->processData = $processData; | |
52 | + | |
53 | + return $this->processData; | |
54 | + } | |
55 | + | |
56 | + /* | |
57 | + * @brief translate output data from AMDA_Integration module to AMDA IHM request | |
58 | + */ | |
59 | + public function getOutput($data) | |
60 | + { | |
61 | + $result = array('success' => $data->getSuccess()); | |
62 | + if ($result['success']) { | |
63 | + $result['file'] = $data->getOutputDir()."/".$data->getOutputFileName(); | |
64 | + } | |
65 | + return $result; | |
66 | + } | |
67 | +} | |
68 | + | |
69 | +?> | |
... | ... |
src/InputOutput/IHMImpl/TimeTables/IHMInputOutputTTClass.php
1 | -<?php | |
2 | - | |
3 | -/** | |
4 | - * @class IHMInputOutputTTClass | |
5 | - * @brief | |
6 | - * @details | |
7 | -*/ | |
8 | -class IHMInputOutputTTClass implements InputOutputInterface | |
9 | -{ | |
10 | - | |
11 | -/* | |
12 | - * @brief Constructor | |
13 | -*/ | |
14 | - function __construct() | |
15 | - { | |
16 | - | |
17 | - } | |
18 | - | |
19 | -/* | |
20 | - * @brief translate input data from IHM client to AMDA_Integration module for a tt process request | |
21 | -*/ | |
22 | - public function getInputData($input, $function, $requestId="") | |
23 | - { | |
24 | - if (isset($this->processDatas)) | |
25 | - unset($this->processDatas); | |
26 | - | |
27 | - $sendToSamp = isset($input->sendToSamp) && $input->sendToSamp; | |
28 | - $compression = !$sendToSamp && ($input->compression !== 'none'); | |
29 | - $formatstr = $sendToSamp ? 'vot' : $input->fileformat; | |
30 | - $tmp = new TTRequestDataClass(); // just to be sure that TTRequestDataClass is loaded with the 'autoload' => TTRequestDataClass is defined | |
31 | - $outputformat = $this->getFormatFromString(!empty($formatstr) ? $formatstr : 'vot'); | |
32 | - | |
33 | - $final = ""; | |
34 | - | |
35 | - if (is_dir(IHMConfigClass::getDownloadTmpPath())) { | |
36 | - foreach (glob(IHMConfigClass::getDownloadTmpPath().'*.zip') as $filename) unlink($filename); | |
37 | - foreach (glob(IHMConfigClass::getDownloadTmpPath().'*.tar.gz') as $filename) unlink($filename); | |
38 | - } | |
39 | - | |
40 | - foreach($input->list as $tt) | |
41 | - { | |
42 | - //create a list of data to treat | |
43 | - $processData = new TTRequestDataClass(); | |
44 | - | |
45 | - if (!isset($tt->id) && !empty($tt->path)) { | |
46 | - $ttName = $tt->path; | |
47 | - $inputformat = $this->getFormatFromString(!empty($tt->format) ? $tt->format : 'internal'); | |
48 | - } | |
49 | - else if (strpos($tt->id,"sharedtimeTable_") === 0 || strpos($tt->id,"sharedcatalog_") === 0) { | |
50 | - //Shared TimeTable /Catalog | |
51 | - $objectType = strpos($tt->id,"timeTable") != 0 ? "timeTable" : "catalog"; | |
52 | - $result = IHMSharedObjectsClass::getPath($objectType, $tt->id); | |
53 | - if (!$result['success']) | |
54 | - throw new Exception('Shared '.$objectType.' '.$tt->name.' not found'); | |
55 | - $ttName = $result['path']; | |
56 | - $inputformat = TTRequestFileFormatEnum::INTERNAL; | |
57 | - } | |
58 | - else { | |
59 | - //User TimeTable / Catalog | |
60 | - $ttName = IHMConfigClass::getUserTTPath().$tt->id.'.xml'; | |
61 | - $inputformat = TTRequestFileFormatEnum::INTERNAL; | |
62 | - } | |
63 | - if (!file_exists($ttName)) | |
64 | - throw new Exception('TimeTable or Catalog '.$tt->name.' not found'); | |
65 | - $processData->setInputFileName($ttName); | |
66 | - $processData->setInputFileFormat($inputformat); | |
67 | - $processData->setOutputDir(IHMConfigClass::getDownloadTmpPath()); | |
68 | - $processData->setOutputFileFormat($outputformat); | |
69 | - | |
70 | - switch ($outputformat) { | |
71 | - case TTRequestFileFormatEnum::VOTABLE : | |
72 | - $outputName = $tt->name.'.xml'; | |
73 | - break; | |
74 | - case TTRequestFileFormatEnum::ASCII : | |
75 | - $outputName = $tt->name.'.txt'; | |
76 | - break; | |
77 | - default : | |
78 | - $outputName = $tt->name.'.xml'; | |
79 | - } | |
80 | - | |
81 | - // $processData->setOutputTimeFormat($input->timeformat); | |
82 | - $processData->setOutputFileName($outputName); | |
83 | - $final .= " ".$outputName; | |
84 | - $processData->setType($function); | |
85 | - $processData->setCmd("ttConversion"); | |
86 | - $processData->setSendToSamp($sendToSamp); | |
87 | - | |
88 | - $this->processDatas[] = $processData; | |
89 | - } | |
90 | - | |
91 | - $this->postProcessTT = new PostProcessTTClass(); | |
92 | - $this->postProcessTT->setOutputDirAlias($this->processDatas[0]->getOutputDir()); | |
93 | - | |
94 | - if ($compression) { | |
95 | - $this->postProcessTT->compression = true; | |
96 | - $archive = "Timetable_archive_".date('Ymd_Hi'); | |
97 | - switch ($input->compression) { | |
98 | - case 'zip' : | |
99 | - $postCmd = "zip -Dj ".$archive.".zip ".$final." 1> /dev/null 2> /dev/null"; | |
100 | - $outputFileName = $archive.".zip"; | |
101 | - break; | |
102 | - case 'tar+gzip': | |
103 | - default : | |
104 | - $postCmd="tar cfz ".$archive.".tar.gz --directory=".$this->processDatas[0]->getOutputDir()." ".$final; | |
105 | - $outputFileName = $archive.".tar.gz"; | |
106 | - break; | |
107 | - } | |
108 | - $this->postProcessTT->setPostCmd($postCmd); | |
109 | - $this->postProcessTT->setOutputFileName($outputFileName); | |
110 | - $this->postProcessTT->setOutputDir($this->processDatas[0]->getOutputDir()); | |
111 | - } | |
112 | - | |
113 | - return $this->processDatas; | |
114 | - } | |
115 | - | |
116 | - /* | |
117 | - * @brief Get format from input string | |
118 | - */ | |
119 | - private function getFormatFromString($str) { | |
120 | - switch (strtolower($str)) { | |
121 | - case 'vot': | |
122 | - case 'votable': | |
123 | - return TTRequestFileFormatEnum::VOTABLE; | |
124 | - case 'ascii': | |
125 | - case 'text': | |
126 | - case 'txt': | |
127 | - case 'asc': | |
128 | - return TTRequestFileFormatEnum::ASCII; | |
129 | - } | |
130 | - return TTRequestFileFormatEnum::INTERNAL; | |
131 | - } | |
132 | - | |
133 | -/* | |
134 | - * @brief translate output data from AMDA_Integration module to IHM client request | |
135 | -*/ | |
136 | - public function getOutput($data) | |
137 | - { | |
138 | - if ( $this->postProcessTT->compression ) { | |
139 | - | |
140 | - $timeStart = time(); | |
141 | - | |
142 | - $cmd = $this->postProcessTT->getPostCmd(); | |
143 | - system($cmd); | |
144 | - | |
145 | - while (!file_exists($this->postProcessTT->getOutputFileName()) && ( time() - $timeStart ) < KernelConfigClass::getTimeToBatchMode()) | |
146 | - sleep(1); | |
147 | - | |
148 | - | |
149 | - foreach ($data as $d) | |
150 | - { | |
151 | - $rawFileName = $d->getOutputDir().$d->getOutputFileName(); | |
152 | - if (file_exists($rawFileName)) | |
153 | - unlink($rawFileName); | |
154 | - } | |
155 | - | |
156 | - $result = array('success'=>true, | |
157 | - 'download'=>$this->postProcessTT->getOutputDirAlias().$this->postProcessTT->getOutputFileName(), | |
158 | - 'compression' => $this->postProcessTT->compression); | |
159 | - | |
160 | - | |
161 | - } | |
162 | - else if ($data[0]->getSendToSamp()) { | |
163 | - $donwload = array(); | |
164 | - foreach ($data as $d) { | |
165 | - $donwload[] = $this->postProcessTT->getOutputDirAlias().$d->getOutputFileName(); | |
166 | - } | |
167 | - $result = array('success'=>$data[0]->getSuccess(), 'sendToSamp' => TRUE, | |
168 | - 'download' => $donwload); | |
169 | - } | |
170 | - else { | |
171 | - $result = array('success'=>$data[0]->getSuccess(), | |
172 | - 'download' => $this->postProcessTT->getOutputDirAlias().$data[0]->getOutputFileName()); | |
173 | - } | |
174 | - | |
175 | - return $result; | |
176 | - } | |
177 | -} | |
178 | - | |
179 | -?> | |
1 | +<?php | |
2 | + | |
3 | +/** | |
4 | + * @class IHMInputOutputTTClass | |
5 | + * @brief | |
6 | + * @details | |
7 | +*/ | |
8 | +class IHMInputOutputTTClass implements InputOutputInterface | |
9 | +{ | |
10 | + | |
11 | +/* | |
12 | + * @brief Constructor | |
13 | +*/ | |
14 | + function __construct() | |
15 | + { | |
16 | + | |
17 | + } | |
18 | + | |
19 | +/* | |
20 | + * @brief translate input data from IHM client to AMDA_Integration module for a tt process request | |
21 | +*/ | |
22 | + public function getInputData($input, $function, $requestId="") | |
23 | + { | |
24 | + if (isset($this->processDatas)) | |
25 | + unset($this->processDatas); | |
26 | + | |
27 | + $sendToSamp = isset($input->sendToSamp) && $input->sendToSamp; | |
28 | + $compression = !$sendToSamp && ($input->compression !== 'none'); | |
29 | + $formatstr = $sendToSamp ? 'vot' : $input->fileformat; | |
30 | + $tmp = new TTRequestDataClass(); // just to be sure that TTRequestDataClass is loaded with the 'autoload' => TTRequestDataClass is defined | |
31 | + $outputformat = $this->getFormatFromString(!empty($formatstr) ? $formatstr : 'vot'); | |
32 | + | |
33 | + $final = ""; | |
34 | + | |
35 | + if (is_dir(IHMConfigClass::getDownloadTmpPath())) { | |
36 | + foreach (glob(IHMConfigClass::getDownloadTmpPath().'*.zip') as $filename) unlink($filename); | |
37 | + foreach (glob(IHMConfigClass::getDownloadTmpPath().'*.tar.gz') as $filename) unlink($filename); | |
38 | + } | |
39 | + | |
40 | + foreach($input->list as $tt) | |
41 | + { | |
42 | + //create a list of data to treat | |
43 | + $processData = new TTRequestDataClass(); | |
44 | + | |
45 | + if (!isset($tt->id) && !empty($tt->path)) { | |
46 | + $ttName = $tt->path; | |
47 | + $inputFileFormat = $this->getFormatFromString(!empty($tt->format) ? $tt->format : TTRequestFileFormatEnum::INTERNAL); | |
48 | + } | |
49 | + else if (strpos($tt->id,"sharedtimeTable_") === 0 || strpos($tt->id,"sharedcatalog_") === 0) { | |
50 | + //Shared TimeTable /Catalog | |
51 | + $objectType = strpos($tt->id,"timeTable") != 0 ? "timeTable" : "catalog"; | |
52 | + $result = IHMSharedObjectsClass::getPath($objectType, $tt->id); | |
53 | + if (!$result['success']) | |
54 | + throw new Exception('Shared '.$objectType.' '.$tt->name.' not found'); | |
55 | + $ttName = $result['path']; | |
56 | + $inputFileFormat = TTRequestFileFormatEnum::INTERNAL; | |
57 | + } | |
58 | + else { | |
59 | + //User TimeTable / Catalog | |
60 | + $ttName = IHMConfigClass::getUserTTPath().$tt->id.'.xml'; | |
61 | + $inputFileFormat = TTRequestFileFormatEnum::INTERNAL; | |
62 | + } | |
63 | + if (!file_exists($ttName)) | |
64 | + throw new Exception('TimeTable or Catalog '.$tt->name.' not found'); | |
65 | + $processData->setInputFileName($ttName); | |
66 | + $processData->setInputFileFormat($inputFileFormat); | |
67 | + $processData->setOutputDir(IHMConfigClass::getDownloadTmpPath()); | |
68 | + $processData->setOutputFileFormat($outputformat); | |
69 | + | |
70 | + switch ($outputformat) { | |
71 | + case TTRequestFileFormatEnum::VOTABLE : | |
72 | + $outputName = $tt->name.'.xml'; | |
73 | + break; | |
74 | + case TTRequestFileFormatEnum::ASCII : | |
75 | + $outputName = $tt->name.'.txt'; | |
76 | + break; | |
77 | + default : | |
78 | + $outputName = $tt->name.'.xml'; | |
79 | + } | |
80 | + | |
81 | + //timeformatData : [['Y-m-dTH:i:s', 'YYYY-MM-DDThh:mm:ss'], ['DD Time', 'DD Time'], ['Timestamp', 'Timestamp']], | |
82 | + switch ($input->timeformat) | |
83 | + { | |
84 | + case 'YYYY-MM-DDThh:mm:ss' : | |
85 | + $processData->setOutputTimeFormat(TTRequestTimeFormatEnum::ISO); | |
86 | + break; | |
87 | + case 'DD Time' : | |
88 | + $processData->setOutputTimeFormat(TTRequestTimeFormatEnum::DDTIME); | |
89 | + break; | |
90 | + case 'Timestamp' : | |
91 | + $processData->setOutputTimeFormat(TTRequestTimeFormatEnum::TIMESTAMP); | |
92 | + break; | |
93 | + case 'Timestamp-with-milliseconds' : | |
94 | + $processData->setOutputTimeFormat(TTRequestTimeFormatEnum::MS); | |
95 | + break; | |
96 | + case 'YYYY MM DD hh mm ss' : | |
97 | + $processData->setOutputTimeFormat(TTRequestTimeFormatEnum::SPACES); | |
98 | + break; | |
99 | + | |
100 | + default : | |
101 | + throw new Exception('Time format not implemented.'); | |
102 | + } | |
103 | + | |
104 | + $processData->setOutputFileName($outputName); | |
105 | + $final .= " ".$outputName; | |
106 | + $processData->setType($function); | |
107 | + $processData->setCmd("ttConversion"); | |
108 | + $processData->setSendToSamp($sendToSamp); | |
109 | + | |
110 | + $this->processDatas[] = $processData; | |
111 | + } | |
112 | + | |
113 | + $this->postProcessTT = new PostProcessTTClass(); | |
114 | + $this->postProcessTT->setOutputDirAlias($this->processDatas[0]->getOutputDir()); | |
115 | + | |
116 | + if ($compression) { | |
117 | + $this->postProcessTT->compression = true; | |
118 | + $archive = "Timetable_archive_".date('Ymd_Hi'); | |
119 | + switch ($input->compression) { | |
120 | + case 'zip' : | |
121 | + $postCmd = "zip -Dj ".$archive.".zip ".$final." 1> /dev/null 2> /dev/null"; | |
122 | + $outputFileName = $archive.".zip"; | |
123 | + break; | |
124 | + case 'tar+gzip': | |
125 | + default : | |
126 | + $postCmd="tar cfz ".$archive.".tar.gz --directory=".$this->processDatas[0]->getOutputDir()." ".$final; | |
127 | + $outputFileName = $archive.".tar.gz"; | |
128 | + break; | |
129 | + } | |
130 | + $this->postProcessTT->setPostCmd($postCmd); | |
131 | + $this->postProcessTT->setOutputFileName($outputFileName); | |
132 | + $this->postProcessTT->setOutputDir($this->processDatas[0]->getOutputDir()); | |
133 | + } | |
134 | + | |
135 | + return $this->processDatas; | |
136 | + } | |
137 | + | |
138 | + /* | |
139 | + * @brief Get format from input string | |
140 | + */ | |
141 | + private function getFormatFromString($str) { | |
142 | + switch (strtolower($str)) { | |
143 | + case 'vot': | |
144 | + case 'votable': | |
145 | + return TTRequestFileFormatEnum::VOTABLE; | |
146 | + case 'ascii': | |
147 | + case 'text': | |
148 | + case 'txt': | |
149 | + case 'asc': | |
150 | + return TTRequestFileFormatEnum::ASCII; | |
151 | + } | |
152 | + return TTRequestFileFormatEnum::INTERNAL; | |
153 | + } | |
154 | + | |
155 | +/* | |
156 | + * @brief translate output data from AMDA_Integration module to IHM client request | |
157 | +*/ | |
158 | + public function getOutput($data) | |
159 | + { | |
160 | + if ( $this->postProcessTT->compression ) { | |
161 | + | |
162 | + $timeStart = time(); | |
163 | + | |
164 | + $cmd = $this->postProcessTT->getPostCmd(); | |
165 | + system($cmd); | |
166 | + | |
167 | + while (!file_exists($this->postProcessTT->getOutputFileName()) && ( time() - $timeStart ) < KernelConfigClass::getTimeToBatchMode()) | |
168 | + sleep(1); | |
169 | + | |
170 | + | |
171 | + foreach ($data as $d) | |
172 | + { | |
173 | + $rawFileName = $d->getOutputDir().$d->getOutputFileName(); | |
174 | + if (file_exists($rawFileName)) | |
175 | + unlink($rawFileName); | |
176 | + } | |
177 | + | |
178 | + $result = array('success'=>true, | |
179 | + 'download'=>$this->postProcessTT->getOutputDirAlias().$this->postProcessTT->getOutputFileName(), | |
180 | + 'compression' => $this->postProcessTT->compression); | |
181 | + | |
182 | + | |
183 | + } | |
184 | + else if ($data[0]->getSendToSamp()) { | |
185 | + $donwload = array(); | |
186 | + foreach ($data as $d) { | |
187 | + $donwload[] = $this->postProcessTT->getOutputDirAlias().$d->getOutputFileName(); | |
188 | + } | |
189 | + $result = array('success'=>$data[0]->getSuccess(), 'sendToSamp' => TRUE, | |
190 | + 'download' => $donwload); | |
191 | + } | |
192 | + else { | |
193 | + $result = array('success'=>$data[0]->getSuccess(), | |
194 | + 'download' => $this->postProcessTT->getOutputDirAlias().$data[0]->getOutputFileName()); | |
195 | + } | |
196 | + | |
197 | + return $result; | |
198 | + } | |
199 | +} | |
200 | + | |
201 | +?> | |
... | ... |
src/Request/TTRequestImpl/TTRequestClass.php
... | ... | @@ -61,8 +61,8 @@ class TTRequestClass extends RequestAbstractClass |
61 | 61 | //run process |
62 | 62 | |
63 | 63 | $args = "\"".$this->requestData->getInputFileName()."\" ".$this->requestData->getInputFileFormat() |
64 | - ." \"".$this->requestData->getOutputDir()."\" \"".$this->requestData->getOutputFileName() | |
65 | - ."\" ".$this->requestData->getOutputFileFormat(); | |
64 | + ." \"".$this->requestData->getOutputDir()."\" \"".$this->requestData->getOutputFileName()."\" " | |
65 | + .$this->requestData->getOutputFileFormat()." ".$this->requestData->getOutputTimeFormat(); | |
66 | 66 | |
67 | 67 | $cmd = $this->requestData->getCmd()." ".$args; |
68 | 68 | |
... | ... |
src/Request/TTRequestImpl/TTRequestDataClass.php
1 | -<?php | |
2 | - | |
3 | -abstract class TTRequestTimeFormatEnum | |
4 | -{ | |
5 | - const UNKNOWN = ""; | |
6 | - const ISO = "ISO"; | |
7 | - const DDTIME = "DD"; | |
8 | - const TIMESTAMP = "DOUBLE"; | |
9 | -} | |
10 | - | |
11 | -abstract class TTRequestFileFormatEnum | |
12 | -{ | |
13 | - const UNKNOWN = ""; | |
14 | - const ASCII = "ASCII"; | |
15 | - const VOTABLE = "VO"; | |
16 | - const INTERNAL = "Internal"; | |
17 | -} | |
18 | - | |
19 | -/** | |
20 | - * @class TTRequestDataClass | |
21 | - * @brief Data for a TT process request | |
22 | - * @details | |
23 | - */ | |
24 | -class TTRequestDataClass extends RequestDataClass | |
25 | -{ | |
26 | - private $inputTimeTable = ""; | |
27 | - private $outputTimeTable = ""; | |
28 | - private $inputFileFormat = ""; | |
29 | - private $outputFileFormat = ""; | |
30 | - private $inputTimeFormat = ""; | |
31 | - private $outputTimeFormat = ""; | |
32 | - private $outputDir = ""; | |
33 | - private $cmd = ""; | |
34 | - private $envVars = array(); | |
35 | - private $exitCode = 0; | |
36 | - private $sendToSamp = FALSE; | |
37 | - | |
38 | - public function getInputFileName() | |
39 | - { | |
40 | - return $this->inputTimeTable; | |
41 | - } | |
42 | - | |
43 | - public function setInputFileName($inputTimeTable) | |
44 | - { | |
45 | - $this->inputTimeTable = $inputTimeTable; | |
46 | - } | |
47 | - | |
48 | - public function getOutputFileName() | |
49 | - { | |
50 | - return $this->outputTimeTable; | |
51 | - } | |
52 | - | |
53 | - public function setOutputFileName($outputTimeTable) | |
54 | - { | |
55 | - $this->outputTimeTable = $outputTimeTable; | |
56 | - } | |
57 | - | |
58 | - public function getOutputFileFormat() | |
59 | - { | |
60 | - return $this->outputFileFormat; | |
61 | - } | |
62 | - | |
63 | - public function setOutputFileFormat($outputFileFormat) | |
64 | - { | |
65 | - $this->outputFileFormat = $outputFileFormat; | |
66 | - } | |
67 | - | |
68 | - public function getInputFileFormat() | |
69 | - { | |
70 | - return $this->inputFileFormat; | |
71 | - } | |
72 | - | |
73 | - public function setInputFileFormat($inputFileFormat) | |
74 | - { | |
75 | - $this->inputFileFormat = $inputFileFormat; | |
76 | - } | |
77 | - | |
78 | - public function getOutputDir() | |
79 | - { | |
80 | - return $this->outputDir."/"; | |
81 | - } | |
82 | - | |
83 | - public function setOutputDir($outputDir) | |
84 | - { | |
85 | - $this->outputDir = $outputDir; | |
86 | - } | |
87 | - | |
88 | - public function setSendToSamp($sendToSamp) | |
89 | - { | |
90 | - $this->sendToSamp = $sendToSamp; | |
91 | - } | |
92 | - | |
93 | - public function getSendToSamp() | |
94 | - { | |
95 | - return $this->sendToSamp; | |
96 | - } | |
97 | - | |
98 | - public function getCmd() | |
99 | - { | |
100 | - return $this->cmd; | |
101 | - } | |
102 | - | |
103 | - public function setCmd($cmd) | |
104 | - { | |
105 | - $this->cmd = $cmd; | |
106 | - } | |
107 | - | |
108 | - public function getEnvVars() | |
109 | - { | |
110 | - return $this->envVars; | |
111 | - } | |
112 | - | |
113 | - public function setEnvVars($envVars) | |
114 | - { | |
115 | - $this->envVars = $envVars; | |
116 | - } | |
117 | - | |
118 | - public function getType() | |
119 | - { | |
120 | - return $this->type; | |
121 | - } | |
122 | - | |
123 | - public function setType($type) | |
124 | - { | |
125 | - $this->type = $type; | |
126 | - } | |
127 | - | |
128 | - | |
129 | - public function getErrorCode() | |
130 | - { | |
131 | - return $this->exitCode; | |
132 | - } | |
133 | - | |
134 | - public function setErrorCode($errorCode) | |
135 | - { | |
136 | - $this->exitCode = $errorCode; | |
137 | - } | |
138 | -} | |
139 | - | |
140 | -?> | |
1 | +<?php | |
2 | + | |
3 | +abstract class TTRequestTimeFormatEnum | |
4 | +{ | |
5 | + const UNKNOWN = ""; | |
6 | + const ISO = "ISO"; | |
7 | + const DDTIME = "DD"; | |
8 | + const TIMESTAMP = "DOUBLE"; | |
9 | + const SPACES = "SPACES"; | |
10 | + const MS = "MS"; | |
11 | +} | |
12 | + | |
13 | +abstract class TTRequestFileFormatEnum | |
14 | +{ | |
15 | + const UNKNOWN = ""; | |
16 | + const ASCII = "ASCII"; | |
17 | + const VOTABLE = "VO"; | |
18 | + const INTERNAL = "Internal"; | |
19 | +} | |
20 | + | |
21 | +/** | |
22 | + * @class TTRequestDataClass | |
23 | + * @brief Data for a TT process request | |
24 | + * @details | |
25 | + */ | |
26 | +class TTRequestDataClass extends RequestDataClass | |
27 | +{ | |
28 | + private $inputTimeTable = ""; | |
29 | + private $outputTimeTable = ""; | |
30 | + private $inputFileFormat = ""; | |
31 | + private $outputFileFormat = ""; | |
32 | + private $inputTimeFormat = ""; | |
33 | + private $outputTimeFormat = ""; | |
34 | + private $outputDir = ""; | |
35 | + private $cmd = ""; | |
36 | + private $envVars = array(); | |
37 | + private $exitCode = 0; | |
38 | + private $sendToSamp = FALSE; | |
39 | + | |
40 | + public function getInputFileName() | |
41 | + { | |
42 | + return $this->inputTimeTable; | |
43 | + } | |
44 | + | |
45 | + public function setInputFileName($inputTimeTable) | |
46 | + { | |
47 | + $this->inputTimeTable = $inputTimeTable; | |
48 | + } | |
49 | + | |
50 | + public function getOutputFileName() | |
51 | + { | |
52 | + return $this->outputTimeTable; | |
53 | + } | |
54 | + | |
55 | + public function setOutputFileName($outputTimeTable) | |
56 | + { | |
57 | + $this->outputTimeTable = $outputTimeTable; | |
58 | + } | |
59 | + | |
60 | + public function getOutputFileFormat() | |
61 | + { | |
62 | + return $this->outputFileFormat; | |
63 | + } | |
64 | + | |
65 | + public function setOutputFileFormat($outputFileFormat) | |
66 | + { | |
67 | + $this->outputFileFormat = $outputFileFormat; | |
68 | + } | |
69 | + | |
70 | + public function getInputFileFormat() | |
71 | + { | |
72 | + return $this->inputFileFormat; | |
73 | + } | |
74 | + | |
75 | + public function setInputFileFormat($inputFileFormat) | |
76 | + { | |
77 | + $this->inputFileFormat = $inputFileFormat; | |
78 | + } | |
79 | + | |
80 | + public function setInputTimeFormat($inputTimeFormat) | |
81 | + { | |
82 | + $this->inputTimeFormat = $inputTimeFormat; | |
83 | + } | |
84 | + | |
85 | + public function getInputTimeFormat() | |
86 | + { | |
87 | + return $this->inputTimeFormat; | |
88 | + } | |
89 | + | |
90 | + public function setOutputTimeFormat($outputTimeFormat) | |
91 | + { | |
92 | + $this->outputTimeFormat = $outputTimeFormat; | |
93 | + } | |
94 | + | |
95 | + public function getOutputTimeFormat() | |
96 | + { | |
97 | + return $this->outputTimeFormat; | |
98 | + } | |
99 | + | |
100 | + public function getOutputDir() | |
101 | + { | |
102 | + return $this->outputDir."/"; | |
103 | + } | |
104 | + | |
105 | + public function setOutputDir($outputDir) | |
106 | + { | |
107 | + $this->outputDir = $outputDir; | |
108 | + } | |
109 | + | |
110 | + public function setSendToSamp($sendToSamp) | |
111 | + { | |
112 | + $this->sendToSamp = $sendToSamp; | |
113 | + } | |
114 | + | |
115 | + public function getSendToSamp() | |
116 | + { | |
117 | + return $this->sendToSamp; | |
118 | + } | |
119 | + | |
120 | + public function getCmd() | |
121 | + { | |
122 | + return $this->cmd; | |
123 | + } | |
124 | + | |
125 | + public function setCmd($cmd) | |
126 | + { | |
127 | + $this->cmd = $cmd; | |
128 | + } | |
129 | + | |
130 | + public function getEnvVars() | |
131 | + { | |
132 | + return $this->envVars; | |
133 | + } | |
134 | + | |
135 | + public function setEnvVars($envVars) | |
136 | + { | |
137 | + $this->envVars = $envVars; | |
138 | + } | |
139 | + | |
140 | + public function getType() | |
141 | + { | |
142 | + return $this->type; | |
143 | + } | |
144 | + | |
145 | + public function setType($type) | |
146 | + { | |
147 | + $this->type = $type; | |
148 | + } | |
149 | + | |
150 | + | |
151 | + public function getErrorCode() | |
152 | + { | |
153 | + return $this->exitCode; | |
154 | + } | |
155 | + | |
156 | + public function setErrorCode($errorCode) | |
157 | + { | |
158 | + $this->exitCode = $errorCode; | |
159 | + } | |
160 | +} | |
161 | + | |
162 | +?> | |
... | ... |