Пример #1
0
 public function getOpenURL($strResolver, $strReferer = null, $param_delimiter = "&")
 {
     $url = parent::getOpenURL($strResolver, $strReferer, $param_delimiter);
     // always ignore dates for journals and books, since worldcat is describing
     // the item as a whole, not any specific issue or part
     return $url . "&sfx.ignore_date_threshold=1";
 }
Пример #2
0
 /**
  * Create new Metalib Record
  * @param \Xerxes_MetalibRecord $record
  */
 public function __construct(\Xerxes_MetalibRecord $record)
 {
     parent::__construct();
     // inspect the metalib record
     $metalib_reflect = new \ReflectionClass($record);
     $metalib_properties = $metalib_reflect->getProperties(\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED);
     // take it's properties and convert them into updated x2 equivalent
     foreach ($metalib_properties as $metalib_prop) {
         $metalib_prop->setAccessible(true);
         $name = $metalib_prop->getName();
         $value = $metalib_prop->getValue($record);
         if ($value == "") {
             continue;
         }
         // objects
         if ($name == 'authors') {
             foreach ($value as $metalib_author) {
                 $author = new Xerxes\Record\Author();
                 $author->first_name = $metalib_author->first_name;
                 $author->last_name = $metalib_author->last_name;
                 $author->init = $metalib_author->init;
                 $author->name = $metalib_author->name;
                 $author->type = $metalib_author->type;
                 $author->additional = $metalib_author->additional;
                 $author->display = $metalib_author->display;
                 $this->authors[] = $author;
             }
         } elseif ($name == 'subjects') {
             if (!is_array($value)) {
                 $value = array($value);
             }
             foreach ($value as $metalib_subject) {
                 $subject = new Xerxes\Record\Subject();
                 $subject->display = $metalib_subject->display;
                 $subject->value = $metalib_subject->value;
             }
         } elseif ($name == 'format') {
             $this->format = new Xerxes\Record\Format();
             $this->format->determineFormat($value);
         } elseif ($name == 'links') {
             foreach ($value as $metalib_link_array) {
                 $display = $metalib_link_array[0];
                 $type = $metalib_link_array[2];
                 // url handling
                 $url = '?base=databases&action=proxy&database=' . $this->metalib_id;
                 // link template
                 if (is_array($metalib_link_array[1])) {
                     foreach ($metalib_link_array[1] as $key => $value) {
                         $url .= '&param=' . urlencode("{$key}={$value}");
                     }
                 } else {
                     $url .= '&url=' . urlencode($metalib_link_array[1]);
                 }
                 switch ($type) {
                     case 'original_record':
                         $type = Xerxes\Record\Link::ORIGINAL_RECORD;
                         break;
                     case 'pdf':
                         $type = Xerxes\Record\Link::PDF;
                         break;
                     case 'html':
                         $type = Xerxes\Record\Link::HTML;
                         break;
                     case 'none':
                         $type = Xerxes\Record\Link::INFORMATIONAL;
                         break;
                     case 'online':
                         $type = Xerxes\Record\Link::ONLINE;
                         break;
                 }
                 $link = new Xerxes\Record\Link($url);
                 $link->setDisplay($display);
                 $link->setType($type);
                 $this->links[] = $link;
             }
         } elseif ($name == 'toc') {
             if (!is_array($value)) {
                 $value = array($value);
             }
             foreach ($value as $metalib_toc) {
                 $toc = new Xerxes\Record\Chapter();
                 $toc->statement = $metalib_toc;
                 $this->toc;
             }
         } elseif ($name == 'journal_title_continues' || $name == 'journal_title_continued_by') {
             // ignore for now
         } elseif (property_exists($this, $name)) {
             $this->{$name} = $value;
         }
     }
 }
Пример #3
0
 public function toXml()
 {
     $objXml = parent::toXml();
     return $objXml;
 }
Пример #4
0
 /**
  * Parse record information in alternate languae script
  * 
  * Such as CJK, Cyrillic, etc.
  */
 protected function parseAltScript()
 {
     // the 880 represents an alternative character-script, like hebrew or cjk
     if ($this->marc->datafield("880")->length() > 0) {
         // we create a new marc record from the 880, using subfield 6 as the
         // name of each new tag
         $marc = new MarcRecord();
         foreach ($this->marc->datafield("880") as $datafield) {
             $datafield->tag = (string) $datafield->subfield("6");
             $marc->addDataField($datafield);
         }
         $bibliogaphic = new Bibliographic();
         $bibliogaphic->loadMarc($marc);
         array_push($this->alt_scripts, $bibliogaphic);
     }
     // now use the $6 to figure out which character-script this is
     // assume just one for now
     $alt_script = (string) $this->marc->datafield("880")->subfield("6");
     if ($alt_script != null) {
         $match_codes_array = array();
         $script_code_array = array("(3" => "Arabic", "(B" => "Latin", '$1' => "CJK", "(N" => "Cyrillic", "(S" => "Greek", "(2" => "Hebrew");
         if (preg_match('/[0-9]{3}-[0-9]{2}\\/([^\\/]*)/', $alt_script, $match_codes_array)) {
             if (array_key_exists($match_codes_array[1], $script_code_array)) {
                 $this->alt_script_name = $script_code_array[$match_codes_array[1]];
             }
         }
     }
 }
Пример #5
0
 protected function parseISSN()
 {
     parent::parseISSN();
     // gale puts issn in 773b
     if (strstr($this->source, 'GALE')) {
         $strGaleIssn = (string) $this->marc->datafield("773")->subfield("b");
         if ($strGaleIssn != null) {
             array_push($this->issns, $strGaleIssn);
         }
     }
 }