enju_oai 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. data/app/views/manifestations/list_identifiers.oai.builder +1 -1
  2. data/app/views/manifestations/list_records.oai.builder +1 -1
  3. data/lib/enju_oai/oai_controller.rb +32 -0
  4. data/lib/enju_oai/version.rb +1 -1
  5. data/spec/controllers/manifestations_controller_spec.rb +45 -0
  6. data/spec/dummy/README.rdoc +261 -0
  7. data/spec/dummy/Rakefile +7 -0
  8. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  9. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  10. data/spec/dummy/app/controllers/application_controller.rb +76 -0
  11. data/spec/dummy/app/controllers/manifestations_controller.rb +519 -0
  12. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  13. data/spec/dummy/app/models/ability.rb +29 -0
  14. data/spec/dummy/app/models/carrier_type.rb +33 -0
  15. data/spec/dummy/app/models/create.rb +38 -0
  16. data/spec/dummy/app/models/exemplify.rb +45 -0
  17. data/spec/dummy/app/models/item.rb +276 -0
  18. data/spec/dummy/app/models/manifestation.rb +631 -0
  19. data/spec/dummy/app/models/patron.rb +290 -0
  20. data/spec/dummy/app/models/produce.rb +39 -0
  21. data/spec/dummy/app/models/realize.rb +38 -0
  22. data/spec/dummy/app/models/role.rb +46 -0
  23. data/spec/dummy/app/models/search_engine.rb +51 -0
  24. data/spec/dummy/app/models/user.rb +94 -0
  25. data/spec/dummy/app/models/user_has_role.rb +4 -0
  26. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  27. data/spec/dummy/config/application.rb +57 -0
  28. data/spec/dummy/config/boot.rb +10 -0
  29. data/spec/dummy/config/configatron/cucumber.rb +4 -0
  30. data/spec/dummy/config/configatron/defaults.rb +28 -0
  31. data/spec/dummy/config/configatron/development.rb +4 -0
  32. data/spec/dummy/config/configatron/production.rb.sample +12 -0
  33. data/spec/dummy/config/configatron/test.rb +7 -0
  34. data/spec/dummy/config/database.yml +25 -0
  35. data/spec/dummy/config/environment.rb +5 -0
  36. data/spec/dummy/config/environments/development.rb +37 -0
  37. data/spec/dummy/config/environments/production.rb +67 -0
  38. data/spec/dummy/config/environments/test.rb +37 -0
  39. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  40. data/spec/dummy/config/initializers/configatron.rb +2 -0
  41. data/spec/dummy/config/initializers/devise.rb +209 -0
  42. data/spec/dummy/config/initializers/inflections.rb +15 -0
  43. data/spec/dummy/config/initializers/mime_types.rb +14 -0
  44. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  45. data/spec/dummy/config/initializers/session_store.rb +8 -0
  46. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  47. data/spec/dummy/config/locales/en.yml +5 -0
  48. data/spec/dummy/config/routes.rb +60 -0
  49. data/spec/dummy/config.ru +4 -0
  50. data/spec/dummy/db/migrate/001_create_patrons.rb +53 -0
  51. data/spec/dummy/db/migrate/002_devise_create_users.rb +71 -0
  52. data/spec/dummy/db/migrate/005_create_manifestations.rb +59 -0
  53. data/spec/dummy/db/migrate/006_create_items.rb +28 -0
  54. data/spec/dummy/db/migrate/012_create_owns.rb +14 -0
  55. data/spec/dummy/db/migrate/015_create_creates.rb +14 -0
  56. data/spec/dummy/db/migrate/041_create_roles.rb +13 -0
  57. data/spec/dummy/db/migrate/047_create_produces.rb +14 -0
  58. data/spec/dummy/db/migrate/059_create_libraries.rb +30 -0
  59. data/spec/dummy/db/migrate/073_create_carrier_types.rb +11 -0
  60. data/spec/dummy/db/migrate/077_create_user_groups.rb +12 -0
  61. data/spec/dummy/db/migrate/080_create_library_groups.rb +21 -0
  62. data/spec/dummy/db/migrate/112_create_frequencies.rb +12 -0
  63. data/spec/dummy/db/migrate/117_create_form_of_works.rb +12 -0
  64. data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +15 -0
  65. data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +15 -0
  66. data/spec/dummy/db/migrate/20080905191442_create_patron_types.rb +12 -0
  67. data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +17 -0
  68. data/spec/dummy/db/migrate/20081025083323_create_countries.rb +28 -0
  69. data/spec/dummy/db/migrate/20081025083905_create_languages.rb +23 -0
  70. data/spec/dummy/db/migrate/20090719201843_create_extents.rb +12 -0
  71. data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +12 -0
  72. data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +12 -0
  73. data/spec/dummy/db/migrate/20090812151902_create_patron_relationship_types.rb +12 -0
  74. data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +12 -0
  75. data/spec/dummy/db/migrate/20091202124834_create_versions.rb +18 -0
  76. data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +9 -0
  77. data/spec/dummy/db/migrate/20100326024214_add_date_index_to_resource.rb +11 -0
  78. data/spec/dummy/db/migrate/20100502171926_add_latitude_and_longitude_to_library.rb +11 -0
  79. data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +13 -0
  80. data/spec/dummy/db/migrate/20100606065209_create_user_has_roles.rb +12 -0
  81. data/spec/dummy/db/migrate/20100606073747_create_patron_relationships.rb +13 -0
  82. data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +12 -0
  83. data/spec/dummy/db/migrate/20100627193848_add_enju_access_key_to_user.rb +10 -0
  84. data/spec/dummy/db/migrate/20100814091104_add_position_to_patron_relationship.rb +11 -0
  85. data/spec/dummy/db/migrate/20100919121500_drop_user_email_unique_index.rb +11 -0
  86. data/spec/dummy/db/migrate/20101103090330_add_title_to_patron.rb +9 -0
  87. data/spec/dummy/db/migrate/20101103090457_rename_manifestation_identifier_to_identifier.rb +9 -0
  88. data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +9 -0
  89. data/spec/dummy/db/migrate/20101228081401_rename_postal_code_to_zip_code.rb +11 -0
  90. data/spec/dummy/db/migrate/20110115022329_add_position_to_library_group.rb +9 -0
  91. data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +9 -0
  92. data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +9 -0
  93. data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_patron.rb +11 -0
  94. data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +13 -0
  95. data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +9 -0
  96. data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +13 -0
  97. data/spec/dummy/db/migrate/20110916053430_rename_manifestation_number_list_to_number_string.rb +13 -0
  98. data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +13 -0
  99. data/spec/dummy/db/migrate/20110927135845_add_missing_since_to_item.rb +9 -0
  100. data/spec/dummy/db/migrate/20111103221239_rename_manifestation_identifier_to_manifestation_identifier.rb +9 -0
  101. data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +12 -0
  102. data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +12 -0
  103. data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +12 -0
  104. data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +7 -0
  105. data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +5 -0
  106. data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +6 -0
  107. data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +5 -0
  108. data/spec/dummy/db/migrate/20120413225628_add_fingerprint_to_manifestation.rb +5 -0
  109. data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +5 -0
  110. data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +5 -0
  111. data/spec/dummy/db/migrate/20120426034355_add_unique_index_to_item_identifier.rb +11 -0
  112. data/spec/dummy/db/migrate/20120426042730_add_unique_index_to_manifestation_identifier.rb +11 -0
  113. data/spec/dummy/db/schema.rb +564 -0
  114. data/spec/dummy/db/test.sqlite3 +0 -0
  115. data/spec/dummy/lib/enju_leaf/calculate_stat.rb +30 -0
  116. data/spec/dummy/lib/enju_leaf/expire_editable_fragment.rb +30 -0
  117. data/spec/dummy/lib/enju_leaf/expire_fragment_cache.rb +17 -0
  118. data/spec/dummy/lib/enju_leaf/import_file.rb +13 -0
  119. data/spec/dummy/lib/enju_leaf/localized_name.rb +13 -0
  120. data/spec/dummy/lib/enju_leaf/master_model.rb +19 -0
  121. data/spec/dummy/lib/enju_leaf/url_validator.rb +10 -0
  122. data/spec/dummy/lib/enju_leaf.rb +8 -0
  123. data/spec/dummy/public/404.html +26 -0
  124. data/spec/dummy/public/422.html +26 -0
  125. data/spec/dummy/public/500.html +25 -0
  126. data/spec/dummy/public/favicon.ico +0 -0
  127. data/spec/dummy/script/rails +6 -0
  128. data/spec/dummy/tmp/cache/4F7/F90/default_role +0 -0
  129. data/spec/dummy/tmp/cache/6E4/420/search_engine_all +0 -0
  130. data/spec/factories/manifestation.rb +6 -0
  131. data/spec/factories/user.rb +34 -0
  132. data/spec/fixtures/carrier_types.yml +51 -0
  133. data/spec/fixtures/creates.yml +66 -0
  134. data/spec/fixtures/exemplifies.yml +156 -0
  135. data/spec/fixtures/items.yml +262 -0
  136. data/spec/fixtures/libraries.yml +109 -0
  137. data/spec/fixtures/library_groups.yml +36 -0
  138. data/spec/fixtures/manifestations.yml +2024 -0
  139. data/spec/fixtures/patron_types.yml +41 -0
  140. data/spec/fixtures/patrons.yml +338 -0
  141. data/spec/fixtures/produces.yml +150 -0
  142. data/spec/fixtures/realizes.yml +87 -0
  143. data/spec/fixtures/roles.yml +21 -0
  144. data/spec/fixtures/user_has_roles.yml +41 -0
  145. data/spec/fixtures/users.yml +93 -0
  146. data/spec/spec_helper.rb +38 -0
  147. data/spec/support/controller_macros.rb +48 -0
  148. data/spec/support/devise.rb +4 -0
  149. metadata +290 -6
  150. data/test/enju_oai_test.rb +0 -7
  151. data/test/test_helper.rb +0 -15
