cul_scv_hydra 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. data/app/models/bag_aggregator.rb +3 -2
  2. data/app/models/concerns/cul.rb +7 -0
  3. data/{lib/cul_scv_hydra/active_fedora.rb → app/models/concerns/cul/scv/hydra/models.rb} +4 -5
  4. data/{lib/cul_scv_hydra/active_fedora/model → app/models/concerns/cul/scv/hydra/models}/aggregator.rb +3 -3
  5. data/{lib/cul_scv_hydra/active_fedora/model → app/models/concerns/cul/scv/hydra/models}/common.rb +36 -9
  6. data/{lib/cul_scv_hydra/active_fedora/model → app/models/concerns/cul/scv/hydra/models}/resource.rb +2 -2
  7. data/app/models/content_aggregator.rb +3 -2
  8. data/app/models/cul/scv/hydra/datastreams/dc_metadata.rb +109 -0
  9. data/app/models/cul/scv/hydra/datastreams/mods_document.rb +157 -0
  10. data/{lib/cul_scv_hydra/active_fedora/model → app/models/cul/scv/hydra/datastreams}/struct_metadata.rb +10 -4
  11. data/app/models/dcdocument.rb +2 -1
  12. data/app/models/generic_aggregator.rb +4 -3
  13. data/app/models/generic_object.rb +3 -2
  14. data/app/models/generic_resource.rb +2 -1
  15. data/app/models/jp2_image_aggregator.rb +3 -2
  16. data/app/models/mets_structured_aggregator.rb +3 -2
  17. data/app/models/resource.rb +3 -2
  18. data/app/models/static_audio_aggregator.rb +3 -2
  19. data/app/models/static_image_aggregator.rb +3 -2
  20. data/bin/rails +12 -0
  21. data/lib/cul_scv_hydra.rb +0 -1
  22. data/lib/cul_scv_hydra/engine.rb +15 -0
  23. data/lib/cul_scv_hydra/om.rb +0 -2
  24. data/lib/cul_scv_hydra/om/standard_mods.rb +8 -0
  25. data/lib/cul_scv_hydra/version.rb +1 -1
  26. data/lib/tasks/cmodel.rake +11 -2
  27. metadata +29 -61
  28. data/lib/cul_scv_hydra/active_fedora/model.rb +0 -9
  29. data/lib/cul_scv_hydra/active_fedora/model/nokogiri_datastreams.rb +0 -142
  30. data/lib/cul_scv_hydra/om/dc_metadata.rb +0 -102
  31. data/lib/cul_scv_hydra/om/scv_mods_document.rb +0 -150
@@ -1,9 +1,12 @@
1
- module Cul::Scv::Hydra::ActiveFedora::Model
1
+ module Cul
2
+ module Scv
3
+ module Hydra
4
+ module Datastreams
2
5
  class StructMetadata < ::ActiveFedora::Datastream
3
- include NokogiriDatastreams
6
+ include ::ActiveFedora::Datastreams::NokogiriDatastreams
4
7
 
5
- def self.default_attributes
6
- super.merge(:controlGroup => 'M', :mimeType => 'text/xml')
8
+ def self.default_attributes
9
+ super.merge(:controlGroup => 'M', :mimeType => 'text/xml')
7
10
  end
8
11
 
9
12
  def self.xml_template
@@ -116,3 +119,6 @@ class StructMetadata < ::ActiveFedora::Datastream
116
119
 
117
120
  end
118
121
  end
122
+ end
123
+ end
124
+ end
@@ -1,10 +1,11 @@
1
1
  require "active-fedora"
2
+ require "active_fedora_finders"
2
3
  class DcDocument < ActiveFedora::Base
3
4
  include ::ActiveFedora::Associations
4
5
  include ::ActiveFedora::Finders
5
6
  include ::ActiveFedora::DatastreamCollections
6
7
  include Hydra::ModelMethods
7
- include Cul::Scv::Hydra::ActiveFedora::Model::Common
8
+ include Cul::Scv::Hydra::Models::Common
8
9
  alias :file_objects :resources
9
10
 
