db =& JFactory::getDBO(); } public function getServiceUrl($provider = 'openaire') { $this -> db -> setQuery('SELECT `value` FROM `#__openaire` WHERE `key` = \'serviceUrl.'.$provider.'\''); return $this -> db -> loadResult(); } public function setServiceUrl($serviceUrl, $provider = 'openaire') { $this -> db -> setQuery('UPDATE `#__openaire` SET `value` = ' . $this -> db -> quote($serviceUrl) . ' WHERE `key` = \'serviceUrl.'.$provider.'\''); if (!$this -> db -> query()) JLog::getInstance() -> addEntry(array('level' => 'error', 'comment' => 'Error updating service URL')); } public function getPageSize() { $this -> db -> setQuery('SELECT `value` FROM `#__openaire` WHERE `key` = \'pageSize\''); return $this -> db -> loadResult(); } public function setPageSize($pageSize) { $this -> db -> setQuery('UPDATE `#__openaire` SET `value` = ' . $this -> db -> quote($pageSize) . ' WHERE `key` = \'pageSize\''); if (!$this -> db -> query()) JLog::getInstance() -> addEntry(array('level' => 'error', 'comment' => 'Error updating page size')); } public function getThriftHost() { $this -> db -> setQuery('SELECT `value` FROM `#__openaire` WHERE `key` = \'thriftConnectorHost\''); return $this -> db -> loadResult(); } public function setThriftHost($host) { $this -> db -> setQuery('UPDATE `#__openaire` SET `value` = ' . $this -> db -> quote($host) . ' WHERE `key` = \'thriftConnectorHost\''); if (!$this -> db -> query()) JLog::getInstance() -> addEntry(array('level' => 'error', 'comment' => 'Error updating thrift host')); } public function getThriftPort() { $this -> db -> setQuery('SELECT `value` FROM `#__openaire` WHERE `key` = \'thriftConnectorPort\''); return $this -> db -> loadResult(); } public function setThriftPort($port) { $this -> db -> setQuery('UPDATE `#__openaire` SET `value` = ' . $this -> db -> quote($port) . ' WHERE `key` = \'thriftConnectorPort\''); if (!$this -> db -> query()) JLog::getInstance() -> addEntry(array('level' => 'error', 'comment' => 'Error updating thrift port')); } public function getInvenioUrl() { $this -> db -> setQuery('SELECT `value` FROM `#__openaire` WHERE `key` = \'invenioUrl\''); return $this -> db -> loadResult(); } public function setInvenioUrl($invenioUrl) { $this -> db -> setQuery('UPDATE `#__openaire` SET `value` = ' . $this -> db -> quote($invenioUrl) . ' WHERE `key` = \'invenioUrl\''); if (!$this -> db -> query()) JLog::getInstance() -> addEntry(array('level' => 'error', 'comment' => 'Error updating invenio URL')); } } ?>