adiwg-mdtranslator 2.6.1 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -1
  3. data/adiwg-mdtranslator.gemspec +1 -1
  4. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +3 -2
  5. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_attribute.rb +4 -4
  6. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_fgdc.rb +1 -1
  7. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_identification.rb +7 -2
  8. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_keyword.rb +35 -1
  9. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_lineage.rb +10 -2
  10. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_methodology.rb +69 -0
  11. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_process.rb +6 -10
  12. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_quality.rb +3 -3
  13. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_range.rb +3 -3
  14. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_raster.rb +1 -1
  15. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_source.rb +5 -5
  16. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_spatialOrganization.rb +6 -4
  17. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonSystem.rb +6 -3
  18. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonomy.rb +6 -4
  19. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +6 -6
  20. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +2 -2
  21. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb +101 -94
  22. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicSystem.rb +2 -2
  23. data/lib/adiwg/mdtranslator/version.rb +4 -1
  24. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_browse.rb +54 -0
  25. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +35 -15
  26. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_constraint.rb +53 -0
  27. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_description.rb +1 -1
  28. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +39 -3
  29. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +1 -1
  30. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +148 -89
  31. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_keyword.rb +6 -6
  32. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_lineage.rb +91 -0
  33. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +94 -0
  34. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_methodKeywords.rb +55 -0
  35. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_process.rb +119 -0
  36. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_publisher.rb +1 -1
  37. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_quality.rb +64 -0
  38. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_security.rb +69 -0
  39. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_series.rb +1 -1
  40. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_source.rb +124 -0
  41. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialDomain.rb +2 -2
  42. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialOrganization.rb +177 -0
  43. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_status.rb +1 -1
  44. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomy.rb +70 -0
  45. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyClassification.rb +65 -0
  46. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyKeywords.rb +55 -0
  47. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +154 -0
  48. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_timePeriod.rb +22 -16
  49. data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer.rb +19 -1
  50. data/lib/adiwg/mdtranslator/writers/fgdc/readme.md +2 -2
  51. data/lib/adiwg/mdtranslator/writers/html/html_writer.rb +1 -1
  52. data/lib/adiwg/mdtranslator/writers/html/sections/html_entityAttribute.rb +2 -2
  53. data/lib/adiwg/mdtranslator/writers/html/sections/html_source.rb +7 -0
  54. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entityAttribute.rb +2 -2
  55. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_source.rb +1 -0
  56. metadata +19 -4
@@ -51,14 +51,17 @@ module ADIWG
51
51
  end
52
52
  end
53
53
 
54
- # taxonomy bio.2.2 (idref) - taxonomic identification reference [] {citation}
55
- # -> resourceInfo.taxonomy.idReferences.citation
54
+ # taxonomy bio.2.2 (idref) - taxonomic identification reference [] {identifier}
55
+ # -> resourceInfo.taxonomy.idReferences.authority
56
56
  axTaxRef = xSystem.xpath('./idref')
57
57
  unless axTaxRef.empty?
58
58
  axTaxRef.each do |xTaxRef|
59
59
  hCitation = Citation.unpack(xTaxRef, hResponseObj)
60
60
  unless hCitation.nil?
61
- hTaxonomy[:idReferences] << hCitation
61
+ hIdentifier = intMetadataClass.newIdentifier
62
+ hIdentifier[:identifier] = 'none'
63
+ hIdentifier[:citation] = hCitation
64
+ hTaxonomy[:idReferences] << hIdentifier
62
65
  end
63
66
  end
64
67
  end
@@ -23,11 +23,13 @@ module ADIWG
23
23
  intMetadataClass = InternalMetadata.new
24
24
  hTaxonomy = intMetadataClass.newTaxonomy
25
25
 
26
- # taxonomy bio.1 (keywtax) - taxonomic keywords {keyword}
26
+ # taxonomy bio.1 (keywtax) - taxonomic keywords [] {keyword}
27
27
  # -> resourceInfo.keywords
