enju_biblio 0.1.0.pre6 → 0.1.0.pre7
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/import_request.rb +1 -1
- data/app/models/item.rb +1 -1
- data/app/models/manifestation.rb +2 -2
- data/app/views/manifestations/index.opds.builder +24 -0
- data/lib/enju_biblio/engine.rb +0 -2
- data/lib/enju_biblio/version.rb +1 -1
- data/spec/cassette_library/enju_ndl/manifestation.yml +269 -270
- data/spec/cassette_library/enju_ndl/ndl_search.yml +611 -577
- data/spec/dummy/config/application.rb +2 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/production.sqlite3 +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/solr/conf/schema.xml +1 -7
- data/spec/dummy/solr/data/test/index/segments.gen +0 -0
- data/spec/dummy/solr/data/test/index/segments_66b +0 -0
- data/spec/dummy/solr/data/test/spellchecker/segments_1 +0 -0
- data/spec/dummy/tmp/cache/4F7/F90/default_role +0 -0
- data/spec/dummy/tmp/cache/6E4/420/search_engine_all +0 -0
- metadata +39 -41
- data/app/views/ndl_books/index.html.erb +0 -47
- data/spec/cassette_library/enju_ndl2/manifestation.yml +0 -523
- data/spec/cassette_library/enju_ndl2/ndl_search.yml +0 -1140
- data/spec/dummy/solr/data/test/index/segments_1em +0 -0
@@ -7,7 +7,7 @@ class ImportRequest < ActiveRecord::Base
|
|
7
7
|
validate :check_isbn
|
8
8
|
#validate :check_imported, :on => :create
|
9
9
|
#validates_uniqueness_of :isbn, :if => Proc.new{|request| ImportRequest.where("created_at > ?", 1.day.ago).collect(&:isbn).include?(request.isbn)}
|
10
|
-
enju_ndl_search
|
10
|
+
enju_ndl_search if defined?(EnjuNdl)
|
11
11
|
|
12
12
|
state_machine :initial => :pending do
|
13
13
|
event :sm_fail do
|
data/app/models/item.rb
CHANGED
@@ -3,7 +3,7 @@ class Item < ActiveRecord::Base
|
|
3
3
|
attr_accessible :call_number, :item_identifier, :circulation_status_id,
|
4
4
|
:checkout_type_id, :shelf_id, :include_supplements, :note, :url, :price,
|
5
5
|
:acquired_at, :bookstore_id, :missing_since, :budget_type_id,
|
6
|
-
:manifestation_id #,:exemplify_attributes
|
6
|
+
:manifestation_id, :library_id, :required_role_id #,:exemplify_attributes
|
7
7
|
scope :on_shelf, where('shelf_id != 1')
|
8
8
|
scope :on_web, where(:shelf_id => 1)
|
9
9
|
scope :accepted_between, lambda{|from, to| includes(:accept).where('items.created_at BETWEEN ? AND ?', Time.zone.parse(from).beginning_of_day, Time.zone.parse(to).end_of_day)}
|
data/app/models/manifestation.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
atom_feed(:url => manifestations_url(:format => :atom),
|
2
|
+
"xmlns:opds" => "http://opds-spec.org/2010/catalog",
|
3
|
+
"xmlns:jepa" => "http://www.jepa.or.jp/xmlns/atomPhonetics/1.1"
|
4
|
+
) do |feed|
|
5
|
+
feed.title t('manifestation.query_search_result', :query => @query, :library_group_name => @library_group.display_name.localize)
|
6
|
+
feed.updated(@manifestations.first ? @manifestations.first.created_at : Time.zone.now)
|
7
|
+
feed.link :rel => 'start', :href => manifestations_url(:format => :opds), :type => "application/atom+xml;profile=opds-catalog;kind=navigation"
|
8
|
+
|
9
|
+
@manifestations.each do |manifestation|
|
10
|
+
feed.entry(manifestation) do |entry|
|
11
|
+
entry.link :rel => "http://opds-spec.org/acquisition/borrow", :href => manifestation_url(manifestation), :type => 'text/html'
|
12
|
+
entry.title(manifestation.original_title)
|
13
|
+
if defined?(EnjuBookmark)
|
14
|
+
entry.content(manifestation.tags.join(' '), :type => 'html')
|
15
|
+
end
|
16
|
+
|
17
|
+
manifestation.creators.readable_by(current_user).each do |patron|
|
18
|
+
entry.author do |author|
|
19
|
+
author.name(patron.full_name)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/enju_biblio/engine.rb
CHANGED
data/lib/enju_biblio/version.rb
CHANGED