Permalink
Browse files

update to new bento_search with new decorators architecture

  • Loading branch information...
jrochkind committed Dec 26, 2012
1 parent 2dd4dcf commit 572b586b5f43e7a400a887359c984e45eb1d11b4
Showing with 30 additions and 54 deletions.
  1. +14 −12 Gemfile.lock
  2. +16 −42 config/initializers/bento_search.rb
View
@@ -1,11 +1,12 @@
GIT
remote: git://github.com/jrochkind/bento_search.git
- revision: f4f00a0c77b433e5221c13db96b7036f8ae0114f
+ revision: c01130e58fef14731b05e45e1ec5503fc82e86be
specs:
- bento_search (0.5.0)
+ bento_search (0.7.0)
confstruct (>= 0.2.3, < 1.0)
httpclient (~> 2.2.5)
- multi_json (~> 1.3)
+ language_list
+ multi_json (>= 1.0.4, < 2.0)
nokogiri
openurl (>= 0.3.1, < 1.1)
rails (~> 3.2.3)
@@ -43,7 +44,7 @@ GEM
multi_json (~> 1.0)
arel (3.0.2)
bootstrap-sass (2.0.4.0)
- builder (3.0.0)
+ builder (3.0.4)
celluloid (0.11.1)
timers (>= 1.0.0)
coffee-rails (3.2.2)
@@ -54,15 +55,15 @@ GEM
execjs
coffee-script-source (1.3.3)
columnize (0.3.6)
- confstruct (0.2.4)
+ confstruct (0.2.5)
debugger (1.2.0)
columnize (>= 0.3.1)
debugger-linecache (~> 1.1.1)
debugger-ruby_core_source (~> 1.1.3)
debugger-linecache (1.1.2)
debugger-ruby_core_source (>= 1.1.1)
debugger-ruby_core_source (1.1.3)
- ensure_valid_encoding (0.5.2)
+ ensure_valid_encoding (0.5.3)
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
@@ -74,15 +75,16 @@ GEM
railties (>= 3.1.0, < 5.0)
thor (~> 0.14)
json (1.7.5)
+ language_list (0.0.3)
libv8 (3.3.10.4)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
marc (0.5.0)
mime-types (1.19)
- multi_json (1.3.6)
- nokogiri (1.5.5)
+ multi_json (1.5.0)
+ nokogiri (1.5.6)
openurl (0.4.2)
ensure_valid_encoding
marc
@@ -92,7 +94,7 @@ GEM
rack (>= 0.4)
rack-ssl (1.3.2)
rack
- rack-test (0.6.1)
+ rack-test (0.6.2)
rack (>= 1.0)
rails (3.2.6)
actionmailer (= 3.2.6)
@@ -109,7 +111,7 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
- rake (0.9.2.2)
+ rake (10.0.3)
rdoc (3.12)
json (~> 1.4)
sass (3.2.1)
@@ -129,10 +131,10 @@ GEM
thor (0.16.0)
tilt (1.3.3)
timers (1.0.1)
- treetop (1.4.10)
+ treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.33)
+ tzinfo (0.3.35)
uglifier (1.2.7)
execjs (>= 0.3.0)
multi_json (~> 1.3)
@@ -6,17 +6,21 @@
# services
$battle_engines = %w{primo eds ebscohost summon scopus}
+# An item decorator class that suppresses all links.
+# Could be defined elsewhere in it's own file, but it's so
+# simple that it's straightforward to define here.
+class NoLinkDecorator < BentoSearch::StandardDecorator
+ include BentoSearch::NoLinks
+end
+
+
+
BentoSearch.register_engine("scopus") do |conf|
conf.engine = "BentoSearch::ScopusEngine"
conf.api_key = ENV["SCOPUS_KEY"]
# No links for our test
- conf.item_decorators = [ BentoSearch::NoLinks ]
-
- #conf.item_decorators = [
- # BentoSearch::OpenurlMainLink[:base_url => "http://findit.library.jhu.edu/resolve", :extra_query => "&umlaut.skip_resolve_menu_for_type=fulltext"] ,
- # BentoSearch::OpenurlAddOtherLink[:base_url => "http://findit.library.jhu.edu/resolve", :link_name => "Find It @ JH"]
- #]
+ conf.for_display = {:decorator => "NoLinkDecorator"}
end
BentoSearch.register_engine("summon") do |conf|
@@ -37,15 +41,8 @@
"s.role" => "authenticated"
}
-
# No links for our test
- conf.item_decorators = [ BentoSearch::NoLinks ]
-
- #conf.item_decorators = [
- # BentoSearch::OpenurlMainLink[:base_url => "http://findit.library.jhu.edu/resolve", :extra_query => "&umlaut.skip_resolve_menu_for_type=fulltext"] ,
- # BentoSearch::OpenurlAddOtherLink[:base_url => "http://findit.library.jhu.edu/resolve", :link_name => "Find It @ JH"]
- #]
-
+ conf.for_display = {:decorator => "NoLinkDecorator"}
end
require "#{Rails.root}/config/ebsco_dbs.rb"
@@ -62,21 +59,9 @@
#ofm eft gft bft asf aft ijh hft air flh geh ssf hgh rih cja 22h 20h fmh rph jph}
# No links for our test
- conf.item_decorators = [ BentoSearch::NoLinks ]
-
- #conf.item_decorators = [
- # BentoSearch::OpenurlMainLink[:base_url => "http://findit.library.jhu.edu/resolve", :extra_query => "&umlaut.skip_resolve_menu_for_type=fulltext"] ,
- # BentoSearch::OpenurlAddOtherLink[:base_url => "http://findit.library.jhu.edu/resolve", :link_name => "Find It @ JH"]
- #]
+ conf.for_display = {:decorator => "NoLinkDecorator"}
end
-#BentoSearch.register_engine("eds_old_api") do |conf|
-# conf.engine = "BentoSearch::EbscoHostEngine"
-
-# conf.profile_id = ENV['EDS_PROFILE']
-# conf.profile_password = ENV['EBSCOHOST_PWD']
-
-#end
BentoSearch.register_engine("eds") do |conf|
conf.engine = "BentoSearch::EdsEngine"
@@ -90,14 +75,8 @@
conf.auth = true
# No links for our test
- conf.item_decorators = [ BentoSearch::NoLinks ]
-
- #conf.item_decorators = [
- # BentoSearch::OnlyPremadeOpenurl,
- # BentoSearch::OpenurlMainLink[:base_url => "http://findit.library.jhu.edu/resolve", :extra_query => "&umlaut.skip_resolve_menu_for_type=fulltext"] ,
- # BentoSearch::OpenurlAddOtherLink[:overwrite => true, :base_url => "http://findit.library.jhu.edu/resolve", :link_name => "Find It @ JH"]
- #]
-
+ conf.for_display = {:decorator => "NoLinkDecorator"}
+
# http://support.ebsco.com/knowledge_base/detail.php?id=5382
conf.only_source_types = [
"Academic Journals",
@@ -132,12 +111,7 @@
}
# No links for our test
- conf.item_decorators = [ BentoSearch::NoLinks ]
-
- #conf.item_decorators = [
- # BentoSearch::OpenurlMainLink[:base_url => "http://findit.library.jhu.edu/resolve", :extra_query => "&umlaut.skip_resolve_menu_for_type=fulltext"] ,
- # BentoSearch::OpenurlAddOtherLink[:base_url => "http://findit.library.jhu.edu/resolve", :link_name => "Find It @ JH"]
- #]
+ conf.for_display = {:decorator => "NoLinkDecorator"}
end
-
+

0 comments on commit 572b586

Please sign in to comment.