28
- xKeywords = xTaxonomy.xpath('./keywtax')
29
- unless xKeywords.empty?
30
- Keyword.unpack(xKeywords, hResourceInfo, hResponseObj)
28
+ axKeywords = xTaxonomy.xpath('./keywtax')
29
+ unless axKeywords.empty?
30
+ axKeywords.each do |xKeyword|
31
+ Keyword.unpack(xKeyword, hResourceInfo, hResponseObj)
32
+ end
31
33
  end
32
34
 
33
35
  # taxonomy bio.2 (taxonsys) - taxonomic system
@@ -164,26 +164,26 @@ module ADIWG
164
164
  end
165
165
 
166
166
  # attribute - domain range of values [] {valueRange}
167
- if hAttribute.has_key?('rangeOfValues')
168
- aValueRange = hAttribute['rangeOfValues']
167
+ if hAttribute.has_key?('valueRange')
168
+ aValueRange = hAttribute['valueRange']
169
169
  aValueRange.each do |hRange|
170
170
  unless hRange.empty?
171
171
  hReturn = ValueRange.unpack(hRange, responseObj)
172
172
  unless hReturn.nil?
173
- intAttribute[:rangeOfValues] << hReturn
173
+ intAttribute[:valueRange] << hReturn
174
174
  end
175
175
  end
176
176
  end
177
177
  end
178
178
 
179
179
  # attribute - time period of values [] {timePeriod}
180
- if hAttribute.has_key?('timePeriodOfValues')
181
- aTimePeriods = hAttribute['timePeriodOfValues']
180
+ if hAttribute.has_key?('timePeriod')
181
+ aTimePeriods = hAttribute['timePeriod']
182
182
  aTimePeriods.each do |hTimePeriod|
183
183
  unless hTimePeriod.empty?
184
184
  hReturn = TimePeriod.unpack(hTimePeriod, responseObj)
185
185
  unless hReturn.nil?
186
- intAttribute[:timePeriodOfValues] << hReturn
186
+ intAttribute[:timePeriod] << hReturn
187
187
  end
188
188
  end
189
189
  end
@@ -342,14 +342,14 @@ module ADIWG
342
342
 
343
343
  # resource information - environment description
344
344
  if hResInfo.has_key?('environmentDescription')
345
- if hResInfo['environmentDescription'] != ''
345
+ unless hResInfo['environmentDescription'] == ''
346
346
  intResInfo[:environmentDescription] = hResInfo['environmentDescription']
347
347
  end
348
348
  end
349
349
 
350
350
  # resource information - supplemental information
351
351
  if hResInfo.has_key?('supplementalInfo')
352
- if hResInfo['supplementalInfo'] != ''
352
+ unless hResInfo['supplementalInfo'] == ''
353
353
  intResInfo[:supplementalInfo] = hResInfo['supplementalInfo']
354
354
  end
355
355
  end
@@ -16,108 +16,115 @@ require_relative 'module_scope'
16
16
  require_relative 'module_spatialResolution'
17
17
 
18
18
  module ADIWG
