hydra-head 3.1.4 → 3.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +58 -55
- data/HISTORY.textile +4 -0
- data/README.textile +3 -3
- data/app/controllers/downloads_controller.rb +2 -1
- data/app/controllers/get_controller.rb +1 -5
- data/app/helpers/hydra/downloads_helper_behavior.rb +0 -3
- data/app/helpers/hydra/hydra_fedora_metadata_helper_behavior.rb +11 -13
- data/app/models/common_metadata_asset.rb +13 -0
- data/app/views/catalog/_edit_partials/_default.html.erb +0 -6
- data/app/views/file_assets/_asset_saved_flash.html.erb +2 -0
- data/app/views/file_assets/_index.html.erb +0 -1
- data/app/views/file_assets/_result.html.erb +1 -5
- data/assets/stylesheets/hydra/ie-styles.css +0 -91
- data/assets/stylesheets/hydra/styles.css +1 -523
- data/hydra-head.gemspec +4 -3
- data/lib/generators/hydra/assets_generator.rb +1 -1
- data/lib/hydra-head/version.rb +1 -1
- data/lib/hydra.rb +2 -1
- data/lib/hydra/assets_controller_helper.rb +3 -2
- data/lib/hydra/catalog.rb +1 -1
- data/lib/hydra/file_assets.rb +36 -28
- data/lib/hydra/file_assets_helper.rb +9 -2
- data/lib/hydra/generic_image.rb +1 -1
- data/lib/hydra/image.rb +1 -1
- data/lib/hydra/repository_controller.rb +4 -4
- data/test_support/etc/Gemfile +1 -1
- data/test_support/fixtures/hydra_test_default_partials.foxml.xml +2 -2
- data/test_support/spec/controllers/file_assets_controller_spec.rb +0 -1
- data/test_support/spec/helpers/assets_controller_helper_spec.rb +8 -0
- data/test_support/spec/helpers/file_assets_helper_spec.rb +12 -6
- data/test_support/spec/helpers/hydra_fedora_metadata_helper_spec.rb +1 -8
- data/vendor/cache/actionmailer-3.0.11.gem +0 -0
- data/vendor/cache/actionpack-3.0.11.gem +0 -0
- data/vendor/cache/{active-fedora-3.1.1.gem → active-fedora-3.1.4.gem} +0 -0
- data/vendor/cache/activemodel-3.0.11.gem +0 -0
- data/vendor/cache/activerecord-3.0.11.gem +0 -0
- data/vendor/cache/activeresource-3.0.11.gem +0 -0
- data/vendor/cache/activesupport-3.0.11.gem +0 -0
- data/vendor/cache/capybara-1.1.2.gem +0 -0
- data/vendor/cache/childprocess-0.2.3.gem +0 -0
- data/vendor/cache/columnize-0.3.5.gem +0 -0
- data/vendor/cache/cucumber-1.1.3.gem +0 -0
- data/vendor/cache/cucumber-rails-1.2.0.gem +0 -0
- data/vendor/cache/database_cleaner-0.7.0.gem +0 -0
- data/vendor/cache/factory_girl-2.3.2.gem +0 -0
- data/vendor/cache/ffi-1.0.11.gem +0 -0
- data/vendor/cache/gherkin-2.6.8.gem +0 -0
- data/vendor/cache/jettywrapper-1.1.0.gem +0 -0
- data/vendor/cache/json-1.6.2.gem +0 -0
- data/vendor/cache/json_pure-1.6.2.gem +0 -0
- data/vendor/cache/mime-types-1.17.2.gem +0 -0
- data/vendor/cache/multi_json-1.0.4.gem +0 -0
- data/vendor/cache/{rails-3.0.10.gem → rails-3.0.11.gem} +0 -0
- data/vendor/cache/railties-3.0.11.gem +0 -0
- data/vendor/cache/rake-0.9.2.2.gem +0 -0
- data/vendor/cache/rdoc-3.11.gem +0 -0
- data/vendor/cache/rubydora-0.2.6.gem +0 -0
- data/vendor/cache/rubyzip-0.9.5.gem +0 -0
- data/vendor/cache/selenium-webdriver-2.13.0.gem +0 -0
- data/vendor/cache/solrizer-fedora-1.2.0.gem +0 -0
- data/vendor/cache/tzinfo-0.3.31.gem +0 -0
- metadata +153 -138
- data/app/controllers/generic_content_objects_controller.rb +0 -37
- data/app/views/fluid_infusion/_uploader.html.erb +0 -79
- data/app/views/fluid_infusion/_uploader_generic_content_objects.js.erb +0 -38
- data/app/views/fluid_infusion/_uploader_js.erb +0 -45
- data/test_support/spec/views/uploader.html.erb_spec.rb +0 -30
- data/vendor/cache/actionmailer-3.0.10.gem +0 -0
- data/vendor/cache/actionpack-3.0.10.gem +0 -0
- data/vendor/cache/activemodel-3.0.10.gem +0 -0
- data/vendor/cache/activerecord-3.0.10.gem +0 -0
- data/vendor/cache/activeresource-3.0.10.gem +0 -0
- data/vendor/cache/activesupport-3.0.10.gem +0 -0
- data/vendor/cache/capybara-1.1.1.gem +0 -0
- data/vendor/cache/childprocess-0.2.2.gem +0 -0
- data/vendor/cache/columnize-0.3.4.gem +0 -0
- data/vendor/cache/cucumber-1.1.0.gem +0 -0
- data/vendor/cache/cucumber-rails-1.1.1.gem +0 -0
- data/vendor/cache/database_cleaner-0.6.7.gem +0 -0
- data/vendor/cache/factory_girl-2.1.2.gem +0 -0
- data/vendor/cache/ffi-1.0.9.gem +0 -0
- data/vendor/cache/gherkin-2.5.2.gem +0 -0
- data/vendor/cache/jettywrapper-1.0.4.gem +0 -0
- data/vendor/cache/json-1.6.1.gem +0 -0
- data/vendor/cache/json_pure-1.6.1.gem +0 -0
- data/vendor/cache/mime-types-1.16.gem +0 -0
- data/vendor/cache/multi_json-1.0.3.gem +0 -0
- data/vendor/cache/railties-3.0.10.gem +0 -0
- data/vendor/cache/rake-0.9.2.gem +0 -0
- data/vendor/cache/rdoc-3.10.gem +0 -0
- data/vendor/cache/rubydora-0.2.3.gem +0 -0
- data/vendor/cache/rubyzip-0.9.4.gem +0 -0
- data/vendor/cache/selenium-webdriver-2.8.0.gem +0 -0
- data/vendor/cache/solrizer-fedora-1.1.3.gem +0 -0
- data/vendor/cache/tzinfo-0.3.30.gem +0 -0
@@ -1,37 +0,0 @@
|
|
1
|
-
class GenericContentObjectsController < ApplicationController
|
2
|
-
|
3
|
-
include Hydra::AssetsControllerHelper
|
4
|
-
include Hydra::FileAssetsHelper
|
5
|
-
include Hydra::RepositoryController
|
6
|
-
include MediaShelf::ActiveFedoraHelper
|
7
|
-
include Blacklight::SolrHelper
|
8
|
-
|
9
|
-
before_filter :require_solr
|
10
|
-
|
11
|
-
|
12
|
-
def create
|
13
|
-
unless params.has_key?(:Filedata)
|
14
|
-
raise "No file to process"
|
15
|
-
end
|
16
|
-
if !params[:container_id].nil? && params[:Filedata]
|
17
|
-
af_base = ActiveFedora::Base.find(params[:container_id])
|
18
|
-
af_model = retrieve_af_model( af_base.relationships[:self][:has_model].first.split(":")[-1] )
|
19
|
-
logger.debug "#########: af_model = #{af_model.to_s}"
|
20
|
-
generic_content_object = af_model.load_instance(params[:container_id])
|
21
|
-
generic_content_object.content={:file => params[:Filedata], :file_name => params[:Filename]}
|
22
|
-
logger.debug "#########: set the content"
|
23
|
-
generic_content_object.save
|
24
|
-
logger.debug "#########: saved #{generic_content_object.pid} with new content #{params[:Filename]}"
|
25
|
-
if af_model == GenericImage
|
26
|
-
logger.debug "#########: deriving images"
|
27
|
-
generic_content_object.derive_all
|
28
|
-
logger.debug "#########: finished deriving images"
|
29
|
-
end
|
30
|
-
end
|
31
|
-
render :nothing => true
|
32
|
-
end
|
33
|
-
|
34
|
-
private
|
35
|
-
|
36
|
-
|
37
|
-
end
|
@@ -1,79 +0,0 @@
|
|
1
|
-
<%- stylesheet_links << ['../infusion/framework/fss/css/fss-layout.css'] %>
|
2
|
-
<%- field_tag_options = defined?(uploader_options) ? uploader_options : {} %>
|
3
|
-
<%- container_content_type_param = defined?(container_content_type) ? "?container_content_type=#{container_content_type}" : "" %>
|
4
|
-
<div id="uploader-contents">
|
5
|
-
|
6
|
-
<!-- This form will be progressively enhanced by the Fluid Uploader component. -->
|
7
|
-
<%= form_tag upload_url, :enctype=>"multipart/form-data", :class=>"fl-uploader fl-progEnhance-basic" do %>
|
8
|
-
<input type="hidden" name="container_id" value="<%=h container_id %>"/>
|
9
|
-
<%= hidden_field_tag("container_content_type", container_content_type) if defined?(container_content_type) %>
|
10
|
-
<p>Browse to upload a file.</p>
|
11
|
-
<!-- <input name="Filedata-orig" type="file" /> -->
|
12
|
-
<%= file_field_tag "Filedata", field_tag_options %>
|
13
|
-
<div><input type="submit" value="Upload File"/></div>
|
14
|
-
<% end %>
|
15
|
-
|
16
|
-
<!-- This is the markup for the Fluid Uploader component itself. -->
|
17
|
-
<%= form_tag upload_url, :enctype=>"multipart/form-data", :class=>"flc-uploader fl-uploader fl-progEnhance-enhanced", :method=>:get do %>
|
18
|
-
<!-- The file queue -->
|
19
|
-
<div class="fl-uploader-queue-wrapper">
|
20
|
-
|
21
|
-
<!-- Scrollable view -->
|
22
|
-
<div class="flc-scroller fl-scroller">
|
23
|
-
<div class="fl-scroller-inner">
|
24
|
-
<table class="flc-uploader-queue fl-uploader-queue" >
|
25
|
-
<tbody>
|
26
|
-
<!-- Rows will be rendered in here. -->
|
27
|
-
|
28
|
-
<!-- Template markup for the file queue rows -->
|
29
|
-
<tr class="flc-uploader-file-tmplt flc-uploader-file fl-uploader-hidden-templates">
|
30
|
-
<th class="flc-uploader-file-name fl-uploader-file-name" scope="row">File Name Placeholder</th>
|
31
|
-
|
32
|
-
|
33
|
-
<td class="flc-uploader-file-size fl-uploader-file-size">0 KB</td>
|
34
|
-
<td class="fl-uploader-file-actions">
|
35
|
-
<button type="button" class="flc-uploader-file-action fl-uploader-file-action" title="Remove File" tabindex="-1">
|
36
|
-
<span class="fl-uploader-button-text fl-uploader-hidden">Remove file from queue</span>
|
37
|
-
</button>
|
38
|
-
</td>
|
39
|
-
</tr>
|
40
|
-
|
41
|
-
<!-- Template for the file error info rows -->
|
42
|
-
<tr class="flc-uploader-file-error-tmplt fl-uploader-file-error fl-uploader-hidden-templates">
|
43
|
-
<td colspan="3" class="flc-uploader-file-error"></td>
|
44
|
-
</tr>
|
45
|
-
</tbody>
|
46
|
-
</table>
|
47
|
-
<div class="flc-uploader-file-progressor-tmplt fl-uploader-file-progress"><span class="fl-uploader-file-progress-text fl-uploader-hidden">76%</span></div>
|
48
|
-
</div>
|
49
|
-
</div>
|
50
|
-
|
51
|
-
<div class="flc-uploader-browse-instructions fl-uploader-browse-instructions"></div>
|
52
|
-
|
53
|
-
<!-- Foot of the queue -->
|
54
|
-
<div class="flc-uploader-queue-footer fl-uploader-queue-footer">
|
55
|
-
<table>
|
56
|
-
<tr>
|
57
|
-
<td class="flc-uploader-total-progress-text">
|
58
|
-
<!-- Total: <span class="fl-uploader-totalFiles">0</span> files
|
59
|
-
(<span class="fl-uploader-totalBytes">0 KB</span>) -->
|
60
|
-
</td>
|
61
|
-
<td class=".fl-uploader-footer-buttons" >
|
62
|
-
<a href="#" class="flc-uploader-button-browse fl-uploader-browse">Add Files</a>
|
63
|
-
</td>
|
64
|
-
</tr>
|
65
|
-
|
66
|
-
</table>
|
67
|
-
<div class="flc-uploader-total-progress fl-uploader-total-progress-okay"> </div>
|
68
|
-
</div>
|
69
|
-
|
70
|
-
</div>
|
71
|
-
|
72
|
-
<!-- Action buttons -->
|
73
|
-
<div class="fl-uploader-btns">
|
74
|
-
<button type="button" class="flc-uploader-button-pause fl-uploader-pause fl-uploader-hidden">Stop Upload</button><button type="button" class="flc-uploader-button-upload fl-uploader-upload fl-uploader-button-default fl-uploader-dim ui-button ui-widget ui-state-default" disabled="disabled">Upload</button>
|
75
|
-
</div>
|
76
|
-
<% end %>
|
77
|
-
|
78
|
-
</div>
|
79
|
-
<div style="clear:both;"></div>
|
@@ -1,38 +0,0 @@
|
|
1
|
-
<script type="text/javascript">
|
2
|
-
|
3
|
-
|
4
|
-
var myUploader = fluid.progressiveEnhanceableUploader(".flc-uploader", ".fl-progEnhance-basic", {
|
5
|
-
uploadManager: {
|
6
|
-
type: "fluid.swfUploadManager",
|
7
|
-
|
8
|
-
options: {
|
9
|
-
// Set the uploadURL to the URL for posting files to your server.
|
10
|
-
uploadURL: "<%= generic_content_object_path(:container_id => params[:id], :only_path => false) %>",
|
11
|
-
|
12
|
-
// This option points to the location of the SWFUpload Flash object that ships with Fluid Infusion.
|
13
|
-
flashURL: "<%= image_path("../infusion/lib/swfupload/flash/swfupload.swf", :plugin=>"fluid-infusion") %>"
|
14
|
-
}
|
15
|
-
},
|
16
|
-
|
17
|
-
listeners: {
|
18
|
-
onFileSuccess: function (file, serverData){
|
19
|
-
},
|
20
|
-
|
21
|
-
afterUploadComplete: function () {
|
22
|
-
// first check to see if the file queue is empty and there haven't been any errors
|
23
|
-
if (myUploader.uploadManager.queue.getReadyFiles().length === 0 && myUploader.uploadManager.queue.getErroredFiles().length === 0) {
|
24
|
-
//async_load('<%= "/generic_content_objects/#{params[:container_id]}/content"%>', '#uploads');
|
25
|
-
$("#file_assets .editable-container").hydraTextField();
|
26
|
-
}
|
27
|
-
}
|
28
|
-
},
|
29
|
-
|
30
|
-
decorators: {
|
31
|
-
type: "fluid.swfUploadSetupDecorator",
|
32
|
-
options: {
|
33
|
-
// This option points to the location of the Browse Files button used with Flash 10 clients.
|
34
|
-
flashButtonImageURL: "<%= image_path("../infusion/components/uploader/images/browse.png", :plugin=>"fluid-infusion") %>"
|
35
|
-
}
|
36
|
-
}
|
37
|
-
});
|
38
|
-
</script>
|
@@ -1,45 +0,0 @@
|
|
1
|
-
<script type="text/javascript">
|
2
|
-
var myUploader = fluid.progressiveEnhanceableUploader(".flc-uploader", ".fl-progEnhance-basic", {
|
3
|
-
uploadManager: {
|
4
|
-
type: "fluid.swfUploadManager",
|
5
|
-
|
6
|
-
options: {
|
7
|
-
// Set the uploadURL to the URL for posting files to your server.
|
8
|
-
uploadURL: "<%= file_assets_path(:container_id=> params[:container_id], :only_path => false) %>",
|
9
|
-
|
10
|
-
// This option points to the location of the SWFUpload Flash object that ships with Fluid Infusion.
|
11
|
-
flashURL: "<%= image_path("../infusion/lib/swfupload/flash/swfupload.swf", :plugin=>"fluid-infusion") %>"
|
12
|
-
}
|
13
|
-
},
|
14
|
-
|
15
|
-
listeners: {
|
16
|
-
|
17
|
-
onFileStart: function(file){
|
18
|
-
myUploader.uploadManager.swfUploader.addPostParam("asset[descMetadata][type][0]", $('#asset_descMetadata_type').val());
|
19
|
-
myUploader.uploadManager.swfUploader.addPostParam("asset[descMetadata][description][0]", $('#asset_descMetadata_description').val());
|
20
|
-
},
|
21
|
-
|
22
|
-
onFileSuccess: function (file, serverData){},
|
23
|
-
|
24
|
-
afterUploadComplete: function () {
|
25
|
-
|
26
|
-
// first check to see if the file queue is empty and there haven't been any errors
|
27
|
-
if (myUploader.uploadManager.queue.getReadyFiles().length === 0 && myUploader.uploadManager.queue.getErroredFiles().length === 0) {
|
28
|
-
// Custom for UVA Libra -- triggers update of File Uploaded indicator in progress box
|
29
|
-
//$.fn.hydraProgressBox.checkUncheckProgress('pbFileUploaded', true);
|
30
|
-
async_load('<%= "/assets/#{params[:container_id]}/file_assets"%>', '#uploads');
|
31
|
-
$("#file_assets .editable-container").hydraTextField();
|
32
|
-
}
|
33
|
-
|
34
|
-
}
|
35
|
-
},
|
36
|
-
|
37
|
-
decorators: {
|
38
|
-
type: "fluid.swfUploadSetupDecorator",
|
39
|
-
options: {
|
40
|
-
// This option points to the location of the Browse Files button used with Flash 10 clients.
|
41
|
-
flashButtonImageURL: "<%= image_path("../infusion/components/uploader/images/browse.png", :plugin=>"fluid-infusion") %>"
|
42
|
-
}
|
43
|
-
}
|
44
|
-
});
|
45
|
-
</script>
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
-
|
3
|
-
describe 'fluid_infusion/_uploader.html.erb' do
|
4
|
-
before do
|
5
|
-
view.stubs(:upload_url).returns("/assets/_PID_/file_assets")
|
6
|
-
view.stubs(:container_id).returns('111')
|
7
|
-
end
|
8
|
-
|
9
|
-
it "should permit locals for container_content_type" do
|
10
|
-
render :partial => "fluid_infusion/uploader", :locals => {:container_content_type=>"foo_bar"}
|
11
|
-
rendered.should have_selector "form.fl-uploader.fl-progEnhance-basic", :action => "/assets/_PID_/file_assets" do
|
12
|
-
with_tag "input#container_content_type", :value => "foo_bar"
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should permit locals for uploader html_options" do
|
17
|
-
render :partial => "fluid_infusion/uploader", :locals => {:html_options=>{:uploader_options => {:accept => "application/pdf"}}}
|
18
|
-
rendered.should have_selector "input#Filedata", :type => "file", :accept=>"application/pdf"
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should work with no locals passed in" do
|
22
|
-
render
|
23
|
-
rendered.should have_selector "form.fl-uploader.fl-progEnhance-basic", :action => "/assets/_PID_/file_assets" do
|
24
|
-
without_tag "input#container_content_type"
|
25
|
-
with_tag "input#Filedata", :type=>"file" do
|
26
|
-
without_tag "[accept=?]"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/vendor/cache/ffi-1.0.9.gem
DELETED
Binary file
|
Binary file
|
Binary file
|
data/vendor/cache/json-1.6.1.gem
DELETED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/vendor/cache/rake-0.9.2.gem
DELETED
Binary file
|
data/vendor/cache/rdoc-3.10.gem
DELETED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|