mocd_tab = $mocd_tab; $this->atdc_tab = $atdc_tab; } public function getMocDescList() { // logging $logger = Logger::getInstance(); $logger->log(__CLASS__, "getMocDescList()"); // call implementation via try/catch try { $ta = Transaction::getInstance($this->cur_app); $ta->startTA(); $xmlFormatter = new XmlFormatter(); $xmlFormatter->initResult(); $erco = Administration::getMocDescList($this->mocd_tab, $xmlFormatter); $ta->commitTA(); return $xmlFormatter->printIt(); } catch (Exception $e) { $logger->logException(__CLASS__, $e); Transaction::getInstance($this->cur_app)->rollbackTA(); throw $e; } } public function getAttrDescList($mocd_id) { // logging $logger = Logger::getInstance(); $logger->log(__CLASS__, "getAttrDescList($mocd_id)"); // call implementation via try/catch try { $ta = Transaction::getInstance($this->cur_app); $ta->startTA(); $xmlFormatter = new XmlFormatter(); $xmlFormatter->initResult(); $mocd = $this->mocd_tab[$mocd_id]; $erco = Administration::getAttrDescList($mocd, $this->atdc_tab, $xmlFormatter); $ta->commitTA(); return $xmlFormatter->printIt(); } catch (Exception $e) { $logger->logException(__CLASS__, $e); Transaction::getInstance($this->cur_app)->rollbackTA(); throw $e; } } public function getInstanceList($mocd_id, $req_filt = null) { // logging $logger = Logger::getInstance(); $logger->log(__CLASS__, "getInstanceList($mocd_id)"); $logger->log(__CLASS__, "req_filt($req_filt)"); // call implementation via try/catch try { $ta = Transaction::getInstance($this->cur_app); $ta->startTA(); if ($req_filt != null) { $xmlExtractor = new XmlExtractor(); $xmlExtractor->openInput($req_filt); } else { $xmlExtractor = null; } $xmlFormatter = new XmlFormatter(); $xmlFormatter->initResult(); $mocd = $this->mocd_tab[$mocd_id]; $erco = Administration::getInstanceList($mocd, $this->atdc_tab, $xmlExtractor, $xmlFormatter); if ($erco != GenericAdmin::EC_OK) throw new Exception("Administration::getInstanceList returned: $erco"); $ta->commitTA(); return $xmlFormatter->printIt(); } catch (Exception $e) { $logger->logException(__CLASS__, $e); Transaction::getInstance($this->cur_app)->rollbackTA(); throw $e; } } public function getInstance($mocd_id, $inst_id) { // logging $logger = Logger::getInstance(); $logger->log(__CLASS__, "getInstance($mocd_id, $inst_id)"); // call implementation via try/catch try { $ta = Transaction::getInstance($this->cur_app); $ta->startTA(); $xmlFormatter = new XmlFormatter(); $xmlFormatter->initResult(); $mocd = $this->mocd_tab[$mocd_id]; $erco = Administration::getInstance($this->mocd_tab, $this->atdc_tab, $mocd_id, $inst_id, $xmlFormatter); $ta->commitTA(); if ($erco == self::EC_OK) { return $xmlFormatter->printIt(); } else { return null; } } catch (Exception $e) { $logger->logException(__CLASS__, $e); Transaction::getInstance($this->cur_app)->rollbackTA(); throw $e; } } public function getIdByName($mocd_id, $name) { // assumes an unique attribute called "name" // returns -1 for "not found" // logging $logger = Logger::getInstance(); $logger->log(__CLASS__, "getIdFromName($mocd_id, $name)"); // call implementation via try/catch try { $ta = Transaction::getInstance($this->cur_app); $ta->startTA(); $mocd = $this->mocd_tab[$mocd_id]; $id = Administration::getIdByName($this->mocd_tab, $mocd_id, $name); $ta->commitTA(); return $id; } catch (Exception $e) { $logger->logException(__CLASS__, $e); Transaction::getInstance($this->cur_app)->rollbackTA(); throw $e; } } public function setInstance($mocd_id, $req_par) { // logging $logger = Logger::getInstance(); $logger->log(__CLASS__, "setInstance($mocd_id, $req_par)"); // call implementation via try/catch try { $ta = Transaction::getInstance($this->cur_app); $ta->startTA(); $xmlExtractor = new XmlExtractor(); $xmlExtractor->openInput($req_par); $mocd = $this->mocd_tab[$mocd_id]; $erco = Administration::setInstance($mocd, $this->atdc_tab, $xmlExtractor); $ta->commitTA(); return $erco; } catch (Exception $e) { $logger->logException(__CLASS__, $e); Transaction::getInstance($this->cur_app)->rollbackTA(); throw $e; } } public function createInstance($mocd_id, $req_par, &$id = null) { // logging $logger = Logger::getInstance(); $logger->log(__CLASS__, "createInstance($mocd_id, $req_par)"); // call implementation via try/catch try { // check, if autoloader in configuration $al = Config::getInstance()->getConfig("autoloader"); if (!$al) Config::setConfiguration(array("autoloader" => array("ClassLoader", "autoload"))); $ta = Transaction::getInstance($this->cur_app); $ta->startTA(); $xmlExtractor = new XmlExtractor(); $xmlExtractor->openInput($req_par); $mocd = $this->mocd_tab[$mocd_id]; $erco = Administration::createInstance($mocd, $this->atdc_tab, $xmlExtractor, $id); if($erco == GenericAdmin::EC_OK) $ta->commitTA(); else $ta->rollbackTA(); return $erco; } catch (Exception $e) { $logger->logException(__CLASS__, $e); Transaction::getInstance($this->cur_app)->rollbackTA(); throw $e; } } public function deleteInstance($mocd_id, $inst_id, $mod) { // logging $logger = Logger::getInstance(); $logger->log(__CLASS__, "deleteInstance($mocd_id, $inst_id, $mod)"); // call implementation via try/catch try { $ta = Transaction::getInstance($this->cur_app); $ta->startTA(); $mocd = $this->mocd_tab[$mocd_id]; $erco = Administration::deleteInstance($mocd, $inst_id, $mod); $ta->commitTA(); return $erco; } catch (Exception $e) { $logger->logException(__CLASS__, $e); Transaction::getInstance($this->cur_app)->rollbackTA(); throw $e; } } }