10
11
  has_many :parts, :property=>:cul_member_of, :class_name=>'ActiveFedora::Base'
@@ -1,15 +1,16 @@
1
1
  require "active-fedora"
2
+ require "active_fedora_finders"
2
3
  class GenericAggregator < ::ActiveFedora::Base
3
4
  extend ActiveModel::Callbacks
4
5
  include ::ActiveFedora::Finders
5
6
  include ::ActiveFedora::DatastreamCollections
6
7
  include ::Hydra::ModelMethods
7
- include Cul::Scv::Hydra::ActiveFedora::Model::Common
8
- include Cul::Scv::Hydra::ActiveFedora::Model::Aggregator
8
+ include Cul::Scv::Hydra::Models::Common
9
+ include Cul::Scv::Hydra::Models::Aggregator
9
10
 
10
11
  alias :file_objects :resources
11
12
 
12
13
  def route_as
13
14
  "multipartitem"
14
15
  end
15
- end
16
+ end
@@ -1,11 +1,12 @@
1
1
  require "active-fedora"
2
+ require "active_fedora_finders"
2
3
  class GenericObject < ::ActiveFedora::Base
3
4
  extend ActiveModel::Callbacks
4
5
  include ::ActiveFedora::Finders
5
6
  include ::ActiveFedora::DatastreamCollections
6
7
  include ::Hydra::ModelMethods
7
- include Cul::Scv::Hydra::ActiveFedora::Model::Common
8
- include Cul::Scv::Hydra::ActiveFedora::Model::Aggregator
8
+ include Cul::Scv::Hydra::Models::Common
9
+ include Cul::Scv::Hydra::Models::Aggregator
9
10
 
10
11
  alias :file_objects :resources
11
12
 
@@ -3,12 +3,13 @@ require "mime/types"
3
3
  require "uri"
4
4
  require "open-uri"
5
5
  require "tempfile"
6
+ require "active_fedora_finders"
6
7
  class GenericResource < ::ActiveFedora::Base
7
8
  extend ActiveModel::Callbacks
8
9
  include ::ActiveFedora::Finders
9
10
  include ::ActiveFedora::DatastreamCollections
10
11
  include ::Hydra::ModelMethods
11
- include Cul::Scv::Hydra::ActiveFedora::Model::Common
12
+ include Cul::Scv::Hydra::Models::Common
12
13
  include ::ActiveFedora::RelsInt
13
14
  alias :file_objects :resources
14
15
 
@@ -1,11 +1,12 @@
1
1
  require "active-fedora"
2
+ require "active_fedora_finders"
2
3
  class JP2ImageAggregator < ::ActiveFedora::Base
3
4
  extend ActiveModel::Callbacks
4
5
  include ::ActiveFedora::Finders
5
6
  include ::ActiveFedora::DatastreamCollections
6
7
  include ::Hydra::ModelMethods
7
- include Cul::Scv::Hydra::ActiveFedora::Model::Common
8
- include Cul::Scv::Hydra::ActiveFedora::Model::Aggregator
8
+ include Cul::Scv::Hydra::Models::Common
9
+ include Cul::Scv::Hydra::Models::Aggregator
9
10
 
10
11
  has_datastream :name => "SOURCE", :type=>::ActiveFedora::Datastream, :mimeType=>"image/jp2", :controlGroup=>'E'
11
12
 
@@ -1,11 +1,12 @@
1
1
  require "active-fedora"
2
+ require "active_fedora_finders"
2
3
  class METSStructuredAggregator < ::ActiveFedora::Base
3
4
  extend ActiveModel::Callbacks
4
5
  include ::ActiveFedora::Finders
5
6
  include ::ActiveFedora::DatastreamCollections
6
7
  include ::Hydra::ModelMethods
7
- include Cul::Scv::Hydra::ActiveFedora::Model::Common
8
- include Cul::Scv::Hydra::ActiveFedora::Model::Aggregator
8
+ include Cul::Scv::Hydra::Models::Common
9
+ include Cul::Scv::Hydra::Models::Aggregator
9
10
 
10
11
  alias :file_objects :resources
11
12
 