19
- module Mdtranslator
20
- module Readers
21
- module MdJson
22
-
23
- module Source
24
-
25
- def self.unpack(hSource, responseObj)
26
-
27
- # return nil object if input is empty
28
- if hSource.empty?
29
- responseObj[:readerExecutionMessages] << 'Source object is empty'
30
- responseObj[:readerExecutionPass] = false
31
- return nil
32
- end
33
-
34
- # instance classes needed in script
35
- intMetadataClass = InternalMetadata.new
36
- intSource = intMetadataClass.newDataSource
37
-
38
- # source - description (required)
39
- if hSource.has_key?('description')
40
- intSource[:description] = hSource['description']
41
- end
42
- if intSource[:description].nil? || intSource[:description] == ''
43
- responseObj[:readerExecutionMessages] << 'Source description is missing'
44
- responseObj[:readerExecutionPass] = false
45
- return nil
46
- end
47
-
48
- # source - source citation
49
- if hSource.has_key?('sourceCitation')
50
- hObject = hSource['sourceCitation']
51
- unless hObject.empty?
52
- hReturn = Citation.unpack(hObject, responseObj)
53
- unless hReturn.nil?
54
- intSource[:sourceCitation] = hReturn
55
- end
56
- end
19
+ module Mdtranslator
20
+ module Readers
21
+ module MdJson
22
+
23
+ module Source
24
+
25
+ def self.unpack(hSource, responseObj)
26
+
27
+ # return nil object if input is empty
28
+ if hSource.empty?
29
+ responseObj[:readerExecutionMessages] << 'Source object is empty'
30
+ responseObj[:readerExecutionPass] = false
31
+ return nil
32
+ end
33
+
34
+ # instance classes needed in script
35
+ intMetadataClass = InternalMetadata.new
36
+ intSource = intMetadataClass.newDataSource
37
+
38
+ # source - source ID
39
+ if hSource.has_key?('sourceId')
40
+ unless hSource['sourceId'] == ''
41
+ intSource[:sourceId] = hSource['sourceId']
42
+ end
43
+ end
44
+
45
+ # source - description (required)
46
+ if hSource.has_key?('description')
47
+ intSource[:description] = hSource['description']
48
+ end
49
+ if intSource[:description].nil? || intSource[:description] == ''
50
+ responseObj[:readerExecutionMessages] << 'Source description is missing'
51
+ responseObj[:readerExecutionPass] = false
52
+ return nil
53
+ end
54
+
55
+ # source - source citation
56
+ if hSource.has_key?('sourceCitation')
57
+ hObject = hSource['sourceCitation']
58
+ unless hObject.empty?
59
+ hReturn = Citation.unpack(hObject, responseObj)
60
+ unless hReturn.nil?
61
+ intSource[:sourceCitation] = hReturn
57
62
  end
58
-
59
- # source - source metadata []
60
- if hSource.has_key?('metadataCitation')
61
- aCitation = hSource['metadataCitation']
62
- aCitation.each do |item|
63
- hCitation = Citation.unpack(item, responseObj)
64
- unless hCitation.nil?
65
- intSource[:metadataCitation] << hCitation
66
- end
67
- end
63
+ end
64
+ end
65
+
66
+ # source - source metadata []
67
+ if hSource.has_key?('metadataCitation')
68
+ aCitation = hSource['metadataCitation']
69
+ aCitation.each do |item|
70
+ hCitation = Citation.unpack(item, responseObj)
71
+ unless hCitation.nil?
72
+ intSource[:metadataCitation] << hCitation
68
73
  end
69
-
70
- # source - spatial resolution
71
- if hSource.has_key?('spatialResolution')
72
- hObject = hSource['spatialResolution']
73
- unless hObject.empty?
74
- hReturn = SpatialResolution.unpack(hObject, responseObj)
75
- unless hReturn.nil?
76
- intSource[:spatialResolution] = hReturn
77
- end
78
- end
74
+ end
75
+ end
76
+
77
+ # source - spatial resolution
78
+ if hSource.has_key?('spatialResolution')
79
+ hObject = hSource['spatialResolution']
80
+ unless hObject.empty?
81
+ hReturn = SpatialResolution.unpack(hObject, responseObj)
82
+ unless hReturn.nil?
83
+ intSource[:spatialResolution] = hReturn
79
84
  end
80
-
81
- # source - reference system
82
- if hSource.has_key?('referenceSystem')
83
- hObject = hSource['referenceSystem']
84
- unless hObject.empty?
85
- hReturn = SpatialReferenceSystem.unpack(hObject, responseObj)
86
- unless hReturn.nil?
87
- intSource[:referenceSystem] = hReturn
88
- end
89
- end
85
+ end
86
+ end
87
+
88
+ # source - reference system
89
+ if hSource.has_key?('referenceSystem')
90
+ hObject = hSource['referenceSystem']
91
+ unless hObject.empty?
92
+ hReturn = SpatialReferenceSystem.unpack(hObject, responseObj)
93
+ unless hReturn.nil?
94
+ intSource[:referenceSystem] = hReturn
90
95
  end
