paramsData->setRequestType(ParamsRequestTypeEnumClass::PARAMSINFOGEN); $this->paramsData->setParamId($input->paramId); $this->paramsData->setBatchEnable(FALSE); $this->paramManager->addGeneratedParam($input->paramId, $input->buildchain, $input->sampling_mode, $input->timestep, $input->reference_param, $this->paramsData); return $this->paramsData; } /* * @brief method to marshall the result of a download request */ protected function marshallResult($data) { if (!$data->getSuccess()) return array( 'success' => false, 'message' => $data->getParamId() . " : " . $data->getLastErrorMessage()); if ($data->getErrorCode() != 0) return array( 'success' => false, 'message' => $data->getParamId() . " : " . 'Error detected during parameter compilation'); $info_file_name = 'info_'.$data->getParamId().'.xml'; $info_file_path = $this->getWorkingPath().'/'.$info_file_name; $doc = new DOMDocument("1.0", "UTF-8"); if ($doc->load($info_file_path) === FALSE) { return array( 'success' => false, 'message' => $data->getParamId() . " : " . 'Cannot load info file'); } // $dimensionsNodes = $doc->getElementsByTagName('dimensions'); if ($dimensionsNodes->length == 0) { return array( 'success' => false, 'message' => $data->getParamId() . " : " . 'Cannot load dimensions in info file'); } $dim_1 = $dimensionsNodes->item(0)->getAttribute('dim_1'); $dim_2 = $dimensionsNodes->item(0)->getAttribute('dim_2'); return array( 'success' => true, 'dimensions' => array( 'dim_1' => $dim_1, 'dim_2' => $dim_2, ), ); } } ?>