from_hyrax 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +36 -0
- data/app/assets/config/from_hyrax_manifest.js +2 -0
- data/app/assets/javascripts/from_hyrax/application.js +37 -0
- data/app/assets/stylesheets/from_hyrax/application.css +30 -0
- data/app/controllers/from_hyrax/application_controller.rb +5 -0
- data/app/controllers/from_hyrax_controller.rb +117 -0
- data/app/helpers/from_hyrax/application_helper.rb +4 -0
- data/app/jobs/from_hyrax/application_job.rb +4 -0
- data/app/jobs/from_hyrax/run_import_job.rb +23 -0
- data/app/mailers/from_hyrax/application_mailer.rb +6 -0
- data/app/models/from_hyrax/application_record.rb +5 -0
- data/app/views/from_hyrax/_rows.erb +22 -0
- data/app/views/from_hyrax/create.html.erb +7 -0
- data/app/views/from_hyrax/index.html.erb +9 -0
- data/app/views/from_hyrax/new.html.erb +34 -0
- data/app/views/from_hyrax/receive.html.erb +2 -0
- data/app/views/layouts/from_hyrax/application.html.erb +14 -0
- data/config/routes.rb +7 -0
- data/lib/from_hyrax/engine.rb +29 -0
- data/lib/from_hyrax/version.rb +3 -0
- data/lib/from_hyrax.rb +5 -0
- data/lib/generators/install/install_generator.rb +7 -0
- data/lib/generators/install/templates/config/from_hyrax.yml +2 -0
- data/lib/tasks/from_hyrax_tasks.rake +4 -0
- metadata +100 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 22f1ff74f86e6fdd615c62777a5d740b7f2de2ca7933ce2146f67b1641efd730
|
4
|
+
data.tar.gz: 2029c8bc25562930cd5d37d1560cca4b0cd213cd793f972cea6eaf6b24fb382c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 526a9992cd5fb6eecfbb62963e2c74f4dcf356a8cf257d985c55bee460b4375699d65ea27dc8907d2a6518dfa139a24c473d14aa5908c41577a47f147c2d28cf
|
7
|
+
data.tar.gz: a2314af097f4c8ce3ae8080ce5ab07bea6cac53ce61f44e9aef50cb755f6dfd61a93e5495a3f808712dd226a6a43e47d8ce4caec0199f955eaf0e7ec40cdaf47
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2020 sephirothkod
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# FromHyrax
|
2
|
+
Short description and motivation.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
How to use my plugin.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'from_hyrax'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
```bash
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
```bash
|
21
|
+
$ gem install from_hyrax
|
22
|
+
```
|
23
|
+
|
24
|
+
## Contributing
|
25
|
+
Contribution directions go here.
|
26
|
+
|
27
|
+
## License
|
28
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'FromHyrax'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
|
21
|
+
load 'rails/tasks/statistics.rake'
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
require 'bundler/gem_tasks'
|
26
|
+
|
27
|
+
require 'rake/testtask'
|
28
|
+
|
29
|
+
Rake::TestTask.new(:test) do |t|
|
30
|
+
t.libs << 'test'
|
31
|
+
t.pattern = 'test/**/*_test.rb'
|
32
|
+
t.verbose = false
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
task default: :test
|
@@ -0,0 +1,37 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require_tree .
|
14
|
+
|
15
|
+
function newSelect(e) {
|
16
|
+
count = e.parentElement.childElementCount/2;
|
17
|
+
cln = e.previousElementSibling.cloneNode(true);
|
18
|
+
cln.name = cln.name.replace(/spotlight\]\[.*\]/, "spotlight]["+count+"]");
|
19
|
+
cln.id = cln.id.replace(/spotlight\]\[.*\]/, "spotlight]["+count+"]");
|
20
|
+
e.parentElement.appendChild(document.createElement('br'));
|
21
|
+
e.parentElement.appendChild(cln);
|
22
|
+
|
23
|
+
}
|
24
|
+
|
25
|
+
function get_next(e) {
|
26
|
+
var url = "/from_hyrax/hyrax_api?repo=" + e.value + "&api_type=collections";
|
27
|
+
var replace = document.getElementById("collections_div");
|
28
|
+
var xhttp = new XMLHttpRequest();
|
29
|
+
xhttp.onreadystatechange = function() {
|
30
|
+
if (this.readyState == 4 && this.status == 200) {
|
31
|
+
replace.innerHTML = this.responseText;
|
32
|
+
}
|
33
|
+
};
|
34
|
+
xhttp.open("GET", url, true);
|
35
|
+
xhttp.send();
|
36
|
+
|
37
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
16
|
+
|
17
|
+
.plus {
|
18
|
+
height: 20px;
|
19
|
+
width: 20px;
|
20
|
+
display: inline-block;
|
21
|
+
background-color: darkblue;
|
22
|
+
color: white;
|
23
|
+
font-size: 24px;
|
24
|
+
line-height: 20px;
|
25
|
+
text-align: center;
|
26
|
+
}
|
27
|
+
|
28
|
+
.plus::before {
|
29
|
+
content: "+";
|
30
|
+
}
|
@@ -0,0 +1,117 @@
|
|
1
|
+
class FromHyraxController < ActionController::Base
|
2
|
+
layout 'from_hyrax/application'
|
3
|
+
protect_from_forgery with: :exception
|
4
|
+
skip_before_action :verify_authenticity_token, only: :receive
|
5
|
+
require 'net/http'
|
6
|
+
|
7
|
+
def hyrax_api
|
8
|
+
uri = URI("http://#{params[:repo]}/to_spotlight/api/#{params[:api_type]}")
|
9
|
+
response = ::Net::HTTP.get_response(uri)
|
10
|
+
render html: response.body.html_safe
|
11
|
+
end
|
12
|
+
|
13
|
+
def index
|
14
|
+
@instances = FromHyrax::Engine.config['hyrax_instances'] || []
|
15
|
+
end
|
16
|
+
|
17
|
+
def new
|
18
|
+
uri = URI("http://#{params[:repo]}/to_spotlight/api/fields?work=#{params[:work]}")
|
19
|
+
response = ::Net::HTTP.get_response(uri)
|
20
|
+
@hyrax_fields = eval(response.body)
|
21
|
+
@spotlight_fields = spotlight_fields.map { |f| [f[:label], f[:field_name]] }
|
22
|
+
end
|
23
|
+
|
24
|
+
def create
|
25
|
+
# go to: to_spotlight/receive
|
26
|
+
# use Spotlight::Engine.config.upload_fields to get spotlight fields list
|
27
|
+
# map {|f| [f.label, f.field_name]}
|
28
|
+
@mappings = params[:transfer][:mappings].permit!.to_h.map { |_, v| v unless v['spotlight']['0'].empty? }.compact #use hash.values
|
29
|
+
@res = Net::HTTP.post URI("http://#{params[:repo]}/to_spotlight/receive"),
|
30
|
+
{ transfer: params[:transfer],
|
31
|
+
mappings: @mappings,
|
32
|
+
token: 'secret_token' }.to_json,
|
33
|
+
'Content-Type' => 'application/json'
|
34
|
+
end
|
35
|
+
|
36
|
+
def receive
|
37
|
+
FromHyrax::RunImportJob.perform_later(params[:csv_url], csv_params)
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def instances
|
43
|
+
@instances ||= FromHyrax::Engine.config['hyrax_instances'] || []
|
44
|
+
end
|
45
|
+
|
46
|
+
def token
|
47
|
+
FromHyrax::Engine.config['secret_token']
|
48
|
+
end
|
49
|
+
|
50
|
+
def csv_params
|
51
|
+
params.require(:transfer).permit(:user, :exhibit_id).to_h
|
52
|
+
end
|
53
|
+
|
54
|
+
def spotlight_fields
|
55
|
+
[
|
56
|
+
{ label: 'Description', field_name: 'spotlight_upload_dc_description_tesim' },
|
57
|
+
{ label: 'Abstract', field_name: 'spotlight_upload_dc_Subject_tesim' },
|
58
|
+
{ label: 'Subjects', field_name: 'spotlight_upload_dc_Subjects_tesim' },
|
59
|
+
{ label: 'Subjects Facet', field_name: 'spotlight_upload_dc_Subjects_ftesim' },
|
60
|
+
{ label: 'Creator', field_name: 'spotlight_upload_Creator_tesim' },
|
61
|
+
{ label: 'Publisher', field_name: 'spotlight_upload_Publisher_tesim' },
|
62
|
+
{ label: 'Contributors', field_name: 'spotlight_upload_Contributors_tesim' },
|
63
|
+
{ label: 'Date', field_name: 'spotlight_upload_dc_Date_tesi' },
|
64
|
+
{ label: 'Date searchable', field_name: 'spotlight_upload_dc_Date-Created_Searchable_ftesi' },
|
65
|
+
{ label: 'Date searchable', field_name: 'spotlight_upload_dc_Date-Created_Searchable_tesi' },
|
66
|
+
{ label: 'Genre', field_name: 'spotlight_upload_dc_Type_Genre_tesim' },
|
67
|
+
{ label: 'Genre Facet', field_name: 'spotlight_upload_dc_Type_Genre_ftesim' },
|
68
|
+
{ label: 'Format', field_name: 'spotlight_upload_Format_tesim' },
|
69
|
+
{ label: 'Identifier', field_name: 'spotlight_upload_Identifier_tesim' },
|
70
|
+
{ label: 'Source', field_name: 'spotlight_upload_Source_tesim' },
|
71
|
+
{ label: 'Language', field_name: 'spotlight_upload_Language_tesim' },
|
72
|
+
{ label: 'Language Facet', field_name: 'spotlight_upload_Language_ftesim' },
|
73
|
+
{ label: 'Relation', field_name: 'spotlight_upload_Relation_tesim' },
|
74
|
+
{ label: 'Coverage', field_name: 'spotlight_upload_Coverage_tesim' },
|
75
|
+
{ label: 'Rights', field_name: 'spotlight_upload_Rights_tesim' },
|
76
|
+
{ label: 'Provenance', field_name: 'spotlight_upload_Provenance_tesim' },
|
77
|
+
{ label: 'Title-Alternative', field_name: 'spotlight_upload_dc_Title_Alternative_tesim' },
|
78
|
+
{ label: 'Description-Table Of Contents', field_name: 'spotlight_upload_Description-Table-Of-Contents_tesim' },
|
79
|
+
{ label: 'Description-Abstract', field_name: 'spotlight_upload_Description-Abstract_tesim' },
|
80
|
+
{ label: 'Format-Extent', field_name: 'spotlight_upload_Format-Extent_tesim' },
|
81
|
+
{ label: 'Format-Medium', field_name: 'spotlight_upload_Format-Medium_tesim' },
|
82
|
+
{ label: 'Identifier-Bibliographic Citation', field_name: 'spotlight_upload_Identifier-Bibliographic-Citation_tesim' },
|
83
|
+
{ label: 'Collection', field_name: 'spotlight_upload_dc_Relation_IsPartOf_Collection_tesim' },
|
84
|
+
{ label: 'Collection Facet', field_name: 'spotlight_upload_dc_Relation_IsPartOf_Collection_ftesim' },
|
85
|
+
{ label: 'Location(s)', field_name: 'spotlight_upload_dc_Coverage-Spatial_Location_tesim' },
|
86
|
+
{ label: 'Location(s) Facet', field_name: 'spotlight_upload_dc_Coverage-Spatial_Location_ftesim' },
|
87
|
+
{ label: 'Coverage-Temporal', field_name: 'spotlight_upload_Coverage-Temporal_tesim' },
|
88
|
+
{ label: 'Date Digitized', field_name: 'spotlight_upload_Date-Digitized_tesi' },
|
89
|
+
{ label: 'Transcript', field_name: 'spotlight_upload_dc_Description_Transcript_tesim' },
|
90
|
+
{ label: 'People Depicted', field_name: 'spotlight_upload_dc_Subject_People_tesim' },
|
91
|
+
{ label: 'People Facet', field_name: 'spotlight_upload_dc_Subject_People_ftesim' },
|
92
|
+
{ label: 'Sketchfab Uid', field_name: 'spotlight_upload_Sketchfab-uid_tesim' },
|
93
|
+
{ label: 'Hidden', field_name: :spotlight_annotation_x_dbsm },
|
94
|
+
{ label: 'Hidden', field_name: :spotlight_annotation_y_dbsm },
|
95
|
+
{ label: 'Hidden', field_name: :spotlight_annotation_width_dbsm },
|
96
|
+
{ label: 'Hidden', field_name: :spotlight_annotation_height_dbsm },
|
97
|
+
{ label: 'Hidden', field_name: :spotlight_annotation_title_tesim },
|
98
|
+
{ label: 'Hidden', field_name: :spotlight_annotation_author_tesim },
|
99
|
+
{ label: 'Hidden', field_name: :spotlight_annotation_description_tesim },
|
100
|
+
{ label: 'Hidden', field_name: :spotlight_annotation_date_tesim },
|
101
|
+
{ label: 'Hidden', field_name: :spotlight_annotation_publisher_tesim },
|
102
|
+
{ label: 'Hidden', field_name: 'spotlight_annotation_publisher-place_tesim' },
|
103
|
+
{ label: 'Hidden', field_name: 'spotlight_annotation_publisher-date_tesim' },
|
104
|
+
{ label: 'Hidden', field_name: :spotlight_annotation_people_tesim },
|
105
|
+
{ label: 'Hidden', field_name: :spotlight_annotation_locations_tesim },
|
106
|
+
{ label: 'Hidden', field_name: :spotlight_annotation_transcript_tesim },
|
107
|
+
{ label: 'Hidden', field_name: :spotlight_annotation_genre_tesim },
|
108
|
+
{ label: 'Hidden', field_name: :spotlight_annotation_public_isim },
|
109
|
+
{ label: 'Parent', field_name: 'spotlight_upload_parent_tesim' },
|
110
|
+
{ label: 'Commentary', field_name: 'spotlight_upload_Commentary_tesim' },
|
111
|
+
{ label: 'User Defined 2', field_name: 'spotlight_upload_UserDefined_tesim' },
|
112
|
+
{ label: 'sortDate', field_name: 'sortDate' },
|
113
|
+
{ label: 'Geographic Coordinates', field_name: 'spotlight_upload_dc_box_tesim' }
|
114
|
+
]
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module FromHyrax
|
2
|
+
class RunImportJob < ApplicationJob
|
3
|
+
queue_as :default
|
4
|
+
|
5
|
+
def perform(csv_url, csv_params)
|
6
|
+
csv = CSV.parse(csv_io_param(csv_url), headers: true, return_headers: false).map(&:to_hash)
|
7
|
+
exhibit = ::Exhibit.find(csv_params[:exhibit_id])
|
8
|
+
user = ::User.find(csv_params[:user])
|
9
|
+
Spotlight::AddUploadsFromCSV.perform_later(csv, exhibit, user)
|
10
|
+
end
|
11
|
+
|
12
|
+
def csv_io_param url
|
13
|
+
file_or_io = url
|
14
|
+
io = if file_or_io.respond_to?(:to_io)
|
15
|
+
file_or_io.to_io
|
16
|
+
else
|
17
|
+
file_or_io
|
18
|
+
end
|
19
|
+
|
20
|
+
io.set_encoding('utf-8')
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<tr><td><b><%= "Common Fields" %></b></td></tr>
|
2
|
+
<% @hyrax_fields.each do |category, fields| %>
|
3
|
+
|
4
|
+
<% fields.each_with_index do |field, i| %>
|
5
|
+
|
6
|
+
<tr>
|
7
|
+
<td>
|
8
|
+
<%= label_tag field %>
|
9
|
+
<%= hidden_field_tag "transfer[mappings][#{i}][hyrax]", field %>
|
10
|
+
</td>
|
11
|
+
<td>
|
12
|
+
<%= label_tag 'maps into: ' %>
|
13
|
+
</td>
|
14
|
+
<td>
|
15
|
+
<%= select_tag "transfer[mappings][#{i}][spotlight][0]", options_for_select(@spotlight_fields), include_blank: true %>
|
16
|
+
<span class="plus" onclick="newSelect(this)"></span>
|
17
|
+
</td>
|
18
|
+
</tr>
|
19
|
+
<% end %>
|
20
|
+
<tr><td><b><%= "Work Specific Fields" if category.include?"common" %></b></td></tr>
|
21
|
+
<% end %>
|
22
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<h1>FromHyrax::FromHyrax#index</h1>
|
2
|
+
<p>Find me in app/views/from_hyrax/from_hyrax/index.html.erb</p>
|
3
|
+
|
4
|
+
|
5
|
+
<%= form_tag from_hyrax.new_path do %>
|
6
|
+
<%= select_tag "repo", options_for_select(@instances), {include_blank: true, onchange: 'get_next(this)'} %>
|
7
|
+
<div id="collections_div"></div>
|
8
|
+
<%= submit_tag 'start mapping'%>
|
9
|
+
<% end %>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<h1>FromHyrax::FromHyrax#new</h1>
|
2
|
+
<p>Find me in app/views/from_hyrax/from_hyrax/new.html.erb</p>
|
3
|
+
|
4
|
+
<style type="text/css" media="screen">
|
5
|
+
|
6
|
+
table{
|
7
|
+
border-collapse:collapse;
|
8
|
+
border:1px solid black;
|
9
|
+
}
|
10
|
+
|
11
|
+
table td{
|
12
|
+
border:1px solid black;
|
13
|
+
}
|
14
|
+
</style>
|
15
|
+
|
16
|
+
<h1><%= "Map from #{params[:repo]}" %></h1>
|
17
|
+
|
18
|
+
<%= params.inspect %>
|
19
|
+
|
20
|
+
<%= form_tag from_hyrax.create_path do %>
|
21
|
+
|
22
|
+
<%#= select_tag "admin_set", options_for_select(@admin_sets), include_blank: true %>
|
23
|
+
|
24
|
+
<table>
|
25
|
+
<%= render 'rows' %>
|
26
|
+
<%= hidden_field_tag "repo", params[:repo] %>
|
27
|
+
<%= hidden_field_tag "transfer[user]", "current_user" %>
|
28
|
+
<%= hidden_field_tag "transfer[exhibit_id]", "17" %>
|
29
|
+
<%= hidden_field_tag "transfer[collection_id]", params[:collection] %>
|
30
|
+
<%= hidden_field_tag "transfer[spotlight_url]", request.base_url %>
|
31
|
+
</table>
|
32
|
+
<%= submit_tag 'request import'%>
|
33
|
+
<% end %>
|
34
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>From hyrax</title>
|
5
|
+
<%= stylesheet_link_tag "from_hyrax/application", media: "all" %>
|
6
|
+
<%= javascript_include_tag "from_hyrax/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
module FromHyrax
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
isolate_namespace FromHyrax
|
4
|
+
|
5
|
+
initializer :append_migrations do |app|
|
6
|
+
unless app.root.to_s.match root.to_s
|
7
|
+
config.paths['db/migrate'].expanded.each do |expanded_path|
|
8
|
+
app.config.paths['db/migrate'] << expanded_path
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class << self
|
14
|
+
|
15
|
+
def config
|
16
|
+
file = File.open(File.join(::Rails.root, '/config/from_hyrax.yml'))
|
17
|
+
@config ||= YAML.safe_load(file)
|
18
|
+
end
|
19
|
+
|
20
|
+
# loads a yml file with the configuration options
|
21
|
+
#
|
22
|
+
# @param file [String] path to the yml file
|
23
|
+
#
|
24
|
+
def load_config(file)
|
25
|
+
@config = YAML.load_file(file)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/from_hyrax.rb
ADDED
metadata
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: from_hyrax
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.2'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- sephirothkod
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-05-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 5.1.6
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 5.1.6
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pg
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Spotlight plugin gem to pull data from Hyrax, must use in conjuction
|
42
|
+
with to_spotlight gem
|
43
|
+
email:
|
44
|
+
- bjustice@uvic.ca
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- MIT-LICENSE
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
|
+
- app/assets/config/from_hyrax_manifest.js
|
53
|
+
- app/assets/javascripts/from_hyrax/application.js
|
54
|
+
- app/assets/stylesheets/from_hyrax/application.css
|
55
|
+
- app/controllers/from_hyrax/application_controller.rb
|
56
|
+
- app/controllers/from_hyrax_controller.rb
|
57
|
+
- app/helpers/from_hyrax/application_helper.rb
|
58
|
+
- app/jobs/from_hyrax/application_job.rb
|
59
|
+
- app/jobs/from_hyrax/run_import_job.rb
|
60
|
+
- app/mailers/from_hyrax/application_mailer.rb
|
61
|
+
- app/models/from_hyrax/application_record.rb
|
62
|
+
- app/views/from_hyrax/_rows.erb
|
63
|
+
- app/views/from_hyrax/create.html.erb
|
64
|
+
- app/views/from_hyrax/index.html.erb
|
65
|
+
- app/views/from_hyrax/new.html.erb
|
66
|
+
- app/views/from_hyrax/receive.html.erb
|
67
|
+
- app/views/layouts/from_hyrax/application.html.erb
|
68
|
+
- config/routes.rb
|
69
|
+
- lib/from_hyrax.rb
|
70
|
+
- lib/from_hyrax/engine.rb
|
71
|
+
- lib/from_hyrax/version.rb
|
72
|
+
- lib/generators/install/install_generator.rb
|
73
|
+
- lib/generators/install/templates/config/from_hyrax.yml
|
74
|
+
- lib/tasks/from_hyrax_tasks.rake
|
75
|
+
homepage: https://github.com/sephirothkod/from_hyrax
|
76
|
+
licenses:
|
77
|
+
- MIT
|
78
|
+
metadata: {}
|
79
|
+
post_install_message:
|
80
|
+
rdoc_options: []
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
requirements: []
|
94
|
+
rubyforge_project:
|
95
|
+
rubygems_version: 2.7.7
|
96
|
+
signing_key:
|
97
|
+
specification_version: 4
|
98
|
+
summary: Spotlight plugin gem to pull data from Hyrax, must use in conjuction with
|
99
|
+
to_spotlight gem
|
100
|
+
test_files: []
|