Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit cf52fc0

Browse files
Michael GraueryuzhengZ
authored andcommitted
BUG: Refs #212. Rewrite of KWBatchmakeComponent.php, and reworking of tests.
Rewrote KWBatchmakeComponent.php to be more sensible, rewrote tests and other code that depending on this. Also added a README to the batchmake module for testing, and a switch in CMakeLists.txt for the batchmake module to have batchmake module testing be off by default, since a certain amount of config is required to have the batchmake tests pass.
1 parent 018ecbe commit cf52fc0

File tree

6 files changed

+291
-899
lines changed

6 files changed

+291
-899
lines changed

modules/batchmake/controllers/ConfigController.php

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,14 @@
1313
/**
1414
* Batchmake_ConfigController
1515
* @todo TODO list for ConfigController and batchmake module
16-
* - add phpdocumenter style comments
17-
* - rework Notification
18-
* - add tests
19-
* - clean UI layout
20-
* - repititions/redundancy in controller
21-
* - repititions/redundancy in index.pthml
22-
* - translations/centralized string resources
23-
* - centralize constants
24-
* - ? how to sync PHP, javascript, and css constants? info, error, warning among them
25-
* - ? how to internationalize javascript strings?
2616
* - better way of loading internationalization component in component and form
27-
* - For now, have a KWBatchmakeComponent, which includes kwutils stuff and kwbatchmake
28-
* - separate kw utils, where does this go?
29-
* - separate kwbatchmake, where does this go?
30-
* - clean component, internationalize strings
3117
* - look into zend internationalization/translate
32-
* - look into cmake infinite loop
3318
* - for web api, there is a json wrapper , ajax_web_api.js in midas2
3419
* - an element: ajax_web_api.thtml look in assetstore for usage
3520
* - should need to put the "writing" of the auth token info in some common controller code
3621
* - then include the element in any view
3722
* - then the json .js wrapper will automaticially negotiate
38-
* - ? how to use web api in a module?
39-
* - want to namaespace constants MIDAS_BATCHMAKE
40-
* - for imports have a static var for one time class loading
41-
* - change ajax callst o be through web api
42-
* - kwutils, try to use zend framework
23+
* - change ajax callst o be through web api, and standard ajax
4324
*/
4425
class Batchmake_ConfigController extends Batchmake_AppController
4526
{
@@ -72,18 +53,19 @@ protected function archiveOldModuleLocal()
7253

7354

7455
/**
75-
* @method indexAction()
56+
* @method indexAction(), will test the configuration that the user has set
57+
* and return validation info for the passed in properties.
7658
*/
77-
function indexAction()
59+
public function indexAction()
7860
{
7961

80-
$applicationConfig = $this->ModuleComponent->KWBatchmake->loadApplicationConfig();
62+
$applicationConfig = $this->ModuleComponent->KWBatchmake->loadConfigProperties();
8163
$configPropertiesRequirements = $this->ModuleComponent->KWBatchmake->getConfigPropertiesRequirements();
8264
$configForm = $this->ModuleForm->Config->createConfigForm($configPropertiesRequirements);
8365
$formArray = $this->getFormAsArray($configForm);
8466
foreach($configPropertiesRequirements as $configProperty => $configPropertyRequirement)
8567
{
86-
$formArray[$configProperty]->setValue($applicationConfig[$this->moduleName.'.'.$configProperty]);
68+
$formArray[$configProperty]->setValue($applicationConfig[$configProperty]);
8769
}
8870
$this->view->configForm = $formArray;
8971

@@ -129,7 +111,7 @@ public function testconfigAction()
129111

130112

131113
$configPropertiesParamVals = array();
132-
$configPropertiesRequirements = $this->ModuleComponent->KWBatchmake->GetConfigPropertiesRequirements();
114+
$configPropertiesRequirements = $this->ModuleComponent->KWBatchmake->getConfigPropertiesRequirements();
133115
foreach($configPropertiesRequirements as $configProperty => $configPropertyRequirement)
134116
{
135117
$configPropertiesParamVals[$configProperty] = $this->_getParam($configProperty);
@@ -138,17 +120,7 @@ public function testconfigAction()
138120
$config_status = $this->ModuleComponent->KWBatchmake->testconfig($configPropertiesParamVals);
139121
$jsonout = JsonComponent::encode($config_status);
140122
echo $jsonout;
141-
// echo JsonComponent::encode($config_status);
142123
}//end testconfigAction
143124

144125

145-
146-
147-
148-
149-
150-
151-
152-
153-
154126
}//end class

0 commit comments

Comments
 (0)