ddr-models 2.7.2 → 2.7.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4cad288ab66e27f4a979008788abc101167edee
4
- data.tar.gz: 4f2e67b23dc23c59b03af55688c68b911dcdb757
3
+ metadata.gz: b40e42bff6d22b301a1b06925cf23a5583bcb727
4
+ data.tar.gz: d82f30c7c237c53bb375c8f307ce50420059bbc2
5
5
  SHA512:
6
- metadata.gz: cfdf876d984f71747568ad4f02ffa0d5d3930e7236646367bcb84c0b17d377baaabfd772575f024c73378efcb43df0d1c9fd97a0854da2fdab125ed9e0b27dc1
7
- data.tar.gz: 58e1ea9ab30fab595d3f1b8475f3cc9c80a46ab3af3093f419592fda2ca2847329a9d469c601c66db16f9a9e8e0728b2c2ed4ad065ddf17b2291ca867deb94d9
6
+ metadata.gz: 2b2a22ff451d8c58a36b31ab245b9e5b3570e8e994eaca1a5e8f91698ff1c1111767175cd6d6c5bc011662aea234ac1bd88a4a2c96abbc21374ffc896aeee530
7
+ data.tar.gz: ae332fd91309fdf16e90ed94c3de73f8fa225cdc47404f32ec92f61dc1121f5c8f9d1f9737ed0e3851d975c8cd01a2fc317ed983e5c638a1883205bdad7847f8
@@ -89,7 +89,12 @@ module Ddr::Index
89
89
  SERIES_FACET = Field.new :series_facet, :facetable
90
90
  SETTING_FACET = Field.new :setting_facet, :facetable
91
91
  SPATIAL_FACET = Field.new :spatial_facet, :facetable
92
+ # STRUCT is interim index field to facilitate conversion of the STRUCTURE index field from
93
+ # stored and indexed to just stored. The STRUCTURE field will eventually be pointed to this
94
+ # Field definition.
95
+ STRUCT = Field.new :structure, solr_name: "structure_ss"
92
96
  STRUCTURE = Field.new :structure, :stored_sortable
97
+ STRUCTURE_SOURCE = Field.new :structure_source, :stored_sortable
93
98
  SUBJECT_FACET = Field.new :subject_facet, :facetable
94
99
  SUBSERIES_FACET = Field.new :subseries_facet, :facetable
95
100
  TECHMD_COLOR_SPACE = Field.new :techmd_color_space, :symbol
@@ -103,7 +103,10 @@ module Ddr::Models
103
103
  fields[MULTIRES_IMAGE_FILE_PATH] = multires_image_file_path
104
104
  end
105
105
  if has_struct_metadata?
106
- fields[STRUCTURE] = structure.dereferenced_structure.to_json
106
+ # STRUCT is an interim index field to facilitate conversion of STRUCTURE field definition.
107
+ fields[STRUCT] = fields[STRUCTURE] = structure.dereferenced_structure.to_json
108
+ fields[STRUCTURE_SOURCE] = structure.repository_maintained? ? Ddr::Models::Structure::REPOSITORY_MAINTAINED
109
+ : Ddr::Models::Structure::EXTERNALLY_PROVIDED
107
110
  end
108
111
  if has_extracted_text?
109
112
  fields[EXTRACTED_TEXT] = extractedText.content
@@ -4,6 +4,11 @@ module Ddr::Models
4
4
  #
5
5
  class Structure < SimpleDelegator
6
6
 
7
+ # Indicates whether the structure is externally provided or maintained by the repository itself (i.e., is the
8
+ # default structure for the object).
9
+ EXTERNALLY_PROVIDED = 'provided'.freeze
10
+ REPOSITORY_MAINTAINED = 'repository'.freeze
11
+
7
12
  TYPE_DEFAULT = 'default'.freeze
8
13
 
9
14
  # Based on the PCDM Extension 'Use' ontology -- https://github.com/duraspace/pcdm/blob/master/pcdm-ext/use.rdf
@@ -1,5 +1,5 @@
1
1
  module Ddr
2
2
  module Models
3
- VERSION = "2.7.2"
3
+ VERSION = "2.7.3"
4
4
  end
5
5
  end
@@ -33,9 +33,29 @@ module Ddr::Models
33
33
  end
34
34
  it "should index the JSON representation of the structures" do
35
35
  indexing = item.to_solr
36
- expect(indexing.keys).to include(Ddr::Index::Fields::STRUCTURE)
36
+ expect(indexing[Ddr::Index::Fields::STRUCT]).to eq(expected_json)
37
37
  expect(indexing[Ddr::Index::Fields::STRUCTURE]).to eq(expected_json)
38
38
  end
39
+ describe "structure source" do
40
+ describe "repository maintained" do
41
+ before do
42
+ item.datastreams[Ddr::Datastreams::STRUCT_METADATA].content = simple_structure_xml
43
+ end
44
+ it "should index the structure source as repository maintained" do
45
+ indexing = item.to_solr
46
+ expect(indexing[Ddr::Index::Fields::STRUCTURE_SOURCE]).to eq(Ddr::Models::Structure::REPOSITORY_MAINTAINED)
47
+ end
48
+ end
49
+ describe "externally provided" do
50
+ before do
51
+ item.datastreams[Ddr::Datastreams::STRUCT_METADATA].content = nested_structure_xml
52
+ end
53
+ it "should index the structure source as repository maintained" do
54
+ indexing = item.to_solr
55
+ expect(indexing[Ddr::Index::Fields::STRUCTURE_SOURCE]).to eq(Ddr::Models::Structure::EXTERNALLY_PROVIDED)
56
+ end
57
+ end
58
+ end
39
59
  end
40
60
 
41
61
  end
@@ -28,7 +28,7 @@ module Ddr::Models
28
28
  describe "structure has a metsHdr" do
29
29
  let(:structure) { FactoryGirl.build(:simple_structure) }
30
30
  it "returns the creator" do
31
- expect(structure.creator).to eq("Sam Spade")
31
+ expect(structure.creator).to eq(Ddr::Models::Structures::Agent::NAME_REPOSITORY_DEFAULT)
32
32
  end
33
33
  end
34
34
  describe "structure does not have a metsHdr" do
@@ -29,7 +29,7 @@ def simple_structure_xml
29
29
  <mets xmlns="http://www.loc.gov/METS/" xmlns:xlink="http://www.w3.org/1999/xlink">
30
30
  <metsHdr>
31
31
  <agent ROLE="CREATOR">
32
- <name>Sam Spade</name>
32
+ <name>#{Ddr::Models::Structures::Agent::NAME_REPOSITORY_DEFAULT}</name>
33
33
  </agent>
34
34
  </metsHdr>
35
35
  <fileSec>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddr-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.2
4
+ version: 2.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Coble
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-04-25 00:00:00.000000000 Z
12
+ date: 2017-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -780,7 +780,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
780
780
  version: '0'
781
781
  requirements: []
782
782
  rubyforge_project:
783
- rubygems_version: 2.6.8
783
+ rubygems_version: 2.6.11
784
784
  signing_key:
785
785
  specification_version: 4
786
786
  summary: Models used in the Duke Digital Repository