paramsData->addRequestNode(); $paramsNode = $requestNode->getParamsNode(); //unmarshall time definition $this->unmarshallTimeDefinition($input, 0); //unmarshall statistic output definition $outputsNode = $requestNode->getOutputsNode(); $catalogNode = $outputsNode->addNewOutput(RequestOutputTypeEnum::STATISTIC); $catalogNode->setTimeFormat(RequestOutputStatisticTimeFormatEnum::ISO); $catalogNode->setFileFormat(RequestOutputStatisticFileFormatEnum::XML); $paramTemplateArgs = array(count($input->parameter), count($input->parameter)); $paramTemplateIndex = array(count($input->parameter), count($input->parameter)); // parse parameters / functions array foreach ($input->parameter as $obj) { $paramFunctionAssociation[$obj->paramid][] = $obj->function; // parse template args and indices for template params $array = (array) $obj->template_args; if (!empty ($array)) { $paramTemplateArgs[$obj->paramid][$obj->function] = $obj->template_args; if (($obj->{'dim1-index'} != '*') && ($obj->{'dim1-index'} != '')) { $paramTemplateIndex[$obj->paramid][$obj->function] = $obj->{'dim1-index'}; } } } foreach ($paramFunctionAssociation as $param => $functions) { // template parameter if ($paramTemplateArgs[$param]) { foreach ($functions as $function) { $templateArgs = $paramTemplateArgs[$param][$function]; $paramInfo = $this->paramManager->addExistingParam($param, $this->paramsData, $templateArgs); $paramsNode->addParam($paramInfo['id']); if ($paramTemplateIndex[$param][$function] != null) { $paramInfo['indexes'] = array(); $paramInfo['indexes'][] = $paramTemplateIndex[$param][$function]; } $outputParamNode = $catalogNode->addParam($paramInfo['id'],$paramInfo['indexes']); $outputParamNode->addFunction($function); } } // normal parameter else { $paramInfo = $this->paramManager->addExistingParam($param, $this->paramsData); $paramsNode->addParam($paramInfo['id']); $outputParamNode = $catalogNode->addParam($paramInfo['id'],$paramInfo['indexes']); foreach ($functions as $function) $outputParamNode->addFunction($function); } } $resultFile = "result_".$this->requestID; $this->paramsData->addWaitingResult(STATISTICS_RESULT_FILE_KEY, $resultFile); $postProcessCmd = "mv statistic-*"; $postProcessCmd .= " ".$resultFile.".xml"; $this->paramsData->setPostCmd($postProcessCmd); return $this->paramsData; } /* * @brief method to marshall the result of a catalog generation request */ protected function marshallResult($data) { return $this->commonMarshallResult($data,STATISTICS_RESULT_FILE_KEY); } } ?>