sufia 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/.travis.yml +6 -0
- data/Gemfile +5 -2
- data/History.md +6 -0
- data/README.md +40 -0
- data/Rakefile +4 -0
- data/app/assets/javascripts/sufia.js +3 -115
- data/app/assets/javascripts/sufia/batch_select_all.js +179 -0
- data/app/assets/javascripts/sufia/edit_metadata.js +86 -0
- data/app/assets/javascripts/sufia/multiForm.js +57 -0
- data/app/assets/javascripts/terms_of_service.js +7 -0
- data/app/assets/stylesheets/audio-js.css +3 -0
- data/app/assets/stylesheets/dashboard.css.scss +51 -0
- data/app/assets/stylesheets/generic_files.css +36 -0
- data/app/assets/stylesheets/sufia.css.scss +2 -0
- data/app/controllers/batch_controller.rb +11 -0
- data/app/controllers/batch_edits_controller.rb +1 -77
- data/app/controllers/generic_files_controller.rb +1 -0
- data/app/controllers/mailbox_controller.rb +1 -1
- data/app/controllers/single_use_link_controller.rb +11 -7
- data/app/helpers/generic_file_helper.rb +11 -3
- data/app/helpers/sufia_helper.rb +13 -10
- data/app/models/batch.rb +1 -1
- data/app/models/datastreams/fits_datastream.rb +2 -2
- data/app/models/datastreams/generic_file_rdf_datastream.rb +22 -18
- data/app/models/datastreams/properties_datastream.rb +2 -2
- data/app/views/_user_util_links.html.erb +2 -2
- data/app/views/batch/_metadata.html.erb +82 -0
- data/app/views/batch/_more_metadata.html.erb +6 -0
- data/app/views/batch/edit.html.erb +1 -8
- data/app/views/batch_edits/_check_all.html.erb +0 -157
- data/app/views/batch_edits/edit.html.erb +0 -29
- data/app/views/catalog/_index_partials/_list_files.html.erb +8 -10
- data/app/views/catalog/_recent_document.html.erb +9 -18
- data/app/views/catalog/_results_pagination.html.erb +1 -1
- data/app/views/contact_form/new.html.erb +1 -1
- data/app/views/dashboard/_index_partials/_default_group.html.erb +1 -1
- data/app/views/dashboard/_index_partials/_list_files.html.erb +12 -14
- data/app/views/dashboard/_index_partials/_thumbnail_display.html.erb +9 -19
- data/app/views/dashboard/_results_pagination.html.erb +1 -1
- data/app/views/dashboard/index.html.erb +6 -82
- data/app/views/error/single_use_error.html.erb +35 -0
- data/app/views/generic_files/_descriptions.html.erb +2 -2
- data/app/views/generic_files/_extra_fields_modal.html.erb +1 -1
- data/app/views/generic_files/_field_form.html.erb +2 -5
- data/app/views/generic_files/_media_display.html.erb +8 -6
- data/app/views/generic_files/_permission.html.erb +2 -2
- data/app/views/generic_files/_rights_modal.html.erb +1 -1
- data/app/views/generic_files/_show_actions.html.erb +1 -1
- data/app/views/generic_files/_show_details.html.erb +11 -6
- data/app/views/generic_files/edit.html.erb +0 -8
- data/app/views/generic_files/edit_fields/_type.html.erb +1 -1
- data/app/views/generic_files/show.html.erb +5 -8
- data/app/views/generic_files/show_fields/_based_near.html.erb +4 -1
- data/app/views/generic_files/show_fields/_contributor.html.erb +4 -1
- data/app/views/generic_files/show_fields/_creator.html.erb +4 -1
- data/app/views/generic_files/show_fields/_date_created.html.erb +4 -1
- data/app/views/generic_files/show_fields/_description.html.erb +4 -1
- data/app/views/generic_files/show_fields/_language.html.erb +1 -1
- data/app/views/generic_files/show_fields/_publisher.html.erb +4 -1
- data/app/views/generic_files/show_fields/_related_url.html.erb +3 -1
- data/app/views/generic_files/show_fields/_resource_type.html.erb +1 -1
- data/app/views/generic_files/show_fields/_subject.html.erb +4 -1
- data/app/views/generic_files/show_fields/_tag.html.erb +1 -1
- data/app/views/generic_files/show_fields/_title.html.erb +4 -1
- data/app/views/layouts/error.html.erb +0 -4
- data/app/views/layouts/hydra-head.html.erb +2 -6
- data/app/views/single_use_link/show.html.erb +1 -1
- data/app/views/users/index.html.erb +1 -1
- data/app/views/users/show.html.erb +1 -1
- data/config/locales/sufia.en.yml +1 -0
- data/config/routes.rb +11 -4
- data/lib/generators/sufia/sufia_generator.rb +2 -1
- data/lib/generators/sufia/templates/catalog_controller.rb +143 -117
- data/lib/generators/sufia/templates/config/resque_admin.rb +10 -0
- data/lib/generators/sufia/templates/config/sufia.rb +8 -0
- data/lib/sufia.rb +4 -14
- data/lib/sufia/batch_edits_controller_behavior.rb +89 -0
- data/lib/sufia/controller.rb +7 -5
- data/lib/sufia/downloads_controller_behavior.rb +14 -19
- data/lib/sufia/file_content/extract_metadata.rb +11 -4
- data/lib/sufia/files_controller_behavior.rb +63 -44
- data/lib/sufia/generic_file.rb +29 -11
- data/lib/sufia/generic_file/audit.rb +1 -1
- data/lib/sufia/generic_file/thumbnail.rb +51 -26
- data/lib/sufia/id_service.rb +28 -11
- data/lib/sufia/jobs/batch_update_job.rb +2 -2
- data/lib/sufia/jobs/characterize_job.rb +11 -3
- data/lib/sufia/jobs/ffmpeg_transcode_job.rb +61 -0
- data/lib/sufia/jobs/resolrize_job.rb +1 -1
- data/lib/sufia/jobs/transcode_audio_job.rb +40 -0
- data/lib/sufia/jobs/transcode_video_job.rb +9 -49
- data/lib/sufia/queue/resque.rb +2 -2
- data/lib/sufia/single_use_error.rb +4 -0
- data/lib/sufia/solr_document_behavior.rb +108 -1
- data/lib/sufia/version.rb +1 -1
- data/solr_conf/conf/schema.xml +332 -652
- data/solr_conf/conf/solrconfig.xml +60 -196
- data/spec/controllers/batch_controller_spec.rb +4 -5
- data/spec/controllers/catalog_controller_spec.rb +13 -13
- data/spec/controllers/dashboard_controller_spec.rb +2 -2
- data/spec/controllers/downloads_controller_spec.rb +74 -62
- data/spec/controllers/generic_files_controller_spec.rb +10 -8
- data/spec/controllers/single_use_link_controller_spec.rb +12 -4
- data/spec/fixtures/Example.ogg +0 -0
- data/spec/fixtures/piano_note.wav +0 -0
- data/spec/fixtures/sufia_generic_stub.descMeta.txt +1 -1
- data/spec/helpers/sufia_helper_spec.rb +12 -0
- data/spec/models/characterize_job_spec.rb +89 -0
- data/spec/models/checksum_audit_log_spec.rb +1 -0
- data/spec/models/event_jobs_spec.rb +9 -9
- data/spec/models/file_content_datastream_spec.rb +16 -10
- data/spec/models/fits_datastream_spec.rb +2 -8
- data/spec/models/generic_file_spec.rb +131 -60
- data/spec/models/solr_document_spec.rb +21 -0
- data/spec/models/transcode_audio_job_spec.rb +81 -0
- data/spec/models/transcode_video_job_spec.rb +2 -2
- data/spec/models/unzip_job_spec.rb +3 -3
- data/spec/spec_helper.rb +21 -0
- data/spec/support/Gemfile +7 -3
- data/sufia.gemspec +8 -11
- data/tasks/cucumber.rake +1 -2
- data/tasks/sufia-dev.rake +13 -2
- data/tasks/sufia.rake +1 -1
- metadata +77 -118
- data/app/views/batch_edits/_metadata.html.erb +0 -180
- data/lib/generators/sufia/templates/config/hydra_config.rb +0 -32
- data/lib/kaminari/helpers/tag.rb +0 -11
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
<h2>Individual Titles <small>(applied to individual files uploaded)</small><small class="pull-right"><span class="error">*</span> indicates required fields</small> </h2>
|
|
2
|
-
<div id="" class="well">
|
|
3
|
-
<p>
|
|
4
|
-
<i class="icon-info-sign"></i> Filename will be the default title. Please provide a more meaningful title, and filenames will still be preserved by the system.
|
|
5
|
-
</p>
|
|
6
|
-
<div class="row">
|
|
7
|
-
<div class="span60">
|
|
8
|
-
<% @batch.generic_files.sort! { |a,b| a.label.downcase <=> b.label.downcase }.each_with_index do |gen_f, index| %>
|
|
9
|
-
<div class="control-group">
|
|
10
|
-
<%= f.label :title, "<span class='error'>*</span> Title #{index+1}".html_safe, :class=>"control-label" %>
|
|
11
|
-
<div class="controls" id="additional_title_clone">
|
|
12
|
-
<%= f.text_field :title, :name=>"title[#{gen_f.id}][]", :value=>gen_f.label, :required=> true %>
|
|
13
|
-
<%= help_icon(:title) %>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
<% end %>
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<div class="span40">
|
|
20
|
-
<!-- put metadata about file being edited here -->
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
<%= hidden_field_tag(:extra_description_count, "1") %>
|
|
26
|
-
<div id="descriptions_display">
|
|
27
|
-
<h2 class="non lower">Bulk Descriptions <small>(applied to all files just uploaded)</small> <small class="pull-right"><span class="error">*</span> indicates required fields</small></h2>
|
|
28
|
-
<div class="well">
|
|
29
|
-
<div class="control-group" id="resources">
|
|
30
|
-
<%# See if this works: render_edit_field_partial(:type, f:f) %>
|
|
31
|
-
<%= f.label :resource_type, "Resource Types", :class=>"control-label", :for=>"resource_type" %>
|
|
32
|
-
<div class="controls">
|
|
33
|
-
<p class="help-block">You may select multiple types to apply to all files<p>
|
|
34
|
-
<%= f.select "resource_type", Sufia::Engine::config.resource_types, {}, {:multiple=>true, :size=>7} %>
|
|
35
|
-
<%= help_icon(:resource_type) %>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
<div class="control-group">
|
|
40
|
-
<%= f.label :tag, "<span class='error'>*</span> Keyword".html_safe, :class=>"control-label" %>
|
|
41
|
-
<div class="controls" id="additional_tag_clone">
|
|
42
|
-
<%= f.text_field :tag, :name=>"generic_file[tag][]", :value=>"", :required=> true %>
|
|
43
|
-
<button class="adder btn" name="additional_tag" id="additional_tag_submit">+<span class="accessible-hidden">add another Tag</span></button>
|
|
44
|
-
|
|
45
|
-
<%= help_icon(:tag) %>
|
|
46
|
-
</div>
|
|
47
|
-
<div id="additional_tag_elements"></div>
|
|
48
|
-
</div>
|
|
49
|
-
|
|
50
|
-
<div class="control-group">
|
|
51
|
-
<%= f.label :creator, "<span class='error'>*</span> Creator".html_safe, :class=>"control-label" %>
|
|
52
|
-
<div class="controls" id="additional_creator_clone">
|
|
53
|
-
<%= f.text_field :creator, :name=>"generic_file[creator][]", :value=>"", :required=> true %>
|
|
54
|
-
<button class="adder btn" name="additional_creator" id="additional_creator_submit">+<span class="accessible-hidden">add another Creator</span></button>
|
|
55
|
-
|
|
56
|
-
<%= help_icon(:creator) %>
|
|
57
|
-
</div>
|
|
58
|
-
<div id="additional_creator_elements"></div>
|
|
59
|
-
</div>
|
|
60
|
-
|
|
61
|
-
<div class="control-group">
|
|
62
|
-
<%= f.label :rights, '<span class="error">*</span> Rights'.html_safe, :class=>"control-label" %>
|
|
63
|
-
<div class="controls" id="additional_rights_clone">
|
|
64
|
-
<%= f.select "rights", options_for_select(Sufia::Engine::config.cc_licenses, 'http://creativecommons.org/licenses/by-nc-nd/3.0/us/'), :required => true %>
|
|
65
|
-
<button class="adder btn" name="additional_rights" id="additional_rights_submit">+<span class="accessible-hidden">add another Rights</span></button>
|
|
66
|
-
|
|
67
|
-
<%= help_icon(:rights) %>
|
|
68
|
-
<%= render :partial => "generic_files/rights_modal" %>
|
|
69
|
-
|
|
70
|
-
</div>
|
|
71
|
-
<div id="additional_rights_elements"></div>
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
<div class="row" id="add_descriptions">
|
|
75
|
-
<a href="#" id="add_descriptions" >Add More Description Types</a>
|
|
76
|
-
</div>
|
|
77
|
-
<!-- hidden on initial load -->
|
|
78
|
-
|
|
79
|
-
<div class="hide" id="more_descriptions">
|
|
80
|
-
<div class="control-group">
|
|
81
|
-
<%= f.label :related_url, "Related URL", :class=>"control-label" %>
|
|
82
|
-
<div class="controls" id="additional_related_url_clone">
|
|
83
|
-
<%= f.text_field :related_url, :name=>"generic_file[related_url][]", :value=>"" %>
|
|
84
|
-
<button class="adder btn" name="additional_related_url" id="additional_related_url_submit">+<span class="accessible-hidden">add another Related URL</span></button>
|
|
85
|
-
|
|
86
|
-
<%= help_icon(:related_url) %>
|
|
87
|
-
</div>
|
|
88
|
-
<div id="additional_related_url_elements"></div>
|
|
89
|
-
</div>
|
|
90
|
-
|
|
91
|
-
<div class="control-group">
|
|
92
|
-
<%= f.label :based_near, 'Location', :class=>"control-label" %>
|
|
93
|
-
<div class="controls" id="additional_based_near_clone">
|
|
94
|
-
<%= f.text_field :based_near, :name=>"generic_file[based_near][]", :value=>"" %>
|
|
95
|
-
<button class="adder btn" name="additional_based_near" id="additional_based_near_submit">+<span class="accessible-hidden">add another Location</span></button>
|
|
96
|
-
|
|
97
|
-
<%= help_icon(:based_near) %>
|
|
98
|
-
</div>
|
|
99
|
-
<div id="additional_based_near_elements"></div>
|
|
100
|
-
</div>
|
|
101
|
-
|
|
102
|
-
<div class="control-group">
|
|
103
|
-
<%= f.label :contributor, :class=>"control-label" %>
|
|
104
|
-
<div class="controls" id="additional_contributor_clone">
|
|
105
|
-
<%= f.text_field :contributor, :name=>"generic_file[contributor][]", :value=>gf.contributor[0] %>
|
|
106
|
-
<button class="adder btn" name="additional_contributor" id="additional_contributor_submit">+<span class="accessible-hidden">add another Contributor</span></button>
|
|
107
|
-
|
|
108
|
-
<%= help_icon(:contributor) %>
|
|
109
|
-
</div>
|
|
110
|
-
<div id="additional_contributor_elements"></div>
|
|
111
|
-
</div>
|
|
112
|
-
|
|
113
|
-
<div class="control-group">
|
|
114
|
-
<%= f.label :date_created, "Date Created", :class=>"control-label" %>
|
|
115
|
-
<div class="controls" id="additional_date_created_clone">
|
|
116
|
-
<%= f.text_field :date_created, :name=>"generic_file[date_created][]", :value=>"" %>
|
|
117
|
-
<button class="adder btn" name="additional_date_created" id="additional_date_created_submit">+<span class="accessible-hidden">add another Date Created</span></button>
|
|
118
|
-
|
|
119
|
-
<%= help_icon(:date_created) %>
|
|
120
|
-
</div>
|
|
121
|
-
<div id="additional_date_created_elements"></div>
|
|
122
|
-
</div>
|
|
123
|
-
|
|
124
|
-
<div class="control-group">
|
|
125
|
-
<%= f.label :description, "Abstract or Summary", :class=>"control-label" %>
|
|
126
|
-
<div class="controls" id="additional_description_clone">
|
|
127
|
-
<%= f.text_area :description, :name=>"generic_file[description][]", :value=>"" %>
|
|
128
|
-
<button class="adder btn" name="additional_description" id="additional_description_submit">+<span class="accessible-hidden">add another Abstract or Summary</span></button>
|
|
129
|
-
|
|
130
|
-
<%= help_icon(:description) %>
|
|
131
|
-
</div>
|
|
132
|
-
<div id="additional_description_elements"></div>
|
|
133
|
-
</div>
|
|
134
|
-
|
|
135
|
-
<div class="control-group">
|
|
136
|
-
<%= f.label :identifier, :class=>"control-label" %>
|
|
137
|
-
<div class="controls" id="additional_identifier_clone">
|
|
138
|
-
<%= f.text_field :identifier, :name=>"generic_file[identifier][]", :value=>"" %>
|
|
139
|
-
<button class="adder btn" name="additional_identifier" id="additional_identifier_submit">+<span class="accessible-hidden">add another Identifier</span></button>
|
|
140
|
-
|
|
141
|
-
<%= help_icon(:identifier) %>
|
|
142
|
-
</div>
|
|
143
|
-
<div id="additional_identifier_elements"></div>
|
|
144
|
-
</div>
|
|
145
|
-
|
|
146
|
-
<div class="control-group">
|
|
147
|
-
<%= f.label :language, :class=>"control-label" %>
|
|
148
|
-
<div class="controls" id="additional_language_clone">
|
|
149
|
-
<%= f.text_field :language, :name=>"generic_file[language][]", :value=>"" %>
|
|
150
|
-
<button class="adder btn" name="additional_language" id="additional_language_submit">+<span class="accessible-hidden">add another Language</span></button>
|
|
151
|
-
|
|
152
|
-
<%= help_icon(:language) %>
|
|
153
|
-
</div>
|
|
154
|
-
<div id="additional_language_elements"></div>
|
|
155
|
-
</div>
|
|
156
|
-
|
|
157
|
-
<div class="control-group">
|
|
158
|
-
<%= f.label :publisher, :class=>"control-label" %>
|
|
159
|
-
<div class="controls" id="additional_publisher_clone">
|
|
160
|
-
<%= f.text_field :publisher, :name=>"generic_file[publisher][]", :value=>"" %>
|
|
161
|
-
<button class="adder btn" name="additional_publisher" id="additional_publisher_submit">+<span class="accessible-hidden">add another Publisher</span></button>
|
|
162
|
-
|
|
163
|
-
<%= help_icon(:publisher) %>
|
|
164
|
-
</div>
|
|
165
|
-
<div id="additional_publisher_elements"></div>
|
|
166
|
-
</div>
|
|
167
|
-
|
|
168
|
-
<div class="control-group">
|
|
169
|
-
<%= f.label :subject, :class=>"control-label" %>
|
|
170
|
-
<div class="controls" id="additional_subject_clone">
|
|
171
|
-
<%= f.text_field :subject, :name=>"generic_file[subject][]", :value=>"" %>
|
|
172
|
-
<button class="adder btn" name="additional_subject" id="additional_subject_submit">+<span class="accessible-hidden">add another Subject</span></button>
|
|
173
|
-
|
|
174
|
-
<%= help_icon(:subject) %>
|
|
175
|
-
</div>
|
|
176
|
-
<div id="additional_subject_elements"></div>
|
|
177
|
-
</div>
|
|
178
|
-
</div> <!-- /more_descriptions -->
|
|
179
|
-
</div><!-- /well -->
|
|
180
|
-
</div> <!-- /row /span6 -->
|
|
@@ -1,32 +0,0 @@
|
|
|
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"
|
|
16
|
-
|
|
17
|
-
if Hydra.respond_to?(:configure)
|
|
18
|
-
Hydra.configure(:shared) do |config|
|
|
19
|
-
|
|
20
|
-
# This specifies the solr field names of permissions-related fields.
|
|
21
|
-
# You only need to change these values if you've indexed permissions by some means other than the Hydra's built-in tooling.
|
|
22
|
-
# If you change these, you must also update the permissions request handler in your solrconfig.xml to return those values
|
|
23
|
-
config[:permissions] = {
|
|
24
|
-
:catchall => "access_t",
|
|
25
|
-
:discover => {:group =>"discover_access_group_t", :individual=>"discover_access_person_t"},
|
|
26
|
-
:read => {:group =>"read_access_group_t", :individual=>"read_access_person_t"},
|
|
27
|
-
:edit => {:group =>"edit_access_group_t", :individual=>"edit_access_person_t"},
|
|
28
|
-
:owner => "depositor_t",
|
|
29
|
-
:embargo_release_date => "embargo_release_date_dt"
|
|
30
|
-
}
|
|
31
|
-
end
|
|
32
|
-
end
|
data/lib/kaminari/helpers/tag.rb
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Monkey patch so that it uses the engine routes. See https://github.com/amatsuda/kaminari/issues/323
|
|
2
|
-
module Kaminari
|
|
3
|
-
module Helpers
|
|
4
|
-
class Tag
|
|
5
|
-
def page_url_for(page)
|
|
6
|
-
#@template.url_for @params.merge(@param_name => (page <= 1 ? nil : page)).symbolize_keys
|
|
7
|
-
Sufia::Engine.routes.url_helpers.url_for @params.merge(@param_name => (page <= 1 ? nil : page), :only_path=>true).symbolize_keys
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
end
|