Beispiel #1
0
 public function __construct(Record $record, Config $config)
 {
     $xerxes_record = $record->xerxes_record;
     // old metalib record from xerxes 1
     if ($xerxes_record instanceof \Xerxes_MetalibRecord) {
         $xerxes_record = new Metalib\Record($xerxes_record);
         // convert it x2 record
     } elseif ($xerxes_record instanceof \Xerxes_TransRecord) {
         try {
             $xerxes_record = $xerxes_record->record();
             // extract the x2 record
         } catch (\Exception $e) {
             trigger_error('Xerxes Error (' . $e->getLine() . '): ' . $e->getMessage());
         }
     }
     // record has been corrupted  @todo fix this problem
     if (!$xerxes_record instanceof Xerxes\Record) {
         $this->corrupted = true;
         // mark it as such
         // make a new record with the data we have on hand in the other
         // saved_records fields
         $xerxes_record = new Xerxes\Record();
         $title = $record->title;
         if ($record->nonsort != "") {
             $title = $record->nonsort . ' ' . $title;
         }
         $author = new Author($record->author, null, Author::PERSONAL);
         $format = new \Xerxes\Record\Format();
         $format->setFormat($record->format);
         $properties = array('title' => $title, 'format' => $format, 'authors' => array($author), 'year' => $record->year);
         $xerxes_record->setProperties($properties);
     }
     parent::__construct($xerxes_record, $config);
 }
Beispiel #2
0
 /** 
  * URL for the record display, with no target yet specified
  * 
  * @param $result Record object 
  * @return string url 
  */
 public function linkOther(Result $result)
 {
     $record = $result->getXerxesRecord();
     $arrParams = array('controller' => $this->request->getParam('controller'), "action" => "record", "id" => $record->getRecordID());
     $result->url_for_item = $this->request->url_for($arrParams);
     return $result;
 }
 public function lookupAction()
 {
     $id = $this->request->getParam("id");
     // we essentially create a mock object and add holdings
     $xerxes_record = new Record();
     $xerxes_record->setRecordID($id);
     $xerxes_record->setSource($this->id);
     $result = new Result($xerxes_record, $this->config);
     $result->fetchHoldings();
     // add to response
     $this->data->setVariable('results', $result);
     // view template
     $this->data->setTemplate('search/lookup.xsl');
     return $this->data;
 }
Beispiel #4
0
 public function lookupAction()
 {
     $id = $this->request->getParam("id");
     // we essentially create a mock object and add holdings
     $xerxes_record = new Record();
     $xerxes_record->setRecordID($id);
     $xerxes_record->setSource($this->id);
     $result = new Result($xerxes_record, $this->config);
     $result->fetchHoldings();
     // add to response
     $this->data["results"] = $result;
     return $this->data;
 }