setAttribute(REQUESTOUTPUTSTATISTICFUNCTION_ID, $name); } public function loadFromNode($xmlNode) { $this->setFunctionName($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTSTATISTICFUNCTION_ID)); } } class RequestOutputStatisticParamNodeClass extends NodeClass { public function __construct() { parent::__construct(REQUESTOUTPUTSTATISTICPARAM_NAME); } public function setId($id) { $this->setAttribute(REQUESTOUTPUTSTATISTICPARAM_ID, $id); } public function getId() { return $this->getAttribute(REQUESTOUTPUTSTATISTICPARAM_ID); } public function addFunction($name = "") { $node = new RequestOutputStatisticFunctionNodeClass(); $this->addChild($node); $node->setFunctionName($name); return $node; } public function indexExist($index) { if ($this->getAttribute(REQUESTOUTPUTSTATISTICPARAM_INDEX) == $index) return true; return false; } public function setIndex($index) { if ($this->indexExist($index)) return; $this->setAttribute(REQUESTOUTPUTSTATISTICPARAM_INDEX, $index); } public function loadFromNode($xmlNode) { $this->setId($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTSTATISTICPARAM_ID)); foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTSTATISTICFUNCTION_NAME) as $functionXmlNode) { $this->addFunction()->loadFromNode($functionXmlNode); } $this->setIndex($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTSTATISTICPARAM_INDEX)); } } /** * @class RequestOutputStatisticNodeClass * @brief Definition of a request data mining output node for AMDA_Kernel * @details */ class RequestOutputStatisticNodeClass extends NodeClass { public function __construct() { parent::__construct(REQUESTOUTPUTSTATISTIC_NAME); } public function setTimeFormat($timeFormat) { $node = $this->getChildInstanceByName(REQUESTOUTPUTSTATISTIC_TIMEFORMAT, true); $node->setValue($timeFormat); } public function setFileFormat($fileFormat) { $node = $this->getChildInstanceByName(REQUESTOUTPUTSTATISTIC_FILEFORMAT, true); $node->setValue($fileFormat); } public function setStructure($structure) { $node = $this->getChildInstanceByName(REQUESTOUTPUTSTATISTIC_STRUCTURE, true); $node->setValue($structure); } public function setFileName($fileName) { $node = $this->getChildInstanceByName(REQUESTOUTPUTSTATISTIC_FILENAME, true); $node->setValue($fileName); } public function addParam($id = "", $indexes = array()) { $paramsNode = $this->getFirstChildByName(REQUESTPARAMS_NAME); if (!$paramsNode) { $paramsNode = new RequestParamsNodeClass(); $this->addChild($paramsNode); } $node = new RequestOutputStatisticParamNodeClass(); $paramsNode->addChild($node); $node->setId($id); if (isset($indexes)) { foreach ($indexes as $index) $node->setIndex($index); } return $node; } public function addPostProcessing($process = "") { $node = $this->getChildInstanceByName(REQUESTOUTPUTPOSTPROCESSING_NAME); if ($node == NULL) { $node = new RequestOutputPostProcessingNodeClass(); $this->addChild($node); } $node->addPostProcessing($process); return $node; } public function isPostProcessing($process) { $node = $this->getChildInstanceByName(REQUESTOUTPUTPOSTPROCESSING_NAME); if ($node == NULL) return false; return $node->isPostProcessing($process); } public function loadFromNode($xmlNode) { $this->setTimeFormat($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTSTATISTIC_TIMEFORMAT)); $this->setFileFormat($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTSTATISTIC_FILEFORMAT)); $this->setStructure($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTSTATISTIC_STRUCTURE)); $this->setFileName($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTSTATISTIC_FILENAME)); $paramsXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTPARAMS_NAME); if (isset($paramsXmlNode)) { foreach ($this->getXmlNodeChildrenByTagName($paramsXmlNode, REQUESTOUTPUTSTATISTICPARAM_NAME) as $paramXmlNode) { $this->addParam()->loadFromNode($paramXmlNode); } } $postprocessingXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPOSTPROCESSING_NAME); if (isset($postprocessingXmlNode)) $this->addPostProcessing()->loadFromNode($paramXmlNode); } } ?>