Commit 84cb4dbb1c8f4a1235f7d5bb5cf8c818f007dcf8
1 parent
5cf99396
Exists in
master
and in
65 other branches
Give the possibility to retrieve a request definition from the processId
Showing
5 changed files
with
35 additions
and
4 deletions
Show diff stats
src/InputOutput/IHMImpl/IHMInputOutputClass.php
... | ... | @@ -83,6 +83,9 @@ class IHMInputOutputClass implements InputOutputInterface |
83 | 83 | case FunctionTypeEnumClass::PROCESSCLEAN : |
84 | 84 | $this->inputOutput = new IHMInputOutputCleanProcessClass(); |
85 | 85 | break; |
86 | + case FunctionTypeEnumClass::PROCESSGETREQUEST : | |
87 | + $this->inputOutput = new IHMInputOutputGetProcessRequestClass(); | |
88 | + break; | |
86 | 89 | /*case FunctionTypeEnumClass::TTMERGE : |
87 | 90 | $this->inputOutput = new IHMInputOutputMergeTTClass(); |
88 | 91 | break; |
... | ... |
src/InputOutput/IHMImpl/Process/IHMInputOutputGetInfoProcessClass.php
... | ... | @@ -7,8 +7,8 @@ |
7 | 7 | */ |
8 | 8 | class IHMInputOutputGetInfoProcessClass implements InputOutputInterface |
9 | 9 | { |
10 | - private $jobsManager = null; | |
11 | - private $paramsData = null; | |
10 | + protected $jobsManager = null; | |
11 | + protected $paramsData = null; | |
12 | 12 | |
13 | 13 | /* |
14 | 14 | * @brief Constructor |
... | ... | @@ -52,4 +52,4 @@ class IHMInputOutputGetInfoProcessClass implements InputOutputInterface |
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
55 | -?> | |
56 | 55 | \ No newline at end of file |
56 | +?> | |
... | ... |
src/InputOutput/IHMImpl/Process/IHMInputOutputGetProcessRequestClass.php
0 → 100644
... | ... | @@ -0,0 +1,26 @@ |
1 | +<?php | |
2 | + | |
3 | +/** | |
4 | + * @class IHMInputOutputGetProcessRequestClass | |
5 | + * @brief Class that's implement an InputOutputInterface used to get the request associated to a process | |
6 | + * @details | |
7 | + */ | |
8 | +class IHMInputOutputGetProcessRequestClass extends IHMInputOutputGetInfoProcessClass | |
9 | +{ | |
10 | + /* | |
11 | + * @brief translate output data from AMDA_Integration module to IHM client for a get info process request | |
12 | + */ | |
13 | + public function getOutput($data) | |
14 | + { | |
15 | + if (!$data->getSuccess()) | |
16 | + { | |
17 | + return array( | |
18 | + 'success' => false, | |
19 | + 'message' => $data->getLastErrorMessage()); | |
20 | + } | |
21 | + | |
22 | + return $this->jobsManager->getRequestObjectFile($this->paramsData->getId()); | |
23 | + } | |
24 | +} | |
25 | + | |
26 | +?> | |
... | ... |
src/InputOutput/IHMImpl/Tools/IHMJobsManagerClass.php
... | ... | @@ -107,7 +107,7 @@ class IHMJobsManagerClass { |
107 | 107 | /* |
108 | 108 | * @brief Decode a request object file |
109 | 109 | */ |
110 | - protected function getRequestObjectFile($id) | |
110 | + public function getRequestObjectFile($id) | |
111 | 111 | { |
112 | 112 | if (!file_exists($this->getRequestObjectFilePath($id))) |
113 | 113 | return NULL; |
... | ... |
src/RequestManager.php
... | ... | @@ -76,6 +76,7 @@ abstract class FunctionTypeEnumClass |
76 | 76 | const PROCESSRUNNINGINFO = "process_running_info"; |
77 | 77 | const PROCESSGETINFO = "process_get_info"; |
78 | 78 | const PROCESSCLEAN = "process_clean"; |
79 | + const PROCESSGETREQUEST = "process_get_request"; | |
79 | 80 | const TTMERGE = "tt_merge"; |
80 | 81 | const TTUNION = "tt_union"; |
81 | 82 | const TTCONVERT = "tt_convert"; |
... | ... | @@ -141,6 +142,7 @@ Class RequestManagerClass |
141 | 142 | case FunctionTypeEnumClass::PROCESSRUNNINGINFO : |
142 | 143 | case FunctionTypeEnumClass::PROCESSGETINFO : |
143 | 144 | case FunctionTypeEnumClass::PROCESSCLEAN : |
145 | + case FunctionTypeEnumClass::PROCESSGETREQUEST : | |
144 | 146 | return new ProcessRequestClass($user, $userHost); |
145 | 147 | case FunctionTypeEnumClass::TTMERGE : |
146 | 148 | case FunctionTypeEnumClass::TTUNION : |
... | ... |