enju_oai 0.1.0.pre13 → 0.1.0.pre14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/manifestations/identify.oai.builder +2 -2
- data/app/views/manifestations/index.oai.builder +1 -1
- data/app/views/manifestations/list_identifiers.oai.builder +2 -2
- data/app/views/manifestations/list_metadata_formats.oai.builder +1 -1
- data/app/views/manifestations/list_records.oai.builder +2 -2
- data/app/views/manifestations/list_sets.oai.builder +1 -1
- data/app/views/manifestations/show.oai.builder +1 -1
- data/lib/enju_oai/version.rb +1 -1
- data/spec/dummy/app/models/user.rb +5 -91
- data/spec/dummy/db/migrate/001_create_agents.rb +0 -3
- data/spec/dummy/db/migrate/002_devise_create_users.rb +16 -6
- data/spec/dummy/db/migrate/005_create_manifestations.rb +0 -1
- data/spec/dummy/db/migrate/006_create_items.rb +0 -3
- data/spec/dummy/db/migrate/029_create_subjects.rb +27 -0
- data/spec/dummy/db/migrate/032_create_checkins.rb +17 -0
- data/spec/dummy/db/migrate/033_create_checkouts.rb +25 -0
- data/spec/dummy/db/migrate/035_create_reserves.rb +26 -0
- data/spec/dummy/db/migrate/080_create_library_groups.rb +0 -1
- data/spec/dummy/db/migrate/113_create_events.rb +23 -0
- data/spec/dummy/db/migrate/114_create_event_categories.rb +16 -0
- data/spec/dummy/db/migrate/121_create_checked_items.rb +17 -0
- data/spec/dummy/db/migrate/127_create_use_restrictions.rb +16 -0
- data/spec/dummy/db/migrate/129_create_item_has_use_restrictions.rb +16 -0
- data/spec/dummy/db/migrate/132_create_circulation_statuses.rb +16 -0
- data/spec/dummy/db/migrate/142_create_classifications.rb +19 -0
- data/spec/dummy/db/migrate/144_create_classification_types.rb +16 -0
- data/spec/dummy/db/migrate/145_create_subject_heading_types.rb +16 -0
- data/spec/dummy/db/migrate/146_create_subject_types.rb +16 -0
- data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +0 -2
- data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +0 -2
- data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +25 -0
- data/spec/dummy/db/migrate/20081030023412_create_checkout_types.rb +17 -0
- data/spec/dummy/db/migrate/20081030023518_create_user_group_has_checkout_types.rb +25 -0
- data/spec/dummy/db/migrate/20081030023615_create_carrier_type_has_checkout_types.rb +18 -0
- data/spec/dummy/db/migrate/20081212075554_create_checkout_stat_has_manifestations.rb +17 -0
- data/spec/dummy/db/migrate/20081212080038_create_manifestation_checkout_stats.rb +15 -0
- data/spec/dummy/db/migrate/20081215094302_create_user_checkout_stats.rb +15 -0
- data/spec/dummy/db/migrate/20081215094955_create_checkout_stat_has_users.rb +17 -0
- data/spec/dummy/db/migrate/20081216190517_create_reserve_stat_has_manifestations.rb +17 -0
- data/spec/dummy/db/migrate/20081216190724_create_manifestation_reserve_stats.rb +15 -0
- data/spec/dummy/db/migrate/20081220023628_create_user_reserve_stats.rb +15 -0
- data/spec/dummy/db/migrate/20081220034117_create_reserve_stat_has_users.rb +17 -0
- data/spec/dummy/db/migrate/20090321130448_add_completed_at_to_user_checkout_stat.rb +23 -0
- data/spec/dummy/db/migrate/20090519203307_create_participates.rb +17 -0
- data/spec/dummy/db/migrate/20090831220301_create_lending_policies.rb +21 -0
- data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +0 -1
- data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +15 -0
- data/spec/dummy/db/migrate/20110301134521_add_expire_date_to_reserve.rb +9 -0
- data/spec/dummy/db/migrate/20110328130826_add_current_checkout_count_to_user_group_has_checkout_type.rb +9 -0
- data/spec/dummy/db/migrate/20110621093332_remove_expire_date_from_reserve.rb +9 -0
- data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +9 -0
- data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +12 -0
- data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +13 -0
- data/spec/dummy/db/migrate/20110913120629_add_lft_and_rgt_to_classification.rb +11 -0
- data/spec/dummy/db/migrate/20111217234412_add_save_checkout_history_to_user.rb +5 -0
- data/spec/dummy/db/migrate/20111218002349_add_checkout_icalendar_token_to_user.rb +6 -0
- data/spec/dummy/db/migrate/20120406020752_add_url_to_subject.rb +5 -0
- data/spec/dummy/db/migrate/20120413051535_add_event_import_fingerprint_to_event_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413170734_add_error_message_to_event_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120415060342_rename_event_import_file_imported_at_to_executed_at.rb +9 -0
- data/spec/dummy/db/migrate/20120424103932_add_librarian_id_to_checked_item.rb +5 -0
- data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +0 -10
- data/spec/dummy/db/migrate/20130303124821_add_retained_at_to_reserve.rb +5 -0
- data/spec/dummy/db/migrate/20130304015019_add_postponed_at_to_reserve.rb +5 -0
- data/spec/dummy/db/migrate/20130416054135_add_circulation_status_id_to_item.rb +8 -0
- data/spec/dummy/db/migrate/20130504133816_add_manifestation_id_to_subject.rb +6 -0
- data/spec/dummy/db/migrate/20130504143515_add_manifestation_id_to_classification.rb +6 -0
- data/spec/dummy/db/migrate/20130504195916_add_subject_heading_type_id_to_subject.rb +5 -0
- data/spec/dummy/db/migrate/20130519065638_add_lock_version_to_reserve.rb +5 -0
- data/spec/dummy/db/migrate/20130519065837_add_lock_version_to_checkin.rb +5 -0
- data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +18 -0
- data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +11 -0
- data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +20 -0
- data/spec/dummy/db/migrate/20140518050147_create_reserve_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140523171309_create_event_import_file_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140528045518_create_user_checkout_stat_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140528045539_create_user_reserve_stat_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140528045600_create_manifestation_checkout_stat_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140528045617_create_manifestation_reserve_stat_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140610123439_drop_email_unique_constraint_enju_leaf_rc10.rb +11 -0
- data/spec/dummy/db/migrate/20140614065404_create_resource_export_files.rb +11 -0
- data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140628071719_add_user_encoding_to_event_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140628073524_add_user_encoding_to_agent_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140628073535_add_user_encoding_to_resource_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +11 -0
- data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140720140916_add_binding_item_identifier_to_item.rb +8 -0
- data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140721151416_add_default_shelf_id_to_resource_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140802082007_add_manifestation_id_to_item.rb +6 -0
- data/spec/dummy/db/migrate/20140810061942_add_user_id_to_user_checkout_stat.rb +12 -0
- data/spec/dummy/db/migrate/20140810091231_add_checkout_icalendar_token_to_profile.rb +6 -0
- data/spec/dummy/db/migrate/20140810091417_add_save_checkout_history_to_profile.rb +5 -0
- data/spec/dummy/db/migrate/20140811031145_add_expired_at_to_profile.rb +5 -0
- data/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb +11 -0
- data/spec/dummy/db/migrate/20140812153137_create_event_export_file_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140813182425_add_publication_place_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb +5 -0
- data/spec/dummy/db/schema.rb +678 -42
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/solr/default/data/index/_6y.fdt +0 -0
- data/spec/dummy/solr/default/data/index/{_5a.si → _6y.si} +0 -0
- data/spec/dummy/solr/default/data/index/{_5a_Lucene41_0.tim → _6y_Lucene41_0.tim} +0 -0
- data/spec/dummy/solr/default/data/index/_6y_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/default/data/index/_6z.fdt +0 -0
- data/spec/dummy/solr/default/data/index/{_5b.si → _6z.si} +0 -0
- data/spec/dummy/solr/default/data/index/{_5b_Lucene41_0.tim → _6z_Lucene41_0.tim} +0 -0
- data/spec/dummy/solr/default/data/index/_6z_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/default/data/index/_70.fdt +0 -0
- data/spec/dummy/solr/default/data/index/_70.nvd +0 -0
- data/spec/dummy/solr/default/data/index/{_5c.si → _70.si} +0 -0
- data/spec/dummy/solr/default/data/index/_70_Lucene41_0.doc +0 -0
- data/spec/dummy/solr/default/data/index/_70_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/default/data/index/_70_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/default/data/index/_70_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/default/data/index/segments.gen +0 -0
- data/spec/dummy/solr/default/data/index/segments_9l +0 -0
- data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000000261 → tlog.0000000000000000341} +0 -0
- data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000000262 → tlog.0000000000000000342} +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000343 +0 -0
- data/spec/fixtures/agent_import_files.yml +12 -16
- data/spec/fixtures/agent_import_results.yml +5 -5
- data/spec/fixtures/agent_relationship_types.yml +7 -7
- data/spec/fixtures/agent_relationships.yml +6 -6
- data/spec/fixtures/agent_types.yml +7 -7
- data/spec/fixtures/agents.yml +10 -23
- data/spec/fixtures/baskets.yml +80 -0
- data/spec/fixtures/carrier_types.yml +6 -6
- data/spec/fixtures/circulation_statuses.yml +136 -0
- data/spec/fixtures/content_types.yml +4 -4
- data/spec/fixtures/countries.yml +2 -2
- data/spec/fixtures/create_types.yml +3 -3
- data/spec/fixtures/creates.yml +5 -6
- data/spec/fixtures/donates.yml +5 -5
- data/spec/fixtures/event_categories.yml +55 -0
- data/spec/fixtures/events.yml +142 -0
- data/spec/fixtures/exemplifies.yml +5 -6
- data/spec/fixtures/extents.yml +4 -4
- data/spec/fixtures/form_of_works.yml +4 -4
- data/spec/fixtures/frequencies.yml +4 -4
- data/spec/fixtures/identifier_types.yml +7 -0
- data/spec/fixtures/import_requests.yml +3 -7
- data/spec/fixtures/item_has_use_restrictions.yml +61 -0
- data/spec/fixtures/items.yml +93 -19
- data/spec/fixtures/languages.yml +3 -3
- data/spec/fixtures/library_groups.yml +0 -2
- data/spec/fixtures/licenses.yml +4 -4
- data/spec/fixtures/manifestation_relationship_types.yml +4 -4
- data/spec/fixtures/manifestation_relationships.yml +3 -3
- data/spec/fixtures/manifestations.yml +1 -2
- data/spec/fixtures/medium_of_performances.yml +4 -4
- data/spec/fixtures/owns.yml +5 -5
- data/spec/fixtures/picture_files.yml +4 -4
- data/spec/fixtures/produce_types.yml +3 -3
- data/spec/fixtures/produces.yml +5 -6
- data/spec/fixtures/profiles.yml +98 -0
- data/spec/fixtures/realize_types.yml +3 -3
- data/spec/fixtures/realizes.yml +5 -6
- data/spec/fixtures/series_statements.yml +15 -2
- data/spec/fixtures/user_group_has_checkout_types.yml +111 -0
- data/spec/fixtures/user_groups.yml +10 -3
- data/spec/fixtures/users.yml +0 -42
- data/spec/spec_helper.rb +5 -0
- metadata +282 -82
- data/spec/dummy/solr/default/data/index/_5a.fdt +0 -0
- data/spec/dummy/solr/default/data/index/_5a_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/default/data/index/_5b.fdt +0 -0
- data/spec/dummy/solr/default/data/index/_5b_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/default/data/index/_5c.fdt +0 -0
- data/spec/dummy/solr/default/data/index/_5c.nvd +0 -0
- data/spec/dummy/solr/default/data/index/_5c_Lucene41_0.doc +0 -0
- data/spec/dummy/solr/default/data/index/_5c_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/default/data/index/_5c_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/default/data/index/_5c_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/default/data/index/segments_7d +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000263 +0 -0
- data/spec/fixtures/resource_import_files.yml +0 -47
- data/spec/fixtures/resource_import_results.yml +0 -29
- /data/spec/dummy/solr/default/data/index/{_5a.fdx → _6y.fdx} +0 -0
- /data/spec/dummy/solr/default/data/index/{_5a.fnm → _6y.fnm} +0 -0
- /data/spec/dummy/solr/default/data/index/{_5a.nvd → _6y.nvd} +0 -0
- /data/spec/dummy/solr/default/data/index/{_5a.nvm → _6y.nvm} +0 -0
- /data/spec/dummy/solr/default/data/index/{_5a_Lucene41_0.doc → _6y_Lucene41_0.doc} +0 -0
- /data/spec/dummy/solr/default/data/index/{_5a_Lucene41_0.pos → _6y_Lucene41_0.pos} +0 -0
- /data/spec/dummy/solr/default/data/index/{_5b.fdx → _6z.fdx} +0 -0
- /data/spec/dummy/solr/default/data/index/{_5b.fnm → _6z.fnm} +0 -0
- /data/spec/dummy/solr/default/data/index/{_5b.nvd → _6z.nvd} +0 -0
- /data/spec/dummy/solr/default/data/index/{_5b.nvm → _6z.nvm} +0 -0
- /data/spec/dummy/solr/default/data/index/{_5b_Lucene41_0.doc → _6z_Lucene41_0.doc} +0 -0
- /data/spec/dummy/solr/default/data/index/{_5b_Lucene41_0.pos → _6z_Lucene41_0.pos} +0 -0
- /data/spec/dummy/solr/default/data/index/{_5c.fdx → _70.fdx} +0 -0
- /data/spec/dummy/solr/default/data/index/{_5c.fnm → _70.fnm} +0 -0
- /data/spec/dummy/solr/default/data/index/{_5c.nvm → _70.nvm} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c77c1417b32310473a58259d82eb8638cc6a143b
|
4
|
+
data.tar.gz: 58faf22b39b837611e4e2289eb6407e0c9e1c203
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edf443d15893a84d0b237a186e824ce59994699d71574189b27a0728aaaed259f9421b9571367c8fbfe00dad6f2a732d09dfd6b712c58be89f4c97713da0c005
|
7
|
+
data.tar.gz: 82eacf7252c7a611cdeca24bddaddf330e50cfee347f3128b9880489c2d17263ea63ec758b555db515beb2e16c52d74a712b9d0c37cb16cbcb2bbc186e98c51d
|
@@ -3,10 +3,10 @@ xml.tag! "OAI-PMH", :xmlns => "http://www.openarchives.org/OAI/2.0/",
|
|
3
3
|
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
|
4
4
|
"xsi:schemaLocation" => "http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd" do
|
5
5
|
xml.responseDate Time.zone.now.utc.iso8601
|
6
|
-
xml.request manifestations_url(:
|
6
|
+
xml.request manifestations_url(format: :oai), :verb => "Identify"
|
7
7
|
xml.Identify do
|
8
8
|
xml.repositoryName LibraryGroup.site_config.name
|
9
|
-
xml.baseURL manifestations_url(:
|
9
|
+
xml.baseURL manifestations_url(format: :oai)
|
10
10
|
xml.protocolVersion "2.0"
|
11
11
|
xml.adminEmail LibraryGroup.site_config.email
|
12
12
|
xml.earliestDatestamp Manifestation.last.created_at.utc.iso8601 if Manifestation.last
|
@@ -4,7 +4,7 @@ xml.tag! "OAI-PMH",
|
|
4
4
|
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
|
5
5
|
"xsi:schemaLocation" => "http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd" do
|
6
6
|
xml.responseDate Time.zone.now.utc.iso8601
|
7
|
-
xml.request manifestations_url(:
|
7
|
+
xml.request manifestations_url(format: :oai)
|
8
8
|
@oai[:errors].each do |error|
|
9
9
|
xml.error :code => error
|
10
10
|
end
|
@@ -3,13 +3,13 @@ xml.tag! "OAI-PMH", :xmlns => "http://www.openarchives.org/OAI/2.0/",
|
|
3
3
|
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
|
4
4
|
"xsi:schemaLocation" => "http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd" do
|
5
5
|
xml.responseDate Time.zone.now.utc.iso8601
|
6
|
-
xml.request manifestations_url(:
|
6
|
+
xml.request manifestations_url(format: :oai), :verb => "ListIdentifiers", :metadataPrefix => "oai_dc"
|
7
7
|
@oai[:errors].each do |error|
|
8
8
|
xml.error :code => error
|
9
9
|
end
|
10
10
|
xml.ListIdentifiers do
|
11
11
|
@manifestations.each do |manifestation|
|
12
|
-
cache([manifestation, :
|
12
|
+
cache([manifestation, fragment: 'list_identifiers_oai', role: current_user_role_name, locale: @locale]) do %>
|
13
13
|
xml.header do
|
14
14
|
xml.identifier manifestation.oai_identifier
|
15
15
|
xml.datestamp manifestation.updated_at.utc.iso8601
|
@@ -3,7 +3,7 @@ xml.tag! "OAI-PMH", :xmlns => "http://www.openarchives.org/OAI/2.0/",
|
|
3
3
|
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
|
4
4
|
"xsi:schemaLocation" => "http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd" do
|
5
5
|
xml.responseDate Time.zone.now.utc.iso8601
|
6
|
-
xml.request manifestations_url(:
|
6
|
+
xml.request manifestations_url(format: :oai), :verb => "ListMetadataFormats"
|
7
7
|
xml.ListMetadataFormats do
|
8
8
|
xml.metadataFormat do
|
9
9
|
xml.metadataPrefix "oai_dc"
|
@@ -12,13 +12,13 @@ xml.tag! "OAI-PMH", :xmlns => "http://www.openarchives.org/OAI/2.0/",
|
|
12
12
|
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
|
13
13
|
"xsi:schemaLocation" => "http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd" do
|
14
14
|
xml.responseDate Time.zone.now.utc.iso8601
|
15
|
-
xml.request manifestations_url(:
|
15
|
+
xml.request manifestations_url(format: :oai), request_attr('oai_dc')
|
16
16
|
@oai[:errors].each do |error|
|
17
17
|
xml.error :code => error
|
18
18
|
end
|
19
19
|
xml.ListRecords do
|
20
20
|
@manifestations.each do |manifestation|
|
21
|
-
cache([manifestation, :
|
21
|
+
cache([manifestation, fragment: 'list_records_oai', role: current_user_role_name, locale: @locale]) do %>
|
22
22
|
xml.record do
|
23
23
|
xml.header do
|
24
24
|
xml.identifier manifestation.oai_identifier
|
@@ -3,7 +3,7 @@ xml.tag! "OAI-PMH", :xmlns => "http://www.openarchives.org/OAI/2.0/",
|
|
3
3
|
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
|
4
4
|
"xsi:schemaLocation" => "http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd" do
|
5
5
|
xml.responseDate Time.zone.now.utc.iso8601
|
6
|
-
xml.request manifestations_url(:
|
6
|
+
xml.request manifestations_url(format: :oai), :verb => "ListSets"
|
7
7
|
xml.ListSets do
|
8
8
|
@series_statements.each do |series_statement|
|
9
9
|
xml.set do
|
@@ -3,7 +3,7 @@ xml.tag! "OAI-PMH", :xmlns => "http://www.openarchives.org/OAI/2.0/",
|
|
3
3
|
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
|
4
4
|
"xsi:schemaLocation" => "http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd" do
|
5
5
|
xml.responseDate Time.zone.now.utc.iso8601
|
6
|
-
xml.request manifestations_url(:
|
6
|
+
xml.request manifestations_url(format: :oai), :verb => "GetRecord"
|
7
7
|
xml.GetRecord do
|
8
8
|
xml.record do
|
9
9
|
xml.header do
|
data/lib/enju_oai/version.rb
CHANGED
@@ -1,94 +1,8 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
1
2
|
class User < ActiveRecord::Base
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
:recoverable, :rememberable, :trackable, :validatable
|
3
|
+
devise :database_authenticatable, #:registerable,
|
4
|
+
:recoverable, :rememberable, :trackable, #, :validatable
|
5
|
+
:lockable, :lock_strategy => :none, :unlock_strategy => :none
|
6
6
|
|
7
|
-
|
8
|
-
attr_accessible :email, :password, :password_confirmation, :remember_me
|
9
|
-
|
10
|
-
has_one :patron
|
11
|
-
has_one :user_has_role
|
12
|
-
has_one :role, :through => :user_has_role
|
13
|
-
belongs_to :user_group
|
14
|
-
belongs_to :required_role, :class_name => 'Role', :foreign_key => 'required_role_id'
|
15
|
-
has_many :checkouts, :dependent => :nullify
|
16
|
-
has_many :reserves, :dependent => :destroy
|
17
|
-
has_many :reserved_manifestations, :through => :reserves, :source => :manifestation
|
18
|
-
has_many :checkout_stat_has_users
|
19
|
-
has_many :user_checkout_stats, :through => :checkout_stat_has_users
|
20
|
-
has_many :reserve_stat_has_users
|
21
|
-
has_many :user_reserve_stats, :through => :reserve_stat_has_users
|
22
|
-
has_many :baskets, :dependent => :destroy
|
23
|
-
belongs_to :library
|
24
|
-
|
25
|
-
before_destroy :check_item_before_destroy
|
26
|
-
|
27
|
-
extend FriendlyId
|
28
|
-
friendly_id :username
|
29
|
-
|
30
|
-
def check_item_before_destroy
|
31
|
-
# TODO: 貸出記録を残す場合
|
32
|
-
if checkouts.size > 0
|
33
|
-
raise 'This user has items still checked out.'
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def reset_checkout_icalendar_token
|
38
|
-
self.checkout_icalendar_token = Devise.friendly_token
|
39
|
-
end
|
40
|
-
|
41
|
-
def delete_checkout_icalendar_token
|
42
|
-
self.checkout_icalendar_token = nil
|
43
|
-
end
|
44
|
-
|
45
|
-
def checked_item_count
|
46
|
-
checkout_count = {}
|
47
|
-
CheckoutType.all.each do |checkout_type|
|
48
|
-
# 資料種別ごとの貸出中の冊数を計算
|
49
|
-
checkout_count[:"#{checkout_type.name}"] = self.checkouts.count_by_sql(["
|
50
|
-
SELECT count(item_id) FROM checkouts
|
51
|
-
WHERE item_id IN (
|
52
|
-
SELECT id FROM items
|
53
|
-
WHERE checkout_type_id = ?
|
54
|
-
)
|
55
|
-
AND user_id = ? AND checkin_id IS NULL", checkout_type.id, self.id]
|
56
|
-
)
|
57
|
-
end
|
58
|
-
return checkout_count
|
59
|
-
end
|
60
|
-
|
61
|
-
def reached_reservation_limit?(manifestation)
|
62
|
-
return true if self.user_group.user_group_has_checkout_types.available_for_carrier_type(manifestation.carrier_type).where(:user_group_id => self.user_group.id).collect(&:reservation_limit).max.to_i <= self.reserves.waiting.size
|
63
|
-
false
|
64
|
-
end
|
65
|
-
|
66
|
-
def has_role?(role_in_question)
|
67
|
-
return false unless role
|
68
|
-
return true if role.name == role_in_question
|
69
|
-
case role.name
|
70
|
-
when 'Administrator'
|
71
|
-
return true
|
72
|
-
when 'Librarian'
|
73
|
-
return true if role_in_question == 'User'
|
74
|
-
else
|
75
|
-
false
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
if defined?(EnjuMessage)
|
80
|
-
has_many :sent_messages, :foreign_key => 'sender_id', :class_name => 'Message'
|
81
|
-
has_many :received_messages, :foreign_key => 'receiver_id', :class_name => 'Message'
|
82
|
-
|
83
|
-
def send_message(status, options = {})
|
84
|
-
MessageRequest.transaction do
|
85
|
-
request = MessageRequest.new
|
86
|
-
request.sender = User.find(1)
|
87
|
-
request.receiver = self
|
88
|
-
request.message_template = MessageTemplate.localized_template(status, self.locale)
|
89
|
-
request.save_message_body(options)
|
90
|
-
request.sm_send_message!
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
7
|
+
enju_leaf_user_model
|
94
8
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
class CreateAgents < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :agents do |t|
|
4
|
-
t.integer :user_id
|
5
4
|
t.string :last_name
|
6
5
|
t.string :middle_name
|
7
6
|
t.string :first_name
|
@@ -40,11 +39,9 @@ class CreateAgents < ActiveRecord::Migration
|
|
40
39
|
t.text :note
|
41
40
|
t.integer :required_role_id, :default => 1, :null => false
|
42
41
|
t.integer :required_score, :default => 0, :null => false
|
43
|
-
t.string :state
|
44
42
|
t.text :email
|
45
43
|
t.text :url
|
46
44
|
end
|
47
|
-
add_index :agents, :user_id, :unique => true
|
48
45
|
add_index :agents, :language_id
|
49
46
|
add_index :agents, :country_id
|
50
47
|
add_index :agents, :required_role_id
|
@@ -19,18 +19,28 @@ class DeviseCreateUsers < ActiveRecord::Migration
|
|
19
19
|
t.string :current_sign_in_ip
|
20
20
|
t.string :last_sign_in_ip
|
21
21
|
|
22
|
-
##
|
23
|
-
t.string
|
22
|
+
## Confirmable
|
23
|
+
# t.string :confirmation_token
|
24
|
+
# t.datetime :confirmed_at
|
25
|
+
# t.datetime :confirmation_sent_at
|
26
|
+
# t.string :unconfirmed_email # Only if using reconfirmable
|
24
27
|
|
25
|
-
|
26
|
-
t.
|
28
|
+
## Lockable
|
29
|
+
# t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
|
30
|
+
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
31
|
+
# t.datetime :locked_at
|
32
|
+
|
33
|
+
## Token authenticatable
|
34
|
+
# t.string :authentication_token
|
27
35
|
|
28
36
|
|
29
37
|
t.timestamps
|
30
38
|
end
|
39
|
+
|
31
40
|
add_index :users, :email, :unique => true
|
32
41
|
add_index :users, :reset_password_token, :unique => true
|
33
|
-
add_index :users, :
|
42
|
+
# add_index :users, :confirmation_token, :unique => true
|
43
|
+
# add_index :users, :unlock_token, :unique => true
|
44
|
+
# add_index :users, :authentication_token, :unique => true
|
34
45
|
end
|
35
|
-
|
36
46
|
end
|
@@ -29,7 +29,6 @@ class CreateManifestations < ActiveRecord::Migration
|
|
29
29
|
t.boolean :repository_content, :default => false, :null => false
|
30
30
|
t.integer :lock_version, :default => 0, :null => false
|
31
31
|
t.integer :required_role_id, :default => 1, :null => false
|
32
|
-
t.string :state
|
33
32
|
t.integer :required_score, :default => 0, :null => false
|
34
33
|
t.integer :frequency_id, :default => 1, :null => false
|
35
34
|
t.boolean :subscription_master, :default => false, :null => false
|
@@ -1,7 +1,6 @@
|
|
1
1
|
class CreateItems < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :items do |t|
|
4
|
-
#t.integer :manifestation_id
|
5
4
|
t.string :call_number
|
6
5
|
t.string :item_identifier
|
7
6
|
t.timestamps
|
@@ -13,10 +12,8 @@ class CreateItems < ActiveRecord::Migration
|
|
13
12
|
t.integer :price
|
14
13
|
t.integer :lock_version, :default => 0, :null => false
|
15
14
|
t.integer :required_role_id, :default => 1, :null => false
|
16
|
-
t.string :state
|
17
15
|
t.integer :required_score, :default => 0, :null => false
|
18
16
|
end
|
19
|
-
#add_index :items, :manifestation_id
|
20
17
|
add_index :items, :shelf_id
|
21
18
|
add_index :items, :item_identifier
|
22
19
|
add_index :items, :required_role_id
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class CreateSubjects < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :subjects do |t|
|
4
|
+
t.integer :parent_id
|
5
|
+
t.integer :use_term_id
|
6
|
+
t.string :term
|
7
|
+
t.text :term_transcription
|
8
|
+
t.integer :subject_type_id, :null => false
|
9
|
+
t.text :scope_note
|
10
|
+
t.text :note
|
11
|
+
t.integer :required_role_id, :default => 1, :null => false
|
12
|
+
t.integer :lock_version, :default => 0, :null => false
|
13
|
+
t.datetime :created_at
|
14
|
+
t.datetime :updated_at
|
15
|
+
t.datetime :deleted_at
|
16
|
+
end
|
17
|
+
add_index :subjects, :term
|
18
|
+
add_index :subjects, :parent_id
|
19
|
+
add_index :subjects, :use_term_id
|
20
|
+
add_index :subjects, :subject_type_id
|
21
|
+
add_index :subjects, :required_role_id
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.down
|
25
|
+
drop_table :subjects
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateCheckins < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :checkins do |t|
|
4
|
+
t.integer :item_id, :null => false
|
5
|
+
t.integer :librarian_id
|
6
|
+
t.integer :basket_id
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
add_index :checkins, :item_id
|
10
|
+
add_index :checkins, :librarian_id
|
11
|
+
add_index :checkins, :basket_id
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.down
|
15
|
+
drop_table :checkins
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class CreateCheckouts < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :checkouts do |t|
|
4
|
+
t.integer :user_id
|
5
|
+
t.integer :item_id, :null => false
|
6
|
+
t.integer :checkin_id
|
7
|
+
t.integer :librarian_id
|
8
|
+
t.integer :basket_id
|
9
|
+
t.datetime :due_date
|
10
|
+
t.integer :checkout_renewal_count, :default => 0, :null => false
|
11
|
+
t.integer :lock_version, :default => 0, :null => false
|
12
|
+
t.timestamps
|
13
|
+
end
|
14
|
+
add_index :checkouts, :user_id
|
15
|
+
add_index :checkouts, :item_id
|
16
|
+
add_index :checkouts, :basket_id
|
17
|
+
add_index :checkouts, [:item_id, :basket_id], :unique => true
|
18
|
+
add_index :checkouts, :librarian_id
|
19
|
+
add_index :checkouts, :checkin_id
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.down
|
23
|
+
drop_table :checkouts
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class CreateReserves < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :reserves do |t|
|
4
|
+
t.integer :user_id, :null => false
|
5
|
+
t.integer :manifestation_id, :null => false
|
6
|
+
t.integer :item_id
|
7
|
+
t.integer :request_status_type_id, :null => false
|
8
|
+
t.datetime :checked_out_at
|
9
|
+
t.timestamps
|
10
|
+
t.datetime :canceled_at
|
11
|
+
t.datetime :expired_at
|
12
|
+
t.datetime :deleted_at
|
13
|
+
t.boolean :expiration_notice_to_patron, :default => false
|
14
|
+
t.boolean :expiration_notice_to_library, :default => false
|
15
|
+
end
|
16
|
+
|
17
|
+
add_index :reserves, :user_id
|
18
|
+
add_index :reserves, :manifestation_id
|
19
|
+
add_index :reserves, :item_id
|
20
|
+
add_index :reserves, :request_status_type_id
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.down
|
24
|
+
drop_table :reserves
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class CreateEvents < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :events do |t|
|
4
|
+
t.integer :library_id, :null => false
|
5
|
+
t.integer :event_category_id, :null => false
|
6
|
+
t.string :name
|
7
|
+
t.text :note
|
8
|
+
t.datetime :start_at
|
9
|
+
t.datetime :end_at
|
10
|
+
t.boolean :all_day, :default => false, :null => false
|
11
|
+
t.datetime :deleted_at
|
12
|
+
t.text :display_name
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
add_index :events, :library_id
|
17
|
+
add_index :events, :event_category_id
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.down
|
21
|
+
drop_table :events
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateEventCategories < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :event_categories do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.text :display_name
|
6
|
+
t.text :note
|
7
|
+
t.integer :position
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :event_categories
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateCheckedItems < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :checked_items do |t|
|
4
|
+
t.integer :item_id, :null => false
|
5
|
+
t.integer :basket_id, :null => false
|
6
|
+
t.datetime :due_date, :null => false
|
7
|
+
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
add_index :checked_items, :item_id
|
11
|
+
add_index :checked_items, :basket_id
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.down
|
15
|
+
drop_table :checked_items
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateUseRestrictions < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :use_restrictions do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.text :display_name
|
6
|
+
t.text :note
|
7
|
+
t.integer :position
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :use_restrictions
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateItemHasUseRestrictions < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :item_has_use_restrictions do |t|
|
4
|
+
t.integer :item_id, :null => false
|
5
|
+
t.integer :use_restriction_id, :null => false
|
6
|
+
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
add_index :item_has_use_restrictions, :item_id
|
10
|
+
add_index :item_has_use_restrictions, :use_restriction_id
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :item_has_use_restrictions
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateCirculationStatuses < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :circulation_statuses do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.text :display_name
|
6
|
+
t.text :note
|
7
|
+
t.integer :position
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :circulation_statuses
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreateClassifications < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :classifications do |t|
|
4
|
+
t.integer :parent_id
|
5
|
+
t.string :category, :null => false
|
6
|
+
t.text :note
|
7
|
+
t.integer :classification_type_id, :null => false
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
add_index :classifications, :parent_id
|
12
|
+
add_index :classifications, :category
|
13
|
+
add_index :classifications, :classification_type_id
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.down
|
17
|
+
drop_table :classifications
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateClassificationTypes < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :classification_types do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.text :display_name
|
6
|
+
t.text :note
|
7
|
+
t.integer :position
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :classification_types
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateSubjectHeadingTypes < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :subject_heading_types do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.text :display_name
|
6
|
+
t.text :note
|
7
|
+
t.integer :position
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :subject_heading_types
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateSubjectTypes < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :subject_types do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.text :display_name
|
6
|
+
t.text :note
|
7
|
+
t.integer :position
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :subject_types
|
15
|
+
end
|
16
|
+
end
|
@@ -7,7 +7,6 @@ class CreateAgentImportFiles < ActiveRecord::Migration
|
|
7
7
|
t.integer :user_id
|
8
8
|
t.text :note
|
9
9
|
t.datetime :executed_at
|
10
|
-
t.string :state
|
11
10
|
t.string :agent_import_file_name
|
12
11
|
t.string :agent_import_content_type
|
13
12
|
t.integer :agent_import_file_size
|
@@ -17,6 +16,5 @@ class CreateAgentImportFiles < ActiveRecord::Migration
|
|
17
16
|
end
|
18
17
|
add_index :agent_import_files, :parent_id
|
19
18
|
add_index :agent_import_files, :user_id
|
20
|
-
add_index :agent_import_files, :state
|
21
19
|
end
|
22
20
|
end
|
@@ -7,7 +7,6 @@ class CreateResourceImportFiles < ActiveRecord::Migration
|
|
7
7
|
t.integer :user_id
|
8
8
|
t.text :note
|
9
9
|
t.datetime :executed_at
|
10
|
-
t.string :state
|
11
10
|
t.string :resource_import_file_name
|
12
11
|
t.string :resource_import_content_type
|
13
12
|
t.integer :resource_import_file_size
|
@@ -17,6 +16,5 @@ class CreateResourceImportFiles < ActiveRecord::Migration
|
|
17
16
|
end
|
18
17
|
add_index :resource_import_files, :parent_id
|
19
18
|
add_index :resource_import_files, :user_id
|
20
|
-
add_index :resource_import_files, :state
|
21
19
|
end
|
22
20
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class CreateEventImportFiles < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :event_import_files do |t|
|
4
|
+
t.integer :parent_id
|
5
|
+
t.string :content_type
|
6
|
+
t.integer :size
|
7
|
+
t.integer :user_id
|
8
|
+
t.text :note
|
9
|
+
t.datetime :imported_at
|
10
|
+
t.string :event_import_file_name
|
11
|
+
t.string :event_import_content_type
|
12
|
+
t.integer :event_import_file_size
|
13
|
+
t.datetime :event_import_updated_at
|
14
|
+
t.string :edit_mode
|
15
|
+
|
16
|
+
t.timestamps
|
17
|
+
end
|
18
|
+
add_index :event_import_files, :parent_id
|
19
|
+
add_index :event_import_files, :user_id
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.down
|
23
|
+
drop_table :event_import_files
|
24
|
+
end
|
25
|
+
end
|