91
-
92
- # source - source steps []
93
- if hSource.has_key?('sourceProcessStep')
94
- aSteps = hSource['sourceProcessStep']
95
- aSteps.each do |item|
96
- hStep = ProcessStep.unpack(item, responseObj)
97
- unless hStep.nil?
98
- intSource[:sourceSteps] << hStep
99
- end
100
- end
96
+ end
97
+ end
98
+
99
+ # source - source steps []
100
+ if hSource.has_key?('sourceProcessStep')
101
+ aSteps = hSource['sourceProcessStep']
102
+ aSteps.each do |item|
103
+ hStep = ProcessStep.unpack(item, responseObj)
104
+ unless hStep.nil?
105
+ intSource[:sourceSteps] << hStep
101
106
  end
102
-
103
- # source - scope {scope}
104
- if hSource.has_key?('scope')
105
- hObject = hSource['scope']
106
- unless hObject.empty?
107
- hReturn = Scope.unpack(hObject, responseObj)
108
- unless hReturn.nil?
109
- intSource[:scope] = hReturn
110
- end
111
- end
107
+ end
108
+ end
109
+
110
+ # source - scope {scope}
111
+ if hSource.has_key?('scope')
112
+ hObject = hSource['scope']
113
+ unless hObject.empty?
114
+ hReturn = Scope.unpack(hObject, responseObj)
115
+ unless hReturn.nil?
116
+ intSource[:scope] = hReturn
112
117
  end
118
+ end
119
+ end
113
120
 
114
- return intSource
121
+ return intSource
115
122
 
116
- end
117
-
118
- end
123
+ end
119
124
 
120
125
  end
121
- end
122
- end
126
+
127
+ end
128
+ end
129
+ end
123
130
  end
@@ -18,7 +18,7 @@ module ADIWG
18
18
 
19
19
  # return nil object if input is empty
20
20
  if hSystem.empty?
21
- responseObj[:readerExecutionMessages] << 'TaxonomicSystem object is empty'
21
+ responseObj[:readerExecutionMessages] << 'Taxonomic System object is empty'
22
22
  responseObj[:readerExecutionPass] = false
23
23
  return nil
24
24
  end
@@ -36,7 +36,7 @@ module ADIWG
36
36
  end
37
37
  end
38
38
  if intSystem[:citation].empty?
39
- responseObj[:readerExecutionMessages] << 'TaxonomicSystem object is missing citation'
39
+ responseObj[:readerExecutionMessages] << 'Taxonomic System object is missing citation'
40
40
  responseObj[:readerExecutionPass] = false
41
41
  return nil
42
42
  end
@@ -1,6 +1,9 @@
1
1
  # adiwg mdTranslator
2
2
 
3
3
  # version 2 history
4
+ # 2.7.0 2017-12-26 add fgdc writer identification info section
5
+ # 2.7.0 2017-12-26 add fgdc writer data quality info section
6
+ # 2.7.0 2017-12-26 add fgdc writer spatial domain info section
4
7
  # 2.6.1 2017-11-30 add agreement number to sbJson budget facet
5
8
  # 2.6.1 2017-11-30 add metadataOnlineResources and citation onlineResources to sbJson
6
9
  # 2.6.1 2017-11-30 remove duplicate citation identifiers from sbJson
@@ -52,7 +55,7 @@
52
55
  module ADIWG
53
56
  module Mdtranslator
54
57
  # current mdtranslator version
55
- VERSION = "2.6.1"
58
+ VERSION = "2.7.0"
56
59
  end
57
60
  end
58
61
 
