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

Commit

Permalink
BUG: Refs #212. Rewrite of KWBatchmakeComponent.php, and reworking of…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
Michael Grauer authored and yuzhengZ committed Oct 18, 2011
1 parent 018ecbe commit cf52fc0
Show file tree
Hide file tree
Showing 6 changed files with 291 additions and 899 deletions.
42 changes: 7 additions & 35 deletions modules/batchmake/controllers/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,14 @@
/**
* Batchmake_ConfigController
* @todo TODO list for ConfigController and batchmake module
* - add phpdocumenter style comments
* - rework Notification
* - add tests
* - clean UI layout
* - repititions/redundancy in controller
* - repititions/redundancy in index.pthml
* - translations/centralized string resources
* - centralize constants
* - ? how to sync PHP, javascript, and css constants? info, error, warning among them
* - ? how to internationalize javascript strings?
* - better way of loading internationalization component in component and form
* - For now, have a KWBatchmakeComponent, which includes kwutils stuff and kwbatchmake
* - separate kw utils, where does this go?
* - separate kwbatchmake, where does this go?
* - clean component, internationalize strings
* - look into zend internationalization/translate
* - look into cmake infinite loop
* - for web api, there is a json wrapper , ajax_web_api.js in midas2
* - an element: ajax_web_api.thtml look in assetstore for usage
* - should need to put the "writing" of the auth token info in some common controller code
* - then include the element in any view
* - then the json .js wrapper will automaticially negotiate
* - ? how to use web api in a module?
* - want to namaespace constants MIDAS_BATCHMAKE
* - for imports have a static var for one time class loading
* - change ajax callst o be through web api
* - kwutils, try to use zend framework
* - change ajax callst o be through web api, and standard ajax
*/
class Batchmake_ConfigController extends Batchmake_AppController
{
Expand Down Expand Up @@ -72,18 +53,19 @@ protected function archiveOldModuleLocal()


/**
* @method indexAction()
* @method indexAction(), will test the configuration that the user has set
* and return validation info for the passed in properties.
*/
function indexAction()
public function indexAction()
{

$applicationConfig = $this->ModuleComponent->KWBatchmake->loadApplicationConfig();
$applicationConfig = $this->ModuleComponent->KWBatchmake->loadConfigProperties();
$configPropertiesRequirements = $this->ModuleComponent->KWBatchmake->getConfigPropertiesRequirements();
$configForm = $this->ModuleForm->Config->createConfigForm($configPropertiesRequirements);
$formArray = $this->getFormAsArray($configForm);
foreach($configPropertiesRequirements as $configProperty => $configPropertyRequirement)
{
$formArray[$configProperty]->setValue($applicationConfig[$this->moduleName.'.'.$configProperty]);
$formArray[$configProperty]->setValue($applicationConfig[$configProperty]);
}
$this->view->configForm = $formArray;

Expand Down Expand Up @@ -129,7 +111,7 @@ public function testconfigAction()


$configPropertiesParamVals = array();
$configPropertiesRequirements = $this->ModuleComponent->KWBatchmake->GetConfigPropertiesRequirements();
$configPropertiesRequirements = $this->ModuleComponent->KWBatchmake->getConfigPropertiesRequirements();
foreach($configPropertiesRequirements as $configProperty => $configPropertyRequirement)
{
$configPropertiesParamVals[$configProperty] = $this->_getParam($configProperty);
Expand All @@ -138,17 +120,7 @@ public function testconfigAction()
$config_status = $this->ModuleComponent->KWBatchmake->testconfig($configPropertiesParamVals);
$jsonout = JsonComponent::encode($config_status);
echo $jsonout;
// echo JsonComponent::encode($config_status);
}//end testconfigAction











}//end class
Loading

0 comments on commit cf52fc0

Please sign in to comment.