enju_oai 0.2.0.beta.2 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (297) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +11 -0
  3. data/Rakefile +1 -1
  4. data/app/assets/config/enju_oai_manifest.js +0 -0
  5. data/app/controllers/oai_controller.rb +2 -0
  6. data/app/views/oai/_record_dcndl.xml.builder +164 -54
  7. data/app/views/oai/get_record.xml.builder +2 -2
  8. data/app/views/oai/identify.xml.builder +2 -2
  9. data/app/views/oai/list_identifiers.xml.builder +10 -12
  10. data/app/views/oai/list_metadata_formats.xml.builder +2 -2
  11. data/app/views/oai/list_records.xml.builder +17 -19
  12. data/app/views/oai/list_sets.xml.builder +2 -2
  13. data/app/views/oai/provider.xml.builder +2 -2
  14. data/lib/enju_oai/oai_controller.rb +3 -2
  15. data/lib/enju_oai/version.rb +1 -1
  16. data/spec/cassette_library/oai/list_records_xml_builder/when_metadataPrefix_is_dcndl/renders_well-formed_XML.yml +62 -0
  17. data/spec/controllers/oai_controller_spec.rb +42 -10
  18. data/spec/dummy/app/models/application_record.rb +3 -0
  19. data/spec/dummy/app/models/user.rb +5 -1
  20. data/spec/dummy/bin/rails +1 -1
  21. data/spec/dummy/bin/setup +21 -12
  22. data/spec/dummy/bin/update +29 -0
  23. data/spec/dummy/bin/yarn +11 -0
  24. data/spec/dummy/config/application.rb +7 -17
  25. data/spec/dummy/config/database.yml +17 -22
  26. data/spec/dummy/config/environment.rb +4 -4
  27. data/spec/dummy/config/environments/development.rb +24 -11
  28. data/spec/dummy/config/environments/production.rb +28 -16
  29. data/spec/dummy/config/environments/test.rb +6 -8
  30. data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
  31. data/spec/dummy/config/initializers/assets.rb +14 -0
  32. data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
  33. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  34. data/spec/dummy/config/initializers/inflections.rb +6 -5
  35. data/spec/dummy/config/initializers/mime_types.rb +0 -1
  36. data/spec/dummy/config/initializers/session_store.rb +1 -1
  37. data/spec/dummy/config/initializers/wrap_parameters.rb +6 -6
  38. data/spec/dummy/config/sunspot.yml +23 -0
  39. data/spec/dummy/db/migrate/001_create_agents.rb +7 -7
  40. data/spec/dummy/db/migrate/002_devise_create_users.rb +6 -6
  41. data/spec/dummy/db/migrate/005_create_manifestations.rb +10 -10
  42. data/spec/dummy/db/migrate/006_create_items.rb +6 -6
  43. data/spec/dummy/db/migrate/012_create_owns.rb +3 -3
  44. data/spec/dummy/db/migrate/015_create_creates.rb +3 -3
  45. data/spec/dummy/db/migrate/029_create_subjects.rb +4 -4
  46. data/spec/dummy/db/migrate/032_create_checkins.rb +2 -2
  47. data/spec/dummy/db/migrate/033_create_checkouts.rb +5 -5
  48. data/spec/dummy/db/migrate/035_create_reserves.rb +6 -6
  49. data/spec/dummy/db/migrate/041_create_roles.rb +3 -3
  50. data/spec/dummy/db/migrate/047_create_produces.rb +3 -3
  51. data/spec/dummy/db/migrate/059_create_libraries.rb +8 -10
  52. data/spec/dummy/db/migrate/069_create_shelves.rb +4 -5
  53. data/spec/dummy/db/migrate/073_create_carrier_types.rb +2 -2
  54. data/spec/dummy/db/migrate/077_create_user_groups.rb +2 -2
  55. data/spec/dummy/db/migrate/080_create_library_groups.rb +3 -4
  56. data/spec/dummy/db/migrate/112_create_frequencies.rb +2 -2
  57. data/spec/dummy/db/migrate/113_create_events.rb +4 -4
  58. data/spec/dummy/db/migrate/114_create_event_categories.rb +2 -2
  59. data/spec/dummy/db/migrate/117_create_form_of_works.rb +2 -2
  60. data/spec/dummy/db/migrate/120_create_baskets.rb +3 -4
  61. data/spec/dummy/db/migrate/121_create_checked_items.rb +4 -4
  62. data/spec/dummy/db/migrate/124_create_bookstores.rb +2 -2
  63. data/spec/dummy/db/migrate/125_create_donates.rb +3 -3
  64. data/spec/dummy/db/migrate/127_create_use_restrictions.rb +2 -2
  65. data/spec/dummy/db/migrate/129_create_item_has_use_restrictions.rb +3 -3
  66. data/spec/dummy/db/migrate/130_create_request_status_types.rb +2 -2
  67. data/spec/dummy/db/migrate/131_create_request_types.rb +2 -2
  68. data/spec/dummy/db/migrate/132_create_circulation_statuses.rb +2 -2
  69. data/spec/dummy/db/migrate/133_create_agent_merges.rb +2 -2
  70. data/spec/dummy/db/migrate/134_create_agent_merge_lists.rb +1 -1
  71. data/spec/dummy/db/migrate/142_create_classifications.rb +3 -3
  72. data/spec/dummy/db/migrate/144_create_classification_types.rb +2 -2
  73. data/spec/dummy/db/migrate/145_create_subject_heading_types.rb +2 -2
  74. data/spec/dummy/db/migrate/146_create_subject_types.rb +2 -2
  75. data/spec/dummy/db/migrate/149_create_message_templates.rb +18 -0
  76. data/spec/dummy/db/migrate/154_create_messages.rb +23 -0
  77. data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +18 -0
  78. data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +3 -3
  79. data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +4 -4
  80. data/spec/dummy/db/migrate/20080905191442_create_agent_types.rb +2 -2
  81. data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +5 -8
  82. data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +5 -6
  83. data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +6 -6
  84. data/spec/dummy/db/migrate/20081025083323_create_countries.rb +5 -5
  85. data/spec/dummy/db/migrate/20081025083905_create_languages.rb +6 -6
  86. data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +2 -4
  87. data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +1 -1
  88. data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +1 -1
  89. data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +1 -1
  90. data/spec/dummy/db/migrate/20081030023412_create_checkout_types.rb +2 -2
  91. data/spec/dummy/db/migrate/20081030023518_create_user_group_has_checkout_types.rb +9 -9
  92. data/spec/dummy/db/migrate/20081030023615_create_carrier_type_has_checkout_types.rb +4 -4
  93. data/spec/dummy/db/migrate/20081212075554_create_checkout_stat_has_manifestations.rb +5 -5
  94. data/spec/dummy/db/migrate/20081212080038_create_manifestation_checkout_stats.rb +1 -1
  95. data/spec/dummy/db/migrate/20081215094302_create_user_checkout_stats.rb +1 -1
  96. data/spec/dummy/db/migrate/20081215094955_create_checkout_stat_has_users.rb +4 -4
  97. data/spec/dummy/db/migrate/20081216190517_create_reserve_stat_has_manifestations.rb +4 -4
  98. data/spec/dummy/db/migrate/20081216190724_create_manifestation_reserve_stats.rb +1 -1
  99. data/spec/dummy/db/migrate/20081220023628_create_user_reserve_stats.rb +1 -1
  100. data/spec/dummy/db/migrate/20081220034117_create_reserve_stat_has_users.rb +3 -3
  101. data/spec/dummy/db/migrate/20090321130448_add_completed_at_to_user_checkout_stat.rb +1 -1
  102. data/spec/dummy/db/migrate/20090519203307_create_participates.rb +3 -3
  103. data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +1 -1
  104. data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +1 -1
  105. data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +2 -2
  106. data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +2 -2
  107. data/spec/dummy/db/migrate/20090812151902_create_agent_relationship_types.rb +2 -2
  108. data/spec/dummy/db/migrate/20090831220301_create_lending_policies.rb +7 -7
  109. data/spec/dummy/db/migrate/20090913173236_create_nii_types.rb +3 -3
  110. data/spec/dummy/db/migrate/20090913185239_add_nii_type_id_to_manifestation.rb +1 -1
  111. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +3 -3
  112. data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +2 -2
  113. data/spec/dummy/db/migrate/20091202124834_create_versions.rb +4 -4
  114. data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +1 -1
  115. data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +1 -1
  116. data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +1 -1
  117. data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +1 -1
  118. data/spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb +1 -1
  119. data/spec/dummy/db/migrate/20100321235924_add_series_statement_identifier_to_series_statement.rb +1 -1
  120. data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +1 -1
  121. data/spec/dummy/db/migrate/20100606065209_create_user_has_roles.rb +3 -5
  122. data/spec/dummy/db/migrate/20100606073747_create_agent_relationships.rb +1 -1
  123. data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +2 -2
  124. data/spec/dummy/db/migrate/20100814091104_add_position_to_agent_relationship.rb +1 -1
  125. data/spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb +1 -1
  126. data/spec/dummy/db/migrate/20100925074559_create_agent_import_results.rb +1 -1
  127. data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +1 -1
  128. data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +1 -1
  129. data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +2 -2
  130. data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +1 -1
  131. data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +1 -1
  132. data/spec/dummy/db/migrate/20110301134521_add_expire_date_to_reserve.rb +1 -1
  133. data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +2 -2
  134. data/spec/dummy/db/migrate/20110328130826_add_current_checkout_count_to_user_group_has_checkout_type.rb +1 -1
  135. data/spec/dummy/db/migrate/20110603184217_add_edit_mode_to_resource_import_file.rb +1 -1
  136. data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +1 -1
  137. data/spec/dummy/db/migrate/20110620173525_add_bookstore_id_to_item.rb +1 -1
  138. data/spec/dummy/db/migrate/20110621093332_remove_expire_date_from_reserve.rb +1 -1
  139. data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +1 -1
  140. data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +3 -3
  141. data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +4 -4
  142. data/spec/dummy/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +11 -0
  143. data/spec/dummy/db/migrate/20110913120629_add_lft_and_rgt_to_classification.rb +1 -1
  144. data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +1 -1
  145. data/spec/dummy/db/migrate/20110916103953_add_manifestaiton_id_to_series_statement.rb +1 -1
  146. data/spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb +1 -1
  147. data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +1 -1
  148. data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +1 -1
  149. data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +1 -1
  150. data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +1 -1
  151. data/spec/dummy/db/migrate/20111217234412_add_save_checkout_history_to_user.rb +2 -2
  152. data/spec/dummy/db/migrate/20111218002349_add_checkout_icalendar_token_to_user.rb +2 -2
  153. data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +1 -1
  154. data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +6 -0
  155. data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +1 -1
  156. data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +1 -1
  157. data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +1 -1
  158. data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +2 -2
  159. data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +4 -7
  160. data/spec/dummy/db/migrate/20120406020752_add_url_to_subject.rb +1 -1
  161. data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +1 -1
  162. data/spec/dummy/db/migrate/20120413051535_add_event_import_fingerprint_to_event_import_file.rb +1 -1
  163. data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +1 -1
  164. data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +1 -1
  165. data/spec/dummy/db/migrate/20120413161340_add_fingerprint_to_resource_import_file.rb +1 -1
  166. data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +1 -1
  167. data/spec/dummy/db/migrate/20120413170705_add_error_message_to_resource_import_file.rb +1 -1
  168. data/spec/dummy/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +1 -1
  169. data/spec/dummy/db/migrate/20120413170734_add_error_message_to_event_import_file.rb +1 -1
  170. data/spec/dummy/db/migrate/20120415060342_rename_event_import_file_imported_at_to_executed_at.rb +1 -1
  171. data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +1 -1
  172. data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +1 -1
  173. data/spec/dummy/db/migrate/20120424103932_add_librarian_id_to_checked_item.rb +1 -1
  174. data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +2 -2
  175. data/spec/dummy/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +1 -1
  176. data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +1 -1
  177. data/spec/dummy/db/migrate/20121116031206_add_fulltext_content_to_manifestation.rb +1 -1
  178. data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +4 -4
  179. data/spec/dummy/db/migrate/20130303124821_add_retained_at_to_reserve.rb +1 -1
  180. data/spec/dummy/db/migrate/20130304015019_add_postponed_at_to_reserve.rb +1 -1
  181. data/spec/dummy/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +1 -1
  182. data/spec/dummy/db/migrate/20130416054135_add_circulation_status_id_to_item.rb +3 -3
  183. data/spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb +1 -1
  184. data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +1 -1
  185. data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +1 -1
  186. data/spec/dummy/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb +1 -1
  187. data/spec/dummy/db/migrate/20130504133816_add_manifestation_id_to_subject.rb +1 -1
  188. data/spec/dummy/db/migrate/20130504143515_add_manifestation_id_to_classification.rb +1 -1
  189. data/spec/dummy/db/migrate/20130504195916_add_subject_heading_type_id_to_subject.rb +1 -1
  190. data/spec/dummy/db/migrate/20130506175303_create_identifier_types.rb +1 -1
  191. data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +3 -3
  192. data/spec/dummy/db/migrate/20130509185724_add_statement_of_responsibility_to_manifestation.rb +1 -1
  193. data/spec/dummy/db/migrate/20130519065638_add_lock_version_to_reserve.rb +2 -2
  194. data/spec/dummy/db/migrate/20130519065837_add_lock_version_to_checkin.rb +2 -2
  195. data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +2 -2
  196. data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +3 -3
  197. data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +6 -7
  198. data/spec/dummy/db/migrate/20140518050147_create_reserve_transitions.rb +1 -1
  199. data/spec/dummy/db/migrate/20140518111006_create_message_transitions.rb +18 -0
  200. data/spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb +18 -0
  201. data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +1 -1
  202. data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +1 -1
  203. data/spec/dummy/db/migrate/20140523171309_create_event_import_file_transitions.rb +1 -1
  204. data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +1 -1
  205. data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +2 -3
  206. data/spec/dummy/db/migrate/20140528045518_create_user_checkout_stat_transitions.rb +1 -1
  207. data/spec/dummy/db/migrate/20140528045539_create_user_reserve_stat_transitions.rb +1 -1
  208. data/spec/dummy/db/migrate/20140528045600_create_manifestation_checkout_stat_transitions.rb +1 -1
  209. data/spec/dummy/db/migrate/20140528045617_create_manifestation_reserve_stat_transitions.rb +1 -1
  210. data/spec/dummy/db/migrate/20140610123439_drop_email_unique_constraint_enju_leaf_rc10.rb +1 -1
  211. data/spec/dummy/db/migrate/20140614065404_create_resource_export_files.rb +1 -1
  212. data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +1 -1
  213. data/spec/dummy/db/migrate/20140628071719_add_user_encoding_to_event_import_file.rb +1 -1
  214. data/spec/dummy/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +1 -1
  215. data/spec/dummy/db/migrate/20140628073524_add_user_encoding_to_agent_import_file.rb +1 -1
  216. data/spec/dummy/db/migrate/20140628073535_add_user_encoding_to_resource_import_file.rb +1 -1
  217. data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +2 -2
  218. data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +2 -2
  219. data/spec/dummy/db/migrate/20140720140916_add_binding_item_identifier_to_item.rb +1 -1
  220. data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +2 -2
  221. data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +2 -2
  222. data/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +1 -1
  223. data/spec/dummy/db/migrate/20140721151416_add_default_shelf_id_to_resource_import_file.rb +1 -1
  224. data/spec/dummy/db/migrate/20140802082007_add_manifestation_id_to_item.rb +1 -1
  225. data/spec/dummy/db/migrate/20140810061942_add_user_id_to_user_checkout_stat.rb +1 -1
  226. data/spec/dummy/db/migrate/20140810091231_add_checkout_icalendar_token_to_profile.rb +2 -2
  227. data/spec/dummy/db/migrate/20140810091417_add_save_checkout_history_to_profile.rb +2 -2
  228. data/spec/dummy/db/migrate/20140811031145_add_expired_at_to_profile.rb +1 -1
  229. data/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb +1 -1
  230. data/spec/dummy/db/migrate/20140812153137_create_event_export_file_transitions.rb +1 -1
  231. data/spec/dummy/db/migrate/20140813182425_add_publication_place_to_manifestation.rb +1 -1
  232. data/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb +1 -1
  233. data/spec/dummy/db/migrate/20140821151023_create_colors.rb +2 -4
  234. data/spec/dummy/db/migrate/20140822114527_add_error_message_to_resource_import_result.rb +1 -1
  235. data/spec/dummy/db/migrate/20140823083524_add_extent_to_manifestation.rb +1 -1
  236. data/spec/dummy/db/migrate/20140823094847_add_dimensions_to_manifestation.rb +1 -1
  237. data/spec/dummy/db/migrate/20140823095740_rename_manifestation_periodical_to_serial.rb +1 -1
  238. data/spec/dummy/db/migrate/20141003181336_add_full_name_transcription_to_profile.rb +1 -1
  239. data/spec/dummy/db/migrate/20141003182825_add_date_of_birth_to_profile.rb +1 -1
  240. data/spec/dummy/db/migrate/20141014065831_add_shelf_id_to_checkout.rb +1 -1
  241. data/spec/dummy/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +5 -0
  242. data/spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb +1 -1
  243. data/spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb +1 -1
  244. data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +4 -6
  245. data/spec/dummy/db/migrate/20151125004028_add_profile_id_to_agent.rb +6 -0
  246. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +12 -7
  247. data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +16 -3
  248. data/spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb +1 -1
  249. data/spec/dummy/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb +1 -1
  250. data/spec/dummy/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb +1 -1
  251. data/spec/dummy/db/migrate/20160703185015_add_most_recent_to_message_transitions.rb +9 -0
  252. data/spec/dummy/db/migrate/20160801080612_add_most_recent_to_import_request_transitions.rb +9 -0
  253. data/spec/dummy/db/migrate/20160801080619_add_most_recent_to_resource_import_file_transitions.rb +9 -0
  254. data/spec/dummy/db/migrate/20160801080637_add_most_recent_to_resource_export_file_transitions.rb +9 -0
  255. data/spec/dummy/db/migrate/20160801080643_add_most_recent_to_agent_import_file_transitions.rb +9 -0
  256. data/spec/dummy/db/migrate/20160811102604_add_picture_width_to_picture_file.rb +6 -0
  257. data/spec/dummy/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb +5 -0
  258. data/spec/dummy/db/migrate/20160813191733_add_family_name_first_to_library_group.rb +5 -0
  259. data/spec/dummy/db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb +5 -0
  260. data/spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb +5 -0
  261. data/spec/dummy/db/migrate/20160814165332_add_most_recent_to_message_request_transitions.rb +9 -0
  262. data/spec/dummy/db/migrate/20160820004638_add_attachment_attachment_to_carrier_types.rb +11 -0
  263. data/spec/dummy/db/migrate/20170305064014_add_csv_charset_conversion_to_library_group.rb +5 -0
  264. data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +5 -0
  265. data/spec/dummy/db/migrate/20171119051258_set_not_null_to_manifestation_id_on_items.rb +5 -0
  266. data/spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +5 -0
  267. data/spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +5 -0
  268. data/spec/dummy/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb +5 -0
  269. data/spec/dummy/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +13 -0
  270. data/spec/dummy/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +13 -0
  271. data/spec/dummy/db/migrate/20180107161311_add_constraints_to_most_recent_for_agent_import_file_transitions.rb +13 -0
  272. data/spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb +13 -0
  273. data/spec/dummy/db/migrate/20180107161347_add_constraints_to_most_recent_for_resource_export_file_transitions.rb +13 -0
  274. data/spec/dummy/db/migrate/20180107161410_add_constraints_to_most_recent_for_import_request_transitions.rb +13 -0
  275. data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +5 -0
  276. data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +5 -0
  277. data/spec/dummy/db/migrate/20191219122214_create_custom_properties.rb +12 -0
  278. data/spec/dummy/db/migrate/20200425072340_create_manifestation_custom_properties.rb +12 -0
  279. data/spec/dummy/db/migrate/20200425072349_create_item_custom_properties.rb +12 -0
  280. data/spec/dummy/db/migrate/20200425074758_create_manifestation_custom_values.rb +12 -0
  281. data/spec/dummy/db/migrate/20200425074822_create_item_custom_values.rb +12 -0
  282. data/spec/dummy/db/schema.rb +967 -887
  283. data/spec/factories/manifestation.rb +1 -1
  284. data/spec/factories/user.rb +11 -20
  285. data/spec/fixtures/library_groups.yml +1 -6
  286. data/spec/rails_helper.rb +53 -0
  287. data/spec/spec_helper.rb +82 -47
  288. data/spec/support/controller_macros.rb +3 -3
  289. data/spec/views/oai/get_record.xml.builder +3 -3
  290. data/spec/views/oai/identify.xml.builder_spec.rb +1 -1
  291. data/spec/views/oai/list_identifiers.xml.builder_spec.rb +13 -6
  292. data/spec/views/oai/list_metadata_formats.xml.builder_spec.rb +1 -1
  293. data/spec/views/oai/list_records.xml.builder_spec.rb +57 -17
  294. metadata +421 -297
  295. data/README.rdoc +0 -10
  296. data/spec/dummy/config/initializers/enju_leaf.rb +0 -2
  297. data/spec/dummy/db/migrate/20160813130535_add_email_to_library_group.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 328bd3be1f0de895dc62fe0af4fd666ea0fcb55a
