curate 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (250) hide show
  1. data/LICENSE +14 -0
  2. data/app/controllers/application_controller.rb +69 -0
  3. data/app/controllers/catalog_controller.rb +336 -0
  4. data/app/controllers/classify_concerns_controller.rb +29 -0
  5. data/app/controllers/common_objects_controller.rb +27 -0
  6. data/app/controllers/curation_concern/base_controller.rb +26 -0
  7. data/app/controllers/curation_concern/generic_files_controller.rb +82 -0
  8. data/app/controllers/dashboard_controller.rb +85 -0
  9. data/app/controllers/downloads_controller.rb +22 -0
  10. data/app/controllers/errors_controller.rb +19 -0
  11. data/app/controllers/help_requests_controller.rb +38 -0
  12. data/app/controllers/terms_of_service_agreements_controller.rb +44 -0
  13. data/app/controllers/welcome_controller.rb +14 -0
  14. data/app/helpers/application_helper.rb +89 -0
  15. data/app/helpers/blacklight_helper.rb +19 -0
  16. data/app/helpers/common_objects_helper.rb +5 -0
  17. data/app/inputs/multi_value_input.rb +71 -0
  18. data/app/models/access_right.rb +53 -0
  19. data/app/models/classify_concern.rb +30 -0
  20. data/app/models/contributor_agreement.rb +58 -0
  21. data/app/models/digital_object_identifier.rb +83 -0
  22. data/app/models/doi_config.rb +26 -0
  23. data/app/models/help_request.rb +34 -0
  24. data/app/models/mint_doi.rb +51 -0
  25. data/app/models/mint_purl.rb +40 -0
  26. data/app/models/object_access.rb +17 -0
  27. data/app/models/purl.rb +18 -0
  28. data/app/models/purl_config.rb +10 -0
  29. data/app/models/repo_object.rb +24 -0
  30. data/app/models/solr_document.rb +35 -0
  31. data/app/repository_datastreams/file_content_datastream.rb +36 -0
  32. data/app/repository_models/curation_concern/embargoable.rb +43 -0
  33. data/app/repository_models/curation_concern/with_access_right.rb +31 -0
  34. data/app/repository_models/generic_file.rb +36 -0
  35. data/app/services/anti_virus_scanner.rb +28 -0
  36. data/app/services/curation_concern.rb +22 -0
  37. data/app/services/curation_concern/base_actor.rb +48 -0
  38. data/app/services/curation_concern/generic_file_actor.rb +38 -0
  39. data/app/validators/future_date_validator.rb +19 -0
  40. data/app/views/_footer.html.erb +19 -0
  41. data/app/views/_ga.html.erb +6 -0
  42. data/app/views/_logo.html.erb +34 -0
  43. data/app/views/_masthead.html.erb +34 -0
  44. data/app/views/catalog/_bookmark_control.html.erb +25 -0
  45. data/app/views/catalog/_bookmark_form.html.erb +8 -0
  46. data/app/views/catalog/_citation.html.erb +11 -0
  47. data/app/views/catalog/_constraints.html.erb +6 -0
  48. data/app/views/catalog/_constraints_element.html.erb +20 -0
  49. data/app/views/catalog/_delete_partials/_default.html.erb +29 -0
  50. data/app/views/catalog/_did_you_mean.html.erb +10 -0
  51. data/app/views/catalog/_document.html.erb +19 -0
  52. data/app/views/catalog/_document_list.html.erb +2 -0
  53. data/app/views/catalog/_edit_partials/_default.html.erb +58 -0
  54. data/app/views/catalog/_edit_partials/_default_details.html.erb +13 -0
  55. data/app/views/catalog/_email_form.html.erb +11 -0
  56. data/app/views/catalog/_facet_layout.html.erb +12 -0
  57. data/app/views/catalog/_facet_limit.html.erb +19 -0
  58. data/app/views/catalog/_facet_selected.html.erb +12 -0
  59. data/app/views/catalog/_facets.html.erb +5 -0
  60. data/app/views/catalog/_folder_control.html.erb +12 -0
  61. data/app/views/catalog/_home.html.erb +2 -0
  62. data/app/views/catalog/_home_text.html.erb +10 -0
  63. data/app/views/catalog/_index_default.html.erb +11 -0
  64. data/app/views/catalog/_index_partials/_default_group.html.erb +37 -0
  65. data/app/views/catalog/_marc_view.html.erb +33 -0
  66. data/app/views/catalog/_opensearch_response_metadata.html.erb +2 -0
  67. data/app/views/catalog/_previous_next_doc.html.erb +6 -0
  68. data/app/views/catalog/_refworks_form.html.erb +7 -0
  69. data/app/views/catalog/_results_pagination.html.erb +6 -0
  70. data/app/views/catalog/_search_form.html.erb +20 -0
  71. data/app/views/catalog/_show_default.html.erb +9 -0
  72. data/app/views/catalog/_show_partials/_default.html.erb +22 -0
  73. data/app/views/catalog/_show_partials/_default_details.html.erb +15 -0
  74. data/app/views/catalog/_show_partials/_facets.html.erb +52 -0
  75. data/app/views/catalog/_show_sidebar.html.erb +1 -0
  76. data/app/views/catalog/_show_tools.html.erb +46 -0
  77. data/app/views/catalog/_sms_form.html.erb +21 -0
  78. data/app/views/catalog/_sort_and_per_page.html.erb +38 -0
  79. data/app/views/catalog/_uva_tabs.html.erb +10 -0
  80. data/app/views/catalog/about.html.erb +0 -0
  81. data/app/views/catalog/citation.html.erb +1 -0
  82. data/app/views/catalog/email.erb +1 -0
  83. data/app/views/catalog/endnote.endnote.erb +1 -0
  84. data/app/views/catalog/index.atom.builder +109 -0
  85. data/app/views/catalog/index.html.erb +55 -0
  86. data/app/views/catalog/index.rss.builder +19 -0
  87. data/app/views/catalog/librarian_view.html.erb +3 -0
  88. data/app/views/catalog/opensearch.json.erb +0 -0
  89. data/app/views/catalog/opensearch.xml.builder +10 -0
  90. data/app/views/catalog/send_email_record.erb +0 -0
  91. data/app/views/catalog/show.endnote.erb +1 -0
  92. data/app/views/catalog/show.html.erb +40 -0
  93. data/app/views/catalog/show.refworks.erb +1 -0
  94. data/app/views/catalog/sms.erb +1 -0
  95. data/app/views/classify_concerns/new.html.erb +24 -0
  96. data/app/views/common_objects/_generic_file.html.erb +0 -0
  97. data/app/views/common_objects/_senior_thesis.html.erb +2 -0
  98. data/app/views/common_objects/show.html.erb +11 -0
  99. data/app/views/common_objects/show_stub_information.html.erb +13 -0
  100. data/app/views/curation_concern/_content_license.html.erb +16 -0
  101. data/app/views/curation_concern/_contributor_agreement.html.erb +27 -0
  102. data/app/views/curation_concern/_doi.html.erb +43 -0
  103. data/app/views/curation_concern/_media_display.html.erb +1 -0
  104. data/app/views/curation_concern/_permission.html.erb +39 -0
  105. data/app/views/curation_concern/_related_files.html.erb +46 -0
  106. data/app/views/curation_concern/generic_files/_attributes.html.erb +63 -0
  107. data/app/views/curation_concern/generic_files/_form.html.erb +57 -0
  108. data/app/views/curation_concern/generic_files/edit.html.erb +5 -0
  109. data/app/views/curation_concern/generic_files/new.html.erb +5 -0
  110. data/app/views/curation_concern/generic_files/show.html.erb +12 -0
  111. data/app/views/curation_concern/senior_theses/_attributes.html.erb +13 -0
  112. data/app/views/curation_concern/senior_theses/_form.html.erb +88 -0
  113. data/app/views/curation_concern/senior_theses/edit.html.erb +15 -0
  114. data/app/views/curation_concern/senior_theses/new.html.erb +14 -0
  115. data/app/views/curation_concern/senior_theses/show.html.erb +18 -0
  116. data/app/views/dashboard/_constraints.html.erb +22 -0
  117. data/app/views/dashboard/_did_you_mean.html.erb +26 -0
  118. data/app/views/dashboard/_document_list.html.erb +20 -0
  119. data/app/views/dashboard/_facet_layout.html.erb +27 -0
  120. data/app/views/dashboard/_facet_limit.html.erb +35 -0
  121. data/app/views/dashboard/_facet_pagination.html.erb +25 -0
  122. data/app/views/dashboard/_facet_selected.html.erb +28 -0
  123. data/app/views/dashboard/_facets.html.erb +22 -0
  124. data/app/views/dashboard/_index_partials/_default_group.html.erb +37 -0
  125. data/app/views/dashboard/_index_partials/_list_files.html.erb +66 -0
  126. data/app/views/dashboard/_index_partials/_thumbnail_display.html.erb +0 -0
  127. data/app/views/dashboard/_results_pagination.html.erb +22 -0
  128. data/app/views/dashboard/_search_form.html.erb +36 -0
  129. data/app/views/dashboard/_show_partials/_default.html.erb +38 -0
  130. data/app/views/dashboard/_show_partials/_default_details.html.erb +31 -0
  131. data/app/views/dashboard/_show_partials/_facets.html.erb +103 -0
  132. data/app/views/dashboard/_sort_and_per_page.html.erb +18 -0
  133. data/app/views/dashboard/facet.html.erb +38 -0
  134. data/app/views/dashboard/get_related_file.html.erb +4 -0
  135. data/app/views/dashboard/index.html.erb +60 -0
  136. data/app/views/errors/401.html.erb +5 -0
  137. data/app/views/errors/404.html.erb +16 -0
  138. data/app/views/errors/500.html.erb +10 -0
  139. data/app/views/help_requests/new.html.erb +60 -0
  140. data/app/views/layouts/application.html.erb +14 -0
  141. data/app/views/layouts/boilerplate.html.erb +28 -0
  142. data/app/views/layouts/common_objects.html.erb +45 -0
  143. data/app/views/layouts/curate_nd.html.erb +55 -0
  144. data/app/views/layouts/curate_nd/1_column.html.erb +22 -0
  145. data/app/views/layouts/curate_nd/2_column.html.erb +26 -0
  146. data/app/views/layouts/curate_nd/catalog.html.erb +22 -0
  147. data/app/views/layouts/curate_nd/dashboard.html.erb +22 -0
  148. data/app/views/layouts/hydra-head.html.erb +95 -0
  149. data/app/views/shared/_action_bar.html.erb +30 -0
  150. data/app/views/shared/_flash_message.html.erb +9 -0
  151. data/app/views/shared/_site_search.html.erb +18 -0
  152. data/app/views/terms_of_service_agreements/new.html.erb +136 -0
  153. data/app/views/welcome/index.html.erb +21 -0
  154. data/app/workers/characterize_job.rb +4 -0
  155. data/app/workers/doi_worker.rb +16 -0
  156. data/config/routes.rb +35 -0
  157. data/lib/curate.rb +6 -0
  158. data/lib/curate/engine.rb +46 -0
  159. data/lib/curate/version.rb +1 -1
  160. data/spec/abilities/generic_file_abilities_spec.rb +55 -0
  161. data/spec/controllers/application_controller_spec.rb +38 -0
  162. data/spec/controllers/classify_concerns_controller_spec.rb +36 -0
  163. data/spec/controllers/common_objects_controller_spec.rb +112 -0
  164. data/spec/controllers/curation_concern/base_controller_spec.rb +14 -0
  165. data/spec/controllers/curation_concern/generic_files_controller_spec.rb +156 -0
  166. data/spec/controllers/dashboard_controller_spec.rb +85 -0
  167. data/spec/controllers/downloads_controller_spec.rb +42 -0
  168. data/spec/controllers/help_requests_controller_spec.rb +42 -0
  169. data/spec/controllers/terms_of_service_agreements_controller_spec.rb +30 -0
  170. data/spec/controllers/welcome_controller_spec.rb +10 -0
  171. data/spec/dummy/app/models/solr_document.rb +4 -0
  172. data/spec/dummy/app/models/user.rb +13 -0
  173. data/spec/dummy/config/application.rb +8 -1
  174. data/spec/dummy/config/database.yml +21 -22
  175. data/spec/dummy/config/doi.yml +11 -0
  176. data/spec/dummy/config/fedora.yml +20 -0
  177. data/spec/dummy/config/initializers/devise.rb +232 -0
  178. data/spec/dummy/config/initializers/hydra_config.rb +41 -0
  179. data/spec/dummy/config/initializers/mailboxer.rb +17 -0
  180. data/spec/dummy/config/initializers/redis_config.rb +45 -0
  181. data/spec/dummy/config/initializers/sufia.rb +66 -0
  182. data/spec/dummy/config/purl.yml +15 -0
  183. data/spec/dummy/config/redis.yml +6 -0
  184. data/spec/dummy/config/role_map_ci.yml +15 -0
  185. data/spec/dummy/config/role_map_cucumber.yml +10 -0
  186. data/spec/dummy/config/role_map_development.yml +12 -0
  187. data/spec/dummy/config/role_map_pre_production.yml +2 -0
  188. data/spec/dummy/config/role_map_production.yml +2 -0
  189. data/spec/dummy/config/role_map_test.yml +15 -0
  190. data/spec/dummy/config/routes.rb +4 -55
  191. data/spec/dummy/config/solr.yml +17 -0
  192. data/spec/dummy/db/migrate/20130130142162_create_purl.rb +55 -0
  193. data/spec/dummy/db/migrate/20130312135359_create_help_requests.rb +22 -0
  194. data/spec/dummy/db/migrate/20130408165008_create_users.rb +11 -0
  195. data/spec/dummy/db/migrate/20130408165009_acts_as_follower_migration.rb +31 -0
  196. data/spec/dummy/db/migrate/20130408165010_add_social_to_users.rb +27 -0
  197. data/spec/dummy/db/migrate/20130408165011_create_single_use_links.rb +12 -0
  198. data/spec/dummy/db/migrate/20130408165012_add_ldap_attrs_to_user.rb +41 -0
  199. data/spec/dummy/db/migrate/20130408165013_add_avatars_to_users.rb +23 -0
  200. data/spec/dummy/db/migrate/20130408165014_create_checksum_audit_logs.rb +34 -0
  201. data/spec/dummy/db/migrate/20130408165015_create_version_committers.rb +29 -0
  202. data/spec/dummy/db/migrate/20130408165016_add_groups_to_users.rb +25 -0
  203. data/spec/dummy/db/migrate/20130408165017_create_local_authorities.rb +64 -0
  204. data/spec/dummy/db/migrate/20130408165018_create_trophies.rb +10 -0
  205. data/spec/dummy/db/migrate/20130408165022_create_mailboxer.mailboxer_engine.rb +62 -0
  206. data/spec/dummy/db/migrate/20130408165023_add_notified_object.mailboxer_engine.rb +18 -0
  207. data/spec/dummy/db/migrate/20130408165024_add_notification_code.mailboxer_engine.rb +14 -0
  208. data/spec/dummy/db/migrate/20130408165025_add_attachments.mailboxer_engine.rb +10 -0
  209. data/spec/dummy/db/migrate/20130408165026_rename_receipts_read.mailboxer_engine.rb +10 -0
  210. data/spec/dummy/db/schema.rb +197 -0
  211. data/spec/dummy/db/test.sqlite3 +0 -0
  212. data/spec/dummy/fedora_conf/conf/development/fedora.fcfg +953 -0
  213. data/spec/dummy/fedora_conf/conf/test/fedora.fcfg +953 -0
  214. data/spec/dummy/log/development.log +1791 -0
  215. data/spec/dummy/log/test.log +176333 -0
  216. data/spec/dummy/solr_conf/conf/schema.xml +692 -0
  217. data/spec/dummy/solr_conf/conf/solrconfig.xml +299 -0
  218. data/spec/dummy/solr_conf/solr.xml +35 -0
  219. data/spec/factories/create_curation_concern.rb +11 -0
  220. data/spec/factories/create_generic_file.rb +36 -0
  221. data/spec/factories/help_requests.rb +10 -0
  222. data/spec/factories/mock_curation_concerns.rb +4 -0
  223. data/spec/factories/users.rb +8 -0
  224. data/spec/helpers/application_helper_spec.rb +139 -0
  225. data/spec/helpers/common_objects_helper_spec.rb +9 -0
  226. data/spec/models/access_right_spec.rb +47 -0
  227. data/spec/models/classify_concern_spec.rb +30 -0
  228. data/spec/models/contributor_agreement_spec.rb +45 -0
  229. data/spec/models/digital_object_identifier_spec.rb +50 -0
  230. data/spec/models/help_request_spec.rb +5 -0
  231. data/spec/models/mint_doi_spec.rb +79 -0
  232. data/spec/models/mint_purl_spec.rb +38 -0
  233. data/spec/models/object_access_spec.rb +24 -0
  234. data/spec/models/purl_spec.rb +22 -0
  235. data/spec/models/repo_object_spec.rb +39 -0
  236. data/spec/repository_models/curation_concern/embargoable_spec.rb +69 -0
  237. data/spec/repository_models/generic_file_spec.rb +38 -0
  238. data/spec/services/anti_virus_scanner_spec.rb +26 -0
  239. data/spec/services/curation_concern/base_actor_spec.rb +28 -0
  240. data/spec/services/curation_concern/generic_file_actor_spec.rb +75 -0
  241. data/spec/services/curation_concern_spec.rb +34 -0
  242. data/spec/spec_helper.rb +54 -1
  243. data/spec/support/environment_override.rb +17 -0
  244. data/spec/support/matchers/raise_rescue_response_type_matcher.rb +42 -0
  245. data/spec/support/mock_curation_concern.rb +61 -0
  246. data/spec/support/shared/shared_examples_is_embargoable.rb +9 -0
  247. data/spec/support/shared/shared_examples_with_access_rights.rb +33 -0
  248. data/spec/workers/characterize_job_spec.rb +26 -0
  249. metadata +686 -10
  250. data/MIT-LICENSE +0 -20