@@ -0,0 +1,9 @@
1
+ class AddTitleToPatron < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :patrons, :title, :string
4
+ end
5
+
6
+ def self.down
7
+ remove_column :patrons, :title
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class RenameManifestationIdentifierToIdentifier < ActiveRecord::Migration
2
+ def self.up
3
+ rename_column :manifestations, :manifestation_identifier, :identifier
4
+ end
5
+
6
+ def self.down
7
+ rename_column :manifestations, :identifier, :manifestation_identifier
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddAcquiredAtToItem < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :items, :acquired_at, :timestamp
4
+ end
5
+
6
+ def self.down
7
+ remove_column :items, :acquired_at
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ class RenamePostalCodeToZipCode < ActiveRecord::Migration
2
+ def self.up
3
+ remove_column :patrons, :postal_code
4
+ rename_column :libraries, :postal_code, :zip_code
5
+ end
6
+
7
+ def self.down
8
+ add_column :patrons, :postal_code, :string
9
+ rename_column :libraries, :zip_code, :postal_code
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ class AddPositionToLibraryGroup < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :library_groups, :position, :integer
4
+ end
5
+
6
+ def self.down
7
+ remove_column :library_groups, :position
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddUrlToLibraryGroup < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :library_groups, :url, :string, :default => 'http://localhost:3000/'
4
+ end
5
+
6
+ def self.down
7
+ remove_column :library_groups, :url
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddPubDateToManifestation < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :manifestations, :pub_date, :string
4
+ end
5
+
6
+ def self.down
7
+ remove_column :manifestations, :pub_date
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ class AddBirthDateAndDeathDateToPatron < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :patrons, :birth_date, :string
4
+ add_column :patrons, :death_date, :string
5
+ end
6
+
7
+ def self.down
8
+ remove_column :patrons, :death_date
9
+ remove_column :patrons, :birth_date
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ class AddValidPeriodForNewUserToUserGroup < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :user_groups, :valid_period_for_new_user, :integer, :default => 0, :null => false
4
+ add_column :user_groups, :expired_at, :timestamp
5
+ remove_column :library_groups, :valid_period_for_new_user
6
+ end
7
+
8
+ def self.down
9
+ remove_column :user_groups, :valid_period_for_new_user
10
+ remove_column :user_groups, :expired_at
11
+ add_column :library_groups, :valid_period_for_new_user, :integer, :default => 0, :null => false
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ class AddEditionStringToManifestation < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :manifestations, :edition_string, :string
4
+ end
5
+
6
+ def self.down
7
+ remove_column :manifestations, :edition_string
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ class AddNumberOfDayToNotifyOverdueToUserGroup < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :user_groups, :number_of_day_to_notify_overdue, :integer, :default => 1, :null => false
4
+ add_column :user_groups, :number_of_day_to_notify_due_date, :integer, :default => 7, :null => false
5
+ add_column :user_groups, :number_of_time_to_notify_overdue, :integer, :default => 3, :null => false
6
+ end
7
+
8
+ def self.down
9
+ remove_column :user_groups, :number_of_time_to_notify_overdue
10
+ remove_column :user_groups, :number_of_day_to_notify_due_date
11
+ remove_column :user_groups, :number_of_day_to_notify_overdue
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class RenameManifestationNumberListToNumberString < ActiveRecord::Migration
2
+ def self.up
3
+ rename_column :manifestations, :volume_number_list, :volume_number_string
4
+ rename_column :manifestations, :issue_number_list, :issue_number_string
5
+ rename_column :manifestations, :serial_number_list, :serial_number_string
6
+ end
7
+
8
+ def self.down
9
+ rename_column :manifestations, :serial_number_string, :serial_number_list
10
+ rename_column :manifestations, :issue_number_string, :issue_number_list
11
+ rename_column :manifestations, :volume_number_string, :volume_number_list
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddVolumeNumberToManifestation < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :manifestations, :volume_number, :integer
4
+ add_column :manifestations, :issue_number, :integer
5
+ add_column :manifestations, :serial_number, :integer
6
+ end
7
+
8
+ def self.down
9
+ remove_column :manifestations, :serial_number
10
+ remove_column :manifestations, :issue_number
11
+ remove_column :manifestations, :volume_number
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ class AddMissingSinceToItem < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :items, :missing_since, :timestamp
4
+ end
5
+
6
+ def self.down
7
+ remove_column :items, :missing_since
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class RenameManifestationIdentifierToManifestationIdentifier < ActiveRecord::Migration
2
+ def up
3
+ rename_column :manifestations, :identifier, :manifestation_identifier
4
+ end
5
+
6
+ def down
7
+ rename_column :manifestations, :manifestation_identifier, :identifier
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ class CreateCreateTypes < ActiveRecord::Migration
2
+ def change
3
+ create_table :create_types do |t|
4
+ t.string :name
5
+ t.text :display_name
6
+ t.text :note
7
+ t.integer :position
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ class CreateRealizeTypes < ActiveRecord::Migration
2
+ def change
3
+ create_table :realize_types do |t|
4
+ t.string :name
5
+ t.text :display_name
6
+ t.text :note
7
+ t.integer :position
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ class CreateProduceTypes < ActiveRecord::Migration
2
+ def change
3
+ create_table :produce_types do |t|
4
+ t.string :name
5
+ t.text :display_name
6
+ t.text :note
7
+ t.integer :position
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,7 @@
1
+ class AddCreateTypeToCreate < ActiveRecord::Migration
2
+ def change
3
+ add_column :creates, :create_type_id, :integer
4
+ add_column :realizes, :realize_type_id, :integer
5
+ add_column :produces, :produce_type_id, :integer
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ class AddIsilToLibrary < ActiveRecord::Migration
2
+ def change
3
+ add_column :libraries, :isil, :string
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ class AddContentTypeIdToManifestation < ActiveRecord::Migration
2
+ def change
3
+ add_column :manifestations, :content_type_id, :integer, :default => 1
4
+
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class AddYearOfPublicationToManifestation < ActiveRecord::Migration
2
+ def change
3
+ add_column :manifestations, :year_of_publication, :integer
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddFingerprintToManifestation < ActiveRecord::Migration
2
+ def change
3
+ add_column :manifestations, :attachment_fingerprint, :string
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddAttachmentMetaToManifestation < ActiveRecord::Migration
2
+ def change
3
+ add_column :manifestations, :attachment_meta, :text
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddMonthOfPublicationToManifestation < ActiveRecord::Migration
2
+ def change
3
+ add_column :manifestations, :month_of_publication, :integer
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ class AddUniqueIndexToItemIdentifier < ActiveRecord::Migration
2
+ def up
3
+ remove_index :items, :item_identifier
4
+ add_index :items, :item_identifier, :unique => true
5
+ end
6
+
7
+ def down
8
+ remove_index :items, :item_identifier
9
+ add_index :items, :item_identifier
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ class AddUniqueIndexToManifestationIdentifier < ActiveRecord::Migration
2
+ def up
3
+ remove_index :manifestations, :manifestation_identifier
4
+ add_index :manifestations, :manifestation_identifier, :unique => true
5
+ end
6
+
7
+ def down
8
+ remove_index :manifestations, :manifestation_identifier
9
+ add_index :manifestations, :manifestation_identifier
10
+ end
11
+ end