@@ -1,4 +1,5 @@
1
1
  require "active-fedora"
2
+ require "active_fedora_finders"
2
3
  require "cul_image_props"
3
4
  require "mime/types"
4
5
  require "uri"
@@ -7,8 +8,8 @@ class Resource < ::ActiveFedora::Base
7
8
  include ::ActiveFedora::Finders
8
9
  include ::ActiveFedora::DatastreamCollections
9
10
  include ::Hydra::ModelMethods
10
- include Cul::Scv::Hydra::ActiveFedora::Model::Common
11
- include Cul::Scv::Hydra::ActiveFedora::Model::Resource
11
+ include Cul::Scv::Hydra::Models::Common
12
+ include Cul::Scv::Hydra::Models::Resource
12
13
 
13
14
  alias :file_objects :resources
14
15
 
@@ -1,11 +1,12 @@
1
1
  require "active-fedora"
2
+ require "active_fedora_finders"
2
3
  class StaticAudioAggregator < ::ActiveFedora::Base
3
4
  extend ActiveModel::Callbacks
4
5
  include ::ActiveFedora::Finders
5
6
  include ::ActiveFedora::DatastreamCollections
6
7
  include ::Hydra::ModelMethods
7
- include Cul::Scv::Hydra::ActiveFedora::Model::Common
8
- include Cul::Scv::Hydra::ActiveFedora::Model::Aggregator
8
+ include Cul::Scv::Hydra::Models::Common
9
+ include Cul::Scv::Hydra::Models::Aggregator
9
10
 
10
11
  alias :file_objects :resources
11
12
 
@@ -1,11 +1,12 @@
1
1
  require "active-fedora"
2
+ require "active_fedora_finders"
2
3
  class StaticImageAggregator < ::ActiveFedora::Base
3
4
  extend ActiveModel::Callbacks
4
5
  include ::ActiveFedora::Finders
5
6
  include ::ActiveFedora::DatastreamCollections
6
7
  include ::Hydra::ModelMethods
7
- include Cul::Scv::Hydra::ActiveFedora::Model::Common
8
- include Cul::Scv::Hydra::ActiveFedora::Model::Aggregator
8
+ include Cul::Scv::Hydra::Models::Common
9
+ include Cul::Scv::Hydra::Models::Aggregator
9
10
 
10
11
  alias :file_objects :resources
11
12
 
data/bin/rails ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
3
+
4
+ ENGINE_ROOT = File.expand_path('../..', __FILE__)
5
+ ENGINE_PATH = File.expand_path('../../lib/cul_scv_hydra/engine', __FILE__)
6
+
7
+ # Set up gems listed in the Gemfile.
8
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
9
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
10
+
11
+ require 'rails/all'
12
+ require 'rails/engine/commands'
data/lib/cul_scv_hydra.rb CHANGED
@@ -15,7 +15,6 @@ end
15
15
  require 'hydra/head'
16
16
  require 'active_fedora_relsint'
17
17
  require "cul_scv_hydra/access_controls_enforcement"
18
- require "cul_scv_hydra/active_fedora"
19
18
  require "cul_scv_hydra/controllers"
20
19
  require "cul_scv_hydra/om"
21
20
  require "cul_scv_hydra/solrizer"
@@ -5,5 +5,20 @@ require "rails"
5
5
 
6
6
  module Cul::Scv::Hydra
7
7
  class Engine < ::Rails::Engine
8
+ isolate_namespace Cul::Scv::Hydra
9
+
10
+ config.generators do |g|
11
+ g.test_framework :rspec
12
+ g.integration_tool :rspec
13
+ end
14
+
15
+ # Make the rake tasks visible.
16
+ rake_tasks do
17
+ Dir.chdir(File.expand_path(File.join(File.dirname(__FILE__), '..'))) do
18
+ Dir.glob(File.join('tasks', '*.rake')).each do |railtie|
19
+ load railtie
20
+ end
21
+ end
22
+ end
8
23
  end
9
24
  end
@@ -6,6 +6,4 @@ module Cul
6
6
  end
7
7
  end
8
8
  end
