sufia 1.3.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -3
  3. data/Gemfile +1 -0
  4. data/Releasing_sufia.md +3 -0
  5. data/SUFIA_VERSION +1 -0
  6. data/app/assets/javascripts/sufia.js +22 -24
  7. data/app/assets/javascripts/sufia/batch_select_all.js +2 -0
  8. data/app/assets/javascripts/sufia/fileupload.js +6 -0
  9. data/app/assets/javascripts/sufia/uploader.js +165 -0
  10. data/app/assets/javascripts/terms_of_service.js +36 -30
  11. data/app/assets/stylesheets/{scholarsphere-bootstrap.css → application-bootstrap.css} +0 -0
  12. data/app/assets/stylesheets/sufia.css.scss +1 -1
  13. data/app/controllers/batch_controller.rb +1 -0
  14. data/app/controllers/concerns/sufia/users_controller_behavior.rb +2 -1
  15. data/app/helpers/generic_file_helper.rb +17 -0
  16. data/{lib/sufia → app}/jobs/content_delete_event_job.rb +0 -0
  17. data/{lib/sufia → app}/jobs/content_deposit_event_job.rb +0 -0
  18. data/{lib/sufia → app}/jobs/content_new_version_event_job.rb +0 -0
  19. data/{lib/sufia → app}/jobs/content_restored_version_event_job.rb +0 -0
  20. data/{lib/sufia → app}/jobs/content_update_event_job.rb +0 -0
  21. data/{lib/sufia → app}/jobs/event_job.rb +0 -0
  22. data/{lib/sufia → app}/jobs/user_edit_profile_event_job.rb +0 -0
  23. data/{lib/sufia → app}/jobs/user_follow_event_job.rb +0 -0
  24. data/{lib/sufia → app}/jobs/user_unfollow_event_job.rb +0 -0
  25. data/app/models/contact_form.rb +2 -2
  26. data/app/views/_ga.html.erb +2 -2
  27. data/app/views/batch_edits/_batch_edits_actions.html.erb +1 -0
  28. data/app/views/batch_edits/_check_all.html.erb +1 -2
  29. data/app/views/catalog/_sort_and_per_page.html.erb +1 -1
  30. data/app/views/dashboard/_batch_edits_actions.html.erb +2 -0
  31. data/app/views/dashboard/_sort_and_per_page.html.erb +1 -1
  32. data/app/views/generic_files/_breadcrumbs.html.erb +5 -1
  33. data/app/views/generic_files/_descriptions.html.erb +6 -4
  34. data/app/views/generic_files/_dropbox_import.html.erb +3 -0
  35. data/app/views/generic_files/_field_display.html.erb +12 -0
  36. data/app/views/generic_files/_field_form.html.erb +1 -1
  37. data/app/views/generic_files/_multiple_upload.html.erb +4 -135
  38. data/app/views/generic_files/_permission_form.html.erb +5 -5
  39. data/app/views/generic_files/_show_descriptions.html.erb +6 -14
  40. data/app/views/generic_files/_show_details.html.erb +2 -2
  41. data/app/views/generic_files/edit_fields/_resource_type.html.erb +9 -0
  42. data/app/views/generic_files/edit_fields/_rights.html.erb +1 -1
  43. data/app/views/generic_files/edit_fields/_type.html.erb +4 -1
  44. data/app/views/generic_files/new.html.erb +18 -1
  45. data/app/views/generic_files/show_fields/_default.html.erb +12 -0
  46. data/app/views/generic_files/upload/_agreement.html.erb +5 -0
  47. data/app/views/generic_files/upload/_alerts.html.erb +19 -0
  48. data/app/views/generic_files/upload/_dropbox_chooser.html.erb +39 -0
  49. data/app/views/generic_files/upload/_form.html.erb +6 -0
  50. data/app/views/generic_files/upload/_form_fields.html.erb +47 -0
  51. data/app/views/generic_files/upload/_script_templates.html.erb +61 -0
  52. data/app/views/generic_files/upload/_tos_checkbox.html.erb +3 -0
  53. data/app/views/layouts/_head-tag-content.html.erb +22 -0
  54. data/app/views/layouts/{hydra-head.html.erb → homepage.html.erb} +3 -44
  55. data/app/views/layouts/sufia-one-column.html.erb +43 -0
  56. data/app/views/layouts/sufia-two-column.html.erb +45 -0
  57. data/app/views/static/agreement.html.erb +12 -11
  58. data/app/views/static/mendeley.html.erb +2 -2
  59. data/app/views/static/terms.html.erb +11 -11
  60. data/app/views/static/zotero.html.erb +2 -2
  61. data/config/initializers/sufia_events.rb +3 -0
  62. data/config/locales/sufia.en.yml +3 -6
  63. data/features/step_definitions/{scholarsphere.rb → sufia.rb} +0 -0
  64. data/lib/generators/sufia/sufia_generator.rb +1 -1
  65. data/lib/generators/sufia/templates/config/resque_config.rb +1 -1
  66. data/lib/generators/sufia/templates/config/sufia.rb +3 -0
  67. data/lib/sufia.rb +1 -50
  68. data/lib/sufia/batch_edits_controller_behavior.rb +4 -0
  69. data/lib/sufia/controller.rb +13 -0
  70. data/lib/sufia/dashboard_controller_behavior.rb +3 -2
  71. data/lib/sufia/files_controller_behavior.rb +35 -12
  72. data/lib/sufia/version.rb +1 -1
  73. data/spec/controllers/batch_edits_controller_spec.rb +2 -2
  74. data/spec/controllers/generic_files_controller_spec.rb +37 -1
  75. data/spec/models/generic_file_spec.rb +6 -6
  76. data/spec/models/properties_datastream_spec.rb +8 -7
  77. data/spec/models/transcode_audio_job_spec.rb +1 -1
  78. data/spec/models/transcode_video_job_spec.rb +1 -1
  79. data/spec/views/batch_edits/check_all_spec.rb +22 -0
  80. data/sufia-models/.gitignore +17 -0
  81. data/sufia-models/Gemfile +4 -0
  82. data/sufia-models/LICENSE.md +177 -0
  83. data/sufia-models/README.md +39 -0
  84. data/sufia-models/Rakefile +1 -0
  85. data/{app → sufia-models/app}/models/batch.rb +2 -4
  86. data/{app → sufia-models/app}/models/checksum_audit_log.rb +3 -4
  87. data/{app → sufia-models/app}/models/datastreams/batch_rdf_datastream.rb +0 -0
  88. data/{app → sufia-models/app}/models/datastreams/file_content_datastream.rb +0 -0
  89. data/{app → sufia-models/app}/models/datastreams/fits_datastream.rb +0 -0
  90. data/{app → sufia-models/app}/models/datastreams/generic_file_rdf_datastream.rb +12 -12
  91. data/{app → sufia-models/app}/models/datastreams/paranoid_rights_datastream.rb +0 -15
  92. data/{app → sufia-models/app}/models/datastreams/properties_datastream.rb +1 -2
  93. data/{app → sufia-models/app}/models/domain_term.rb +0 -0
  94. data/{app → sufia-models/app}/models/follow.rb +0 -0
  95. data/{app → sufia-models/app}/models/generic_file.rb +0 -0
  96. data/{app → sufia-models/app}/models/geo_names_resource.rb +0 -0
  97. data/{app → sufia-models/app}/models/group.rb +0 -0
  98. data/{app → sufia-models/app}/models/local_authority.rb +0 -0
  99. data/{app → sufia-models/app}/models/local_authority_entry.rb +0 -0
  100. data/{app → sufia-models/app}/models/single_use_link.rb +0 -0
  101. data/{app → sufia-models/app}/models/subject_local_authority_entry.rb +0 -0
  102. data/{app → sufia-models/app}/models/trophy.rb +0 -0
  103. data/{app → sufia-models/app}/models/version_committer.rb +0 -0
  104. data/sufia-models/config/locales/sufia.en.yml +6 -0
  105. data/sufia-models/lib/sufia/models.rb +34 -0
  106. data/{lib/sufia → sufia-models/lib/sufia/models}/active_fedora/redis.rb +0 -0
  107. data/{lib/sufia → sufia-models/lib/sufia/models}/active_record/redis.rb +0 -0
  108. data/{lib → sufia-models/lib/sufia/models}/active_support/core_ext/marshal.rb +0 -0
  109. data/sufia-models/lib/sufia/models/engine.rb +61 -0
  110. data/sufia-models/lib/sufia/models/file_content.rb +9 -0
  111. data/{lib/sufia → sufia-models/lib/sufia/models}/file_content/extract_metadata.rb +2 -2
  112. data/{lib/sufia → sufia-models/lib/sufia/models}/file_content/versions.rb +0 -0
  113. data/{lib/sufia → sufia-models/lib/sufia/models}/generic_file.rb +3 -34
  114. data/{lib/sufia → sufia-models/lib/sufia/models}/generic_file/actions.rb +16 -1
  115. data/{lib/sufia → sufia-models/lib/sufia/models}/generic_file/audit.rb +1 -1
  116. data/{lib/sufia → sufia-models/lib/sufia/models}/generic_file/characterization.rb +1 -2
  117. data/{lib/sufia → sufia-models/lib/sufia/models}/generic_file/export.rb +0 -0
  118. data/{lib/sufia → sufia-models/lib/sufia/models}/generic_file/permissions.rb +0 -1
  119. data/{lib/sufia → sufia-models/lib/sufia/models}/generic_file/thumbnail.rb +3 -3
  120. data/sufia-models/lib/sufia/models/generic_file/web_form.rb +45 -0
  121. data/{lib/sufia → sufia-models/lib/sufia/models}/id_service.rb +11 -7
  122. data/{lib/sufia → sufia-models/lib/sufia/models}/jobs/audit_job.rb +0 -0
  123. data/{lib/sufia → sufia-models/lib/sufia/models}/jobs/batch_update_job.rb +0 -0
  124. data/{lib/sufia → sufia-models/lib/sufia/models}/jobs/characterize_job.rb +0 -0
  125. data/{lib/sufia → sufia-models/lib/sufia/models}/jobs/ffmpeg_transcode_job.rb +3 -3
  126. data/sufia-models/lib/sufia/models/jobs/import_url_job.rb +55 -0
  127. data/{lib/sufia → sufia-models/lib/sufia/models}/jobs/resolrize_job.rb +0 -0
  128. data/{lib/sufia → sufia-models/lib/sufia/models}/jobs/transcode_audio_job.rb +0 -0
  129. data/{lib/sufia → sufia-models/lib/sufia/models}/jobs/transcode_video_job.rb +0 -0
  130. data/{lib/sufia → sufia-models/lib/sufia/models}/jobs/unzip_job.rb +16 -4
  131. data/{lib/sufia → sufia-models/lib/sufia/models}/model_methods.rb +0 -0
  132. data/{lib/sufia → sufia-models/lib/sufia/models}/noid.rb +1 -1
  133. data/{lib/sufia/queue → sufia-models/lib/sufia/models}/resque.rb +0 -2
  134. data/{lib/sufia → sufia-models/lib/sufia/models}/solr_document_behavior.rb +0 -0
  135. data/{lib/sufia → sufia-models/lib/sufia/models}/user.rb +1 -1
  136. data/{lib/sufia → sufia-models/lib/sufia/models}/utils.rb +0 -0
  137. data/sufia-models/lib/sufia/models/version.rb +5 -0
  138. data/sufia-models/lib/tasks/sufia-models_tasks.rake +7 -0
  139. data/sufia-models/sufia-models.gemspec +44 -0
  140. data/sufia.gemspec +2 -12
  141. data/tasks/release.rake +90 -0
  142. data/tasks/sufia-dev.rake +1 -1
  143. data/tasks/sufia.rake +1 -3
  144. metadata +118 -238
  145. data/app/views/generic_files/show_fields/_based_near.html.erb +0 -12
  146. data/app/views/generic_files/show_fields/_contributor.html.erb +0 -12
  147. data/app/views/generic_files/show_fields/_creator.html.erb +0 -12
  148. data/app/views/generic_files/show_fields/_date_created.html.erb +0 -12
  149. data/app/views/generic_files/show_fields/_description.html.erb +0 -12
  150. data/app/views/generic_files/show_fields/_identifier.html.erb +0 -9
  151. data/app/views/generic_files/show_fields/_language.html.erb +0 -9
  152. data/app/views/generic_files/show_fields/_publisher.html.erb +0 -12
  153. data/app/views/generic_files/show_fields/_related_url.html.erb +0 -11
  154. data/app/views/generic_files/show_fields/_resource_type.html.erb +0 -9
  155. data/app/views/generic_files/show_fields/_rights.html.erb +0 -9
  156. data/app/views/generic_files/show_fields/_subject.html.erb +0 -12
  157. data/app/views/generic_files/show_fields/_tag.html.erb +0 -9
  158. data/app/views/generic_files/show_fields/_title.html.erb +0 -12
  159. data/lib/sufia/file_content.rb +0 -8
  160. data/lib/sufia/generic_file/web_form.rb +0 -15
  161. data/vendor/assets/javascripts/fileupload.js +0 -6
  162. data/vendor/assets/javascripts/fileupload/application.js +0 -185
  163. data/vendor/assets/javascripts/fileupload/jquery-ui-1.8.14.custom.min.js +0 -76
