cul_scv_hydra 0.21.5 → 0.21.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 255cb8ceedd709522e6a803f6813b8cae17f6895
4
- data.tar.gz: e5dd126f6d863d71d8bf8e4a14c81f3f1598bd18
3
+ metadata.gz: 9007c29b846febed8e9db69330bdd01ad4ff888e
4
+ data.tar.gz: ecda81d35bcbac9b01e488079091648f5523ac0f
5
5
  SHA512:
6
- metadata.gz: ab1a0cb02e2e45bb2b9185edf51cab4c0d04af5c51048a91ac9be3a1cbd99e3a115718a9b22bb03b4660e60a83bfd463c030990cdfc3cd4dfe2c71903eef67fd
7
- data.tar.gz: ab6955065a75b7fbfab1e123181e8e6e86cd9a9f46edb34acf81e2edf926fe68b1f3f91ce42cd342f1847d0909a866b8fa222cd216930d778c6264b905dd0a0f
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
@@ -2,4 +2,7 @@ development:
2
2
  url: http://localhost:8983/solr/test
3
3
 
4
4
  test:
5
- url: http://localhost:8983/solr/test
5
+ url: http://localhost:8983/solr/test
6
+
7
+ production:
8
+ url: http://katana.cul.columbia.edu:8080/solr-4.7/dcv_private_dev
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"
@@ -2,7 +2,7 @@
2
2
  module Cul
3
3
  module Scv
4
4
  module Hydra
5
- VERSION = '0.21.5'
5
+ VERSION = '0.21.6'
6
6
  def self.version
7
7
  VERSION
8
8
  end
@@ -2,7 +2,7 @@
2
2
  module Cul
3
3
  module Scv
4
4
  module Hydra
5
- VERSION = '0.21.4'
5
+ VERSION = '0.21.5'
6
6
  def self.version
7
7
  VERSION
8
8
  end
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.5
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-01-23 00:00:00.000000000 Z
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