@@ 143-150 (lines=8) @@ | ||
140 | ||
141 | // set up validators -- OPTIONAL |
|
142 | $v = XMLUtil::getChildElement($action, 'validators'); |
|
143 | if (null !== $v) { |
|
144 | $validators = XMLUtil::getChildElements($v, 'validator'); |
|
145 | foreach ($validators as $validator) { |
|
146 | $validatorDescriptor = DescriptorFactory::getFactory()->createValidatorDescriptor($validator); |
|
147 | $validatorDescriptor->setParent($this); |
|
148 | $this->validators->attach($validatorDescriptor); |
|
149 | } |
|
150 | } |
|
151 | ||
152 | // set up pre-functions -- OPTIONAL |
|
153 | $pre = XMLUtil::getChildElement($action, 'pre-functions'); |
|
@@ 154-161 (lines=8) @@ | ||
151 | ||
152 | // set up pre-functions -- OPTIONAL |
|
153 | $pre = XMLUtil::getChildElement($action, 'pre-functions'); |
|
154 | if (null !== $pre) { |
|
155 | $preFunctions = XMLUtil::getChildElements($pre, 'function'); |
|
156 | foreach ($preFunctions as $preFunction) { |
|
157 | $functionDescriptor = DescriptorFactory::getFactory()->createFunctionDescriptor($preFunction); |
|
158 | $functionDescriptor->setParent($this); |
|
159 | $this->preFunctions->attach($functionDescriptor); |
|
160 | } |
|
161 | } |
|
162 | ||
163 | // set up results - REQUIRED |
|
164 | $resultsElement = XMLUtil::getChildElement($action, 'results'); |
|
@@ 186-193 (lines=8) @@ | ||
183 | ||
184 | // set up post-functions - OPTIONAL |
|
185 | $post = XMLUtil::getChildElement($action, 'post-functions'); |
|
186 | if (null !== $post) { |
|
187 | $postFunctions = XMLUtil::getChildElements($post, 'function'); |
|
188 | foreach ($postFunctions as $postFunction) { |
|
189 | $functionDescriptor = DescriptorFactory::getFactory()->createFunctionDescriptor($postFunction); |
|
190 | $functionDescriptor->setParent($this); |
|
191 | $this->postFunctions->attach($functionDescriptor); |
|
192 | } |
|
193 | } |
|
194 | ||
195 | // set up restrict-to - OPTIONAL |
|
196 | $restrictElement = XMLUtil::getChildElement($action, 'restrict-to'); |
@@ 165-172 (lines=8) @@ | ||
162 | ||
163 | // set up validators -- OPTIONAL |
|
164 | $v = XMLUtil::getChildElement($result, 'validators'); |
|
165 | if (null !== $v) { |
|
166 | $validators = XMLUtil::getChildElements($v, 'validator'); |
|
167 | foreach ($validators as $validator) { |
|
168 | $validatorDescriptor = DescriptorFactory::getFactory()->createValidatorDescriptor($validator); |
|
169 | $validatorDescriptor->setParent($this); |
|
170 | $this->validators->attach($validatorDescriptor); |
|
171 | } |
|
172 | } |
|
173 | ||
174 | // set up pre-functions -- OPTIONAL |
|
175 | $pre = XMLUtil::getChildElement($result, 'pre-functions'); |
|
@@ 176-183 (lines=8) @@ | ||
173 | ||
174 | // set up pre-functions -- OPTIONAL |
|
175 | $pre = XMLUtil::getChildElement($result, 'pre-functions'); |
|
176 | if (null !== $pre) { |
|
177 | $preFunctions = XMLUtil::getChildElements($pre, 'function'); |
|
178 | foreach ($preFunctions as $preFunction) { |
|
179 | $functionDescriptor = DescriptorFactory::getFactory()->createFunctionDescriptor($preFunction); |
|
180 | $functionDescriptor->setParent($this); |
|
181 | $this->preFunctions->attach($functionDescriptor); |
|
182 | } |
|
183 | } |
|
184 | ||
185 | // set up post-functions - OPTIONAL |
|
186 | $post = XMLUtil::getChildElement($result, 'post-functions'); |
|
@@ 187-194 (lines=8) @@ | ||
184 | ||
185 | // set up post-functions - OPTIONAL |
|
186 | $post = XMLUtil::getChildElement($result, 'post-functions'); |
|
187 | if (null !== $post) { |
|
188 | $postFunctions = XMLUtil::getChildElements($post, 'function'); |
|
189 | foreach ($postFunctions as $postFunction) { |
|
190 | $functionDescriptor = DescriptorFactory::getFactory()->createFunctionDescriptor($postFunction); |
|
191 | $functionDescriptor->setParent($this); |
|
192 | $this->postFunctions->attach($functionDescriptor); |
|
193 | } |
|
194 | } |
|
195 | } |
|
196 | ||
197 | /** |
@@ 117-124 (lines=8) @@ | ||
114 | ||
115 | // set up pre-functions -- OPTIONAL |
|
116 | $pre = XMLUtil::getChildElement($step, 'pre-functions'); |
|
117 | if (null !== $pre) { |
|
118 | $preFunctions = XMLUtil::getChildElements($pre, 'function'); |
|
119 | foreach ($preFunctions as $preFunction) { |
|
120 | $functionDescriptor = DescriptorFactory::getFactory()->createFunctionDescriptor($preFunction); |
|
121 | $functionDescriptor->setParent($this); |
|
122 | $this->preFunctions->attach($functionDescriptor); |
|
123 | } |
|
124 | } |
|
125 | ||
126 | // set up permissions - OPTIONAL |
|
127 | $p = XMLUtil::getChildElement($step, 'external-permissions'); |
|
@@ 128-135 (lines=8) @@ | ||
125 | ||
126 | // set up permissions - OPTIONAL |
|
127 | $p = XMLUtil::getChildElement($step, 'external-permissions'); |
|
128 | if (null !== $p) { |
|
129 | $permissions = XMLUtil::getChildElements($p, 'permission'); |
|
130 | foreach ($permissions as $permission) { |
|
131 | $permissionDescriptor = DescriptorFactory::getFactory()->createPermissionDescriptor($permission); |
|
132 | $permissionDescriptor->setParent($this); |
|
133 | $this->permissions->attach($permissionDescriptor); |
|
134 | } |
|
135 | } |
|
136 | ||
137 | // set up actions - OPTIONAL |
|
138 | $a = XMLUtil::getChildElement($step, 'actions'); |
|
@@ 171-178 (lines=8) @@ | ||
168 | ||
169 | // set up post-functions - OPTIONAL |
|
170 | $post = XMLUtil::getChildElement($step, 'post-functions'); |
|
171 | if (null !== $post) { |
|
172 | $postFunctions = XMLUtil::getChildElements($post, 'function'); |
|
173 | foreach ($postFunctions as $postFunction) { |
|
174 | $functionDescriptor = DescriptorFactory::getFactory()->createFunctionDescriptor($postFunction); |
|
175 | $functionDescriptor->setParent($this); |
|
176 | $this->postFunctions->attach($functionDescriptor); |
|
177 | } |
|
178 | } |
|
179 | } |
|
180 | ||
181 | /** |
@@ 309-317 (lines=9) @@ | ||
306 | ||
307 | // handle registers - OPTIONAL |
|
308 | $r = XmlUtil::getChildElement($root, 'registers'); |
|
309 | if (null !== $r) { |
|
310 | $registers = XMLUtil::getChildElements($r, 'register'); |
|
311 | ||
312 | foreach ($registers as $register) { |
|
313 | $registerDescriptor = DescriptorFactory::getFactory()->createRegisterDescriptor($register); |
|
314 | $registerDescriptor->setParent($this); |
|
315 | $this->registers->attach($registerDescriptor); |
|
316 | } |
|
317 | } |
|
318 | ||
319 | // handle global-conditions - OPTIONAL |
|
320 | $globalConditionsElement = XMLUtil::getChildElement($root, 'global-conditions'); |
|
@@ 342-350 (lines=9) @@ | ||
339 | // handle global-actions - OPTIONAL |
|
340 | $globalActionsElement = XMLUtil::getChildElement($root, 'global-actions'); |
|
341 | ||
342 | if (null !== $globalActionsElement) { |
|
343 | $globalActions = XMLUtil::getChildElements($globalActionsElement, 'action'); |
|
344 | ||
345 | foreach ($globalActions as $globalAction) { |
|
346 | $actionDescriptor = DescriptorFactory::getFactory()->createActionDescriptor($globalAction); |
|
347 | $actionDescriptor->setParent($this); |
|
348 | $this->addGlobalAction($actionDescriptor); |
|
349 | } |
|
350 | } |
|
351 | ||
352 | ||
353 | // handle common-actions - OPTIONAL |
|
@@ 358-366 (lines=9) @@ | ||
355 | // any common actions into local references. |
|
356 | $commonActionsElement = XMLUtil::getChildElement($root, 'common-actions'); |
|
357 | ||
358 | if (null !== $commonActionsElement) { |
|
359 | $commonActions = XMLUtil::getChildElements($commonActionsElement, 'action'); |
|
360 | ||
361 | foreach ($commonActions as $commonAction) { |
|
362 | $actionDescriptor = DescriptorFactory::getFactory()->createActionDescriptor($commonAction); |
|
363 | $actionDescriptor->setParent($this); |
|
364 | $this->addCommonAction($actionDescriptor); |
|
365 | } |
|
366 | } |
|
367 | ||
368 | ||
369 | // handle timer-functions - OPTIONAL |
|
@@ 398-405 (lines=8) @@ | ||
395 | ||
396 | // handle splits - OPTIONAL: |
|
397 | $splitsElement = XMLUtil::getChildElement($root, 'splits'); |
|
398 | if (null !== $splitsElement) { |
|
399 | $split = XMLUtil::getChildElements($splitsElement, 'split'); |
|
400 | foreach ($split as $s) { |
|
401 | $splitDescriptor = DescriptorFactory::getFactory()->createSplitDescriptor($s); |
|
402 | $splitDescriptor->setParent($this); |
|
403 | $this->addSplit($splitDescriptor); |
|
404 | } |
|
405 | } |
|
406 | ||
407 | ||
408 | // handle joins - OPTIONAL: |
|
@@ 410-417 (lines=8) @@ | ||
407 | ||
408 | // handle joins - OPTIONAL: |
|
409 | $joinsElement = XMLUtil::getChildElement($root, 'joins'); |
|
410 | if (null !== $joinsElement) { |
|
411 | $join = XMLUtil::getChildElements($joinsElement, 'join'); |
|
412 | foreach ($join as $s) { |
|
413 | $joinDescriptor = DescriptorFactory::getFactory()->createJoinDescriptor($s); |
|
414 | $joinDescriptor->setParent($this); |
|
415 | $this->addJoin($joinDescriptor); |
|
416 | } |
|
417 | } |
|
418 | } |
|
419 | ||
420 | /** |