adiwg-mdtranslator 0.10.2 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -4
- data/Rakefile +4 -1
- data/adiwg-mdtranslator.gemspec +10 -8
- data/bin/mdtranslator +8 -2
- data/lib/adiwg/mdtranslator.rb +72 -147
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +538 -538
- data/lib/adiwg/mdtranslator/internal/module_dateTimeFun.rb +78 -78
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +153 -74
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_validator.rb +41 -108
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_additionalDocumentation.rb +54 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_address.rb +89 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_associatedResource.rb +82 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_boundingBox.rb +62 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_browseGraphic.rb +69 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_citation.rb +122 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_contacts.rb +150 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_coordinates.rb +63 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dataDictionary.rb +63 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dataQuality.rb +51 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dateTime.rb +38 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_descriptiveKeyword.rb +60 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dictionaryInfo.rb +63 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_distributionInfo.rb +161 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_domain.rb +73 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_domainItem.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entity.rb +103 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entityAttribute.rb +102 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entityForeignKey.rb +54 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entityIndex.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_extent.rb +73 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_geoCoordSystem.rb +57 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_geoProperties.rb +100 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_geographicElement.rb +179 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_legalConstraint.rb +56 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_lineString.rb +36 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_lineage.rb +61 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_mdJson.rb +69 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_metadata.rb +88 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_metadataExtension.rb +51 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_metadataInfo.rb +123 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_onlineResource.rb +79 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_phone.rb +79 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_point.rb +36 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_polygon.rb +66 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_processStep.rb +75 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resolution.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceFormat.rb +46 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceIdentifier.rb +60 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceInfo.rb +328 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceMaintenance.rb +61 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceSpecificUsage.rb +61 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_responsibleParty.rb +48 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_securityConstraint.rb +63 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_source.rb +59 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_spatialReference.rb +59 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_taxonClass.rb +54 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_taxonomy.rb +94 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_temporalElement.rb +82 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_timeInstant.rb +56 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_timePeriod.rb +64 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_verticalElement.rb +64 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_voucher.rb +49 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/readme.md +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/validator.rb +43 -0
- data/lib/adiwg/mdtranslator/readers/mdReaders.rb +55 -0
- data/lib/adiwg/mdtranslator/version.rb +15 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_address.rb +107 -86
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_aggregateInformation.rb +68 -57
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_boundingPolygon.rb +59 -48
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_browseGraphic.rb +57 -46
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_citation.rb +149 -138
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_contact.rb +83 -72
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataIdentification.rb +334 -322
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataQuality.rb +46 -34
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_date.rb +47 -36
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_digitalTransferOptions.rb +42 -31
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_distribution.rb +29 -18
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_distributor.rb +77 -66
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_extent.rb +87 -76
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureAttribute.rb +113 -102
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureConstraint.rb +44 -33
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureType.rb +121 -110
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_format.rb +45 -34
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_genericMetaData.rb +45 -36
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicBoundingBox.rb +78 -67
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicDescription.rb +25 -14
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb +30 -19
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_identifier.rb +41 -30
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_keyword.rb +58 -49
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_legalConstraints.rb +65 -54
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_lineString.rb +77 -66
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_lineage.rb +62 -51
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_listedValue.rb +70 -59
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_maintenanceInformation.rb +54 -43
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_medium.rb +58 -47
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_metadataExtension.rb +154 -143
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_multiGeometry.rb +138 -127
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_multiplicity.rb +37 -26
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_onlineResource.rb +79 -68
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_point.rb +77 -66
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_polygon.rb +98 -87
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_processStep.rb +80 -69
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceIdentifier.rb +38 -27
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceSystem.rb +25 -14
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_resolution.rb +51 -40
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_responsibleParty.rb +88 -77
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_securityConstraints.rb +70 -59
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_source.rb +58 -47
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_standardOrderProcess.rb +75 -63
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_taxonClassification.rb +55 -44
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_taxonSystem.rb +98 -87
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_telephone.rb +73 -62
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_temporalExtent.rb +58 -47
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_timeInstant.rb +36 -27
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_timePeriod.rb +42 -33
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_usage.rb +59 -48
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_useConstraints.rb +26 -15
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_verticalExtent.rb +52 -41
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_vouchers.rb +39 -28
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_associationType.rb +41 -29
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_characterSet.rb +82 -47
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_classification.rb +42 -24
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_datatype.rb +56 -34
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_dateType.rb +34 -19
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_initiativeType.rb +41 -29
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_keywordType.rb +46 -27
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_maintenanceFrequency.rb +55 -36
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_mediumFormat.rb +44 -26
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_mediumName.rb +68 -38
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_obligation.rb +32 -25
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_onlineFunction.rb +42 -25
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_presentationForm.rb +58 -31
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_progress.rb +44 -25
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_restriction.rb +47 -32
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_role.rb +52 -29
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_scope.rb +58 -35
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_spatialRepresentationType.rb +43 -30
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_topicCategory.rb +51 -44
- data/lib/adiwg/mdtranslator/writers/iso/units/class_baseUnit.rb +26 -15
- data/lib/adiwg/mdtranslator/writers/iso/units/class_conventionalUnit.rb +56 -45
- data/lib/adiwg/mdtranslator/writers/iso/units/class_definitionUnit.rb +23 -12
- data/lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb +30 -19
- data/lib/adiwg/mdtranslator/writers/iso/units/class_unitsOfMeasure.rb +223 -212
- data/lib/adiwg/mdtranslator/writers/iso19110/class_FCfeatureCatalogue.rb +174 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +41 -12
- data/lib/adiwg/mdtranslator/writers/iso19115_2/class_MImetadata.rb +347 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +151 -119
- data/lib/adiwg/mdtranslator/writers/mdWriters.rb +63 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_additionalDocumentation.rb +84 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_address.rb +100 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_associatedResource.rb +100 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_browseGraphic.rb +66 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_citation.rb +115 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_contact.rb +137 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_onlineResource.rb +47 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_phone.rb +128 -0
- data/test/readers/mdJson/v0_9/tc_translation.rb +82 -0
- data/test/writers/iso19115_2/tc_writer_iso19115_2_address.rb +222 -0
- metadata +87 -60
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_additionalDocumentation.rb +0 -36
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_address.rb +0 -71
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_associatedResource.rb +0 -66
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_boundingBox.rb +0 -51
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_browseGraphic.rb +0 -52
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_citation.rb +0 -104
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_contacts.rb +0 -121
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_coordinates.rb +0 -52
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dataDictionary.rb +0 -53
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dataQuality.rb +0 -40
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dateTime.rb +0 -27
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_descriptiveKeyword.rb +0 -49
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dictionaryInfo.rb +0 -52
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_distributionInfo.rb +0 -150
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_domain.rb +0 -62
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_domainItem.rb +0 -42
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entity.rb +0 -92
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityAttribute.rb +0 -91
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityForeignKey.rb +0 -43
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityIndex.rb +0 -42
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_extent.rb +0 -62
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_geoCoordSystem.rb +0 -46
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_geoProperties.rb +0 -89
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_geographicElement.rb +0 -168
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_legalConstraint.rb +0 -45
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_lineString.rb +0 -25
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_lineage.rb +0 -50
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_metadata.rb +0 -77
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_metadataExtension.rb +0 -40
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_metadataInfo.rb +0 -112
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_onlineResource.rb +0 -62
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_phone.rb +0 -59
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_point.rb +0 -25
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_polygon.rb +0 -55
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_processStep.rb +0 -64
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resolution.rb +0 -42
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceFormat.rb +0 -35
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceIdentifier.rb +0 -49
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceInfo.rb +0 -317
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceMaintenance.rb +0 -50
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceSpecificUsage.rb +0 -50
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_responsibleParty.rb +0 -37
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_securityConstraint.rb +0 -52
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_source.rb +0 -48
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_spatialReference.rb +0 -48
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_taxonClass.rb +0 -43
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_taxonomy.rb +0 -83
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_temporalElement.rb +0 -71
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_timeInstant.rb +0 -45
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_timePeriod.rb +0 -53
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_verticalElement.rb +0 -53
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_voucher.rb +0 -38
- data/lib/adiwg/mdtranslator/validator.rb +0 -43
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_FCfeatureCatalogue.rb +0 -171
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_MImetadata.rb +0 -333
- data/test/tc_translation.rb +0 -73
@@ -4,60 +4,71 @@
|
|
4
4
|
# History:
|
5
5
|
# Stan Smith 2013-11-20 original script
|
6
6
|
# Stan Smith 2014-07-09 modify require statements to function in RubyGem structure
|
7
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
7
8
|
|
8
9
|
require 'class_processStep'
|
9
10
|
require 'class_source'
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
def writeXML(hLineage)
|
18
|
-
|
19
|
-
# classes used
|
20
|
-
sourceClass = LI_Source.new(@xml)
|
21
|
-
pStepClass = LI_ProcessStep.new(@xml)
|
22
|
-
|
23
|
-
@xml.tag!('gmd:LI_Lineage') do
|
24
|
-
|
25
|
-
# lineage - statement
|
26
|
-
s = hLineage[:statement]
|
27
|
-
if !s.nil?
|
28
|
-
@xml.tag!('gmd:statement') do
|
29
|
-
@xml.tag!('gco:CharacterString',s)
|
30
|
-
end
|
31
|
-
elsif $showAllTags
|
32
|
-
@xml.tag!('gmd:statement')
|
33
|
-
end
|
34
|
-
|
35
|
-
# lineage - processing steps
|
36
|
-
aProcSteps = hLineage[:processSteps]
|
37
|
-
if !aProcSteps.empty?
|
38
|
-
aProcSteps.each do |pStep|
|
39
|
-
@xml.tag!('gmd:processStep') do
|
40
|
-
pStepClass.writeXML(pStep)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
elsif $showAllTags
|
44
|
-
@xml.tag!('gmd:processStep')
|
45
|
-
end
|
46
|
-
|
47
|
-
# lineage - data sources
|
48
|
-
aSources = hLineage[:dataSources]
|
49
|
-
if !aSources.empty?
|
50
|
-
aSources.each do |hSource|
|
51
|
-
@xml.tag!('gmd:source') do
|
52
|
-
sourceClass.writeXML(hSource)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
elsif $showAllTags
|
56
|
-
@xml.tag!('gmd:source')
|
57
|
-
end
|
58
|
-
|
59
|
-
end
|
60
|
-
|
61
|
-
end
|
12
|
+
module ADIWG
|
13
|
+
module Mdtranslator
|
14
|
+
module Writers
|
15
|
+
module Iso
|
62
16
|
|
17
|
+
class LI_Lineage
|
18
|
+
|
19
|
+
def initialize(xml)
|
20
|
+
@xml = xml
|
21
|
+
end
|
22
|
+
|
23
|
+
def writeXML(hLineage)
|
24
|
+
|
25
|
+
# classes used
|
26
|
+
sourceClass = $WriterNS::LI_Source.new(@xml)
|
27
|
+
pStepClass = $WriterNS::LI_ProcessStep.new(@xml)
|
28
|
+
|
29
|
+
@xml.tag!('gmd:LI_Lineage') do
|
30
|
+
|
31
|
+
# lineage - statement
|
32
|
+
s = hLineage[:statement]
|
33
|
+
if !s.nil?
|
34
|
+
@xml.tag!('gmd:statement') do
|
35
|
+
@xml.tag!('gco:CharacterString', s)
|
36
|
+
end
|
37
|
+
elsif $showAllTags
|
38
|
+
@xml.tag!('gmd:statement')
|
39
|
+
end
|
40
|
+
|
41
|
+
# lineage - processing steps
|
42
|
+
aProcSteps = hLineage[:processSteps]
|
43
|
+
if !aProcSteps.empty?
|
44
|
+
aProcSteps.each do |pStep|
|
45
|
+
@xml.tag!('gmd:processStep') do
|
46
|
+
pStepClass.writeXML(pStep)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
elsif $showAllTags
|
50
|
+
@xml.tag!('gmd:processStep')
|
51
|
+
end
|
52
|
+
|
53
|
+
# lineage - data sources
|
54
|
+
aSources = hLineage[:dataSources]
|
55
|
+
if !aSources.empty?
|
56
|
+
aSources.each do |hSource|
|
57
|
+
@xml.tag!('gmd:source') do
|
58
|
+
sourceClass.writeXML(hSource)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
elsif $showAllTags
|
62
|
+
@xml.tag!('gmd:source')
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
63
74
|
end
|
@@ -4,65 +4,76 @@
|
|
4
4
|
|
5
5
|
# History:
|
6
6
|
# Stan Smith 2014-12-02 original script
|
7
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
def writeXML(hItem)
|
15
|
-
|
16
|
-
@xml.tag!('gfc:FC_ListedValue') do
|
17
|
-
|
18
|
-
# listed value - label - required
|
19
|
-
# use domain item name
|
20
|
-
s = hItem[:itemName]
|
21
|
-
if !s.nil?
|
22
|
-
@xml.tag!('gfc:label') do
|
23
|
-
@xml.tag!('gco:CharacterString', s)
|
24
|
-
end
|
25
|
-
else
|
26
|
-
@xml.tag!('gfc:label', {'gco:nilReason' => 'missing'})
|
27
|
-
end
|
28
|
-
|
29
|
-
# listed value - code
|
30
|
-
# use domain item value
|
31
|
-
s = hItem[:itemValue]
|
32
|
-
if !s.nil?
|
33
|
-
@xml.tag!('gfc:code') do
|
34
|
-
@xml.tag!('gco:CharacterString', s)
|
35
|
-
end
|
36
|
-
elsif $showAllTags
|
37
|
-
@xml.tag!('gfc:code')
|
38
|
-
end
|
39
|
-
|
40
|
-
# listed value - code
|
41
|
-
# use domain item value
|
42
|
-
s = hItem[:itemDefinition]
|
43
|
-
if !s.nil?
|
44
|
-
@xml.tag!('gfc:definition') do
|
45
|
-
@xml.tag!('gco:CharacterString', s)
|
46
|
-
end
|
47
|
-
elsif $showAllTags
|
48
|
-
@xml.tag!('gfc:definition')
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
def getDomain(domainID)
|
56
|
-
|
57
|
-
# find domain in domain array and return the hash
|
58
|
-
$domainList.each do |hDomain|
|
59
|
-
if hDomain[:domainId] == domainID
|
60
|
-
return hDomain
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
return {}
|
65
|
-
|
66
|
-
end
|
9
|
+
module ADIWG
|
10
|
+
module Mdtranslator
|
11
|
+
module Writers
|
12
|
+
module Iso
|
67
13
|
|
14
|
+
class FC_ListedValue
|
15
|
+
|
16
|
+
def initialize(xml)
|
17
|
+
@xml = xml
|
18
|
+
end
|
19
|
+
|
20
|
+
def writeXML(hItem)
|
21
|
+
|
22
|
+
@xml.tag!('gfc:FC_ListedValue') do
|
23
|
+
|
24
|
+
# listed value - label - required
|
25
|
+
# use domain item name
|
26
|
+
s = hItem[:itemName]
|
27
|
+
if !s.nil?
|
28
|
+
@xml.tag!('gfc:label') do
|
29
|
+
@xml.tag!('gco:CharacterString', s)
|
30
|
+
end
|
31
|
+
else
|
32
|
+
@xml.tag!('gfc:label', {'gco:nilReason' => 'missing'})
|
33
|
+
end
|
34
|
+
|
35
|
+
# listed value - code
|
36
|
+
# use domain item value
|
37
|
+
s = hItem[:itemValue]
|
38
|
+
if !s.nil?
|
39
|
+
@xml.tag!('gfc:code') do
|
40
|
+
@xml.tag!('gco:CharacterString', s)
|
41
|
+
end
|
42
|
+
elsif $showAllTags
|
43
|
+
@xml.tag!('gfc:code')
|
44
|
+
end
|
45
|
+
|
46
|
+
# listed value - code
|
47
|
+
# use domain item value
|
48
|
+
s = hItem[:itemDefinition]
|
49
|
+
if !s.nil?
|
50
|
+
@xml.tag!('gfc:definition') do
|
51
|
+
@xml.tag!('gco:CharacterString', s)
|
52
|
+
end
|
53
|
+
elsif $showAllTags
|
54
|
+
@xml.tag!('gfc:definition')
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
def getDomain(domainID)
|
62
|
+
|
63
|
+
# find domain in domain array and return the hash
|
64
|
+
$domainList.each do |hDomain|
|
65
|
+
if hDomain[:domainId] == domainID
|
66
|
+
return hDomain
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
return {}
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
68
79
|
end
|
@@ -5,60 +5,71 @@
|
|
5
5
|
# Stan Smith 2013-10-31 original script
|
6
6
|
# Stan Smith 2013-12-18 added contact
|
7
7
|
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
8
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
8
9
|
|
9
10
|
require 'code_maintenanceFrequency'
|
10
11
|
require 'class_responsibleParty'
|
11
12
|
|
12
|
-
|
13
|
+
module ADIWG
|
14
|
+
module Mdtranslator
|
15
|
+
module Writers
|
16
|
+
module Iso
|
13
17
|
|
14
|
-
|
15
|
-
@xml = xml
|
16
|
-
end
|
18
|
+
class MD_MaintenanceInformation
|
17
19
|
|
18
|
-
|
20
|
+
def initialize(xml)
|
21
|
+
@xml = xml
|
22
|
+
end
|
19
23
|
|
20
|
-
|
21
|
-
maintFreqCode = MD_MaintenanceFrequencyCode.new(@xml)
|
22
|
-
rPartyClass = CI_ResponsibleParty.new(@xml)
|
24
|
+
def writeXML(hMaintInfo)
|
23
25
|
|
24
|
-
|
26
|
+
# classes used
|
27
|
+
maintFreqCode = $WriterNS::MD_MaintenanceFrequencyCode.new(@xml)
|
28
|
+
rPartyClass = $WriterNS::CI_ResponsibleParty.new(@xml)
|
25
29
|
|
26
|
-
|
27
|
-
s = hMaintInfo[:maintFreq]
|
28
|
-
if s.nil?
|
29
|
-
@xml.tag!('gmd:maintenanceAndUpdateFrequency', {'gco:nilReason'=>'unknown'})
|
30
|
-
else
|
31
|
-
@xml.tag!('gmd:maintenanceAndUpdateFrequency') do
|
32
|
-
maintFreqCode.writeXML(s)
|
33
|
-
end
|
34
|
-
end
|
30
|
+
@xml.tag! 'gmd:MD_MaintenanceInformation' do
|
35
31
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
@xml.tag!('gmd:maintenanceNote')
|
46
|
-
end
|
32
|
+
# maintenance information - frequency code - required
|
33
|
+
s = hMaintInfo[:maintFreq]
|
34
|
+
if s.nil?
|
35
|
+
@xml.tag!('gmd:maintenanceAndUpdateFrequency', {'gco:nilReason' => 'unknown'})
|
36
|
+
else
|
37
|
+
@xml.tag!('gmd:maintenanceAndUpdateFrequency') do
|
38
|
+
maintFreqCode.writeXML(s)
|
39
|
+
end
|
40
|
+
end
|
47
41
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
42
|
+
# maintenance information - note
|
43
|
+
aNotes = hMaintInfo[:maintNotes]
|
44
|
+
if !aNotes.empty?
|
45
|
+
aNotes.each do |note|
|
46
|
+
@xml.tag!('gmd:maintenanceNote') do
|
47
|
+
@xml.tag!('gco:CharacterString', note)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
elsif $showAllTags
|
51
|
+
@xml.tag!('gmd:maintenanceNote')
|
52
|
+
end
|
59
53
|
|
60
|
-
|
54
|
+
# maintenance information - contact - CI_ResponsibleParty
|
55
|
+
aContacts = hMaintInfo[:maintContacts]
|
56
|
+
if aContacts.empty? && $shoeEmpty
|
57
|
+
@xml.tag!('gmd:contact')
|
58
|
+
else
|
59
|
+
aContacts.each do |hContact|
|
60
|
+
@xml.tag!('gmd:contact') do
|
61
|
+
rPartyClass.writeXML(hContact)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
61
65
|
|
62
|
-
|
66
|
+
end
|
63
67
|
|
64
|
-
end
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -4,56 +4,67 @@
|
|
4
4
|
# History:
|
5
5
|
# Stan Smith 2013-09-26 original script
|
6
6
|
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
7
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
7
8
|
|
8
9
|
require 'code_mediumName'
|
9
10
|
require 'code_mediumFormat'
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
def writeXML(medium)
|
18
|
-
|
19
|
-
# classes used
|
20
|
-
medFormatCode = MD_MediumFormatCode.new(@xml)
|
21
|
-
medNameCode = MD_MediumNameCode.new(@xml)
|
22
|
-
|
23
|
-
@xml.tag!('gmd:MD_Medium') do
|
24
|
-
|
25
|
-
# medium - name - MD_MediumNameCode
|
26
|
-
s = medium[:mediumName]
|
27
|
-
if !s.nil?
|
28
|
-
@xml.tag!('gmd:name') do
|
29
|
-
medNameCode.writeXML(s)
|
30
|
-
end
|
31
|
-
elsif $showAllTags
|
32
|
-
@xml.tag!('gmd:name')
|
33
|
-
end
|
34
|
-
|
35
|
-
# medium - medium format - MD_MediumFormatCode
|
36
|
-
s = medium[:mediumFormat]
|
37
|
-
if !s.nil?
|
38
|
-
@xml.tag!('gmd:mediumFormat') do
|
39
|
-
medFormatCode.writeXML(s)
|
40
|
-
end
|
41
|
-
elsif $showAllTags
|
42
|
-
@xml.tag!('gmd:mediumFormat')
|
43
|
-
end
|
44
|
-
|
45
|
-
# medium - medium note
|
46
|
-
s = medium[:mediumNote]
|
47
|
-
if !s.nil?
|
48
|
-
@xml.tag!('gmd:mediumNote') do
|
49
|
-
@xml.tag!('gco:CharacterString',s)
|
50
|
-
end
|
51
|
-
elsif $showAllTags
|
52
|
-
@xml.tag!('gmd:mediumNote')
|
53
|
-
end
|
54
|
-
|
55
|
-
end
|
56
|
-
|
57
|
-
end
|
12
|
+
module ADIWG
|
13
|
+
module Mdtranslator
|
14
|
+
module Writers
|
15
|
+
module Iso
|
58
16
|
|
17
|
+
class MD_Medium
|
18
|
+
|
19
|
+
def initialize(xml)
|
20
|
+
@xml = xml
|
21
|
+
end
|
22
|
+
|
23
|
+
def writeXML(medium)
|
24
|
+
|
25
|
+
# classes used
|
26
|
+
medFormatCode = $WriterNS::MD_MediumFormatCode.new(@xml)
|
27
|
+
medNameCode = $WriterNS::MD_MediumNameCode.new(@xml)
|
28
|
+
|
29
|
+
@xml.tag!('gmd:MD_Medium') do
|
30
|
+
|
31
|
+
# medium - name - MD_MediumNameCode
|
32
|
+
s = medium[:mediumName]
|
33
|
+
if !s.nil?
|
34
|
+
@xml.tag!('gmd:name') do
|
35
|
+
medNameCode.writeXML(s)
|
36
|
+
end
|
37
|
+
elsif $showAllTags
|
38
|
+
@xml.tag!('gmd:name')
|
39
|
+
end
|
40
|
+
|
41
|
+
# medium - medium format - MD_MediumFormatCode
|
42
|
+
s = medium[:mediumFormat]
|
43
|
+
if !s.nil?
|
44
|
+
@xml.tag!('gmd:mediumFormat') do
|
45
|
+
medFormatCode.writeXML(s)
|
46
|
+
end
|
47
|
+
elsif $showAllTags
|
48
|
+
@xml.tag!('gmd:mediumFormat')
|
49
|
+
end
|
50
|
+
|
51
|
+
# medium - medium note
|
52
|
+
s = medium[:mediumNote]
|
53
|
+
if !s.nil?
|
54
|
+
@xml.tag!('gmd:mediumNote') do
|
55
|
+
@xml.tag!('gco:CharacterString', s)
|
56
|
+
end
|
57
|
+
elsif $showAllTags
|
58
|
+
@xml.tag!('gmd:mediumNote')
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
59
70
|
end
|