@@ -1,21 +1,22 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe PropertiesDatastream do
4
- it "should have proxy_depositor" do
5
- subject.proxy_depositor = 'kim@example.com'
6
- subject.proxy_depositor.should == ['kim@example.com']
7
- subject.ng_xml.to_xml.should be_equivalent_to "<?xml version=\"1.0\"?><fields><proxyDepositor>kim@example.com</proxyDepositor></fields>"
4
+
5
+ it "should have import_url" do
6
+ subject.import_url = 'http://example.com/somefile.txt'
7
+ subject.import_url.should == ['http://example.com/somefile.txt']
8
+ subject.ng_xml.to_xml.should be_equivalent_to "<?xml version=\"1.0\"?><fields><importUrl>http://example.com/somefile.txt</importUrl></fields>"
8
9
  end
9
10
 
10
11
  describe "to_solr" do
11
12
  before do
12
13
  @doc = PropertiesDatastream.new.tap do |ds|
13
- ds.proxy_depositor = 'kim@example.com'
14
+ ds.import_url = 'http://example.com/somefile.txt'
14
15
  end
15
16
  end
16
17
  subject { @doc.to_solr}
17
- it "should have proxy_depositor" do
18
- subject['proxy_depositor_ssim'].should == ['kim@example.com']
18
+ it "should have import_url" do
19
+ subject['import_url_ssim'].should == ['http://example.com/somefile.txt']
19
20
  end
