Ejemplo n.º 1
0
 public function __construct(MvcEvent $e, $id, Engine $engine)
 {
     $this->request = $e->getRequest();
     $this->registry = Registry::getInstance();
     $this->id = $id;
     $this->query = $engine->getQuery($this->request);
     $this->config = $engine->getConfig();
 }
Ejemplo n.º 2
0
 /**
  * Create Worldcat Search Engine
  */
 public function __construct($role, $source)
 {
     parent::__construct();
     $config_key = $this->config->getConfig("WORLDCAT_API_KEY", true);
     $config_always_guest = $this->config->getConfig("WORLDCAT_SEARCH_AS_GUEST", false);
     // worldcat search object
     $this->worldcat_client = new Worldcat($config_key, Factory::getHttpClient());
     $this->group = new ConfigGroup();
     // if user is a guest, make it open, and return it pronto, since we
     // can't use the limiters below
     if ($role == "guest" || $config_always_guest != null) {
         $this->worldcat_client->setServiceLevel("default");
     } elseif ($source != "") {
         $this->group = $this->config->getWorldcatGroup($source);
         // no workset grouping, please
         if ($this->group->frbr == "false") {
             $this->worldcat_client->setWorksetGroupings(false);
         }
         // limit to certain libraries
         if ($this->group->libraries_include != null) {
             $this->worldcat_client->limitToLibraries($this->group->libraries_include);
         }
         // exclude certain libraries
         if ($this->group->libraries_exclude != null) {
             $this->worldcat_client->excludeLibraries($this->group->libraries_exclude);
         }
         // limit results to specific document types; a limit entry will
         // take presidence over any format specifically excluded
         if ($this->group->limit_material_types != null) {
             $this->worldcat_client->limitToMaterialType($this->group->limit_material_types);
         } elseif ($this->group->exclude_material_types != null) {
             $this->worldcat_client->excludeMaterialType($this->group->exclude_material_types);
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     // server address
     $this->server = $this->config->getConfig('SOLR', true);
     $this->server = rtrim($this->server, '/');
     $this->server .= "/select/?version=2.2";
 }
Ejemplo n.º 4
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $id = $this->config->getConfig("SUMMON_ID", true);
     $key = $this->config->getConfig("SUMMON_KEY", true);
     $this->summon_client = new Summon($id, $key, Factory::getHttpClient());
     // formats to exclude
     $this->formats_exclude = explode(',', $this->config->getConfig("EXCLUDE_FORMATS"));
 }
Ejemplo n.º 5
0
 /**
  * Return an individual record
  * 
  * @param string	record identifier
  * @return Results
  */
 public function getRecord($id)
 {
     $results = parent::getRecord($id);
     // enhance
     $results->getRecord(0)->addRecommendations();
     $results->markFullText();
     $results->markRefereed();
     return $results;
 }
Ejemplo n.º 6
0
 /**
  * Return an individual record
  * 
  * @param string	record identifier
  * @return Results
  */
 public function getRecord($id)
 {
     // get the record
     $results = parent::getRecord($id);
     $record = $results->getRecord(0);
     $record->fetchHoldings();
     // item availability
     $record->addReviews();
     // good read reviews
     return $results;
 }
Ejemplo n.º 7
0
 /**
  * Return an individual record
  * 
  * @param string	record identifier
  * @return Results
  */
 public function getRecord($id)
 {
     // get result
     $results = parent::getRecord($id);
     // enhance
     $results->getRecord(0)->addRecommendations();
     // bx
     if ($this->config->getConfig('mark_fulltext_using_export', false, false)) {
         $results->markFullText();
         // sfx data
     }
     return $results;
 }
Ejemplo n.º 8
0
 /**
  * Constructor
  */
 public function __construct($on_campus = true, $scope = "")
 {
     parent::__construct();
     // server info
     $this->server = $this->config->getConfig('PRIMO_ADDRESS', true);
     $this->server = rtrim($this->server, '/');
     // institutional id's
     $this->institution = $this->config->getConfig('INSTITUTION', true);
     $this->vid = $this->config->getConfig('VID', false);
     // scope
     $loc = $this->config->getConfig('LOC', false, $scope);
     if ($loc != "") {
         $this->loc = explode(";", $loc);
     }
     // on campus
     $this->on_campus = $on_campus;
 }
 /**
  * Advanced search screen
  */
 public function advancedAction()
 {
     $this->cache = new Cache();
     $id = $this->id . '_facets';
     // get a cached copy if we got it
     $facets = $this->cache->get($id);
     if (!$facets instanceof Facets) {
         $facets = $this->engine->getAllFacets();
         $this->cache->set($id, $facets, time() + 7 * 24 * 60 * 60);
         // one week cache
     }
     $terms_number = count($this->query->getQueryTerms());
     // add blank terms to get us to 4 rows
     if ($terms_number < 4) {
         for ($x = $terms_number + 1; $x <= 4; $x++) {
             $this->query->addTerm($x, null, null, null, null);
         }
     }
     $this->response->setVariable('query', $this->query);
     $this->response->setVariable('limits', $facets);
     $this->response->setView('search/advanced.xsl');
     return $this->response;
 }
Ejemplo n.º 10
0
 /**
  * New Savd Records Engine
  */
 public function __construct()
 {
     parent::__construct();
     $this->datamap = new SavedRecords();
 }
Ejemplo n.º 11
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->username = $this->config->getConfig("EBSCO_USERNAME");
     $this->password = $this->config->getConfig("EBSCO_PASSWORD");
 }
Ejemplo n.º 12
0
 /**
  * Return an individual record
  * 
  * @param string	record identifier
  * @return Results
  */
 public function getRecord($id)
 {
     $results = parent::getRecord($id);
     // add holdings
     $record = $results->getRecord(0);
     if ($this->group->libraries_include != '' && $record != null && $this->group->show_holdings == true) {
         $library_codes = $this->group->libraries_include;
         $holdings_xml = $this->worldcat_client->getHoldings($id, $library_codes);
         $record->holdings = $this->extractHoldings($holdings_xml);
     }
     return $results;
 }
Ejemplo n.º 13
0
 /**
  * Create new Google Appliance Search Engine
  */
 public function __construct()
 {
     parent::__construct();
     $this->server = $this->config->getConfig('google_address', true);
     $this->server = rtrim($this->server, '/');
 }