4
- data.tar.gz: 62f6aa1220faa8d7a239c5730a7dca972565724a
2
+ SHA256:
3
+ metadata.gz: 657cc7609b6f1f359d2c84821e58e5db324be49aaf55a98e6824cfd333f3bf58
4
+ data.tar.gz: 904de4f9a94cababee669cb39df0b30e3e3ad8edb4f08ced264d2f9c6ef72cfd
5
5
  SHA512:
6
- metadata.gz: e156fc49edc35a863b1e0dbaecd0022b137931872b7d9c750485d8ce427df3412374bcfdf4d9b64cdd96e11aa0c4d862407a33ec3ced2e5fb703573391c514dd
7
- data.tar.gz: 5d8ec84ed2afd8fa3c888642284da00131e3219a64f051173e8596dd201aceed718c8b79f5bea8920672ac81f8e5ceea83dc3b561c8a92740d31fc315aa4bb68
6
+ metadata.gz: 931d716daefe83e49001901fdd18cda465fc32ad1887778b4a8c7652a0430fb23aa78866c211906014d222e77b67141aa17957a0f73f0bfc62c236d8bec8a8da
7
+ data.tar.gz: fd09adc6f23c069163510135780c861a6bb688992f0f25bbe1a356e8e2985c996418758da82158abb3b7b935cbe4da8f4cd6b6ba534fafcf49f3d2abcf18655b
data/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # EnjuEvent
2
+ [![Travis CI](https://travis-ci.com/next-l/enju_oai.svg?branch=1.3)](https://travis-ci.com/next-l/enju_oai)
3
+ [![Coverage Status](https://coveralls.io/repos/github/next-l/enju_oai/badge.svg?branch=1.3)](https://coveralls.io/github/next-l/enju_oai?branch=1.3)
4
+ [![security](https://hakiri.io/github/next-l/enju_oai/1.3.svg)](https://hakiri.io/github/next-l/enju_oai/1.3)
5
+
6
+ This project rocks and uses MIT-LICENSE.
7
+
8
+ ## 製作者・貢献者 (Authors and contributors)
9
+ * [TANABE, Kosuke](https://github.com/nabeta) ([@nabeta](https://twitter.com/nabeta))
10
+ * [Project Next-L](https://www.next-l.jp) ([@ProjectNextL](https://twitter.com/ProjectNextL))
11
+
data/Rakefile CHANGED
@@ -32,4 +32,4 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
32
32
  spec.pattern = FileList['spec/**/*_spec.rb']
33
33
  end
34
34
 
35
- task :default => :spec
35
+ task default: :spec
File without changes
@@ -21,6 +21,8 @@ class OaiController < ApplicationController
21
21
  search = Manifestation.search do
22
22
  order_by :updated_at, :desc
23
23
  paginate cursor: token, per_page: oai_per_page
24
+ with(:updated_at).between(from_time..until_time)
25
+ with(:required_role_id).equal_to Role.default_role.id
24
26
  end
25
27
  @manifestations = search.execute!.results
26
28
 
@@ -1,26 +1,29 @@
1
1
  xml_builder.tag! "rdf:RDF",
2
- "xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
3
- "xmlns:dcterms": "http://purl.org/dc/terms/",
4
- "xmlns:dcndl": "http://ndl.go.jp/dcndl/terms/",
5
- "xmlns:dc": "http://purl.org/dc/elements/1.1/",
6
- "xmlns:rdfs": "http://www.w3.org/2000/01/rdf-schema#",
7
- "xmlns:owl": "http://www.w3.org/2002/07/owl#",
8
- "xmlns:foaf": "http://xmlns.com/foaf/0.1/" do
9
- get_record_url = manifestations_url format: "oai", verb: 'GetRecord', metadataPrefix: 'dcndl', identifier: manifestation.oai_identifier
10
- xml_builder.tag! "dcndl:BibAdminResource", "rdf:about": get_record_url do
11
- xml_builder.tag! "dcndl:record", "rdf:resource": get_record_url
2
+ "xmlns:rdf" => "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
3
+ "xmlns:dcterms" => "http://purl.org/dc/terms/",
4
+ "xmlns:dcndl" => "http://ndl.go.jp/dcndl/terms/",
5
+ "xmlns:dc" => "http://purl.org/dc/elements/1.1/",
6
+ "xmlns:rdfs" => "http://www.w3.org/2000/01/rdf-schema#",
7
+ "xmlns:owl" => "http://www.w3.org/2002/07/owl#",
8
+ "xmlns:foaf" => "http://xmlns.com/foaf/0.1/" do
9
+ get_record_url = oai_provider_url format: "xml", verb: 'GetRecord', metadataPrefix: 'dcndl', identifier: manifestation.oai_identifier
10
+ xml_builder.tag! "dcndl:BibAdminResource", "rdf:about" => get_record_url do
11
+ xml_builder.tag! "dcndl:record", "rdf:resource" => get_record_url + "#material"
12
12
  xml_builder.tag! "dcndl:bibRecordCategory", ENV['DCNDL_BIBRECORDCATEGORY']
13
13
  end
14
- xml_builder.tag! "dcndl:BibResource", "rdf:about": get_record_url + "#material" do
14
+ xml_builder.tag! "dcndl:BibResource", "rdf:about" => get_record_url + "#material" do
15
+ xml_builder.tag! "rdfs:seeAlso", "rdf:resource" => manifestation_url(manifestation)
15
16
  manifestation.identifiers.each do |identifier|
16
17
  case identifier.identifier_type.try(:name)
17
18
  when 'isbn'
18
- xml_builder.tag! "rdfs:seeAlso", "rdf:resource": "http://iss.ndl.go.jp/isbn/#{ identifier.body }"
19
- xml_builder.tag! "dcterms:identifier", identifier.body, "rdf:datatype": "http://ndl.go.jp/dcndl/terms/ISBN"
19
+ xml_builder.tag! "rdfs:seeAlso", "rdf:resource" => "http://iss.ndl.go.jp/isbn/#{ identifier.body }"
20
+ xml_builder.tag! "dcterms:identifier", identifier.body, "rdf:datatype" => "http://ndl.go.jp/dcndl/terms/ISBN"
20
21
  when 'issn'
21
- xml_builder.tag! "dcterms:identifier", identifier.body, "rdf:datatype": "http://ndl.go.jp/dcndl/terms/ISSN"
22
+ xml_builder.tag! "dcterms:identifier", identifier.body, "rdf:datatype" => "http://ndl.go.jp/dcndl/terms/ISSN"
23
+ when 'doi'
24
+ xml_builder.tag! "dcterms:identifier", identifier.body, "rdf:datatype" => "http://ndl.go.jp/dcndl/terms/DOI"
22
25
  when 'ncid'
23
- xml_builder.tag! "dcterms:identifier", identifier.body, "rdf:datatype": "http://ndl.go.jp/dcndl/terms/NIIBibID"
26
+ xml_builder.tag! "dcterms:identifier", identifier.body, "rdf:datatype" => "http://ndl.go.jp/dcndl/terms/NIIBibID"
24
27
  end
25
28
  end
26
29
  xml_builder.tag! "dcterms:title", manifestation.original_title
@@ -32,54 +35,161 @@ xml_builder.tag! "rdf:RDF",
32
35
  end
33
36
  end
34
37
  end
35
- xml_builder.tag! "dcterms:creator" do
38
+ if manifestation.title_alternative?
39
+ xml_builder.tag! "dcndl:alternative" do
40
+ xml_builder.tag! "rdf:Description" do
41
+ xml_builder.tag! "rdf:value", manifestation.title_alternative
42
+ if manifestation.title_alternative_transcription?
43
+ xml_builder.tag! "dcndl:transcription", manifestation.title_alternative_transcription
44
+ end
45
+ end
46
+ end
47
+ end
48
+ if manifestation.volume_number_string?
49
+ xml_builder.tag! "dcndl:volume" do
50
+ xml_builder.tag! "rdf:Description" do
51
+ xml_builder.tag! "rdf:value", manifestation.volume_number_string
52
+ end
53
+ end
54
+ elsif manifestation.volume_number?
55
+ xml_builder.tag! "dcndl:volume" do
56
+ xml_builder.tag! "rdf:Description" do
57
+ xml_builder.tag! "rdf:value", manifestation.volume_number
58
+ end
59
+ end
60
+ end
61
+ manifestation.series_statements.each do |series_statement|
62
+ xml_builder.tag! "dcndl:seriesTitle" do
63
+ xml_builder.tag! "rdf:Description" do
64
+ xml_builder.tag! "rdf:value", series_statement.original_title
65
+ if series_statement.title_transcription?
66
+ xml_builder.tag! "dcndl:transcription", series_statement.title_transcription
67
+ end
68
+ end
69
+ end
70
+ end
71
+ if manifestation.edition_string?
72
+ xml_builder.tag! "dcndl:edition", manifestation.edition_string
73
+ elsif manifestation.edition?
74
+ xml_builder.tag! "dcndl:edition", manifestation.edition
75
+ end
76
+ unless manifestation.creators.empty?
36
77
  manifestation.creators.each do |creator|
37
- xml_builder.tag! "foaf:Agent" do
38
- xml_builder.tag! "foaf:name", creator.full_name
78
+ xml_builder.tag! "dcterms:creator" do
79
+ xml_builder.tag! "foaf:Agent" do
80
+ xml_builder.tag! "foaf:name", creator.full_name
81
+ if creator.full_name_transcription?
82
+ xml_builder.tag! "dcndl:transcription", creator.full_name_transcription
83
+ end
84
+ end
39
85
  end
40
86
  end
41
- xml_builder.tag! "dc:creator", manifestation.statement_of_responsibility
42
87
  end
43
- xml_builder.tag! "dcterms:publisher" do
44
- manifestation.publishers.each do |publisher|
88
+ xml_builder.tag! "dc:creator", manifestation.statement_of_responsibility unless manifestation.statement_of_responsibility.blank?
89
+ manifestation.series_statements.each do |series_statement|
90
+ xml_builder.tag! "dcndl:seriesCreator", series_statement.creator_string
91
+ end
92
+ manifestation.contributors.each do |contributor|
93
+ xml_builder.tag! "dcndl:contributor", contributor.full_name
94
+ end
95
+ manifestation.publishers.each do |publisher|
96
+ xml_builder.tag! "dcterms:publisher" do
45
97
  xml_builder.tag! "foaf:Agent" do
46
- xml_builder.tag! "foaf:name", publisher.full_name
98
+ if publisher.corporate_name
99
+ xml_builder.tag! "foaf:name", publisher.corporate_name
100
+ xml_builder.tag! "dcndl:transcription", publisher.corporate_name_transcription if publisher.corporate_name_transcription?
101
+ elsif publisher.full_name
102
+ xml_builder.tag! "foaf:name", publisher.full_name
103
+ xml_builder.tag! "dcndl:transcription", publisher.full_name_transcription if publisher.full_name_transcription?
104
+ end
105
+ xml_builder.tag! "dcterms:description", publisher.note if publisher.note?
106
+ xml_builder.tag! "dcndl:location", publisher.place if publisher.place?
47
107
  end
48
108
  end
49
109
  end
50
- xml_builder.tag! "dcterms:issued", manifestation.pub_date, "rdf:datatype": "http://purl.org/dc/terms/W3CDTF"
51
- xml_builder.tag! "dcndl:materialType", "rdf:resource": "http://ndl.go.jp/ndltype/Book"
52
- end
53
- unless manifestation.attachment.blank?
54
- xml_builder.fulltextURL manifestation_url(id: manifestation.id, format: :download)
55
- end
56
- %w( ISBN ISSN NCID ).each do |identifier|
57
- manifestation.identifier_contents(identifier.downcase).each do |val|
58
- xml_builder.tag! identifier, val
110
+ manifestation.publishers.each do |publisher|
111
+ xml_builder.tag! "dcndl:publicationPlace", publisher.country.alpha_2 if publisher.country.try(:name) != "unknown"
59
112
  end
60
- end
61
- if manifestation.root_series_statement
62
- xml_builder.jtitle manifestation.root_series_statement.original_title
63
- end
64
- xml_builder.volume manifestation.volume_number_string
65
- xml_builder.issue manifestation.issue_number_string
66
- xml_builder.spage manifestation.start_page
67
- xml_builder.epage manifestation.end_page
68
- xml_builder.dateofissued manifestation.pub_date
69
- #TODO: junii2: source
70
- if manifestation.language.blank? or manifestation.language.name == 'unknown'
71
- xml_builder.language "und"
72
- else
73
- xml_builder.language manifestation.language.iso_639_2
74
- end
75
- %w( pmid doi NAID ichushi ).each do |identifier|
76
- manifestation.identifier_contents(identifier.downcase).each do |val|
77
- xml_builder.tag! identifier, val
113
+ xml_builder.tag! "dcterms:issued", manifestation.pub_date, "rdf:datatype" => "http://purl.org/dc/terms/W3CDTF" if manifestation.pub_date?
114
+ xml_builder.tag! "dcterms:description", manifestation.description if manifestation.description?
115
+ manifestation.subjects.each do |subject|
116
+ xml_builder.tag! "dcterms:subject" do
117
+ xml_builder.tag! "rdf:Description" do
118
+ xml_builder.tag! "rdf:value", subject.term
119
+ xml_builder.tag! "dcndl:transcription", subject.term_transcription if subject.term_transcription?
120
+ end
121
+ end
122
+ end
123
+ manifestation.classifications.each do |classification|
124
+ case classification.classification_type.name
125
+ when 'ndlc'
126
+ xml_builder.tag! "dcterms:subject", "rdf:resource" => "http://id.ndl.go.jp/class/ndlc/"+classification.category
127
+ when 'ndc9'
128
+ xml_builder.tag! "dcterms:subject", "rdf:resource" => "http://id.ndl.go.jp/class/ndc9/"+classification.category
129
+ when 'ddc'
130
+ xml_builder.tag! "dcterms:subject", "rdf:resource" => "http://dewey.info/class/"+classification.category
131
+ when 'ndc8'
132
+ xml_builder.tag! "dc:subject", classification.category, "rdf:datatype" => "http://ndl.go.jp/dcndl/terms/NDC8"
133
+ when 'ndc'
134
+ xml_builder.tag! "dc:subject", classification.category, "rdf:datatype" => "http://ndl.go.jp/dcndl/terms/NDC"
135
+ when 'lcc'
136
+ xml_builder.tag! "dc:subject", classification.category, "rdf:datatype" => "http://ndl.go.jp/dcndl/terms/LCC"
137
+ when 'udc'
138
+ xml_builder.tag! "dc:subject", classification.category, "rdf:datatype" => "http://ndl.go.jp/dcndl/terms/UDC"
139
+ end
140
+ end
141
+ xml_builder.tag! "dcterms:language", manifestation.language.iso_639_2, "rdf:datatype" => "http://purl.org/dc/terms/ISO639-2"
142
+ xml_builder.tag! "dcndl:price", manifestation.price if manifestation.price?
143
+ if manifestation.extent? or manifestation.dimensions?
144
+ xml_builder.tag! "dcterms:extent", [ manifestation.extent, manifestation.dimensions ].compact.join(" ; ")
145
+ end
146
+ material_type = nil
147
+ case manifestation.carrier_type.name
148
+ when "volume"
149
+ material_type = :book
150
+ when "online_resource"
151
+ material_type = :electronic_resource
152
+ end
153
+ case manifestation.manifestation_content_type.name
154
+ when "text"
155
+ material_type = :book
156
+ when "tactile_text"
157
+ material_type = :braille
158
+ when "cartographic_image"
159
+ material_type = :map
160
+ when "performed_music"
161
+ material_type = :music
162
+ when "notated_music"
163
+ material_type = :music_score
164
+ when "still_image"
165
+ material_type = :still_image
166
+ when "two_dimensional_moving_image"
167
+ material_type = :moving_image
168
+ when "sounds"
169
+ material_type = :sound
170
+ end
171
+ case material_type
172
+ when :book
173
+ xml_builder.tag! "dcndl:materialType", "rdf:resource" => "http://ndl.go.jp/ndltype/Book", "rdfs:label" => "図書"
174
+ when :electronic_resource
175
+ xml_builder.tag! "dcndl:materialType", "rdf:resource" => "http://ndl.go.jp/ndltype/ElectronicResource", "rdfs:label" => "電子資料"
176
+ when :braille
177
+ xml_builder.tag! "dcndl:materialType", "rdf:resource" => "http://ndl.go.jp/ndltype/Braille", "rdfs:label" => "点字"
178
+ when :map
179
+ xml_builder.tag! "dcndl:materialType", "rdf:resource" => "http://ndl.go.jp/ndltype/Map", "rdfs:label" => "地図"
180
+ when :music
181
+ xml_builder.tag! "dcndl:materialType", "rdf:resource" => "http://ndl.go.jp/ndltype/Music", "rdfs:label" => "音楽"
182
+ when :music_score
183
+ xml_builder.tag! "dcndl:materialType", "rdf:resource" => "http://ndl.go.jp/ndltype/MusicScore", "rdfs:label" => "楽譜"
184
+ when :still_image
185
+ xml_builder.tag! "dcndl:materialType", "rdf:resource" => "http://purl.org/dc/dcmitype/StillImage", "rdfs:label" => "静止画資料"
186
+ when :moving_image
187
+ xml_builder.tag! "dcndl:materialType", "rdf:resource" => "http://purl.org/dc/dcmitype/MovingImage", "rdfs:label" => "映像資料"
188
+ when :sound
189
+ xml_builder.tag! "dcndl:materialType", "rdf:resource" => "http://purl.org/dc/dcmitype/Sound", "rdfs:label" => "録音資料"
190
+ end
191
+ if manifestation.serial and manifestation.frequency
192
+ xml_builder.tag! "dcndl:publicationPeriodicity", manifestation.frequency.name
78
193
  end
79
194
  end
80
- #TODO: junii2: isVersionOf, hasVersion, isReplaceBy, replaces, isRequiredBy, requires, isPartOf, hasPart, isReferencedBy, references, isFormatOf, hasFormat
81
- #TODO: junii2: coverage, spatial, NIIspatial, temporal, NIItemporal
82
- #TODO: junii2: rights
83
- #TODO: junii2: textversion
84
- #TODO: junii2: grantid, dateofgranted, degreename, grantor
85
195
  end
@@ -1,9 +1,9 @@
1
- xml.instruct! :xml, :version=>"1.0"
1
+ xml.instruct! :xml, version: "1.0"
2
2
  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(format: :oai), :verb => "GetRecord"
6
+ xml.request manifestations_url(format: :oai), verb: "GetRecord"
7
7
  xml.GetRecord do
8
8
  xml.record do
9
9
  xml.header do
@@ -1,9 +1,9 @@
1
- xml.instruct! :xml, :version=>"1.0"
1
+ xml.instruct! :xml, version: "1.0"
2
2
  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 oai_provider_url(format: :xml), :verb => "Identify"
6
+ xml.request oai_provider_url(format: :xml), verb: "Identify"
7
7
  xml.Identify do
8
8
  xml.repositoryName LibraryGroup.site_config.name
9
9
  xml.baseURL oai_provider_url(format: :xml)
@@ -1,28 +1,26 @@
1
- xml.instruct! :xml, :version => "1.0"
1
+ xml.instruct! :xml, version: "1.0"
2
2
  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
6
  xml.request oai_provider_url(format: :xml), request_attr(@from_time, @until_time, @oai[:metadataPrefix])
7
7
  @oai[:errors].each do |error|
8
- xml.error :code => error
8
+ xml.error code: error
9
9
  end
10
10
  xml.ListIdentifiers do
11
11
  @manifestations.each do |manifestation|
12
- cache([manifestation, fragment: 'list_identifiers_oai', role: current_user_role_name, locale: @locale]) do
13
- xml.header do
14
- xml.identifier manifestation.oai_identifier
15
- xml.datestamp manifestation.updated_at.utc.iso8601
16
- manifestation.series_statements.each do |series_statement|
17
- xml.setSpec series_statement.id
18
- end
12
+ xml.header do
13
+ xml.identifier manifestation.oai_identifier
14
+ xml.datestamp manifestation.updated_at.utc.iso8601
15
+ manifestation.series_statements.each do |series_statement|
16
+ xml.setSpec series_statement.id
19
17
  end
20
18
  end
21
19
  end
22
- if @manifestations.last_page?
23
- xml.resumptionToken nil, completeListSize: @manifestations.total_count
24
- else
20
+ if @manifestations.next_page_cursor
25
21
  xml.resumptionToken CGI.escape(@manifestations.next_page_cursor), completeListSize: @manifestations.total_count
22
+ else
23
+ xml.resumptionToken nil, completeListSize: @manifestations.total_count
26
24
  end
27
25
  end
28
26
  end
@@ -1,9 +1,9 @@
1
- xml.instruct! :xml, :version=>"1.0"
1
+ xml.instruct! :xml, version: "1.0"
2
2
  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 oai_provider_url(format: :xml), :verb => "ListMetadataFormats"
6
+ xml.request oai_provider_url(format: :xml), verb: "ListMetadataFormats"
7
7
  xml.ListMetadataFormats do
8
8
  xml.metadataFormat do
9
9
  xml.metadataPrefix "oai_dc"
@@ -1,4 +1,4 @@
1
- xml.instruct! :xml, :version => "1.0"
1
+ xml.instruct! :xml, version: "1.0"
2
2
  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
@@ -9,29 +9,27 @@ xml.tag! "OAI-PMH", :xmlns => "http://www.openarchives.org/OAI/2.0/",
9
9
  end
10
10
  xml.ListRecords do
11
11
  @manifestations.each do |manifestation|
12
- cache([manifestation, fragment: 'list_records_oai', role: current_user_role_name, locale: @locale]) do
13
- xml.record do
14
- xml.header do
15
- xml.identifier manifestation.oai_identifier
16
- xml.datestamp manifestation.updated_at.utc.iso8601
17
- end
18
- xml.metadata do
19
- case @oai[:metadataPrefix]
20
- when 'oai_dc', nil
21
- render 'record_oai_dc', manifestation: manifestation, xml_builder: xml
22
- when 'junii2'
23
- render 'record_junii2', manifestation: manifestation, xml_builder: xml
24
- when 'dcndl'
25
- render 'record_dcndl', manifestation: manifestation, xml_builder: xml
26
- end
12
+ xml.record do
13
+ xml.header do
14
+ xml.identifier manifestation.oai_identifier
15
+ xml.datestamp manifestation.updated_at.utc.iso8601
16
+ end
17
+ xml.metadata do
18
+ case @oai[:metadataPrefix]
19
+ when 'oai_dc', nil
20
+ render 'record_oai_dc', manifestation: manifestation, xml_builder: xml
21
+ when 'junii2'
22
+ render 'record_junii2', manifestation: manifestation, xml_builder: xml
23
+ when 'dcndl'
24
+ render 'record_dcndl', manifestation: manifestation, xml_builder: xml
27
25
  end
28
26
  end
29
27
  end
30
28
  end
31
- if @manifestations.last_page?
32
- xml.resumptionToken nil, completeListSize: @manifestations.total_count
33
- else
29
+ if @manifestations.next_page_cursor
34
30
  xml.resumptionToken CGI.escape(@manifestations.next_page_cursor), completeListSize: @manifestations.total_count
31
+ else
32
+ xml.resumptionToken nil, completeListSize: @manifestations.total_count
35
33
  end
36
34
  end
37
35
  end
@@ -1,9 +1,9 @@
1
- xml.instruct! :xml, :version=>"1.0"
1
+ xml.instruct! :xml, version: "1.0"
2
2
  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 oai_provider_url(format: :xml), :verb => "ListSets"
6
+ xml.request oai_provider_url(format: :xml), verb: "ListSets"
7
7
  xml.ListSets do
8
8
  @series_statements.each do |series_statement|
9
9
  xml.set do
@@ -1,4 +1,4 @@
1
- xml.instruct! :xml, :version=>"1.0"
1
+ xml.instruct! :xml, version: "1.0"
2
2
  xml.tag! "OAI-PMH",
3
3
  :xmlns => "http://www.openarchives.org/OAI/2.0/",
4
4
  "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
@@ -6,6 +6,6 @@ xml.tag! "OAI-PMH",
6
6
  xml.responseDate Time.zone.now.utc.iso8601
7
7
  xml.request oai_provider_url(format: :xml)
8
8
  @oai[:errors].each do |error|
9
- xml.error :code => error
9
+ xml.error code: error
10
10
  end
11
11
  end