active-fedora 11.0.0.rc1 → 11.0.0
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/.gitignore +1 -0
- data/.rubocop.yml +2 -7
- data/.rubocop_todo.yml +40 -9
- data/.solr_wrapper +6 -0
- data/README.md +1 -3
- data/active-fedora.gemspec +5 -9
- data/lib/active_fedora/associations/collection_association.rb +1 -1
- data/lib/active_fedora/associations/contained_finder.rb +2 -2
- data/lib/active_fedora/associations/has_many_association.rb +1 -1
- data/lib/active_fedora/associations/has_subresource_association.rb +2 -2
- data/lib/active_fedora/attribute_assignment.rb +0 -1
- data/lib/active_fedora/attributes.rb +1 -1
- data/lib/active_fedora/base.rb +3 -7
- data/lib/active_fedora/change_set.rb +6 -2
- data/lib/active_fedora/containers/container.rb +1 -1
- data/lib/active_fedora/core.rb +22 -25
- data/lib/active_fedora/fedora_attributes.rb +1 -1
- data/lib/active_fedora/file.rb +1 -1
- data/lib/active_fedora/indexing_service.rb +0 -4
- data/lib/active_fedora/orders/ordered_list.rb +2 -2
- data/lib/active_fedora/querying.rb +1 -1
- data/lib/active_fedora/railtie.rb +2 -2
- data/lib/active_fedora/rake_support.rb +1 -1
- data/lib/active_fedora/rdf.rb +0 -1
- data/lib/active_fedora/relation/delegation.rb +4 -0
- data/lib/active_fedora/solr_hit.rb +0 -4
- data/lib/active_fedora/solr_query_builder.rb +16 -12
- data/lib/active_fedora/version.rb +1 -1
- data/lib/active_fedora.rb +0 -10
- data/lib/generators/active_fedora/config/solr/templates/solr/config/solrconfig.xml +11 -0
- data/lib/generators/active_fedora/config/solr/templates/solr_wrapper_test.yml +1 -1
- data/spec/config_helper.rb +1 -1
- data/spec/integration/associations_spec.rb +17 -18
- data/spec/integration/attached_files_spec.rb +18 -8
- data/spec/integration/attributes_spec.rb +12 -16
- data/spec/integration/autosave_association_spec.rb +6 -6
- data/spec/integration/base_spec.rb +3 -3
- data/spec/integration/collection_association_spec.rb +2 -5
- data/spec/integration/date_time_properties_spec.rb +1 -2
- data/spec/integration/direct_container_spec.rb +8 -8
- data/spec/integration/directly_contains_one_association_spec.rb +11 -13
- data/spec/integration/eradicate_spec.rb +1 -1
- data/spec/integration/fedora_solr_sync_spec.rb +2 -2
- data/spec/integration/file_fixity_spec.rb +6 -8
- data/spec/integration/file_spec.rb +32 -34
- data/spec/integration/generators/solr_generator_spec.rb +7 -10
- data/spec/integration/has_many_associations_spec.rb +6 -8
- data/spec/integration/indexing_spec.rb +1 -1
- data/spec/integration/indirect_container_spec.rb +8 -9
- data/spec/integration/json_serialization_spec.rb +4 -4
- data/spec/integration/query_result_builder_spec.rb +9 -21
- data/spec/integration/rdf_nested_attributes_spec.rb +6 -6
- data/spec/integration/relation_delegation_spec.rb +8 -10
- data/spec/integration/relation_spec.rb +13 -16
- data/spec/integration/solr_hit_spec.rb +4 -4
- data/spec/integration/versionable_spec.rb +73 -327
- data/spec/spec_helper.rb +52 -10
- data/spec/unit/active_fedora_spec.rb +1 -1
- data/spec/unit/aggregation/list_source_spec.rb +37 -37
- data/spec/unit/aggregation/ordered_reader_spec.rb +4 -4
- data/spec/unit/association_hash_spec.rb +17 -31
- data/spec/unit/attached_files_spec.rb +35 -32
- data/spec/unit/attributes_spec.rb +25 -25
- data/spec/unit/base_active_model_spec.rb +8 -8
- data/spec/unit/base_cma_spec.rb +1 -1
- data/spec/unit/base_extra_spec.rb +7 -22
- data/spec/unit/base_spec.rb +14 -20
- data/spec/unit/callback_spec.rb +2 -2
- data/spec/unit/change_set_spec.rb +5 -5
- data/spec/unit/checksum_spec.rb +2 -2
- data/spec/unit/code_configurator_spec.rb +1 -1
- data/spec/unit/core_spec.rb +62 -26
- data/spec/unit/default_model_mapper_spec.rb +6 -6
- data/spec/unit/fedora_spec.rb +2 -2
- data/spec/unit/file_configurator_spec.rb +96 -96
- data/spec/unit/file_path_builder_spec.rb +1 -1
- data/spec/unit/file_spec.rb +61 -61
- data/spec/unit/files_hash_spec.rb +9 -9
- data/spec/unit/finder_methods_spec.rb +3 -3
- data/spec/unit/has_and_belongs_to_many_association_spec.rb +13 -14
- data/spec/unit/has_many_association_spec.rb +28 -13
- data/spec/unit/indexers/global_indexer_spec.rb +6 -6
- data/spec/unit/indexing_service_spec.rb +5 -5
- data/spec/unit/indexing_spec.rb +6 -6
- data/spec/unit/inheritance_spec.rb +11 -7
- data/spec/unit/loadable_from_json_spec.rb +4 -4
- data/spec/unit/logger_spec.rb +1 -1
- data/spec/unit/model_classifier_spec.rb +5 -5
- data/spec/unit/ordered_spec.rb +142 -142
- data/spec/unit/orders/list_node_spec.rb +21 -21
- data/spec/unit/orders/ordered_list_spec.rb +96 -96
- data/spec/unit/orders/reflection_spec.rb +4 -4
- data/spec/unit/pathing_spec.rb +4 -4
- data/spec/unit/persistence_spec.rb +28 -28
- data/spec/unit/property_spec.rb +2 -2
- data/spec/unit/query_spec.rb +10 -10
- data/spec/unit/rdf/indexing_service_spec.rb +26 -26
- data/spec/unit/readonly_spec.rb +5 -4
- data/spec/unit/reflection_spec.rb +3 -3
- data/spec/unit/rspec_matchers/belong_to_associated_active_fedora_object_matcher_spec.rb +9 -9
- data/spec/unit/rspec_matchers/have_many_associated_active_fedora_objects_matcher_spec.rb +9 -9
- data/spec/unit/rspec_matchers/have_predicate_matcher_spec.rb +9 -9
- data/spec/unit/schema_indexing_strategy_spec.rb +5 -5
- data/spec/unit/serializers_spec.rb +3 -4
- data/spec/unit/solr_config_options_spec.rb +13 -16
- data/spec/unit/solr_hit_spec.rb +9 -9
- data/spec/unit/solr_service_spec.rb +4 -10
- data/spec/unit/sparql_insert_spec.rb +2 -2
- data/spec/unit/validations_spec.rb +9 -9
- data/spec/unit/with_metadata/default_metadata_class_factory_spec.rb +3 -2
- data/spec/unit/with_metadata/metadata_node_spec.rb +3 -2
- metadata +17 -118
- data/lib/active_fedora/datastreams/nokogiri_datastreams.rb +0 -119
- data/lib/active_fedora/datastreams.rb +0 -6
- data/lib/active_fedora/nom_datastream.rb +0 -73
- data/lib/active_fedora/om_datastream.rb +0 -118
- data/lib/active_fedora/qualified_dublin_core_datastream.rb +0 -158
- data/lib/active_fedora/rdf/datastream_indexing.rb +0 -49
- data/lib/active_fedora/rdf/ntriples_rdf_datastream.rb +0 -13
- data/lib/active_fedora/rdf/rdf_datastream.rb +0 -173
- data/lib/active_fedora/rdf/rdfxml_datastream.rb +0 -13
- data/solr/config/_rest_managed.json +0 -3
- data/solr/config/admin-extra.html +0 -31
- data/solr/config/elevate.xml +0 -36
- data/solr/config/mapping-ISOLatin1Accent.txt +0 -246
- data/solr/config/protwords.txt +0 -21
- data/solr/config/schema.xml +0 -372
- data/solr/config/scripts.conf +0 -24
- data/solr/config/solrconfig.xml +0 -311
- data/solr/config/spellings.txt +0 -2
- data/solr/config/stopwords.txt +0 -58
- data/solr/config/stopwords_en.txt +0 -58
- data/solr/config/synonyms.txt +0 -31
- data/solr/config/xslt/example.xsl +0 -132
- data/solr/config/xslt/example_atom.xsl +0 -67
- data/solr/config/xslt/example_rss.xsl +0 -66
- data/solr/config/xslt/luke.xsl +0 -337
- data/spec/fixtures/damsObjectModel.xml +0 -38
- data/spec/fixtures/dublin_core_rdf_descMetadata.nt +0 -13
- data/spec/fixtures/mixed_rdf_descMetadata.nt +0 -7
- data/spec/fixtures/mods_articles/mods_article1.xml +0 -98
- data/spec/fixtures/solr_rdf_descMetadata.nt +0 -7
- data/spec/integration/complex_rdf_datastream_spec.rb +0 -227
- data/spec/integration/datastream_rdf_nested_attributes_spec.rb +0 -180
- data/spec/integration/ntriples_datastream_spec.rb +0 -215
- data/spec/integration/om_datastream_spec.rb +0 -78
- data/spec/samples/hydra-mods_article_datastream.rb +0 -515
- data/spec/samples/models/mods_article.rb +0 -9
- data/spec/samples/oral_history_sample.xml +0 -38
- data/spec/samples/oral_history_xml.xml +0 -35
- data/spec/samples/samples.rb +0 -2
- data/spec/unit/nom_datastream_spec.rb +0 -60
- data/spec/unit/ntriples_datastream_spec.rb +0 -167
- data/spec/unit/om_datastream_spec.rb +0 -294
- data/spec/unit/qualified_dublin_core_datastream_spec.rb +0 -119
- data/spec/unit/rdf_datastream_spec.rb +0 -84
- data/spec/unit/rdf_resource_datastream_spec.rb +0 -208
- data/spec/unit/rdfxml_datastream_spec.rb +0 -106
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active-fedora
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 11.0.0
|
|
4
|
+
version: 11.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Zumwalt
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2016-
|
|
13
|
+
date: 2016-09-13 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rsolr
|
|
@@ -18,20 +18,20 @@ dependencies:
|
|
|
18
18
|
requirements:
|
|
19
19
|
- - "~>"
|
|
20
20
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: '1.
|
|
21
|
+
version: '1.1'
|
|
22
22
|
- - ">="
|
|
23
23
|
- !ruby/object:Gem::Version
|
|
24
|
-
version: 1.
|
|
24
|
+
version: 1.1.2
|
|
25
25
|
type: :runtime
|
|
26
26
|
prerelease: false
|
|
27
27
|
version_requirements: !ruby/object:Gem::Requirement
|
|
28
28
|
requirements:
|
|
29
29
|
- - "~>"
|
|
30
30
|
- !ruby/object:Gem::Version
|
|
31
|
-
version: '1.
|
|
31
|
+
version: '1.1'
|
|
32
32
|
- - ">="
|
|
33
33
|
- !ruby/object:Gem::Version
|
|
34
|
-
version: 1.
|
|
34
|
+
version: 1.1.2
|
|
35
35
|
- !ruby/object:Gem::Dependency
|
|
36
36
|
name: solrizer
|
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -46,34 +46,6 @@ dependencies:
|
|
|
46
46
|
- - "~>"
|
|
47
47
|
- !ruby/object:Gem::Version
|
|
48
48
|
version: '3.4'
|
|
49
|
-
- !ruby/object:Gem::Dependency
|
|
50
|
-
name: om
|
|
51
|
-
requirement: !ruby/object:Gem::Requirement
|
|
52
|
-
requirements:
|
|
53
|
-
- - "~>"
|
|
54
|
-
- !ruby/object:Gem::Version
|
|
55
|
-
version: '3.1'
|
|
56
|
-
type: :runtime
|
|
57
|
-
prerelease: false
|
|
58
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
59
|
-
requirements:
|
|
60
|
-
- - "~>"
|
|
61
|
-
- !ruby/object:Gem::Version
|
|
62
|
-
version: '3.1'
|
|
63
|
-
- !ruby/object:Gem::Dependency
|
|
64
|
-
name: nom-xml
|
|
65
|
-
requirement: !ruby/object:Gem::Requirement
|
|
66
|
-
requirements:
|
|
67
|
-
- - ">="
|
|
68
|
-
- !ruby/object:Gem::Version
|
|
69
|
-
version: 0.5.1
|
|
70
|
-
type: :runtime
|
|
71
|
-
prerelease: false
|
|
72
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
73
|
-
requirements:
|
|
74
|
-
- - ">="
|
|
75
|
-
- !ruby/object:Gem::Version
|
|
76
|
-
version: 0.5.1
|
|
77
49
|
- !ruby/object:Gem::Dependency
|
|
78
50
|
name: activesupport
|
|
79
51
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -120,42 +92,14 @@ dependencies:
|
|
|
120
92
|
requirements:
|
|
121
93
|
- - "~>"
|
|
122
94
|
- !ruby/object:Gem::Version
|
|
123
|
-
version: 0.
|
|
95
|
+
version: 0.11.0
|
|
124
96
|
type: :runtime
|
|
125
97
|
prerelease: false
|
|
126
98
|
version_requirements: !ruby/object:Gem::Requirement
|
|
127
99
|
requirements:
|
|
128
100
|
- - "~>"
|
|
129
101
|
- !ruby/object:Gem::Version
|
|
130
|
-
version: 0.
|
|
131
|
-
- !ruby/object:Gem::Dependency
|
|
132
|
-
name: rdf-rdfxml
|
|
133
|
-
requirement: !ruby/object:Gem::Requirement
|
|
134
|
-
requirements:
|
|
135
|
-
- - ">="
|
|
136
|
-
- !ruby/object:Gem::Version
|
|
137
|
-
version: '0'
|
|
138
|
-
type: :runtime
|
|
139
|
-
prerelease: false
|
|
140
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
141
|
-
requirements:
|
|
142
|
-
- - ">="
|
|
143
|
-
- !ruby/object:Gem::Version
|
|
144
|
-
version: '0'
|
|
145
|
-
- !ruby/object:Gem::Dependency
|
|
146
|
-
name: linkeddata
|
|
147
|
-
requirement: !ruby/object:Gem::Requirement
|
|
148
|
-
requirements:
|
|
149
|
-
- - ">="
|
|
150
|
-
- !ruby/object:Gem::Version
|
|
151
|
-
version: '0'
|
|
152
|
-
type: :runtime
|
|
153
|
-
prerelease: false
|
|
154
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
155
|
-
requirements:
|
|
156
|
-
- - ">="
|
|
157
|
-
- !ruby/object:Gem::Version
|
|
158
|
-
version: '0'
|
|
102
|
+
version: 0.11.0
|
|
159
103
|
- !ruby/object:Gem::Dependency
|
|
160
104
|
name: deprecation
|
|
161
105
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -176,14 +120,14 @@ dependencies:
|
|
|
176
120
|
requirements:
|
|
177
121
|
- - "~>"
|
|
178
122
|
- !ruby/object:Gem::Version
|
|
179
|
-
version: 0.
|
|
123
|
+
version: 0.6.0
|
|
180
124
|
type: :runtime
|
|
181
125
|
prerelease: false
|
|
182
126
|
version_requirements: !ruby/object:Gem::Requirement
|
|
183
127
|
requirements:
|
|
184
128
|
- - "~>"
|
|
185
129
|
- !ruby/object:Gem::Version
|
|
186
|
-
version: 0.
|
|
130
|
+
version: 0.6.0
|
|
187
131
|
- !ruby/object:Gem::Dependency
|
|
188
132
|
name: rails
|
|
189
133
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -246,14 +190,14 @@ dependencies:
|
|
|
246
190
|
requirements:
|
|
247
191
|
- - "~>"
|
|
248
192
|
- !ruby/object:Gem::Version
|
|
249
|
-
version: '0.
|
|
193
|
+
version: '0.15'
|
|
250
194
|
type: :development
|
|
251
195
|
prerelease: false
|
|
252
196
|
version_requirements: !ruby/object:Gem::Requirement
|
|
253
197
|
requirements:
|
|
254
198
|
- - "~>"
|
|
255
199
|
- !ruby/object:Gem::Version
|
|
256
|
-
version: '0.
|
|
200
|
+
version: '0.15'
|
|
257
201
|
- !ruby/object:Gem::Dependency
|
|
258
202
|
name: fcrepo_wrapper
|
|
259
203
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -344,14 +288,14 @@ dependencies:
|
|
|
344
288
|
requirements:
|
|
345
289
|
- - "~>"
|
|
346
290
|
- !ruby/object:Gem::Version
|
|
347
|
-
version: '1.
|
|
291
|
+
version: '1.6'
|
|
348
292
|
type: :development
|
|
349
293
|
prerelease: false
|
|
350
294
|
version_requirements: !ruby/object:Gem::Requirement
|
|
351
295
|
requirements:
|
|
352
296
|
- - "~>"
|
|
353
297
|
- !ruby/object:Gem::Version
|
|
354
|
-
version: '1.
|
|
298
|
+
version: '1.6'
|
|
355
299
|
description: ActiveFedora provides for creating and managing objects in the Fedora
|
|
356
300
|
Repository Architecture.
|
|
357
301
|
email:
|
|
@@ -368,6 +312,7 @@ files:
|
|
|
368
312
|
- ".rspec"
|
|
369
313
|
- ".rubocop.yml"
|
|
370
314
|
- ".rubocop_todo.yml"
|
|
315
|
+
- ".solr_wrapper"
|
|
371
316
|
- ".travis.yml"
|
|
372
317
|
- CONTRIBUTING.md
|
|
373
318
|
- CONTRIBUTORS.md
|
|
@@ -458,8 +403,6 @@ files:
|
|
|
458
403
|
- lib/active_fedora/core.rb
|
|
459
404
|
- lib/active_fedora/core/fedora_id_translator.rb
|
|
460
405
|
- lib/active_fedora/core/fedora_uri_translator.rb
|
|
461
|
-
- lib/active_fedora/datastreams.rb
|
|
462
|
-
- lib/active_fedora/datastreams/nokogiri_datastreams.rb
|
|
463
406
|
- lib/active_fedora/default_model_mapper.rb
|
|
464
407
|
- lib/active_fedora/delegated_attribute.rb
|
|
465
408
|
- lib/active_fedora/errors.rb
|
|
@@ -493,9 +436,7 @@ files:
|
|
|
493
436
|
- lib/active_fedora/log_subscriber.rb
|
|
494
437
|
- lib/active_fedora/model_classifier.rb
|
|
495
438
|
- lib/active_fedora/nested_attributes.rb
|
|
496
|
-
- lib/active_fedora/nom_datastream.rb
|
|
497
439
|
- lib/active_fedora/null_relation.rb
|
|
498
|
-
- lib/active_fedora/om_datastream.rb
|
|
499
440
|
- lib/active_fedora/orders.rb
|
|
500
441
|
- lib/active_fedora/orders/collection_proxy.rb
|
|
501
442
|
- lib/active_fedora/orders/list_node.rb
|
|
@@ -504,22 +445,17 @@ files:
|
|
|
504
445
|
- lib/active_fedora/pathing.rb
|
|
505
446
|
- lib/active_fedora/persistence.rb
|
|
506
447
|
- lib/active_fedora/property.rb
|
|
507
|
-
- lib/active_fedora/qualified_dublin_core_datastream.rb
|
|
508
448
|
- lib/active_fedora/query_result_builder.rb
|
|
509
449
|
- lib/active_fedora/querying.rb
|
|
510
450
|
- lib/active_fedora/railtie.rb
|
|
511
451
|
- lib/active_fedora/rake_support.rb
|
|
512
452
|
- lib/active_fedora/rdf.rb
|
|
513
|
-
- lib/active_fedora/rdf/datastream_indexing.rb
|
|
514
453
|
- lib/active_fedora/rdf/fcrepo.rb
|
|
515
454
|
- lib/active_fedora/rdf/field_map.rb
|
|
516
455
|
- lib/active_fedora/rdf/field_map_entry.rb
|
|
517
456
|
- lib/active_fedora/rdf/indexing_service.rb
|
|
518
|
-
- lib/active_fedora/rdf/ntriples_rdf_datastream.rb
|
|
519
457
|
- lib/active_fedora/rdf/persistence.rb
|
|
520
458
|
- lib/active_fedora/rdf/project_hydra.rb
|
|
521
|
-
- lib/active_fedora/rdf/rdf_datastream.rb
|
|
522
|
-
- lib/active_fedora/rdf/rdfxml_datastream.rb
|
|
523
459
|
- lib/active_fedora/reflection.rb
|
|
524
460
|
- lib/active_fedora/relation.rb
|
|
525
461
|
- lib/active_fedora/relation/calculations.rb
|
|
@@ -593,37 +529,16 @@ files:
|
|
|
593
529
|
- script/console
|
|
594
530
|
- script/destroy
|
|
595
531
|
- script/generate
|
|
596
|
-
- solr/config/_rest_managed.json
|
|
597
|
-
- solr/config/admin-extra.html
|
|
598
|
-
- solr/config/elevate.xml
|
|
599
|
-
- solr/config/mapping-ISOLatin1Accent.txt
|
|
600
|
-
- solr/config/protwords.txt
|
|
601
|
-
- solr/config/schema.xml
|
|
602
|
-
- solr/config/scripts.conf
|
|
603
|
-
- solr/config/solrconfig.xml
|
|
604
|
-
- solr/config/spellings.txt
|
|
605
|
-
- solr/config/stopwords.txt
|
|
606
|
-
- solr/config/stopwords_en.txt
|
|
607
|
-
- solr/config/synonyms.txt
|
|
608
|
-
- solr/config/xslt/example.xsl
|
|
609
|
-
- solr/config/xslt/example_atom.xsl
|
|
610
|
-
- solr/config/xslt/example_rss.xsl
|
|
611
|
-
- solr/config/xslt/luke.xsl
|
|
612
532
|
- spec/config_helper.rb
|
|
613
|
-
- spec/fixtures/damsObjectModel.xml
|
|
614
533
|
- spec/fixtures/dino.jpg
|
|
615
534
|
- spec/fixtures/dino_jpg_no_file_ext
|
|
616
|
-
- spec/fixtures/dublin_core_rdf_descMetadata.nt
|
|
617
535
|
- spec/fixtures/minivan.jpg
|
|
618
|
-
- spec/fixtures/mixed_rdf_descMetadata.nt
|
|
619
|
-
- spec/fixtures/mods_articles/mods_article1.xml
|
|
620
536
|
- spec/fixtures/rails_root/config/fake_fedora.yml
|
|
621
537
|
- spec/fixtures/rails_root/config/fedora.yml
|
|
622
538
|
- spec/fixtures/rails_root/config/solr.yml
|
|
623
539
|
- spec/fixtures/rails_root/config/solr_mappings.yml
|
|
624
540
|
- spec/fixtures/rails_root/config/solr_mappings_af_0.1.yml
|
|
625
541
|
- spec/fixtures/rails_root/config/solr_mappings_bl_2.4.yml
|
|
626
|
-
- spec/fixtures/solr_rdf_descMetadata.nt
|
|
627
542
|
- spec/integration/associations/rdf_spec.rb
|
|
628
543
|
- spec/integration/associations_spec.rb
|
|
629
544
|
- spec/integration/attached_files_spec.rb
|
|
@@ -635,8 +550,6 @@ files:
|
|
|
635
550
|
- spec/integration/caching_spec.rb
|
|
636
551
|
- spec/integration/clean_connection_spec.rb
|
|
637
552
|
- spec/integration/collection_association_spec.rb
|
|
638
|
-
- spec/integration/complex_rdf_datastream_spec.rb
|
|
639
|
-
- spec/integration/datastream_rdf_nested_attributes_spec.rb
|
|
640
553
|
- spec/integration/date_time_properties_spec.rb
|
|
641
554
|
- spec/integration/delete_all_spec.rb
|
|
642
555
|
- spec/integration/direct_container_spec.rb
|
|
@@ -657,8 +570,6 @@ files:
|
|
|
657
570
|
- spec/integration/marshal_spec.rb
|
|
658
571
|
- spec/integration/nested_attribute_spec.rb
|
|
659
572
|
- spec/integration/nested_hash_resources_spec.rb
|
|
660
|
-
- spec/integration/ntriples_datastream_spec.rb
|
|
661
|
-
- spec/integration/om_datastream_spec.rb
|
|
662
573
|
- spec/integration/persistence_spec.rb
|
|
663
574
|
- spec/integration/query_result_builder_spec.rb
|
|
664
575
|
- spec/integration/rdf_nested_attributes_spec.rb
|
|
@@ -670,11 +581,6 @@ files:
|
|
|
670
581
|
- spec/integration/versionable_spec.rb
|
|
671
582
|
- spec/integration/with_metadata_spec.rb
|
|
672
583
|
- spec/rcov.opts
|
|
673
|
-
- spec/samples/hydra-mods_article_datastream.rb
|
|
674
|
-
- spec/samples/models/mods_article.rb
|
|
675
|
-
- spec/samples/oral_history_sample.xml
|
|
676
|
-
- spec/samples/oral_history_xml.xml
|
|
677
|
-
- spec/samples/samples.rb
|
|
678
584
|
- spec/spec.opts
|
|
679
585
|
- spec/spec_helper.rb
|
|
680
586
|
- spec/support/an_active_model.rb
|
|
@@ -719,9 +625,6 @@ files:
|
|
|
719
625
|
- spec/unit/loadable_from_json_spec.rb
|
|
720
626
|
- spec/unit/logger_spec.rb
|
|
721
627
|
- spec/unit/model_classifier_spec.rb
|
|
722
|
-
- spec/unit/nom_datastream_spec.rb
|
|
723
|
-
- spec/unit/ntriples_datastream_spec.rb
|
|
724
|
-
- spec/unit/om_datastream_spec.rb
|
|
725
628
|
- spec/unit/ordered_spec.rb
|
|
726
629
|
- spec/unit/orders/list_node_spec.rb
|
|
727
630
|
- spec/unit/orders/ordered_list_spec.rb
|
|
@@ -730,15 +633,11 @@ files:
|
|
|
730
633
|
- spec/unit/persistence_spec.rb
|
|
731
634
|
- spec/unit/property_predicate_spec.rb
|
|
732
635
|
- spec/unit/property_spec.rb
|
|
733
|
-
- spec/unit/qualified_dublin_core_datastream_spec.rb
|
|
734
636
|
- spec/unit/query_result_builder_spec.rb
|
|
735
637
|
- spec/unit/query_spec.rb
|
|
736
638
|
- spec/unit/querying_spec.rb
|
|
737
639
|
- spec/unit/rdf/indexing_service_spec.rb
|
|
738
|
-
- spec/unit/rdf_datastream_spec.rb
|
|
739
|
-
- spec/unit/rdf_resource_datastream_spec.rb
|
|
740
640
|
- spec/unit/rdf_vocab_spec.rb
|
|
741
|
-
- spec/unit/rdfxml_datastream_spec.rb
|
|
742
641
|
- spec/unit/readonly_spec.rb
|
|
743
642
|
- spec/unit/reflection_spec.rb
|
|
744
643
|
- spec/unit/rspec_matchers/belong_to_associated_active_fedora_object_matcher_spec.rb
|
|
@@ -770,9 +669,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
770
669
|
version: '2.0'
|
|
771
670
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
772
671
|
requirements:
|
|
773
|
-
- - "
|
|
672
|
+
- - ">="
|
|
774
673
|
- !ruby/object:Gem::Version
|
|
775
|
-
version:
|
|
674
|
+
version: '0'
|
|
776
675
|
requirements: []
|
|
777
676
|
rubyforge_project:
|
|
778
677
|
rubygems_version: 2.5.1
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
module ActiveFedora
|
|
2
|
-
module Datastreams
|
|
3
|
-
module NokogiriDatastreams
|
|
4
|
-
extend ActiveSupport::Concern
|
|
5
|
-
|
|
6
|
-
module ClassMethods
|
|
7
|
-
def xml_template
|
|
8
|
-
Nokogiri::XML::Document.parse("<xml/>")
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def decorate_ng_xml(xml)
|
|
12
|
-
xml
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def ng_xml
|
|
17
|
-
@ng_xml ||= begin
|
|
18
|
-
xml = if new_record?
|
|
19
|
-
## Load up the template
|
|
20
|
-
self.class.xml_template
|
|
21
|
-
else
|
|
22
|
-
Nokogiri::XML::Document.parse(remote_content)
|
|
23
|
-
end
|
|
24
|
-
self.class.decorate_ng_xml xml
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def ng_xml=(new_xml)
|
|
29
|
-
# before we set ng_xml, we load the datastream so we know if the new value differs.
|
|
30
|
-
# TODO reinstate this
|
|
31
|
-
# local_or_remote_content(true)
|
|
32
|
-
|
|
33
|
-
case new_xml
|
|
34
|
-
when Nokogiri::XML::Document
|
|
35
|
-
self.content = new_xml.to_xml
|
|
36
|
-
when Nokogiri::XML::Node
|
|
37
|
-
## Cast a fragment to a document
|
|
38
|
-
self.content = new_xml.to_s
|
|
39
|
-
when String
|
|
40
|
-
self.content = new_xml
|
|
41
|
-
else
|
|
42
|
-
raise TypeError, "You passed a #{new_xml.class} into the ng_xml of the #{dsid} datastream. OmDatastream.ng_xml= only accepts Nokogiri::XML::Document, Nokogiri::XML::Element, Nokogiri::XML::Node, or raw XML (String) as inputs."
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def refresh_attributes
|
|
47
|
-
changed_attributes.clear
|
|
48
|
-
@ng_xml = nil
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
# don't want content eagerly loaded by proxy, so implementing methods that would be implemented by define_attribute_methods
|
|
52
|
-
def ng_xml_will_change!
|
|
53
|
-
changed_attributes['ng_xml'] = nil
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def ng_xml_doesnt_change!
|
|
57
|
-
changed_attributes.delete('ng_xml')
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
# don't want content eagerly loaded by proxy, so implementing methods that would be implemented by define_attribute_methods
|
|
61
|
-
def ng_xml_changed?
|
|
62
|
-
changed_attributes.key? 'ng_xml'
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
def remote_content
|
|
66
|
-
@ds_content ||= Nokogiri::XML(super).to_xml(&:no_declaration).strip
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
def content=(new_content)
|
|
70
|
-
if remote_content != new_content.to_s
|
|
71
|
-
ng_xml_will_change!
|
|
72
|
-
@ng_xml = Nokogiri::XML::Document.parse(new_content)
|
|
73
|
-
super(@ng_xml.to_s.strip)
|
|
74
|
-
end
|
|
75
|
-
self.class.decorate_ng_xml @ng_xml
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
def content_changed?
|
|
79
|
-
return true if autocreate? && new_record?
|
|
80
|
-
return false unless xml_loaded
|
|
81
|
-
ng_xml_changed?
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
def to_xml(xml = nil)
|
|
85
|
-
xml = ng_xml if xml.nil?
|
|
86
|
-
ng_xml = self.ng_xml
|
|
87
|
-
if ng_xml.respond_to?(:root) && ng_xml.root.nil? && self.class.respond_to?(:root_property_ref) && !self.class.root_property_ref.nil?
|
|
88
|
-
ng_xml = self.class.generate(self.class.root_property_ref, "")
|
|
89
|
-
xml = ng_xml if xml.root.nil?
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
unless xml == ng_xml || ng_xml.root.nil?
|
|
93
|
-
if xml.is_a?(Nokogiri::XML::Document)
|
|
94
|
-
xml.root.add_child(ng_xml.root)
|
|
95
|
-
elsif xml.is_a?(Nokogiri::XML::Node)
|
|
96
|
-
xml.add_child(ng_xml.root)
|
|
97
|
-
else
|
|
98
|
-
raise "You can only pass instances of Nokogiri::XML::Node into this method. You passed in #{xml}"
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
xml.to_xml.strip
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
def content
|
|
106
|
-
@content = to_xml if ng_xml_changed? || autocreate?
|
|
107
|
-
super
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
def autocreate?
|
|
111
|
-
changed_attributes.key? :profile
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
def xml_loaded
|
|
115
|
-
instance_variable_defined? :@ng_xml
|
|
116
|
-
end
|
|
117
|
-
end
|
|
118
|
-
end
|
|
119
|
-
end
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
require "nom"
|
|
2
|
-
|
|
3
|
-
module ActiveFedora
|
|
4
|
-
class NomDatastream < File
|
|
5
|
-
include Datastreams::NokogiriDatastreams
|
|
6
|
-
extend Deprecation
|
|
7
|
-
|
|
8
|
-
def self.set_terminology(options = {}, &block)
|
|
9
|
-
@terminology_options = options || {}
|
|
10
|
-
@terminology = block
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def initialize(*args)
|
|
14
|
-
super
|
|
15
|
-
Deprecation.warn(NomDatastream, "NomDatastream is deprecated and will be removed in ActiveFedora 11")
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
class << self
|
|
19
|
-
attr_reader :terminology_options
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
class << self
|
|
23
|
-
attr_reader :terminology
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def self.decorate_ng_xml(xml)
|
|
27
|
-
xml.set_terminology terminology_options, &terminology
|
|
28
|
-
xml.nom!
|
|
29
|
-
xml
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def serialize!
|
|
33
|
-
self.content = @ng_xml.to_s if @ng_xml
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def to_solr
|
|
37
|
-
solr_doc = {}
|
|
38
|
-
|
|
39
|
-
ng_xml.terminology.flatten.select { |x| x.options[:index] }.each do |term|
|
|
40
|
-
term.values.each do |v|
|
|
41
|
-
Array(term.options[:index]).each do |index_as|
|
|
42
|
-
solr_doc[index_as] ||= []
|
|
43
|
-
solr_doc[index_as] << if v.is_a? Nokogiri::XML::Node
|
|
44
|
-
v.text
|
|
45
|
-
else
|
|
46
|
-
v
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
solr_doc
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
def method_missing(method, *args, &block)
|
|
56
|
-
if ng_xml.respond_to? method
|
|
57
|
-
ng_xml.send(method, *args, &block)
|
|
58
|
-
else
|
|
59
|
-
super
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
def respond_to?(*args)
|
|
64
|
-
super || self.class.terminology.respond_to?(*args)
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
protected
|
|
68
|
-
|
|
69
|
-
def default_mime_type
|
|
70
|
-
'text/xml'
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
end
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
require "om"
|
|
2
|
-
|
|
3
|
-
module ActiveFedora
|
|
4
|
-
class OmDatastream < File
|
|
5
|
-
# before_save do
|
|
6
|
-
# if content.blank?
|
|
7
|
-
# ActiveFedora::Base.logger.warn "Cowardly refusing to save a datastream with empty content: #{self.inspect}"
|
|
8
|
-
# false
|
|
9
|
-
# end
|
|
10
|
-
# end
|
|
11
|
-
|
|
12
|
-
include OM::XML::Document
|
|
13
|
-
include OM::XML::TerminologyBasedSolrizer # this adds support for calling .to_solr
|
|
14
|
-
include Datastreams::NokogiriDatastreams
|
|
15
|
-
extend Deprecation
|
|
16
|
-
|
|
17
|
-
alias om_term_values term_values unless method_defined?(:om_term_values)
|
|
18
|
-
alias om_update_values update_values unless method_defined?(:om_update_values)
|
|
19
|
-
|
|
20
|
-
def initialize(*args)
|
|
21
|
-
super
|
|
22
|
-
Deprecation.warn(OmDatastream, "OmDatastream is deprecated and will be removed in ActiveFedora 11")
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def default_mime_type
|
|
26
|
-
'text/xml'
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
# Indicates that this datastream has metadata content.
|
|
30
|
-
# @return true
|
|
31
|
-
def metadata?
|
|
32
|
-
true
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# Return a hash suitable for indexing in solr. Every field name is prefixed with the
|
|
36
|
-
# value returned by the +prefix+ method.
|
|
37
|
-
def to_solr(solr_doc = {}, opts = {})
|
|
38
|
-
prefix = self.prefix(opts[:name])
|
|
39
|
-
solr_doc.merge super({}).each_with_object({}) { |(key, value), new| new[[prefix, key].join] = value }
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
# Update field values within the current datastream using {#update_values}, which is a wrapper for {http://rdoc.info/gems/om/1.2.4/OM/XML/TermValueOperators#update_values-instance_method OM::TermValueOperators#update_values}
|
|
43
|
-
# Ignores any fields from params that this datastream's Terminology doesn't recognize
|
|
44
|
-
#
|
|
45
|
-
# @param [Hash] params The params specifying which fields to update and their new values. The syntax of the params Hash is the same as that expected by
|
|
46
|
-
# term_pointers must be a valid OM Term pointers (ie. [:name]). Strings will be ignored.
|
|
47
|
-
# @param [Hash] _opts This is not currently used by the datastream-level update_indexed_attributes method
|
|
48
|
-
#
|
|
49
|
-
# Example:
|
|
50
|
-
# @mods_ds.update_indexed_attributes( {[{":person"=>"0"}, "role"]=>{"0"=>"role1", "1"=>"role2", "2"=>"role3"} })
|
|
51
|
-
# => {"person_0_role"=>{"0"=>"role1", "1"=>"role2", "2"=>"role3"}}
|
|
52
|
-
#
|
|
53
|
-
# @mods_ds.to_xml # (the following is an approximation)
|
|
54
|
-
# <mods>
|
|
55
|
-
# <mods:name type="person">
|
|
56
|
-
# <mods:role>
|
|
57
|
-
# <mods:roleTerm>role1</mods:roleTerm>
|
|
58
|
-
# </mods:role>
|
|
59
|
-
# <mods:role>
|
|
60
|
-
# <mods:roleTerm>role2</mods:roleTerm>
|
|
61
|
-
# </mods:role>
|
|
62
|
-
# <mods:role>
|
|
63
|
-
# <mods:roleTerm>role3</mods:roleTerm>
|
|
64
|
-
# </mods:role>
|
|
65
|
-
# </mods:name>
|
|
66
|
-
# </mods>
|
|
67
|
-
def update_indexed_attributes(params = {}, _opts = {})
|
|
68
|
-
if self.class.terminology.nil?
|
|
69
|
-
raise "No terminology is set for this OmDatastream class. Cannot perform update_indexed_attributes"
|
|
70
|
-
end
|
|
71
|
-
# remove any fields from params that this datastream doesn't recognize
|
|
72
|
-
# make sure to make a copy of params so not to modify hash that might be passed to other methods
|
|
73
|
-
current_params = params.clone
|
|
74
|
-
current_params.delete_if do |term_pointer, new_values|
|
|
75
|
-
if term_pointer.is_a?(String)
|
|
76
|
-
ActiveFedora::Base.logger.warn "WARNING: #{self.class.name} ignoring {#{term_pointer.inspect} => #{new_values.inspect}} because #{term_pointer.inspect} is a String (only valid OM Term Pointers will be used). Make sure your html has the correct field_selector tags in it." if ActiveFedora::Base.logger
|
|
77
|
-
true
|
|
78
|
-
else
|
|
79
|
-
!self.class.terminology.has_term?(*OM.destringify(term_pointer))
|
|
80
|
-
end
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
result = {}
|
|
84
|
-
result = update_values(current_params) unless current_params.empty?
|
|
85
|
-
|
|
86
|
-
result
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
def get_values(field_key, _default = [])
|
|
90
|
-
term_values(*field_key)
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
def find_by_terms(*termpointer)
|
|
94
|
-
super
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
# Update values in the datastream's xml
|
|
98
|
-
# This wraps {http://rdoc.info/gems/om/1.2.4/OM/XML/TermValueOperators#update_values-instance_method OM::TermValueOperators#update_values} so that returns an error if we have loaded from solr since datastreams loaded that way should be read-only
|
|
99
|
-
#
|
|
100
|
-
# @example Updating multiple values with a Hash of Term pointers and values
|
|
101
|
-
# ds.update_values( {[{":person"=>"0"}, "role", "text"]=>{"0"=>"role1", "1"=>"role2", "2"=>"role3"}, [{:person=>1}, :family_name]=>"Andronicus", [{"person"=>"1"},:given_name]=>["Titus"],[{:person=>1},:role,:text]=>["otherrole1","otherrole2"] } )
|
|
102
|
-
# => {"person_0_role_text"=>{"0"=>"role1", "1"=>"role2", "2"=>"role3"}, "person_1_role_text"=>{"0"=>"otherrole1", "1"=>"otherrole2"}}
|
|
103
|
-
def update_values(params = {})
|
|
104
|
-
raise "can't modify frozen #{self.class}" if frozen?
|
|
105
|
-
ng_xml_will_change!
|
|
106
|
-
result = om_update_values(params)
|
|
107
|
-
result
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
protected
|
|
111
|
-
|
|
112
|
-
# The string to prefix all solr fields with. Override this method if you want
|
|
113
|
-
# a prefix other than the default
|
|
114
|
-
def prefix(path)
|
|
115
|
-
path ? "#{path.underscore}__" : ''
|
|
116
|
-
end
|
|
117
|
-
end
|
|
118
|
-
end
|