public function selectAction() { $engine = new Engine(); $query = new Query(); $query->addTerm('username', null, 'query', null, $this->request->getSessionData('username')); $results = $engine->searchRetrieve($query, 1, 500); }
/** * Fetch and display the metadata of records by id */ public function fetchAction() { $format = $this->request->getParam('format'); // id's can either come in as a series of 'record' params // or a single 'records' param containing id's separated by comma $id_array = $this->request->getParam('record', null, true); if (count($id_array) == 0) { $record_ids = $this->request->getParam('records'); $id_array = explode(',', $record_ids); } if (count($id_array) == 0) { throw new \Exception('Request must specify record ids'); } $results = $this->engine->getRecords($id_array); $this->response->setVariable('results', $results); if ($format == 'ris') { $this->response->setView('citation/ris.xsl'); } return $this->response; }
/** * Select previously saved records for inclusion in the reading list */ public function selectAction() { $engine = new Engine(); $query = $engine->getQuery($this->request); $username = $this->request->getSessionData('username'); $query->addTerm('username', null, 'query', null, $username); $results = $engine->searchRetrieve($query, 1, 500); // echo '<pre>' . print_r($results) . '</pre>'; exit; $this->response->setVariable('results', $results); return $this->response; }
/** * New reading list search engine * * @param string $id course id */ public function __construct($id) { $this->context_id = $id; $this->reading_list = new ReadingList($id); parent::__construct(); }