@@ -0,0 +1,54 @@
1
+ # FGDC <<Class>> Browse
2
+ # FGDC CSDGM writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2017-12-12 original script
6
+
7
+ module ADIWG
8
+ module Mdtranslator
9
+ module Writers
10
+ module Fgdc
11
+
12
+ class Browse
13
+
14
+ def initialize(xml, hResponseObj)
15
+ @xml = xml
16
+ @hResponseObj = hResponseObj
17
+ end
18
+
19
+ def writeXML(hGraphic)
20
+
21
+ # browse 1.10.1 (browsen) - browse name (required)
22
+ unless hGraphic[:graphicName].nil?
23
+ @xml.tag!('browsen', hGraphic[:graphicName])
24
+ end
25
+ if hGraphic[:graphicName].nil?
26
+ @hResponseObj[:writerPass] = false
27
+ @hResponseObj[:writerMessages] << 'Browse Graphic is missing name'
28
+ end
29
+
30
+ # browse 1.10.2 (browsed) - browse description (required)
31
+ unless hGraphic[:graphicDescription].nil?
32
+ @xml.tag!('browsed', hGraphic[:graphicDescription])
33
+ end
34
+ if hGraphic[:graphicDescription].nil?
35
+ @hResponseObj[:writerPass] = false
36
+ @hResponseObj[:writerMessages] << 'Browse Graphic is missing description'
37
+ end
38
+
39
+ # browse 1.10.3 (browset) - browse type (required)
40
+ unless hGraphic[:graphicType].nil?
41
+ @xml.tag!('browset', hGraphic[:graphicType])
42
+ end
43
+ if hGraphic[:graphicType].nil?
44
+ @hResponseObj[:writerPass] = false
45
+ @hResponseObj[:writerMessages] << 'Browse Graphic is missing file type'
46
+ end
47
+
48
+ end # writeXML
49
+ end # Browse
50
+
51
+ end
52
+ end
53
+ end
54
+ end
@@ -5,6 +5,7 @@
5
5
  # Stan Smith 2017-11-17 original script
6
6
 
7
7
  require 'adiwg/mdtranslator/internal/module_dateTimeFun'
8
+ require_relative '../fgdc_writer'
8
9
  require_relative 'class_series'
9
10
  require_relative 'class_publisher'
10
11
  require_relative 'class_citation'
@@ -21,19 +22,6 @@ module ADIWG
21
22
  @hResponseObj = hResponseObj
22
23
  end
23
24
 
24
- def find_responsibility(hCitation, roleName)
25
- aParties = []
26
- hCitation[:responsibleParties].each do |hRParty|
27
- if hRParty[:roleName] == roleName
28
- hRParty[:parties].each do |hParty|
29
- aParties << hParty[:contactId]
30
- end
31
- end
32
- end
33
- aParties = aParties.uniq
34
- return aParties
35
- end
36
-
37
25
  def writeXML(hCitation, aAssocResource)
38
26
 
39
27
  seriesClass = Series.new(@xml, @hResponseObj)
@@ -45,7 +33,8 @@ module ADIWG
45
33
  # citation 8.1 (origin) - originator [] (required)
46
34
  # <- hCitation[:responsibleParties] role = 'originator'
47
35
  haveOriginator = false
48
- aOriginators = find_responsibility(hCitation, 'originator')
36
+ aRParties = hCitation[:responsibleParties]
37
+ aOriginators = ADIWG::Mdtranslator::Writers::Fgdc.find_responsibility(aRParties, 'originator')
49
38
  aOriginators.each do |contactId|
50
39
  hContact = ADIWG::Mdtranslator::Writers::Fgdc.get_contact(contactId)
51
40
  unless hContact.empty?
@@ -65,6 +54,7 @@ module ADIWG
65
54
  # citation 8.3 (pubtime) - publication time
66
55
  # <- hCitation[:dates] dateType = 'publication'
67
56
  havePubDate = false
57
+ havePubTime = false
68
58
  hCitation[:dates].each do |hDate|
69
59
  unless hDate.empty?
70
60
  unless hDate[:dateType].nil?
@@ -77,6 +67,7 @@ module ADIWG
77
67
  end
78
68
  unless pubTime == 'ERROR'
79
69
  @xml.tag!('pubtime', pubTime)
70
+ havePubTime = true
80
71
  end
81
72
  break
82
73
  end
@@ -87,6 +78,9 @@ module ADIWG
87
78
  @hResponseObj[:writerPass] = false
88
79
  @hResponseObj[:writerMessages] << 'Citation is missing publication date'
89
80
  end
81
+ if !havePubTime && @hResponseObj[:writerShowTags]
82
+ @xml.tag!('pubtime')
83
+ end
90
84
 
