hydra-tutorial 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
data/hydra-tutorial.gemspec
CHANGED
@@ -151,6 +151,11 @@ class HydraOpenRepositoriesTutorialApp < Thor::Group
|
|
151
151
|
end
|
152
152
|
end
|
153
153
|
|
154
|
+
def add_file_upload
|
155
|
+
inside $application_root do
|
156
|
+
AddFileUpload.start
|
157
|
+
end
|
158
|
+
end
|
154
159
|
|
155
160
|
def sprinkle_some_styling
|
156
161
|
inside $application_root do
|
@@ -244,10 +249,6 @@ class HydraOpenRepositoriesTutorialApp < Thor::Group
|
|
244
249
|
}, Thor::Shell::Color::YELLOW
|
245
250
|
run "rails new #{$application_root}"
|
246
251
|
run "cd #{$application_root}"
|
247
|
-
inside $application_root do
|
248
|
-
gem 'execjs'
|
249
|
-
gem 'therubyracer'
|
250
|
-
end
|
251
252
|
end
|
252
253
|
|
253
254
|
def out_of_the_box
|
@@ -285,6 +286,11 @@ class HydraOpenRepositoriesTutorialApp < Thor::Group
|
|
285
286
|
|
286
287
|
|
287
288
|
def adding_dependencies
|
289
|
+
gem 'execjs'
|
290
|
+
gem 'therubyracer'
|
291
|
+
end
|
292
|
+
|
293
|
+
def add_fedora_and_solr_with_hydrajetty
|
288
294
|
|
289
295
|
say %Q{
|
290
296
|
Fedora runs as a Java servlet inside a container like Tomcat or Jetty.
|
@@ -736,18 +742,6 @@ class HydraOpenRepositoriesTutorialApp < Thor::Group
|
|
736
742
|
|
737
743
|
end
|
738
744
|
|
739
|
-
class AddFileAssets < Thor::Group
|
740
|
-
include Thor::Actions
|
741
|
-
include Rails::Generators::Actions
|
742
|
-
include TutorialActions
|
743
|
-
|
744
|
-
def self.source_paths
|
745
|
-
[File.join($base_templates_path, "add_tests")]
|
746
|
-
end
|
747
|
-
|
748
|
-
|
749
|
-
end
|
750
|
-
|
751
745
|
class SprinkeSomeStyling < Thor::Group
|
752
746
|
include Thor::Actions
|
753
747
|
include Rails::Generators::Actions
|
@@ -766,14 +760,52 @@ class HydraOpenRepositoriesTutorialApp < Thor::Group
|
|
766
760
|
end
|
767
761
|
|
768
762
|
class AddCollections
|
763
|
+
def add_collection_model
|
764
|
+
|
765
|
+
end
|
766
|
+
|
767
|
+
def add_collection_controller
|
769
768
|
|
769
|
+
end
|
770
|
+
|
771
|
+
def add_collection_reference_to_record
|
772
|
+
|
773
|
+
end
|
770
774
|
end
|
771
775
|
|
772
|
-
class
|
776
|
+
class AddFileUpload < Thor::Group
|
777
|
+
include Thor::Actions
|
778
|
+
include Rails::Generators::Actions
|
779
|
+
include TutorialActions
|
780
|
+
|
781
|
+
def self.source_paths
|
782
|
+
[File.join($base_templates_path, "add_file_upload")]
|
783
|
+
end
|
773
784
|
|
785
|
+
def add_file_uploads
|
786
|
+
inject_into_class 'app/models/record.rb', 'Record' do
|
787
|
+
"has_file_datastream :name => 'content', :type => ActiveFedora::Datastream\n"
|
788
|
+
end
|
789
|
+
end
|
790
|
+
|
791
|
+
def add_file_upload_controller
|
792
|
+
inject_into_class "app/controllers/records_controller.rb", "RecordsController" do
|
793
|
+
" include Hydra::Controller::UploadBehavior\n"
|
794
|
+
end
|
795
|
+
insert_into_file "app/controllers/records_controller.rb", :after => "apply_depositor_metadata(@record)\n" do
|
796
|
+
" add_posted_blob_to_asset(@record, params[:filedata]) if params.has_key?(:filedata)\n"
|
797
|
+
end
|
798
|
+
end
|
799
|
+
|
800
|
+
def add_file_upload_ui
|
801
|
+
copy_file "_form.html.erb", "app/views/records/_form.html.erb"
|
802
|
+
end
|
774
803
|
end
|
775
804
|
|
776
805
|
class AddTechnicalMetadata
|
806
|
+
def add_datastream_and_terminology
|
807
|
+
|
808
|
+
end
|
777
809
|
|
778
810
|
end
|
779
811
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<%= form_for(@record, :html => { :multipart => true } ) do |f| -%>
|
2
|
+
<h2>File</h2>
|
3
|
+
<%= file_field_tag "filedata" %>
|
4
|
+
|
5
|
+
<h2>Title</h2>
|
6
|
+
<div class="row">
|
7
|
+
<%= f.label :title, "Title" %>
|
8
|
+
<%= f.text_area :title, :value=>@record.title, :required => true %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<h2>Abstract and keywords</h2>
|
12
|
+
|
13
|
+
<div class="row">
|
14
|
+
<%= f.label :abstract %>
|
15
|
+
<%= f.text_area :abstract, :value=>@record.abstract.first, :required=>true %>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div class="row">
|
19
|
+
<%= label_tag("hydrus_item_keywords", "Keywords") %>
|
20
|
+
<%= text_field_tag("hydrus_item_keywords", @record.descMetadata.subject.topic.join(", ")) -%>
|
21
|
+
<div class="help">separate keywords with commas</div>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<h2>Citations</h2>
|
25
|
+
<div class="row">
|
26
|
+
<%= f.label :preferred_citation, "Preferred citation for this object", :class => "hidden-tablet" %>
|
27
|
+
<%= f.text_area :preferred_citation, :value=>@record.preferred_citation %>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<input type="submit" class="btn btn-small save-edits" name="save" id="save" />
|
31
|
+
|
32
|
+
<% end %>
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-tutorial
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -74,6 +74,7 @@ files:
|
|
74
74
|
- bin/hydra-tutorial
|
75
75
|
- hydra-tutorial.gemspec
|
76
76
|
- open-repositories-tutorial.thor
|
77
|
+
- or_templates/add_file_upload/_form.html.erb
|
77
78
|
- or_templates/add_tests/ci.rake
|
78
79
|
- or_templates/add_tests/integration_spec.rb
|
79
80
|
- or_templates/add_tests/records_controller_spec.rb
|
@@ -111,7 +112,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
111
112
|
version: '0'
|
112
113
|
segments:
|
113
114
|
- 0
|
114
|
-
hash: -
|
115
|
+
hash: -366629335021699433
|
115
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
117
|
none: false
|
117
118
|
requirements:
|
@@ -120,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
121
|
version: '0'
|
121
122
|
segments:
|
122
123
|
- 0
|
123
|
-
hash: -
|
124
|
+
hash: -366629335021699433
|
124
125
|
requirements: []
|
125
126
|
rubyforge_project:
|
126
127
|
rubygems_version: 1.8.24
|