1 | <?php |
---|
2 | require_once(PHPGW_SERVER_ROOT.SEP.'workflow'.SEP.'inc'.SEP.'natural'.SEP.'class.natural.php'); |
---|
3 | |
---|
4 | /** |
---|
5 | * Mainframe connection to workflow |
---|
6 | * @author Everton Flávio Rufino Seára |
---|
7 | * @package Workflow |
---|
8 | * @subpackage local |
---|
9 | * @license http://www.gnu.org/copyleft/gpl.html GPL |
---|
10 | **/ |
---|
11 | |
---|
12 | class wf_natural extends Natural |
---|
13 | { |
---|
14 | |
---|
15 | function __construct() |
---|
16 | { |
---|
17 | parent::Natural(); |
---|
18 | |
---|
19 | $natconf = array( |
---|
20 | 'mainframe_ip' => '', |
---|
21 | 'mainframe_port' => '', |
---|
22 | 'mainframe_key' => '', |
---|
23 | 'mainframe_password' => '', |
---|
24 | 'mainframe_environment' => '' |
---|
25 | ); |
---|
26 | |
---|
27 | $nat_conf_values = $GLOBALS['workflow']['wf_runtime']->getConfigValues($natconf); |
---|
28 | |
---|
29 | $this->setIPAddress($nat_conf_values['mainframe_ip']); |
---|
30 | $this->setServerPort($nat_conf_values['mainframe_port']); |
---|
31 | $this->setKey($nat_conf_values['mainframe_key']); |
---|
32 | $this->setPassword($nat_conf_values['mainframe_password']); |
---|
33 | $this->setApplication($nat_conf_values['mainframe_environment']); |
---|
34 | } |
---|
35 | |
---|
36 | /** |
---|
37 | * Method to configure the access to mainframe |
---|
38 | * This method MUST be called before using execute method, else 'false' will be returned |
---|
39 | * |
---|
40 | * Only the first and second param are mandatory. |
---|
41 | * |
---|
42 | * @param String $subProgram - Name of sub-program |
---|
43 | * @param String $inputParameter - Input parameters to sub-program |
---|
44 | * |
---|
45 | * @param String $ip - IP Address of Mainfram |
---|
46 | * @param int $port - ServerPort to access the mainframe |
---|
47 | * @param String $key - Access key (user) |
---|
48 | * @param String $password - Key (user) password |
---|
49 | * @param char $environment - Application environment access 'D' (development) or 'P' (production) |
---|
50 | |
---|
51 | */ |
---|
52 | |
---|
53 | public function configure($obj) |
---|
54 | { |
---|
55 | $this->obj = $obj; |
---|
56 | |
---|
57 | $this->initialize($obj->name); |
---|
58 | |
---|
59 | if ($obj->server != NULL){ |
---|
60 | $this->setIPAddress($obj->server); |
---|
61 | } |
---|
62 | if ($obj->port != NULL){ |
---|
63 | $this->setServerPort($obj->port); |
---|
64 | } |
---|
65 | if ($obj->key != NULL){ |
---|
66 | $this->setKey($obj->key); |
---|
67 | } |
---|
68 | if ($obj->password != NULL){ |
---|
69 | $this->setPassword($obj->password); |
---|
70 | } |
---|
71 | if ($obj->environment != NULL){ |
---|
72 | $this->setApplication($obj->environment); |
---|
73 | } |
---|
74 | if ($obj->logon != NULL){ |
---|
75 | $this->setLogon($obj->logon); |
---|
76 | } |
---|
77 | if ($obj->system != NULL){ |
---|
78 | $this->setSystem($obj->system); |
---|
79 | } |
---|
80 | if ($obj->rc != NULL){ |
---|
81 | $this->setRC($obj->rc); |
---|
82 | } |
---|
83 | } |
---|
84 | |
---|
85 | /* |
---|
86 | |
---|
87 | public function configure($subProgram, $inputParameter, $ip = NULL, $port = NULL, |
---|
88 | $key = NULL, $password = NULL, $environment = NULL, $logon = NULL, $system = NULL, $rc = NULL) |
---|
89 | { |
---|
90 | $this->initialize($subProgram, $inputParameter); |
---|
91 | |
---|
92 | if ($ip != NULL){ |
---|
93 | $this->setIPAddress($ip); |
---|
94 | } |
---|
95 | if ($port != NULL){ |
---|
96 | $this->setServerPort($port); |
---|
97 | } |
---|
98 | if ($key != NULL){ |
---|
99 | $this->setKey($key); |
---|
100 | } |
---|
101 | if ($password != NULL){ |
---|
102 | $this->setPassword($password); |
---|
103 | } |
---|
104 | if ($environment != NULL){ |
---|
105 | $this->setApplication($environment); |
---|
106 | } |
---|
107 | if ($logon != NULL){ |
---|
108 | $this->setLogon($logon); |
---|
109 | } |
---|
110 | if ($system != NULL){ |
---|
111 | $this->setSystem($system); |
---|
112 | } |
---|
113 | if ($rc != NULL){ |
---|
114 | $this->setRC($rc); |
---|
115 | } |
---|
116 | |
---|
117 | } |
---|
118 | |
---|
119 | */ |
---|
120 | |
---|
121 | /** |
---|
122 | * Access and retrieve data from mainframe |
---|
123 | * @return bool |
---|
124 | */ |
---|
125 | public function execute($inputParams = "") |
---|
126 | { |
---|
127 | return parent::execute($inputParams); |
---|
128 | } |
---|
129 | } |
---|
130 | ?> |
---|