91
85
  # citation 8.4 (title) - title (required)
92
86
  # <- hCitation[:title]
@@ -103,6 +97,9 @@ module ADIWG
103
97
  unless hCitation[:edition].nil?
104
98
  @xml.tag!('edition', hCitation[:edition])
105
99
  end
100
+ if hCitation[:edition].nil? && @hResponseObj[:writerShowTags]
101
+ @xml.tag!('edition')
102
+ end
106
103
 
107
104
  # citation 8.6 (geoform) - geospatial data presentation form
108
105
  # <- hCitation[:presentationForm] [] - take first
@@ -112,6 +109,9 @@ module ADIWG
112
109
  break
113
110
  end
114
111
  end
112
+ if hCitation[:presentationForms].empty? && @hResponseObj[:writerShowTags]
113
+ @xml.tag!('geoform')
114
+ end
115
115
 
116
116
  # citation 8.7 (serinfo) - series information
117
117
  # <- hCitation[:series]
@@ -120,25 +120,37 @@ module ADIWG
120
120
  seriesClass.writeXML(hCitation[:series])
121
121
  end
122
122
  end
123
+ if hCitation[:series].empty? && @hResponseObj[:writerShowTags]
124
+ @xml.tag!('serinfo')
125
+ end
123
126
 
124
127
  # citation 8.8 (pubinfo) - publication information
125
128
  # <- hCitation[:responsibleParties] role = 'publisher'
126
129
  # only take first publisher
127
- aPublisher = find_responsibility(hCitation, 'publisher')
130
+ havePublisher = false
131
+ aRParties = hCitation[:responsibleParties]
132
+ aPublisher = ADIWG::Mdtranslator::Writers::Fgdc.find_responsibility(aRParties, 'publisher')
128
133
  unless aPublisher.empty?
129
134
  hContact = ADIWG::Mdtranslator::Writers::Fgdc.get_contact(aPublisher[0])
130
135
  unless hContact.empty?
131
136
  @xml.tag!('pubinfo') do
132
137
  pubClass.writeXML(hContact)
138
+ havePublisher = true
133
139
  end
134
140
  end
135
141
  end
142
+ if !havePublisher && @hResponseObj[:writerShowTags]
143
+ @xml.tag!('pubinfo')
144
+ end
136
145
 
137
146
  # citation 8.9 (othercit) - other citation details
138
147
  # <- hCitation[:otherDetails][0] - take first
139
148
  unless hCitation[:otherDetails].empty?
140
149
  @xml.tag!('othercit', hCitation[:otherDetails][0])
141
150
  end
151
+ if hCitation[:otherDetails].empty? && @hResponseObj[:writerShowTags]
152
+ @xml.tag!('othercit')
153
+ end
142
154
 
143
155
  # citation 8.10 (onlink) - online linkage []
144
156
  # <- hCitation[:onlineResources][:uri]
@@ -147,20 +159,28 @@ module ADIWG
147
159
  @xml.tag!('onlink', hOnline[:olResURI])
148
160
  end
149
161
  end
162
+ if hCitation[:onlineResources].empty? && @hResponseObj[:writerShowTags]
163
+ @xml.tag!('onlink')
164
+ end
150
165
 
151
166
  # citation 8.11 (lworkcit) - larger work citation
152
167
  # <- associatedResource[] - associationType = 'largerWorkCitation' take first
153
168
  # <- associatedResource[:resourceCitation]
169
+ haveLarger = false
154
170
  aAssocResource.each do |hResource|
155
171
  if hResource[:associationType] == 'largerWorkCitation'
156
172
  unless hResource[:resourceCitation].empty?
157
173
  @xml.tag!('lworkcit') do
158
174
  citationClass.writeXML(hResource[:resourceCitation], [])
175
+ haveLarger = true
159
176
  end
160
177
  break
161
178
  end
162
179
  end
163
180
  end
181
+ if !haveLarger && @hResponseObj[:writerShowTags]
182
+ @xml.tag!('lworkcit')
183
+ end
164
184
 
165
185
  end # citeinfo tag
166
186
  end # writeXML