9
- require "cul_scv_hydra/om/dc_metadata"
10
- require "cul_scv_hydra/om/scv_mods_document"
11
9
  require "cul_scv_hydra/om/standard_mods"
@@ -77,6 +77,14 @@ module Om
77
77
  builder.doc.root["xsi:schemaLocation"] = 'http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd'
78
78
  return builder.doc
79
79
  end
80
+
81
+ def prefix
82
+ if ::ActiveFedora::VERSION >= '8'
83
+ Rails.logger.warn("the prefix method of #{self.class.name} was overriden to maintain backwards compatibility")
84
+ end
85
+ ''
86
+ end
87
+
80
88
  def method_missing method, *args
81
89
  query = false
82
90
  _mname = method.id2name
@@ -1,7 +1,7 @@
1
1
  module Cul
2
2
  module Scv
3
3
  module Hydra
4
- VERSION = '0.10.0'
4
+ VERSION = '0.11.0'
5
5
  def self.version
6
6
  VERSION
7
7
  end
@@ -23,8 +23,17 @@ def each_cmodel
23
23
  end
24
24
 
25
25
  def config_subs
26
- cfile = File.open(File.join(APP_ROOT,'config','subs.yml'))
27
- YAML::load(cfile)[Rails.env]
26
+ @subs ||= begin
27
+ cfile = File.join(APP_ROOT,'config','subs.yml')
28
+ subs = {}
29
+ if File.exists? cfile
30
+ open(cfile) {|blob| subs = YAML::load(blob)[Rails.env] }
31
+ else
32
+ Rails.logger.warn("No subs.yml found; CModels will be loaded without inline substitutions")
33
+ end
34
+ subs
35
+ end
36
+ @subs
28
37
  end
29
38
 
30
39
  def do_subs(orig)
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.10.0
4
+ version: 0.11.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-21 00:00:00.000000000 Z
12
+ date: 2014-04-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: blacklight
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 4.0.0
21
+ version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,39 +26,39 @@ dependencies:
26
26
  requirements:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 4.0.0
29
+ version: '0'
30
30
  - !ruby/object:Gem::Dependency
31
- name: active-fedora
31
+ name: hydra-head
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ! '>='
35
+ - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: 6.7.0
37
+ version: '7'
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ! '>='
43
+ - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: 6.7.0
45
+ version: '7'
46
46
  - !ruby/object:Gem::Dependency
47
- name: hydra-head
47
+ name: active-fedora
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
- - - '='
51
+ - - ! '>='
52
52
  - !ruby/object:Gem::Version
53
- version: 6.4.1
53
+ version: 7.0.2
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
- - - '='
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
- version: 6.4.1
61
+ version: 7.0.2
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: active_fedora_finders
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ! '>='
68
68
  - !ruby/object:Gem::Version
69
- version: '0'
69
+ version: 0.5.0
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
- version: '0'
77
+ version: 0.5.0
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: active_fedora_relsint
80
80
  requirement: !ruby/object:Gem::Requirement
@@ -124,14 +124,14 @@ dependencies:
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  - !ruby/object:Gem::Dependency
127
- name: om
127
+ name: sqlite3
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  none: false
130
130
  requirements:
131
131
  - - ! '>='
132
132
  - !ruby/object:Gem::Version
133
133
  version: '0'
134
- type: :runtime
134
+ type: :development
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  none: false
@@ -139,22 +139,6 @@ dependencies:
139
139
  - - ! '>='
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
- - !ruby/object:Gem::Dependency
143
- name: solrizer
144
- requirement: !ruby/object:Gem::Requirement
145
- none: false
146
- requirements:
147
- - - ~>
148
- - !ruby/object:Gem::Version
149
- version: '3.0'
150
- type: :runtime
151
- prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
- requirements:
155
- - - ~>
156
- - !ruby/object:Gem::Version
157
- version: '3.0'
158
142
  - !ruby/object:Gem::Dependency
159
143
  name: rspec
160
144
  requirement: !ruby/object:Gem::Requirement
@@ -187,22 +171,6 @@ dependencies:
187
171
  - - ~>
188
172
  - !ruby/object:Gem::Version
