public function doExecute() { $objXml = new DOMDOcument(); $objXml->loadXML("<databases />"); $strID = $this->request->getProperty("id"); $strQuery = $this->request->getProperty("query"); $alpha = $this->request->getProperty("alpha"); $objDataMap = new Xerxes_DataMap(); $arrResults = array(); if ($strID) { $arrResults = $objDataMap->getDatabases($strID); if (count($arrResults) == 0) { throw new Xerxes_Exception_NotFound("Can not find database with id {$strID}"); } } elseif ($alpha != "") { $this->addAlphaList(); $arrResults = $objDataMap->getDatabasesStartingWith($alpha); } elseif ($strQuery) { $arrResults = $objDataMap->getDatabases(null, $strQuery); } elseif ($this->request->getProperty("suppress_full_db_list") != "true") { $this->addAlphaList(); // only show single letters, please if ($this->registry->getConfig("DATABASE_LIST_SINGLE_LETTER_DISPAY", false, false) && $this->request->getProperty("action") == "alphabetical") { $params = array("base" => "databases", "action" => "alphabetical", "alpha" => "A"); $link = $this->request->url_for($params); $this->request->setRedirect($link); return 0; } // all database $arrResults = $objDataMap->getDatabases(); } foreach ($arrResults as $objDatabaseData) { $objDatabase = Xerxes_Helper::databaseToNodeset($objDatabaseData, $this->request, $this->registry); $objDatabase = $objXml->importNode($objDatabase, true); $objXml->documentElement->appendChild($objDatabase); } $this->request->addDocument($objXml); return 1; }