@@ -0,0 +1,27 @@
1
+ # Copyright © 2012 The Pennsylvania State University
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ class AddSocialToUsers < ActiveRecord::Migration
16
+ def self.up
17
+ add_column :users, :facebook_handle, :string
18
+ add_column :users, :twitter_handle, :string
19
+ add_column :users, :googleplus_handle, :string
20
+ end
21
+
22
+ def self.down
23
+ remove_column :users, :facebook_handle, :string
24
+ remove_column :users, :twitter_handle, :string
25
+ remove_column :users, :googleplus_handle, :string
26
+ end
27
+ end
@@ -0,0 +1,12 @@
1
+ class CreateSingleUseLinks < ActiveRecord::Migration
2
+ def change
3
+ create_table :single_use_links do |t|
4
+ t.string :downloadKey
5
+ t.string :path
6
+ t.string :itemId
7
+ t.datetime :expires
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,41 @@
1
+ # Copyright © 2012 The Pennsylvania State University
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ class AddLdapAttrsToUser < ActiveRecord::Migration
16
+ def self.up
17
+ add_column :users, :display_name, :string
18
+ add_column :users, :address, :string
19
+ add_column :users, :admin_area, :string
20
+ add_column :users, :department, :string
21
+ add_column :users, :title, :string
22
+ add_column :users, :office, :string
23
+ add_column :users, :chat_id, :string
24
+ add_column :users, :website, :string
25
+ add_column :users, :affiliation, :string
26
+ add_column :users, :telephone, :string
27
+ end
28
+
29
+ def self.down
30
+ remove_column :users, :display_name
31
+ remove_column :users, :address
32
+ remove_column :users, :admin_area
33
+ remove_column :users, :department
34
+ remove_column :users, :title
35
+ remove_column :users, :office
36
+ remove_column :users, :chat_id
37
+ remove_column :users, :website
38
+ remove_column :users, :affiliation
39
+ remove_column :users, :telephone
40
+ end
41
+ end
@@ -0,0 +1,23 @@
1
+ # Copyright © 2012 The Pennsylvania State University
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ class AddAvatarsToUsers < ActiveRecord::Migration
16
+ def self.up
17
+ add_attachment :users, :avatar
18
+ end
19
+
20
+ def self.down
21
+ remove_attachment :users, :avatar
22
+ end
23
+ end
@@ -0,0 +1,34 @@
1
+ # Copyright © 2012 The Pennsylvania State University
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ class CreateChecksumAuditLogs < ActiveRecord::Migration
16
+ def self.up
17
+ create_table :checksum_audit_logs do |t|
18
+ t.string :pid
19
+ t.string :dsid
20
+ t.string :version
21
+ t.integer :pass
22
+ t.string :expected_result
23
+ t.string :actual_result
24
+ t.timestamps
25
+ end
26
+ add_index :checksum_audit_logs, [:pid, :dsid], :name=>'by_pid_and_dsid', :order => {:created_at => "DESC" }
27
+
28
+ end
29
+
30
+ def self.down
31
+ remove_index(:checksum_audit_logs, :name => 'by_pid_and_dsid')
32
+ drop_table :checksum_audit_logs
33
+ end
34
+ end
@@ -0,0 +1,29 @@
1
+ # Copyright © 2012 The Pennsylvania State University
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ class CreateVersionCommitters < ActiveRecord::Migration
16
+ def self.up
17
+ create_table :version_committers do |t|
18
+ t.string :obj_id
19
+ t.string :datastream_id
20
+ t.string :version_id
21
+ t.string :committer_login
22
+ t.timestamps
23
+ end
24
+ end
25
+
26
+ def self.down
27
+ drop_table :version_committers
28
+ end
29
+ end
@@ -0,0 +1,25 @@
1
+ # Copyright © 2012 The Pennsylvania State University
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ class AddGroupsToUsers < ActiveRecord::Migration
16
+ def self.up
17
+ add_column :users, :group_list, :text
18
+ add_column :users, :groups_last_update, :datetime
19
+ end
20
+
21
+ def self.down
22
+ remove_column :users, :group_list
23
+ remove_column :users, :groups_last_update
24
+ end
25
+ end
@@ -0,0 +1,64 @@
1
+ # Copyright © 2012 The Pennsylvania State University
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ class CreateLocalAuthorities < ActiveRecord::Migration
16
+ def self.up
17
+ create_table :local_authority_entries, :force => true do |t|
18
+ t.integer :local_authority_id
19
+ t.string :label
20
+ t.string :uri
21
+ end
22
+
23
+ create_table :local_authorities, :force => true do |t|
24
+ t.string :name, :unique => true
25
+ end
26
+
27
+ create_table :domain_terms, :force => true do |t|
28
+ t.string :model
29
+ t.string :term
30
+ end
31
+
32
+ create_table :domain_terms_local_authorities, :id => false do |t|
33
+ t.integer :domain_term_id, :foreign_key => true
34
+ t.integer :local_authority_id, :foreign_key => true
35
+ end
36
+
37
+ create_table :subject_local_authority_entries, :force => true do |t|
38
+ t.string :label
39
+ t.string :lowerLabel
40
+ t.string :url
41
+ end
42
+
43
+ add_index :local_authority_entries, [:local_authority_id, :label], :name => 'entries_by_term_and_label'
44
+ add_index :local_authority_entries, [:local_authority_id, :uri], :name => 'entries_by_term_and_uri'
45
+ add_index :domain_terms, [:model, :term], :name => 'terms_by_model_and_term'
46
+ add_index :domain_terms_local_authorities, [:local_authority_id, :domain_term_id], :name => 'dtla_by_ids1'
47
+ add_index :domain_terms_local_authorities, [:domain_term_id, :local_authority_id], :name => 'dtla_by_ids2'
48
+ add_index :subject_local_authority_entries, [:lowerLabel], :name => 'entries_by_lower_label'
49
+ end
50
+
51
+ def self.down
52
+ drop_table :local_authority_entries
53
+ drop_table :local_authorities
54
+ drop_table :domain_terms
55
+ drop_table :domain_terms_local_authorities
56
+ drop_table :subject_local_authority_entries
57
+ remove_index :local_authority_entries, :name => "entries_by_term_and_label"
58
+ remove_index :local_authority_entries, :name => "entries_by_term_and_uri"
59
+ remove_index :domain_terms, :name => "terms_by_model_and_term"
60
+ remove_index :subject_local_authority_entries, :name => 'entries_by_lower_label'
61
+ remove_index :domain_terms_local_authorities, :name => 'dtla_by_ids1'
62
+ remove_index :domain_terms_local_authorities, :name => 'dtla_by_ids2'
63
+ end
64
+ end
@@ -0,0 +1,10 @@
1
+ class CreateTrophies < ActiveRecord::Migration
2
+ def change
3
+ create_table :trophies do |t|
4
+ t.integer :user_id
5
+ t.string :generic_file_id
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,62 @@
1
+ # This migration comes from mailboxer_engine (originally 20110511145103)
2
+ class CreateMailboxer < ActiveRecord::Migration
3
+ def self.up
4
+ #Tables
5
+ #Conversations
6
+ create_table :conversations do |t|
7
+ t.column :subject, :string, :default => ""
8
+ t.column :created_at, :datetime, :null => false
9
+ t.column :updated_at, :datetime, :null => false
10
+ end
11
+ #Receipts
12
+ create_table :receipts do |t|
13
+ t.references :receiver, :polymorphic => true
14
+ t.column :notification_id, :integer, :null => false
15
+ t.column :read, :boolean, :default => false
16
+ t.column :trashed, :boolean, :default => false
17
+ t.column :deleted, :boolean, :default => false
18
+ t.column :mailbox_type, :string, :limit => 25
19
+ t.column :created_at, :datetime, :null => false
20
+ t.column :updated_at, :datetime, :null => false
21
+ end
22
+ #Notifications and Messages
23
+ create_table :notifications do |t|
24
+ t.column :type, :string
25
+ t.column :body, :text
26
+ t.column :subject, :string, :default => ""
27
+ t.references :sender, :polymorphic => true
28
+ t.references :object, :polymorphic => true
29
+ t.column :conversation_id, :integer
30
+ t.column :draft, :boolean, :default => false
31
+ t.column :updated_at, :datetime, :null => false
32
+ t.column :created_at, :datetime, :null => false
33
+ end
34
+
35
+
36
+ #Indexes
37
+ #Conversations
38
+ #Receipts
39
+ add_index "receipts","notification_id"
40
+
41
+ #Messages
42
+ add_index "notifications","conversation_id"
43
+
44
+ #Foreign keys
45
+ #Conversations
46
+ #Receipts
47
+ add_foreign_key "receipts", "notifications", :name => "receipts_on_notification_id"
48
+ #Messages
49
+ add_foreign_key "notifications", "conversations", :name => "notifications_on_conversation_id"
50
+ end
51
+
52
+ def self.down
53
+ #Tables
54
+ remove_foreign_key "receipts", :name => "receipts_on_notification_id"
55
+ remove_foreign_key "notifications", :name => "notifications_on_conversation_id"
56
+
57
+ #Indexes
58
+ drop_table :receipts
59
+ drop_table :conversations
60
+ drop_table :notifications
61
+ end
62
+ end
@@ -0,0 +1,18 @@
1
+ # This migration comes from mailboxer_engine (originally 20110719110700)
2
+ class AddNotifiedObject < ActiveRecord::Migration
3
+ def self.up
4
+ change_table :notifications do |t|
5
+ t.references :notified_object, :polymorphic => true
6
+ t.remove :object_id
7
+ t.remove :object_type
8
+ end
9
+ end
10
+
11
+ def self.down
12
+ change_table :notifications do |t|
13
+ t.remove :notified_object_id
14
+ t.remove :notified_object_type
15
+ t.references :object, :polymorphic => true
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,14 @@
1
+ # This migration comes from mailboxer_engine (originally 20110912163911)
2
+ class AddNotificationCode < ActiveRecord::Migration
3
+ def self.up
4
+ change_table :notifications do |t|
5
+ t.string :notification_code, :default => nil
6
+ end
7
+ end
8
+
9
+ def self.down
10
+ change_table :notifications do |t|
11
+ t.remove :notification_code
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,10 @@
1
+ # This migration comes from mailboxer_engine (originally 20111204163911)
2
+ class AddAttachments < ActiveRecord::Migration
3
+ def self.up
4
+ add_column :notifications, :attachment, :string
5
+ end
6
+
7
+ def self.down
8
+ remove_column :notifications, :attachment, :string
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # This migration comes from mailboxer_engine (originally 20120813110712)
2
+ class RenameReceiptsRead < ActiveRecord::Migration
3
+ def up
4
+ rename_column :receipts, :read, :is_read
5
+ end
6
+
7
+ def down
8
+ rename_column :receipts, :is_read, :read
9
+ end
10
+ end
@@ -0,0 +1,197 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20130408165026) do
15
+
16
+ create_table "checksum_audit_logs", :force => true do |t|
17
+ t.string "pid"
18
+ t.string "dsid"
19
+ t.string "version"
20
+ t.integer "pass"
21
+ t.string "expected_result"
22
+ t.string "actual_result"
23
+ t.datetime "created_at", :null => false
24
+ t.datetime "updated_at", :null => false
25
+ end
26
+
27
+ add_index "checksum_audit_logs", ["pid", "dsid"], :name => "by_pid_and_dsid"
28
+
29
+ create_table "conversations", :force => true do |t|
30
+ t.string "subject", :default => ""
31
+ t.datetime "created_at", :null => false
32
+ t.datetime "updated_at", :null => false
33
+ end
34
+
35
+ create_table "domain_terms", :force => true do |t|
36
+ t.string "model"
37
+ t.string "term"
38
+ end
39
+
40
+ add_index "domain_terms", ["model", "term"], :name => "terms_by_model_and_term"
41
+
42
+ create_table "domain_terms_local_authorities", :id => false, :force => true do |t|
43
+ t.integer "domain_term_id"
44
+ t.integer "local_authority_id"
45
+ end
46
+
47
+ add_index "domain_terms_local_authorities", ["domain_term_id", "local_authority_id"], :name => "dtla_by_ids2"
48
+ add_index "domain_terms_local_authorities", ["local_authority_id", "domain_term_id"], :name => "dtla_by_ids1"
49
+
50
+ create_table "follows", :force => true do |t|
51
+ t.integer "followable_id", :null => false
52
+ t.string "followable_type", :null => false
53
+ t.integer "follower_id", :null => false
54
+ t.string "follower_type", :null => false
55
+ t.boolean "blocked", :default => false, :null => false
56
+ t.datetime "created_at", :null => false
57
+ t.datetime "updated_at", :null => false
58
+ end
59
+
60
+ add_index "follows", ["followable_id", "followable_type"], :name => "fk_followables"
61
+ add_index "follows", ["follower_id", "follower_type"], :name => "fk_follows"
62
+
63
+ create_table "help_requests", :force => true do |t|
64
+ t.string "view_port"
65
+ t.text "current_url"
66
+ t.string "user_agent"
67
+ t.string "resolution"
68
+ t.text "how_can_we_help_you"
69
+ t.boolean "javascript_enabled"
70
+ t.string "release_version"
71
+ t.integer "user_id"
72
+ t.datetime "created_at", :null => false
73
+ t.datetime "updated_at", :null => false
74
+ end
75
+
76
+ add_index "help_requests", ["created_at"], :name => "index_help_requests_on_created_at"
77
+ add_index "help_requests", ["user_id"], :name => "index_help_requests_on_user_id"
78
+
79
+ create_table "local_authorities", :force => true do |t|
80
+ t.string "name"
81
+ end
82
+
83
+ create_table "local_authority_entries", :force => true do |t|
84
+ t.integer "local_authority_id"
85
+ t.string "label"
86
+ t.string "uri"
87
+ end
88
+
89
+ add_index "local_authority_entries", ["local_authority_id", "label"], :name => "entries_by_term_and_label"
90
+ add_index "local_authority_entries", ["local_authority_id", "uri"], :name => "entries_by_term_and_uri"
91
+
92
+ create_table "notifications", :force => true do |t|
93
+ t.string "type"
94
+ t.text "body"
95
+ t.string "subject", :default => ""
96
+ t.integer "sender_id"
97
+ t.string "sender_type"
98
+ t.integer "conversation_id"
99
+ t.boolean "draft", :default => false
100
+ t.datetime "updated_at", :null => false
101
+ t.datetime "created_at", :null => false
102
+ t.integer "notified_object_id"
103
+ t.string "notified_object_type"
104
+ t.string "notification_code"
105
+ t.string "attachment"
106
+ end
107
+
108
+ add_index "notifications", ["conversation_id"], :name => "index_notifications_on_conversation_id"
109
+
110
+ create_table "object_access", :primary_key => "access_id", :force => true do |t|
111
+ t.datetime "date_accessed"
112
+ t.string "ip_address"
113
+ t.string "host_name"
114
+ t.string "user_agent"
115
+ t.string "request_method"
116
+ t.string "path_info"
117
+ t.integer "repo_object_id"
118
+ t.integer "purl_id"
119
+ end
120
+
121
+ create_table "purl", :primary_key => "purl_id", :force => true do |t|
122
+ t.integer "repo_object_id"
123
+ t.string "access_count"
124
+ t.datetime "last_accessed"
125
+ t.string "source_app"
126
+ t.datetime "date_created"
127
+ end
128
+
129
+ create_table "receipts", :force => true do |t|
130
+ t.integer "receiver_id"
131
+ t.string "receiver_type"
132
+ t.integer "notification_id", :null => false
133
+ t.boolean "is_read", :default => false
134
+ t.boolean "trashed", :default => false
135
+ t.boolean "deleted", :default => false
136
+ t.string "mailbox_type", :limit => 25
137
+ t.datetime "created_at", :null => false
138
+ t.datetime "updated_at", :null => false
139
+ end
140
+
141
+ add_index "receipts", ["notification_id"], :name => "index_receipts_on_notification_id"
142
+
143
+ create_table "repo_object", :primary_key => "repo_object_id", :force => true do |t|
144
+ t.string "filename"
145
+ t.string "url"
146
+ t.datetime "date_added"
147
+ t.string "add_source_ip"
148
+ t.datetime "date_modified"
149
+ t.string "information"
150
+ end
151
+
152
+ create_table "single_use_links", :force => true do |t|
153
+ t.string "downloadKey"
154
+ t.string "path"
155
+ t.string "itemId"
156
+ t.datetime "expires"
157
+ t.datetime "created_at", :null => false
158
+ t.datetime "updated_at", :null => false
159
+ end
160
+
161
+ create_table "subject_local_authority_entries", :force => true do |t|
162
+ t.string "label"
163
+ t.string "lowerLabel"
164
+ t.string "url"
165
+ end
166
+
167
+ add_index "subject_local_authority_entries", ["lowerLabel"], :name => "entries_by_lower_label"
168
+
169
+ create_table "trophies", :force => true do |t|
170
+ t.integer "user_id"
171
+ t.string "generic_file_id"
172
+ t.datetime "created_at", :null => false
173
+ t.datetime "updated_at", :null => false
174
+ end
175
+
176
+ create_table "users", :force => true do |t|
177
+ t.string "email"
178
+ t.boolean "agreed_to_terms_of_service"
179
+ t.string "encrypted_password"
180
+ t.datetime "created_at", :null => false
181
+ t.datetime "updated_at", :null => false
182
+ end
183
+
184
+ create_table "version_committers", :force => true do |t|
185
+ t.string "obj_id"
186
+ t.string "datastream_id"
187
+ t.string "version_id"
188
+ t.string "committer_login"
189
+ t.datetime "created_at", :null => false
190
+ t.datetime "updated_at", :null => false
191
+ end
192
+
193
+ add_foreign_key "notifications", "conversations", :name => "notifications_on_conversation_id"
194
+
195
+ add_foreign_key "receipts", "notifications", :name => "receipts_on_notification_id"
196
+
197
+ end