enju_biblio 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/manifestations_controller.rb +36 -20
- data/app/controllers/picture_files_controller.rb +25 -16
- data/app/controllers/series_has_manifestations_controller.rb +4 -0
- data/app/controllers/series_statements_controller.rb +9 -7
- data/app/helpers/series_statements_helper.rb +6 -0
- data/app/models/item.rb +3 -0
- data/app/models/manifestation.rb +29 -15
- data/app/models/patron.rb +2 -0
- data/app/models/resource_import_file.rb +47 -12
- data/app/models/series_has_manifestation.rb +2 -3
- data/app/views/carrier_types/index.html.erb +1 -1
- data/app/views/content_types/index.html.erb +1 -1
- data/app/views/create_types/index.html.erb +1 -1
- data/app/views/creates/_index.html.erb +1 -1
- data/app/views/creates/_index_patron.html.erb +1 -1
- data/app/views/creates/_index_work.html.erb +2 -9
- data/app/views/donates/index.html.erb +1 -1
- data/app/views/exemplifies/index.html.erb +1 -1
- data/app/views/extents/index.html.erb +1 -1
- data/app/views/form_of_works/index.html.erb +1 -1
- data/app/views/frequencies/index.html.erb +1 -1
- data/app/views/import_requests/index.html.erb +1 -1
- data/app/views/import_requests/new.html.erb +1 -1
- data/app/views/items/edit.html.erb +1 -1
- data/app/views/items/show.html.erb +2 -1
- data/app/views/licenses/index.html.erb +1 -1
- data/app/views/manifestation_relationship_types/index.html.erb +1 -1
- data/app/views/manifestation_relationships/index.html.erb +1 -1
- data/app/views/manifestations/_form.html.erb +1 -1
- data/app/views/manifestations/_manifestation.html.erb +21 -17
- data/app/views/manifestations/_paginate_id_link.html.erb +20 -2
- data/app/views/manifestations/_session_ids.html.erb +10 -0
- data/app/views/manifestations/_show_detail_librarian.html.erb +7 -5
- data/app/views/manifestations/_show_detail_user.html.erb +7 -5
- data/app/views/manifestations/_show_index.html.erb +7 -1
- data/app/views/manifestations/_show_series_index.html.erb +15 -0
- data/app/views/manifestations/_show_series_statement.html.erb +30 -0
- data/app/views/manifestations/_submenu_series_statement.html.erb +8 -0
- data/app/views/manifestations/edit.html.erb +1 -1
- data/app/views/manifestations/index.html.erb +11 -0
- data/app/views/manifestations/show.html.erb +2 -2
- data/app/views/medium_of_performances/index.html.erb +1 -1
- data/app/views/owns/index.html.erb +1 -1
- data/app/views/patron_import_files/index.html.erb +1 -1
- data/app/views/patron_import_results/index.html.erb +1 -1
- data/app/views/patron_relationship_types/index.html.erb +1 -1
- data/app/views/patron_relationships/index.html.erb +1 -1
- data/app/views/patron_types/index.html.erb +1 -1
- data/app/views/patrons/_index_expression.html.erb +2 -1
- data/app/views/patrons/_index_manifestation.html.erb +2 -1
- data/app/views/patrons/_index_patron.html.erb +1 -1
- data/app/views/patrons/_index_patron_merge_list.html.erb +1 -1
- data/app/views/patrons/_index_work.html.erb +2 -1
- data/app/views/patrons/edit.html.erb +1 -1
- data/app/views/patrons/show.html.erb +1 -1
- data/app/views/picture_files/_index.html.erb +1 -1
- data/app/views/picture_files/_index_event.html.erb +1 -1
- data/app/views/picture_files/_index_manifestation.html.erb +1 -1
- data/app/views/picture_files/_index_patron.html.erb +1 -1
- data/app/views/picture_files/_index_shelf.html.erb +1 -1
- data/app/views/picture_files/_link.mobile.erb +3 -0
- data/app/views/picture_files/show.mobile.erb +49 -0
- data/app/views/produce_types/index.html.erb +1 -1
- data/app/views/produces/_index.html.erb +1 -1
- data/app/views/produces/_index_manifestation.html.erb +5 -11
- data/app/views/produces/_index_patron.html.erb +1 -1
- data/app/views/realize_types/index.html.erb +1 -1
- data/app/views/realizes/_index.html.erb +1 -1
- data/app/views/realizes/_index_expression.html.erb +5 -11
- data/app/views/realizes/_index_patron.html.erb +1 -1
- data/app/views/resource_import_files/index.html.erb +1 -1
- data/app/views/resource_import_results/index.html.erb +1 -1
- data/app/views/series_has_manifestations/index.html.erb +1 -1
- data/app/views/series_statements/_index.html.erb +1 -1
- data/app/views/series_statements/_index_manifestation.html.erb +1 -1
- data/app/views/series_statements/_index_series_statement_merge_list.html.erb +1 -1
- data/app/views/series_statements/show.html.erb +0 -3
- data/config/locales/translation_en.yml +34 -0
- data/config/locales/translation_ja.yml +34 -0
- data/config/routes.rb +7 -2
- data/lib/enju_biblio.rb +0 -5
- data/lib/enju_biblio/engine.rb +2 -6
- data/lib/enju_biblio/version.rb +1 -1
- data/spec/cassette_library/enju_ndl/ndl_search.yml +1140 -0
- data/spec/controllers/items_controller_spec.rb +1 -1
- data/spec/controllers/series_statements_controller_spec.rb +26 -21
- data/spec/dummy/config/application.rb +1 -0
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/dummy/db/schema.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/enju_leaf.rb +0 -1
- data/spec/dummy/private/system/patron_import_files/patron_imports/000/000/004/original/patron_delete_file.tsv +8 -0
- data/spec/dummy/private/system/patron_import_files/patron_imports/000/000/004/original/patron_import_file_sample1.tsv +5 -0
- data/spec/dummy/private/system/patron_import_files/patron_imports/000/000/004/original/patron_import_file_sample3.tsv +5 -0
- data/spec/dummy/private/system/patron_import_files/patron_imports/000/000/004/original/patron_update_file.tsv +3 -0
- data/spec/dummy/private/system/picture_files/pictures/000/000/005/medium/spinner.gif +0 -0
- data/spec/dummy/private/system/picture_files/pictures/000/000/005/original/spinner.gif +0 -0
- data/spec/dummy/private/system/picture_files/pictures/000/000/005/thumb/spinner.gif +0 -0
- data/spec/dummy/private/system/resource_imports/4/original/isbn_sample.txt +3 -0
- data/spec/dummy/private/system/resource_imports/4/original/item_delete_file.tsv +11 -0
- data/spec/dummy/private/system/resource_imports/4/original/item_update_file.tsv +4 -0
- data/spec/dummy/private/system/resource_imports/4/original/resource_import_file_sample1.tsv +19 -0
- data/spec/dummy/private/system/resource_imports/4/original/resource_import_file_sample2.tsv +19 -0
- data/spec/dummy/private/system/resource_imports/4/original/update_series_statement.tsv +2 -0
- data/spec/dummy/solr/data/test/index/_2z.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_2z.fdx +0 -0
- data/spec/dummy/solr/data/test/index/{_2v.fnm → _2z.fnm} +0 -0
- data/spec/dummy/solr/data/test/index/_2z.frq +0 -0
- data/spec/dummy/solr/data/test/index/_2z.nrm +1 -0
- data/spec/dummy/solr/data/test/index/_2z.prx +0 -0
- data/spec/dummy/solr/data/test/index/_2z.tii +0 -0
- data/spec/dummy/solr/data/test/index/_2z.tis +0 -0
- data/spec/dummy/solr/data/test/index/{_2v.fdt → _39.fdt} +0 -0
- data/spec/dummy/solr/data/test/index/{_2v.fdx → _39.fdx} +0 -0
- data/spec/dummy/solr/data/test/index/_39.fnm +10 -0
- data/spec/dummy/solr/data/test/index/_39.frq +0 -0
- data/spec/dummy/solr/data/test/index/_39.nrm +1 -0
- data/spec/dummy/solr/data/test/index/_39.prx +0 -0
- data/spec/dummy/solr/data/test/index/{_2v.tii → _39.tii} +0 -0
- data/spec/dummy/solr/data/test/index/_39.tis +0 -0
- data/spec/dummy/solr/data/test/index/_39_1.del +0 -0
- data/spec/dummy/solr/data/test/index/_k_3.del +0 -0
- data/spec/dummy/solr/data/test/index/segments.gen +0 -0
- data/spec/dummy/solr/data/test/index/{segments_2v → segments_39} +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
- data/spec/fixtures/exemplifies.yml +6 -0
- data/spec/models/resource_import_file_spec.rb +8 -0
- metadata +88 -129
- data/lib/enju_biblio/expire_editable_fragment.rb +0 -30
- data/lib/enju_biblio/expire_fragment_cache.rb +0 -17
- data/lib/enju_biblio/import_file.rb +0 -13
- data/lib/enju_biblio/master_model.rb +0 -19
- data/lib/enju_biblio/url_validator.rb +0 -10
- data/spec/dummy/app/models/library_group.rb +0 -86
- data/spec/dummy/lib/enju_leaf/localized_name.rb +0 -15
- data/spec/dummy/solr/data/test/index/_2v.frq +0 -0
- data/spec/dummy/solr/data/test/index/_2v.nrm +0 -1
- data/spec/dummy/solr/data/test/index/_2v.prx +0 -0
- data/spec/dummy/solr/data/test/index/_2v.tis +0 -0
- data/spec/dummy/solr/data/test/index/_2v_1.del +0 -0
- data/spec/dummy/solr/data/test/index/_k_2.del +0 -0
- data/spec/dummy/tmp/cache/4AD/470/country_all +0 -0
@@ -1,30 +0,0 @@
|
|
1
|
-
module ExpireEditableFragment
|
2
|
-
def expire_editable_fragment(record, fragments = [])
|
3
|
-
fragments.uniq!
|
4
|
-
if record.is_a?(Manifestation)
|
5
|
-
if fragments.empty?
|
6
|
-
fragments = %w[manifestation_html show_detail_user_html show_detail_librarian_html pickup_html title_html title_mobile index_sru list_identifiers_oai list_records_oai]
|
7
|
-
end
|
8
|
-
expire_manifestation_cache(record, fragments)
|
9
|
-
else
|
10
|
-
I18n.available_locales.each do |locale|
|
11
|
-
Role.all_cache.each do |role|
|
12
|
-
fragments.each do |fragment|
|
13
|
-
expire_fragment(":#{record.class.to_s.downcase}" => record.id, :fragment => fragment, :role => role.name, :locale => locale)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
def expire_manifestation_cache(manifestation, fragments = [])
|
22
|
-
I18n.available_locales.each do |locale|
|
23
|
-
Role.all_cache.each do |role|
|
24
|
-
fragments.uniq.each do |fragment|
|
25
|
-
expire_fragment([:manifestation => manifestation.id, :fragment => fragment, :role => role.name, :locale => locale])
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
class ExpireFragmentCache
|
2
|
-
def self.expire_fragment_cache(record, fragments = [])
|
3
|
-
if record.is_a?(Manifestation)
|
4
|
-
if fragments.empty?
|
5
|
-
fragments = %w[manifestation_html show_detail_user_html show_detail_librarian_html pickup_html title_html title_mobile index_sru]
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
I18n.available_locales.each do |locale|
|
10
|
-
Role.all_cache.each do |role|
|
11
|
-
fragments.each do |fragment|
|
12
|
-
Rails.cache.clear([":#{record.class.to_s.downcase}" => record.id, :fragment => fragment, :role => role.name, :locale => locale])
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module MasterModel
|
2
|
-
def self.included(base)
|
3
|
-
#base.extend ClassMethods
|
4
|
-
base.send :include, InstanceMethods
|
5
|
-
base.class_eval do
|
6
|
-
acts_as_list
|
7
|
-
validates_uniqueness_of :name, :case_sensitive => false
|
8
|
-
validates_presence_of :name, :display_name
|
9
|
-
before_validation :set_display_name, :on => :create
|
10
|
-
normalize_attributes :name
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
module InstanceMethods
|
15
|
-
def set_display_name
|
16
|
-
self.display_name = "#{I18n.locale}: #{self.name}" if self.display_name.blank?
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,86 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
class LibraryGroup < ActiveRecord::Base
|
3
|
-
attr_accessible :name, :display_name, :short_name, :email, :my_networks,
|
4
|
-
:login_banner, :note, :country_id, :admin_networks, :url
|
5
|
-
|
6
|
-
#include Singleton
|
7
|
-
#include Configurator
|
8
|
-
include MasterModel
|
9
|
-
|
10
|
-
has_many :libraries
|
11
|
-
belongs_to :country
|
12
|
-
|
13
|
-
validates :email, :format => {:with => /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i}, :presence => true
|
14
|
-
validates :url, :presence => true, :url => true
|
15
|
-
after_save :clear_site_config_cache
|
16
|
-
|
17
|
-
def clear_site_config_cache
|
18
|
-
Rails.cache.delete('library_site_config')
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.site_config
|
22
|
-
#if Rails.env == 'production'
|
23
|
-
# Rails.cache.fetch('library_site_config'){LibraryGroup.find(1)}
|
24
|
-
#else
|
25
|
-
LibraryGroup.find(1)
|
26
|
-
#end
|
27
|
-
rescue ActiveRecord::RecordNotFound
|
28
|
-
nil
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.system_name(locale = I18n.locale)
|
32
|
-
LibraryGroup.site_config.display_name.localize(locale)
|
33
|
-
end
|
34
|
-
|
35
|
-
def config?
|
36
|
-
true if self == LibraryGroup.site_config
|
37
|
-
end
|
38
|
-
|
39
|
-
def real_libraries
|
40
|
-
# 物理的な図書館 = IDが1以外
|
41
|
-
libraries.where('id != 1').all
|
42
|
-
end
|
43
|
-
|
44
|
-
def network_access_allowed?(ip_address, options = {})
|
45
|
-
options = {:network_type => :lan}.merge(options)
|
46
|
-
client_ip = IPAddr.new(ip_address)
|
47
|
-
case options[:network_type]
|
48
|
-
when :admin
|
49
|
-
allowed_networks = self.admin_networks.to_s.split
|
50
|
-
else
|
51
|
-
allowed_networks = self.my_networks.to_s.split
|
52
|
-
end
|
53
|
-
allowed_networks.each do |allowed_network|
|
54
|
-
begin
|
55
|
-
network = IPAddr.new(allowed_network)
|
56
|
-
return true if network.include?(client_ip)
|
57
|
-
rescue ArgumentError
|
58
|
-
nil
|
59
|
-
end
|
60
|
-
end
|
61
|
-
return false
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
|
66
|
-
# == Schema Information
|
67
|
-
#
|
68
|
-
# Table name: library_groups
|
69
|
-
#
|
70
|
-
# id :integer not null, primary key
|
71
|
-
# name :string(255) not null
|
72
|
-
# display_name :text
|
73
|
-
# short_name :string(255) not null
|
74
|
-
# email :string(255)
|
75
|
-
# my_networks :text
|
76
|
-
# login_banner :text
|
77
|
-
# note :text
|
78
|
-
# country_id :integer
|
79
|
-
# created_at :datetime not null
|
80
|
-
# updated_at :datetime not null
|
81
|
-
# admin_networks :text
|
82
|
-
# allow_bookmark_external_url :boolean default(FALSE), not null
|
83
|
-
# position :integer
|
84
|
-
# url :string(255) default("http://localhost:3000/")
|
85
|
-
#
|
86
|
-
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module LocalizedName
|
2
|
-
def localize(locale = I18n.locale)
|
3
|
-
string = YAML.load(self)
|
4
|
-
if string.is_a?(Hash) and string[locale.to_s]
|
5
|
-
return string[locale.to_s]
|
6
|
-
end
|
7
|
-
self
|
8
|
-
rescue NoMethodError
|
9
|
-
self
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
class String
|
14
|
-
include LocalizedName
|
15
|
-
end
|
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
NRM�||||||||||||||yy||yy||yyyxyx||||||||||||||||||||||||||||||||||||||||||yy||yy||y||x|x��||��||�||�|�||qt||qt||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|