Example #1
0
 /**
  * Lazyload Config
  */
 protected function config()
 {
     if (!$this->config instanceof Config) {
         $this->config = Config::getInstance();
     }
     return $this->config;
 }
Example #2
0
 protected function parseLinks()
 {
     ### create our own link
     // some databases have full-text but no 856
     // will capture these here and add to links array
     // factiva -- no indicator of full-text, just make original record
     if (stristr($this->source, "FACTIVA")) {
         $link_array = array("035_a" => (string) $this->marc->datafield("035")->subfield("a"));
         $this->links[] = new Link($link_array, Link::ORIGINAL_RECORD);
     }
     // eric -- document is recent enough to likely contain full-text;
     // 340000 being a rough approximation of the document number after which they
     // started digitizing
     if (strstr($this->source, "ERIC") && strlen($this->eric_number) > 3) {
         $strEricType = substr($this->eric_number, 0, 2);
         $strEricNumber = (int) substr($this->eric_number, 2);
         if ($strEricType == "ED" && $strEricNumber >= 340000) {
             $strFullTextPdf = "http://www.eric.ed.gov/ERICWebPortal/contentdelivery/servlet/ERICServlet?accno=" . $this->eric_number;
             $this->links[] = new Link($strFullTextPdf, Link::PDF);
         }
     }
     // 7 Apr 09, jrochkind. Gale Biography Resource Center
     // No 856 is included at all, but a full text link can be
     // constructed from the 001 record id.
     if (stristr($this->source, "GALE_ZBRC")) {
         $url = "http://ic.galegroup.com/ic/bic1/ReferenceDetailsPage/ReferenceDetailsWindow?" . "displayGroupName=K12-Reference&action=e&windowstate=normal&mode=view&documentId=GALE|" . (string) $this->marc->controlfield("001");
         $this->links[] = new Link($url, Link::HTML);
     }
     ### remove links
     $notes = $this->marc->fieldArray("500", "a");
     // needed for gale
     foreach ($this->marc->datafield("856") as $link) {
         $strDisplay = (string) $link->subfield("z");
         $strUrl = (string) $link->subfield("u");
         // records that have 856s, but are not always for full-text
         if (stristr($this->source, "METAPRESS_XML") || stristr($this->source, "WILSON_") && (string) $this->marc->datafield("901")->subfield("t") == "" || stristr($this->source, "CABI") || stristr($this->source, "AMAZON") || stristr($this->source, "ABCCLIO") || stristr($this->source, "EVII") || stristr($this->source, "WILEY_IS") || stristr($this->source, "OXFORD_JOU") && !strstr($strUrl, "content/full/") || strstr($this->source, "GALE") && !strstr($this->source, "GALE_GVRL") && !in_array("Text available", $notes) || stristr($this->source, "IEEE_XPLORE") || stristr($this->source, "ELSEVIER_SCOPUS") || stristr($this->source, "ELSEVIER_SCIRUS") || stristr($this->source, "SCOPUS4") || strstr($strUrl, "proquest.umi.com") && strstr($strUrl, "Fmt=2") || strstr($strUrl, "gateway.proquest.com") && strstr($strUrl, "xri:fiaf:article")) {
             $link->tag = "XXX";
             // take it out so the parent class doesn't treat it as full-text
             $this->links[] = new Link($strUrl, Link::ORIGINAL_RECORD, $strDisplay);
         } elseif (stristr($this->source, "EBSCO_RZH") || stristr($this->source, "EBSCO") && $strUrl != "" && !strstr($strUrl, "epnet") || stristr($this->source, "NEWPC")) {
             $link->tag = "XXX";
             // take it out so the parent class doesn't treat it as full-text
             $this->links[] = new Link($strUrl, Link::INFORMATIONAL, $strDisplay);
         }
     }
     parent::parseLinks();
     ## jstor links are all pdfs
     if (strstr($this->source, 'JSTOR')) {
         for ($x = 0; $x < count($this->links); $x++) {
             $link = $this->links[$x];
             $link->setType(LINK::PDF);
             $this->links[$x] = $link;
         }
     }
     ## demote links based on config
     $config = Config::getInstance();
     $configIgnoreFullText = $config->getConfig("FULLTEXT_IGNORE_SOURCES", false);
     $configIgnoreFullText = str_replace(" ", "", $configIgnoreFullText);
     $arrIgnore = explode(",", $configIgnoreFullText);
     for ($x = 0; $x < count($this->links); $x++) {
         $link = $this->links[$x];
         if (in_array($this->source, $arrIgnore) || in_array($this->metalib_id, $arrIgnore)) {
             $link->setType(Link::ORIGINAL_RECORD);
         }
         $this->links[$x] = $link;
     }
 }
Example #3
0
 /**
  * Return the search engine config
  *
  * @return Config
  */
 public function getConfig()
 {
     return Config::getInstance();
 }