20
21
  end
21
22
  end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe TranscodeAudioJob, :if => Sufia::Engine.config.enable_ffmpeg do
3
+ describe TranscodeAudioJob, :if => Sufia.config.enable_ffmpeg do
4
4
  before do
5
5
  @generic_file = GenericFile.new
6
6
  @generic_file.apply_depositor_metadata('jcoyne@example.com')
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe TranscodeVideoJob, :if => Sufia::Engine.config.enable_ffmpeg do
3
+ describe TranscodeVideoJob, :if => Sufia.config.enable_ffmpeg do
4
4
  before do
5
5
  @generic_file = GenericFile.new
6
6
  @generic_file.apply_depositor_metadata('jcoyne@example.com')
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Check All' do
4
+ before (:all) do
5
+ @document_list = ['a','b','c']
6
+ @batch_size_on_other_page = 0
7
+ @max_batch_size = 100
8
+ end
9
+
10
+ it 'should render batch edits actions' do
11
+ controller.prepend_view_path "app/views/batch_edits"
12
+ html = render :partial=>'/batch_edits/check_all'
13
+ html.should have_selector("li[data-behavior='batch-edit-select-abc']")
14
+ end
15
+
16
+ it 'should render dashboard actions' do
17
+ controller.prepend_view_path "app/views/dashboard"
18
+ html = render :partial=>'/batch_edits/check_all'
19
+ html.should have_selector("li[data-behavior='batch-edit-select-none']")
20
+ html.should have_selector("li[data-behavior='batch-edit-select-page']")
21
+ end
22
+ end
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in sufia-models.gemspec
4
+ gemspec
@@ -0,0 +1,177 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,39 @@
1
+ # Sufia::Models
2
+
3
+ An ongoing project to extract Sufia models.
4
+
5
+ ## Why
6
+
7
+ Sufia is a Rails engine that is an opinionated -- in a good way -- self-deposit application built from [Project Hydra components](https://github.com/projecthydra) that is mostly "turn-key ready".
8
+ And while the turn-key solution is greatly appreciated, there are use cases, namely ours, where its opinions don't quite work;
9
+ Namely the views and controllers. We want a different work flow through our application and a notably different UI.
10
+
11
+ Enter the **sufia-models** gem.
12
+ The goal of **sufia-models** is to provide a common foundation for the Sufia engine as well as a common foundation for other engines -- [Curate](https://github.com/ndlib/curate).
13
+
14
+ ## Installation
15
+
16
+ Add this line to your application's Gemfile:
17
+
18
+ gem 'sufia-models'
19
+
20
+ And then execute:
21
+
22
+ $ bundle
23
+
24
+ Or install it yourself as:
25
+
26
+ $ gem install sufia-models
27
+
28
+ ## Usage
29
+
30
+ This project is closely tied to [Sufia](https://github.com/projecthydra/sufia).
31
+ Presently this gems tests are found in the sufia gem (I'm working on it).
32
+
33
+ ## Contributing
34
+
35
+ 1. Fork it
36
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
37
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
38
+ 4. Push to the branch (`git push origin my-new-feature`)
39
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -12,8 +12,6 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- require 'datastreams/batch_rdf_datastream'
16
-
17
15
  class Batch < ActiveFedora::Base
18
16
  include Hydra::ModelMixins::CommonMetadata
19
17
  include Hydra::ModelMixins::RightsMetadata
@@ -32,9 +30,9 @@ class Batch < ActiveFedora::Base
32
30
 
33
31
  def self.find_or_create(pid)
34
32
  begin
35
- @batch = Batch.find(pid)
33
+ Batch.find(pid)
36
34
  rescue ActiveFedora::ObjectNotFoundError
37
- @batch = Batch.create({pid: pid})
35
+ Batch.create({pid: pid})
38
36
  end
39
37
  end
40
38
 
@@ -16,10 +16,9 @@ class ChecksumAuditLog < ActiveRecord::Base
16
16
  attr_accessible :pass, :pid, :dsid, :version, :created_at
17
17
 
18
18
  def ChecksumAuditLog.get_audit_log(version)
19
- log = ChecksumAuditLog.find_or_create_by_pid_and_dsid_and_version(:pid => version.pid,
20
- :dsid => version.dsid,
21
- :version => version.versionID)
22
- log
19
+ ChecksumAuditLog.find_or_create_by_pid_and_dsid_and_version(:pid => version.pid,
20
+ :dsid => version.dsid,
21
+ :version => version.versionID)
23
22
  end
24
23
 
25
24
  def ChecksumAuditLog.prune_history(version)
@@ -15,19 +15,28 @@
15
15
  class GenericFileRdfDatastream < ActiveFedora::NtriplesRDFDatastream
16
16
  map_predicates do |map|
17
17
  map.part_of(:to => "isPartOf", :in => RDF::DC)
18
- map.contributor(:in => RDF::DC) do |index|
18
+ map.resource_type(:to => "type", :in => RDF::DC) do |index|
19
19
  index.as :stored_searchable, :facetable
20
20
  end
21
+ map.title(:in => RDF::DC) do |index|
22
+ index.as :stored_searchable
23
+ end
21
24
  map.creator(:in => RDF::DC) do |index|
22
25
  index.as :stored_searchable, :facetable
23
26
  end
24
- map.title(:in => RDF::DC) do |index|
25
- index.as :stored_searchable
27
+ map.contributor(:in => RDF::DC) do |index|
28
+ index.as :stored_searchable, :facetable
26
29
  end
27
30
  map.description(:in => RDF::DC) do |index|
28
31
  index.type :text
29
32
  index.as :stored_searchable
30
33
  end
34
+ map.tag(:to => "relation", :in => RDF::DC) do |index|
35
+ index.as :stored_searchable, :facetable
36
+ end
37
+ map.rights(:in => RDF::DC) do |index|
38
+ index.as :stored_searchable
39
+ end
31
40
  map.publisher(:in => RDF::DC) do |index|
32
41
  index.as :stored_searchable, :facetable
33
42
  end
@@ -48,21 +57,12 @@ class GenericFileRdfDatastream < ActiveFedora::NtriplesRDFDatastream
48
57
  map.language(:in => RDF::DC) do |index|
49
58
  index.as :stored_searchable, :facetable
50
59
  end
51
- map.rights(:in => RDF::DC) do |index|
52
- index.as :stored_searchable
53
- end
54
- map.resource_type(:to => "type", :in => RDF::DC) do |index|
55
- index.as :stored_searchable, :facetable
56
- end
57
60
  map.identifier(:in => RDF::DC) do |index|
58
61
  index.as :stored_searchable
59
62
  end
60
63
  map.based_near(:in => RDF::FOAF) do |index|
61
64
  index.as :stored_searchable, :facetable
62
65
  end
63
- map.tag(:to => "relation", :in => RDF::DC) do |index|
64
- index.as :stored_searchable, :facetable
65
- end
66
66
  map.related_url(:to => "seeAlso", :in => RDF::RDFS)
67
67
  end
68
68
  begin
@@ -1,18 +1,3 @@
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
- require 'hydra/datastream/rights_metadata'
16
1
  # subclass built-in Hydra RightsDatastream and build in extra model-level validation
17
2
  class ParanoidRightsDatastream < Hydra::Datastream::RightsMetadata
18
3
  use_terminology Hydra::Datastream::RightsMetadata
@@ -20,8 +20,7 @@ class PropertiesDatastream < ActiveFedora::OmDatastream
20
20
  t.depositor :index_as=>[:stored_searchable]
21
21
  # This is where we put the relative path of the file if submitted as a folder
22
22
  t.relative_path
23
-
24
- t.proxy_depositor path: 'proxyDepositor', :index_as=>:symbol
23
+ t.import_url path: 'importUrl', :index_as=>:symbol
25
24
  end
26
25
 
27
26
  def self.xml_template