cul_scv_hydra 0.21.5 → 0.21.6
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 +4 -4
- data/app/models/generic_resource.rb +40 -0
- data/config/fedora.yml +6 -0
- data/config/solr.yml +4 -1
- data/config/subs.yml +17 -0
- data/lib/cul_scv_hydra/version.rb +1 -1
- data/lib/cul_scv_hydra/version.rb~ +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9007c29b846febed8e9db69330bdd01ad4ff888e
|
4
|
+
data.tar.gz: ecda81d35bcbac9b01e488079091648f5523ac0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57fc6fb0bef9f0bf6143d696fb2b95c109db9961ef017f8ea003833db988b88524dcf17f7d42769d873f87fce4c997734e0441772b9ef8c61688e16ecf646169
|
7
|
+
data.tar.gz: 796e3c83263621ce1a33c65cab31c9fcb8197c34997cd4488df54784c474c17d4b25e2e3e34ec9dd76d378be62b8a583c9fc9da19f0e0583d9f90d66005d2326
|
@@ -136,6 +136,46 @@ class GenericResource < ::ActiveFedora::Base
|
|
136
136
|
(zr = rels_int.relationships(datastreams['content'], :foaf_zooming) and not zr.first.blank?)
|
137
137
|
end
|
138
138
|
|
139
|
+
def with_content_resource(fedora_content_filesystem_mounted=false, &block)
|
140
|
+
|
141
|
+
content_ds = self.datastreams['content']
|
142
|
+
|
143
|
+
if fedora_content_filesystem_mounted
|
144
|
+
if content_ds.dsLocation =~ /^file:\//
|
145
|
+
dsLocation = content_ds.dsLocation.sub(/^file:\/+/,'/')
|
146
|
+
path = URI.unescape(dsLocation)
|
147
|
+
else
|
148
|
+
path = content_ds.dsLocation
|
149
|
+
end
|
150
|
+
|
151
|
+
yield(path)
|
152
|
+
else
|
153
|
+
internal_uri = "info:fedora/#{self.pid}/content"
|
154
|
+
# No local fedora mount, need to download content over http[s]
|
155
|
+
|
156
|
+
file_basename = File.basename(content_ds.dsLocation.gsub(/^file:/,''))
|
157
|
+
file_extension = File.extname(file_basename)
|
158
|
+
|
159
|
+
# In some cases, we actually do want to know the original extension of the file, so we'll preserve it in the temp file filename
|
160
|
+
temp_file = Tempfile.new([file_basename, file_extension])
|
161
|
+
begin
|
162
|
+
parts = internal_uri.split('/')
|
163
|
+
open(temp_file.path, 'wb') do |blob|
|
164
|
+
repo = ActiveFedora::Base.connection_for_pid(parts[1])
|
165
|
+
repo.datastream_dissemination({:dsid=>parts[2], :pid=>parts[1], :finished=>false}) do |res|
|
166
|
+
res.read_body do |seg|
|
167
|
+
blob << seg
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
171
|
+
yield(temp_file.path)
|
172
|
+
ensure
|
173
|
+
temp_file.unlink
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
end
|
178
|
+
|
139
179
|
private
|
140
180
|
def datastream_as_resource(dsid, props={})
|
141
181
|
ds = datastreams[dsid]
|
data/config/fedora.yml
CHANGED
@@ -8,4 +8,10 @@ test:
|
|
8
8
|
:user: fedoraAdmin
|
9
9
|
:password: fedoraAdmin
|
10
10
|
:url: http://localhost:8983/fedora-test
|
11
|
+
:time_zone: "America/New_York"
|
12
|
+
|
13
|
+
production:
|
14
|
+
:user: fedoraAdmin
|
15
|
+
:password: f+BULUS*^
|
16
|
+
:url: http://alcott.cul.columbia.edu:8080/fedora
|
11
17
|
:time_zone: "America/New_York"
|
data/config/solr.yml
CHANGED
data/config/subs.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
development:
|
2
|
+
djatoka_server: "http://iris.cul.columbia.edu:8080"
|
3
|
+
fedora_server: "http://sayers.cul.columbia.edu:8080"
|
4
|
+
php_server: "http://bach.cul.columbia.edu/dev"
|
5
|
+
test:
|
6
|
+
djatoka_server: "http://iris.cul.columbia.edu:8080"
|
7
|
+
fedora_server: "http://sayers.cul.columbia.edu:8080"
|
8
|
+
php_server: "http://bach.cul.columbia.edu/dev"
|
9
|
+
production:
|
10
|
+
djatoka_server: "http://iris.cul.columbia.edu:8080"
|
11
|
+
fedora_server: "http://alcott.cul.columbia.edu:8080"
|
12
|
+
php_server: "http://bach.cul.columbia.edu"
|
13
|
+
|
14
|
+
hyacinth_prod:
|
15
|
+
djatoka_server: "http://iris.cul.columbia.edu:8080"
|
16
|
+
fedora_server: "http://alcott.cul.columbia.edu:8080"
|
17
|
+
php_server: "http://bach.cul.columbia.edu"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cul_scv_hydra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.21.
|
4
|
+
version: 0.21.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Armintor
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-02-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: blacklight
|
@@ -331,6 +331,7 @@ files:
|
|
331
331
|
- config/solr.yml
|
332
332
|
- config/solr_mappings.yml
|
333
333
|
- config/solr_value_maps.yml
|
334
|
+
- config/subs.yml
|
334
335
|
- fixtures/cmodels/ldpd_ADLMetadata.xml
|
335
336
|
- fixtures/cmodels/ldpd_AESMetadata.xml
|
336
337
|
- fixtures/cmodels/ldpd_BagAggregator.xml
|