189
173
  version: '2.10'
190
- - !ruby/object:Gem::Dependency
191
- name: mocha
192
- requirement: !ruby/object:Gem::Requirement
193
- none: false
194
- requirements:
195
- - - '='
196
- - !ruby/object:Gem::Version
197
- version: 0.12.7
198
- type: :development
199
- prerelease: false
200
- version_requirements: !ruby/object:Gem::Requirement
201
- none: false
202
- requirements:
203
- - - '='
204
- - !ruby/object:Gem::Version
205
- version: 0.12.7
206
174
  - !ruby/object:Gem::Dependency
207
175
  name: equivalent-xml
208
176
  requirement: !ruby/object:Gem::Requirement
@@ -235,21 +203,14 @@ dependencies:
235
203
  - - ! '>='
236
204
  - !ruby/object:Gem::Version
237
205
  version: '0'
238
- description: ActiveFedora, OM, and Solrizer implementations for CUL Staff Collection
239
- Viewer
206
+ description: Hydra implementations for CUL Staff Collection Viewer
240
207
  email: armintor@gmail.com
241
208
  executables: []
242
209
  extensions: []
243
210
  extra_rdoc_files: []
244
211
  files:
212
+ - bin/rails
245
213
  - lib/cul_scv_hydra/access_controls_enforcement.rb
246
- - lib/cul_scv_hydra/active_fedora/model/aggregator.rb
247
- - lib/cul_scv_hydra/active_fedora/model/common.rb
248
- - lib/cul_scv_hydra/active_fedora/model/nokogiri_datastreams.rb
249
- - lib/cul_scv_hydra/active_fedora/model/resource.rb
250
- - lib/cul_scv_hydra/active_fedora/model/struct_metadata.rb
251
- - lib/cul_scv_hydra/active_fedora/model.rb
252
- - lib/cul_scv_hydra/active_fedora.rb
253
214
  - lib/cul_scv_hydra/controllers/aggregates.rb
254
215
  - lib/cul_scv_hydra/controllers/aggregator_controller_helper.rb
255
216
  - lib/cul_scv_hydra/controllers/catalog.rb
@@ -269,8 +230,6 @@ files:
269
230
  - lib/cul_scv_hydra/controllers/terms.rb
270
231
  - lib/cul_scv_hydra/controllers.rb
271
232
  - lib/cul_scv_hydra/engine.rb
272
- - lib/cul_scv_hydra/om/dc_metadata.rb
273
- - lib/cul_scv_hydra/om/scv_mods_document.rb
274
233
  - lib/cul_scv_hydra/om/standard_mods.rb
275
234
  - lib/cul_scv_hydra/om.rb
276
235
  - lib/cul_scv_hydra/solrizer/extractor.rb
@@ -297,7 +256,15 @@ files:
297
256
  - app/assets/images/cul_scv_hydra/crystal/multimedia2.png
298
257
  - app/assets/images/cul_scv_hydra/crystal/video.png
299
258
  - app/models/bag_aggregator.rb
259
+ - app/models/concerns/cul/scv/hydra/models/aggregator.rb
260
+ - app/models/concerns/cul/scv/hydra/models/common.rb
261
+ - app/models/concerns/cul/scv/hydra/models/resource.rb
262
+ - app/models/concerns/cul/scv/hydra/models.rb
263
+ - app/models/concerns/cul.rb
300
264
  - app/models/content_aggregator.rb
265
+ - app/models/cul/scv/hydra/datastreams/dc_metadata.rb
266
+ - app/models/cul/scv/hydra/datastreams/mods_document.rb
267
+ - app/models/cul/scv/hydra/datastreams/struct_metadata.rb
301
268
  - app/models/dcdocument.rb
302
269
  - app/models/generic_aggregator.rb
303
270
  - app/models/generic_object.rb
@@ -318,6 +285,7 @@ post_install_message:
318
285
  rdoc_options: []
319
286
  require_paths:
320
287
  - lib
288
+ - fixtures
321
289
  required_ruby_version: !ruby/object:Gem::Requirement
322
290
  none: false
323
291
  requirements: