adiwg-mdtranslator 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -7
- data/Rakefile +1 -2
- data/adiwg-mdtranslator.gemspec +23 -23
- data/bin/mdtranslator +187 -155
- data/lib/adiwg/mdtranslator.rb +63 -38
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +123 -5
- data/lib/adiwg/mdtranslator/internal/module_coordinates.rb +55 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +98 -70
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_validator.rb +13 -11
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_additionalDocumentation.rb +13 -3
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_address.rb +3 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_associatedResource.rb +22 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_boundingBox.rb +3 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_browseGraphic.rb +11 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_citation.rb +28 -9
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_classedData.rb +49 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_classedDataItem.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_contacts.rb +14 -12
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_coverageInfo.rb +83 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_coverageItem.rb +136 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_dataDictionary.rb +9 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_dataQuality.rb +17 -3
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_dateTime.rb +3 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_descriptiveKeyword.rb +22 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_dictionaryInfo.rb +18 -3
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_digitalTransferOption.rb +80 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_dimension.rb +81 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_distributionInfo.rb +89 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_distributionOrder.rb +62 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_domain.rb +24 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_domainItem.rb +23 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_entity.rb +26 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_entityAttribute.rb +24 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_entityForeignKey.rb +20 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_entityIndex.rb +20 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_extent.rb +9 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_geoCoordSystem.rb +3 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_geoProperties.rb +9 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_geographicElement.rb +20 -18
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_gridInfo.rb +67 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_imageInfo.rb +119 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_legalConstraint.rb +7 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_lineString.rb +5 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_lineage.rb +11 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_locale.rb +57 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_mdJson.rb +10 -9
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_medium.rb +73 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_metadata.rb +14 -12
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_metadataExtension.rb +3 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_metadataInfo.rb +35 -15
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_onlineResource.rb +7 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_phone.rb +3 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_point.rb +5 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_polygon.rb +5 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_processStep.rb +19 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resolution.rb +7 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resourceFormat.rb +12 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resourceIdentifier.rb +30 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resourceInfo.rb +70 -33
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resourceMaintenance.rb +5 -3
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resourceSpecificUsage.rb +5 -3
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_responsibleParty.rb +10 -8
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_securityConstraint.rb +3 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_sensorInfo.rb +69 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_source.rb +11 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_spatialReference.rb +3 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_taxonClass.rb +3 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_taxonomy.rb +11 -9
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_temporalElement.rb +9 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_timeInstant.rb +5 -3
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_timePeriod.rb +6 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_verticalElement.rb +3 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_voucher.rb +5 -3
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/version.rb +19 -0
- data/lib/adiwg/mdtranslator/readers/mdReaders.rb +21 -18
- data/lib/adiwg/mdtranslator/version.rb +15 -1
- data/lib/adiwg/mdtranslator/writers/html/html_writer.rb +11 -8
- data/lib/adiwg/mdtranslator/writers/html/md_html_writer.rb +21 -18
- data/lib/adiwg/mdtranslator/writers/html/sections/html_additionalDocumentation.rb +48 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_associatedResource.rb +73 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +84 -135
- data/lib/adiwg/mdtranslator/writers/html/sections/html_citation.rb +18 -8
- data/lib/adiwg/mdtranslator/writers/html/sections/html_classedData.rb +50 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_classedDataItem.rb +50 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_contact.rb +5 -9
- data/lib/adiwg/mdtranslator/writers/html/sections/html_coverageInfo.rb +88 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_coverageItem.rb +139 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_dataDictionary.rb +13 -12
- data/lib/adiwg/mdtranslator/writers/html/sections/html_dataLineage.rb +5 -4
- data/lib/adiwg/mdtranslator/writers/html/sections/html_dataSource.rb +5 -4
- data/lib/adiwg/mdtranslator/writers/html/sections/html_dimension.rb +71 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_distributor.rb +62 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_domain.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_entity.rb +5 -4
- data/lib/adiwg/mdtranslator/writers/html/sections/html_extent.rb +7 -6
- data/lib/adiwg/mdtranslator/writers/html/sections/html_format.rb +7 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_geographicElement.rb +7 -7
- data/lib/adiwg/mdtranslator/writers/html/sections/html_gridInfo.rb +65 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_head.rb +18 -3
- data/lib/adiwg/mdtranslator/writers/html/sections/html_imageInfo.rb +120 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_inlineCss.css +13 -20
- data/lib/adiwg/mdtranslator/writers/html/sections/html_keyword.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_medium.rb +19 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_metadataInfo.rb +22 -9
- data/lib/adiwg/mdtranslator/writers/html/sections/html_orderProcess.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_processStep.rb +5 -4
- data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceContact.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceGeneral.rb +25 -14
- data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceId.rb +30 -3
- data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceInfo.rb +194 -129
- data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceMaint.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceOther.rb +7 -6
- data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceUsage.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_responsibleParty.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_sensorInfo.rb +66 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomy.rb +7 -6
- data/lib/adiwg/mdtranslator/writers/html/sections/html_temporalElement.rb +7 -6
- data/lib/adiwg/mdtranslator/writers/html/sections/html_timeInstant.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_timePeriod.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_transferOption.rb +29 -4
- data/lib/adiwg/mdtranslator/writers/html/version.rb +17 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/class_FCfeatureCatalogue.rb +17 -16
- data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_address.rb +12 -8
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_baseUnit.rb +42 -0
- data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_codelist.rb +8 -3
- data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_contact.rb +16 -25
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_conventionalUnit.rb +68 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_definitionUnit.rb +39 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_derivedUnit.rb +46 -0
- data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_featureAttribute.rb +17 -14
- data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_featureConstraint.rb +6 -2
- data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_featureType.rb +16 -12
- data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_listedValue.rb +9 -18
- data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_multiplicity.rb +8 -4
- data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_onlineResource.rb +13 -9
- data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_responsibleParty.rb +16 -12
- data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_telephone.rb +9 -5
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_unitsOfMeasure.rb +262 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +36 -16
- data/lib/adiwg/mdtranslator/writers/iso19110/version.rb +14 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/class_MImetadata.rb +73 -37
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_address.rb +116 -0
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_aggregateInformation.rb +13 -9
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_band.rb +165 -0
- data/lib/adiwg/mdtranslator/writers/{iso/units → iso19115_2/classes}/class_baseUnit.rb +6 -6
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_boundingPolygon.rb +14 -10
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_browseGraphic.rb +9 -5
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_citation.rb +31 -16
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_codelist.rb +56 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_contact.rb +87 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_contentInfo.rb +111 -0
- data/lib/adiwg/mdtranslator/writers/{iso/units → iso19115_2/classes}/class_conventionalUnit.rb +6 -6
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_dataIdentification.rb +106 -59
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_dataQuality.rb +11 -7
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_date.rb +8 -5
- data/lib/adiwg/mdtranslator/writers/{iso/units → iso19115_2/classes}/class_definitionUnit.rb +7 -7
- data/lib/adiwg/mdtranslator/writers/{iso/units → iso19115_2/classes}/class_derivedUnit.rb +6 -6
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_digitalTransferOptions.rb +92 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dimension.rb +68 -0
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_distribution.rb +8 -4
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_distributor.rb +44 -22
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_enumerationList.rb +7 -2
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_extent.rb +18 -14
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_format.rb +18 -2
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_geographicBoundingBox.rb +6 -2
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_geographicDescription.rb +8 -4
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_geographicElement.rb +10 -6
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gridInfo.rb +80 -0
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_identifier.rb +10 -6
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_imageDescription.rb +157 -0
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_keyword.rb +12 -8
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_legalConstraints.rb +12 -8
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_lineString.rb +13 -10
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_lineage.rb +14 -10
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_locale.rb +67 -0
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_maintenanceInformation.rb +12 -8
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_medium.rb +30 -9
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_metadataExtension.rb +19 -15
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_multiGeometry.rb +22 -17
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_onlineResource.rb +94 -0
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_point.rb +12 -9
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_polygon.rb +14 -11
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_processStep.rb +12 -9
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rangeElementDescription.rb +88 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +52 -0
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_resolution.rb +6 -2
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_resourceIdentifier.rb +94 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_responsibleParty.rb +106 -0
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_securityConstraints.rb +12 -8
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_source.rb +12 -8
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_standardOrderProcess.rb +11 -9
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_taxonClassification.rb +8 -4
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_taxonSystem.rb +18 -14
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_telephone.rb +92 -0
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_temporalExtent.rb +10 -6
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_timeInstant.rb +9 -8
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_timePeriod.rb +10 -8
- data/lib/adiwg/mdtranslator/writers/{iso/units → iso19115_2/classes}/class_unitsOfMeasure.rb +48 -25
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_usage.rb +11 -7
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_useConstraints.rb +6 -2
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_verticalExtent.rb +6 -2
- data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_vouchers.rb +8 -4
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +32 -19
- data/lib/adiwg/mdtranslator/writers/iso19115_2/version.rb +17 -0
- data/lib/adiwg/mdtranslator/writers/mdWriters.rb +21 -24
- data/test/readers/mdJson/v1/tc_reader_mdjson_additionalDocumentation.rb +116 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_address.rb +111 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_associatedResource.rb +157 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_browseGraphic.rb +119 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_citation.rb +143 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_contact.rb +138 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_dataQuality.rb +111 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_dateTime.rb +159 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_descriptiveKeyword.rb +115 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_dictionaryInfo.rb +121 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_digitalTransferOption.rb +94 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_distributionOrder.rb +103 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_domain.rb +130 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_domainItem.rb +98 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_entity.rb +134 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_entityAttribute.rb +154 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_entityForeignKey.rb +100 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_entityIndex.rb +99 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_legalConstraint.rb +104 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_lineage.rb +117 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_medium.rb +98 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_metadataInfo.rb +141 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_onlineResource.rb +110 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_phone.rb +112 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_processStep.rb +118 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_resolution.rb +77 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_source.rb +117 -0
- data/test/readers/mdJson/v1/tc_translation_19110.rb +57 -0
- data/test/readers/mdJson/{v1_0/tc_translation.rb → v1/tc_translation_19115_2.rb} +16 -31
- data/test/writers/iso19115_2/tc_writer_iso19115_2_address.rb +22 -15
- metadata +219 -140
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_coordinates.rb +0 -63
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_distributionInfo.rb +0 -161
- data/lib/adiwg/mdtranslator/writers/html/sections/logo150.txt +0 -25
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_digitalTransferOptions.rb +0 -62
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_genericMetaData.rb +0 -74
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceIdentifier.rb +0 -53
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceSystem.rb +0 -40
- data/test/readers/mdJson/v1_0/tc_reader_mdjson_additionalDocumentation.rb +0 -85
- data/test/readers/mdJson/v1_0/tc_reader_mdjson_address.rb +0 -100
- data/test/readers/mdJson/v1_0/tc_reader_mdjson_associatedResource.rb +0 -101
- data/test/readers/mdJson/v1_0/tc_reader_mdjson_browseGraphic.rb +0 -86
- data/test/readers/mdJson/v1_0/tc_reader_mdjson_citation.rb +0 -116
- data/test/readers/mdJson/v1_0/tc_reader_mdjson_contact.rb +0 -138
- data/test/readers/mdJson/v1_0/tc_reader_mdjson_dictionaryInfo.rb +0 -95
- data/test/readers/mdJson/v1_0/tc_reader_mdjson_domain.rb +0 -99
- data/test/readers/mdJson/v1_0/tc_reader_mdjson_onlineResource.rb +0 -92
- data/test/readers/mdJson/v1_0/tc_reader_mdjson_phone.rb +0 -110
@@ -8,6 +8,8 @@
|
|
8
8
|
# Stan Smith 2014-12-01 changed adiwgJson to mdJson in version name check
|
9
9
|
# Stan Smith 2014-12-03 changed class name to MdJsonValidation from AdiwgJsonValidation
|
10
10
|
# Stan Smith 2014-12-11 added namespace
|
11
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
|
12
|
+
|
11
13
|
|
12
14
|
require 'json'
|
13
15
|
require 'json-schema'
|
@@ -23,31 +25,31 @@ module ADIWG
|
|
23
25
|
|
24
26
|
# validate json against the adiwg-json_schemas
|
25
27
|
# only one schema version is supported at this time
|
26
|
-
def self.validate(file)
|
27
|
-
begin
|
28
|
+
def self.validate(file, responseObj)
|
28
29
|
|
30
|
+
begin
|
29
31
|
schema = ADIWG::MdjsonSchemas::Utils.schema_path
|
30
32
|
aValErrs = Array.new
|
31
|
-
if
|
33
|
+
if responseObj[:readerValidationLevel] == 'strict'
|
32
34
|
aValErrs = JSON::Validator.fully_validate(schema, file, :strict => true, :errors_as_objects => true)
|
33
|
-
elsif
|
35
|
+
elsif responseObj[:readerValidationLevel] == 'normal'
|
34
36
|
aValErrs = JSON::Validator.fully_validate(schema, file, :errors_as_objects => true)
|
35
37
|
end
|
36
38
|
|
37
39
|
if aValErrs.length > 0
|
38
|
-
|
39
|
-
|
40
|
-
|
40
|
+
responseObj[:readerValidationPass] = false
|
41
|
+
responseObj[:readerValidationMessages] << 'mdJson schema validation Failed - see following message(s):\n'
|
42
|
+
responseObj[:readerValidationMessages] << aValErrs
|
41
43
|
return
|
42
44
|
end
|
43
45
|
rescue JSON::Schema::ValidationError
|
44
|
-
|
45
|
-
|
46
|
-
|
46
|
+
responseObj[:readerValidationPass] = false
|
47
|
+
responseObj[:readerValidationMessages] << 'mdJson schema validation Failed - see following message(s):\n'
|
48
|
+
responseObj[:readerValidationMessages] << $!.message
|
47
49
|
return
|
48
50
|
end
|
49
51
|
|
50
|
-
|
52
|
+
responseObj[:readerValidationPass] = true
|
51
53
|
end
|
52
54
|
|
53
55
|
end
|
@@ -7,8 +7,10 @@
|
|
7
7
|
# Stan Smith 2014-12-30 added return if empty input
|
8
8
|
# ... found & fixed error of method using associatedResource object instead of
|
9
9
|
# ... additionalDocumentation object
|
10
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
|
11
|
+
# Stan Smith 2015-07-14 refactored to remove global namespace constants
|
10
12
|
|
11
|
-
require
|
13
|
+
require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_citation')
|
12
14
|
|
13
15
|
module ADIWG
|
14
16
|
module Mdtranslator
|
@@ -17,7 +19,7 @@ module ADIWG
|
|
17
19
|
|
18
20
|
module AdditionalDocumentation
|
19
21
|
|
20
|
-
def self.unpack(hAddDoc)
|
22
|
+
def self.unpack(hAddDoc, responseObj)
|
21
23
|
|
22
24
|
# return nil object if input is empty
|
23
25
|
intAddDoc = nil
|
@@ -39,8 +41,16 @@ module ADIWG
|
|
39
41
|
if hAddDoc.has_key?('citation')
|
40
42
|
hCitation = hAddDoc['citation']
|
41
43
|
unless hCitation.empty?
|
42
|
-
intAddDoc[:citation] =
|
44
|
+
intAddDoc[:citation] = Citation.unpack(hCitation, responseObj)
|
45
|
+
else
|
46
|
+
responseObj[:readerExecutionMessages] << 'Additional documentation citation is empty'
|
47
|
+
responseObj[:readerExecutionPass] = false
|
48
|
+
return nil
|
43
49
|
end
|
50
|
+
else
|
51
|
+
responseObj[:readerExecutionMessages] << 'Additional documentation citation is missing'
|
52
|
+
responseObj[:readerExecutionPass] = false
|
53
|
+
return nil
|
44
54
|
end
|
45
55
|
|
46
56
|
return intAddDoc
|
@@ -7,6 +7,8 @@
|
|
7
7
|
# Stan Smith 2014-12-19 prevented passing blank deliveryPoints and
|
8
8
|
# ... electronicMailAddresses into internal object
|
9
9
|
# Stan Smith 2014-12-30 refactored
|
10
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
|
11
|
+
# Stan Smith 2015-07-14 refactored to remove global namespace constants
|
10
12
|
|
11
13
|
module ADIWG
|
12
14
|
module Mdtranslator
|
@@ -15,7 +17,7 @@ module ADIWG
|
|
15
17
|
|
16
18
|
module Address
|
17
19
|
|
18
|
-
def self.unpack(hConAddress)
|
20
|
+
def self.unpack(hConAddress, responseObj)
|
19
21
|
|
20
22
|
# return nil object if input is empty
|
21
23
|
intAdd = nil
|
data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_associatedResource.rb
RENAMED
@@ -11,8 +11,10 @@
|
|
11
11
|
# Stan Smith 2014-11-06 added resourceType for 0.9.0
|
12
12
|
# Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
|
13
13
|
# Stan Smith 2014-12-30 added return if empty input
|
14
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
|
15
|
+
# Stan Smith 2015-07-14 refactored to remove global namespace constants
|
14
16
|
|
15
|
-
require
|
17
|
+
require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_citation')
|
16
18
|
|
17
19
|
module ADIWG
|
18
20
|
module Mdtranslator
|
@@ -21,7 +23,7 @@ module ADIWG
|
|
21
23
|
|
22
24
|
module AssociatedResource
|
23
25
|
|
24
|
-
def self.unpack(hAssocRes)
|
26
|
+
def self.unpack(hAssocRes, responseObj)
|
25
27
|
|
26
28
|
# return nil object if input is empty
|
27
29
|
intAssocRes = nil
|
@@ -36,7 +38,15 @@ module ADIWG
|
|
36
38
|
s = hAssocRes['associationType']
|
37
39
|
if s != ''
|
38
40
|
intAssocRes[:associationType] = s
|
41
|
+
else
|
42
|
+
responseObj[:readerExecutionMessages] << 'Associated resource association type is empty'
|
43
|
+
responseObj[:readerExecutionPass] = false
|
44
|
+
return nil
|
39
45
|
end
|
46
|
+
else
|
47
|
+
responseObj[:readerExecutionMessages] << 'Associated resource association type is missing'
|
48
|
+
responseObj[:readerExecutionPass] = false
|
49
|
+
return nil
|
40
50
|
end
|
41
51
|
|
42
52
|
# associated resource - initiative type
|
@@ -52,14 +62,22 @@ module ADIWG
|
|
52
62
|
s = hAssocRes['resourceType']
|
53
63
|
if s != ''
|
54
64
|
intAssocRes[:resourceType] = s
|
65
|
+
else
|
66
|
+
responseObj[:readerExecutionMessages] << 'Associated resource resource type is empty'
|
67
|
+
responseObj[:readerExecutionPass] = false
|
68
|
+
return nil
|
55
69
|
end
|
70
|
+
else
|
71
|
+
responseObj[:readerExecutionMessages] << 'Associated resource resource type is missing'
|
72
|
+
responseObj[:readerExecutionPass] = false
|
73
|
+
return nil
|
56
74
|
end
|
57
75
|
|
58
76
|
# associated resource - resource citation
|
59
77
|
if hAssocRes.has_key?('resourceCitation')
|
60
78
|
hCitation = hAssocRes['resourceCitation']
|
61
79
|
unless hCitation.empty?
|
62
|
-
intAssocRes[:resourceCitation] =
|
80
|
+
intAssocRes[:resourceCitation] = Citation.unpack(hCitation, responseObj)
|
63
81
|
end
|
64
82
|
end
|
65
83
|
|
@@ -67,7 +85,7 @@ module ADIWG
|
|
67
85
|
if hAssocRes.has_key?('metadataCitation')
|
68
86
|
hCitation = hAssocRes['metadataCitation']
|
69
87
|
unless hCitation.empty?
|
70
|
-
intAssocRes[:metadataCitation] =
|
88
|
+
intAssocRes[:metadataCitation] = Citation.unpack(hCitation, responseObj)
|
71
89
|
end
|
72
90
|
end
|
73
91
|
|
@@ -5,6 +5,8 @@
|
|
5
5
|
# Stan Smith 2013-11-07 original script
|
6
6
|
# Stan Smith 2014-04-28 reorganized for json schema 0.3.0
|
7
7
|
# Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
|
8
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
|
9
|
+
# Stan Smith 2015-07-14 refactored to remove global namespace constants
|
8
10
|
|
9
11
|
module ADIWG
|
10
12
|
module Mdtranslator
|
@@ -13,7 +15,7 @@ module ADIWG
|
|
13
15
|
|
14
16
|
module BoundingBox
|
15
17
|
|
16
|
-
def self.unpack(aBBox)
|
18
|
+
def self.unpack(aBBox, responseObj)
|
17
19
|
|
18
20
|
# instance classes needed in script
|
19
21
|
intMetadataClass = InternalMetadata.new
|
data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_browseGraphic.rb
RENAMED
@@ -8,6 +8,8 @@
|
|
8
8
|
# Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
|
9
9
|
# Stan Smith 2014-12-24 added return if input hash is empty
|
10
10
|
# Stan Smith 2014-12-30 refactored
|
11
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
|
12
|
+
# Stan Smith 2015-07-14 refactored to remove global namespace constants
|
11
13
|
|
12
14
|
module ADIWG
|
13
15
|
module Mdtranslator
|
@@ -16,7 +18,7 @@ module ADIWG
|
|
16
18
|
|
17
19
|
module BrowseGraphic
|
18
20
|
|
19
|
-
def self.unpack(hBgraphic)
|
21
|
+
def self.unpack(hBgraphic, responseObj)
|
20
22
|
|
21
23
|
# return nil object if input is empty
|
22
24
|
intBGraphic = nil
|
@@ -31,7 +33,15 @@ module ADIWG
|
|
31
33
|
s = hBgraphic['fileName']
|
32
34
|
if s != ''
|
33
35
|
intBGraphic[:bGName] = s
|
36
|
+
else
|
37
|
+
responseObj[:readerExecutionMessages] << 'Graphic overview name is empty'
|
38
|
+
responseObj[:readerExecutionPass] = false
|
39
|
+
return nil
|
34
40
|
end
|
41
|
+
else
|
42
|
+
responseObj[:readerExecutionMessages] << 'Graphic overview name is missing'
|
43
|
+
responseObj[:readerExecutionPass] = false
|
44
|
+
return nil
|
35
45
|
end
|
36
46
|
|
37
47
|
# graphic - file description
|
@@ -9,11 +9,14 @@
|
|
9
9
|
# Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
|
10
10
|
# Stan Smith 2014-12-19 refactored to return nil when hCitation is empty
|
11
11
|
# Stan Smith 2014-12-30 refactored
|
12
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
|
13
|
+
# Stan Smith 2015-07-14 refactored to remove global namespace constants
|
14
|
+
# Stan Smith 2015-08-28 added alternate title
|
12
15
|
|
13
|
-
require
|
14
|
-
require
|
15
|
-
require
|
16
|
-
require
|
16
|
+
require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_dateTime')
|
17
|
+
require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_responsibleParty')
|
18
|
+
require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_onlineResource')
|
19
|
+
require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_resourceIdentifier')
|
17
20
|
|
18
21
|
module ADIWG
|
19
22
|
module Mdtranslator
|
@@ -22,7 +25,7 @@ module ADIWG
|
|
22
25
|
|
23
26
|
module Citation
|
24
27
|
|
25
|
-
def self.unpack(hCitation)
|
28
|
+
def self.unpack(hCitation, responseObj)
|
26
29
|
|
27
30
|
# return nil object if input is empty
|
28
31
|
intCitation = nil
|
@@ -37,6 +40,22 @@ module ADIWG
|
|
37
40
|
s = hCitation['title']
|
38
41
|
if s != ''
|
39
42
|
intCitation[:citTitle] = s
|
43
|
+
else
|
44
|
+
responseObj[:readerExecutionMessages] << 'Citation title is empty'
|
45
|
+
responseObj[:readerExecutionPass] = false
|
46
|
+
return nil
|
47
|
+
end
|
48
|
+
else
|
49
|
+
responseObj[:readerExecutionMessages] << 'Citation title is missing'
|
50
|
+
responseObj[:readerExecutionPass] = false
|
51
|
+
return nil
|
52
|
+
end
|
53
|
+
|
54
|
+
# citation - alternate title
|
55
|
+
if hCitation.has_key?('alternateTitle')
|
56
|
+
s = hCitation['alternateTitle']
|
57
|
+
if s != ''
|
58
|
+
intCitation[:citAltTitle] = s
|
40
59
|
end
|
41
60
|
end
|
42
61
|
|
@@ -48,7 +67,7 @@ module ADIWG
|
|
48
67
|
if hCitDate.has_key?('date')
|
49
68
|
s = hCitDate['date']
|
50
69
|
if s != ''
|
51
|
-
intDateTime =
|
70
|
+
intDateTime = DateTime.unpack(s, responseObj)
|
52
71
|
if hCitDate.has_key?('dateType')
|
53
72
|
s = hCitDate['dateType']
|
54
73
|
if s != ''
|
@@ -75,7 +94,7 @@ module ADIWG
|
|
75
94
|
aRParty = hCitation['responsibleParty']
|
76
95
|
unless aRParty.empty?
|
77
96
|
aRParty.each do |hRParty|
|
78
|
-
intCitation[:citResponsibleParty] <<
|
97
|
+
intCitation[:citResponsibleParty] << ResponsibleParty.unpack(hRParty, responseObj)
|
79
98
|
end
|
80
99
|
end
|
81
100
|
end
|
@@ -95,7 +114,7 @@ module ADIWG
|
|
95
114
|
aResIds = hCitation['identifier']
|
96
115
|
aResIds.each do |hIdentifier|
|
97
116
|
unless hIdentifier.empty?
|
98
|
-
intCitation[:citResourceIds] <<
|
117
|
+
intCitation[:citResourceIds] << ResourceIdentifier.unpack(hIdentifier, responseObj)
|
99
118
|
end
|
100
119
|
end
|
101
120
|
end
|
@@ -105,7 +124,7 @@ module ADIWG
|
|
105
124
|
aOlRes = hCitation['onlineResource']
|
106
125
|
aOlRes.each do |hOlRes|
|
107
126
|
unless hOlRes.empty?
|
108
|
-
intCitation[:citOlResources] <<
|
127
|
+
intCitation[:citOlResources] << OnlineResource.unpack(hOlRes, responseObj)
|
109
128
|
end
|
110
129
|
end
|
111
130
|
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# unpack classed data
|
2
|
+
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2015-08-20 original script
|
6
|
+
|
7
|
+
require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_classedDataItem')
|
8
|
+
|
9
|
+
module ADIWG
|
10
|
+
module Mdtranslator
|
11
|
+
module Readers
|
12
|
+
module MdJson
|
13
|
+
|
14
|
+
module ClassedData
|
15
|
+
|
16
|
+
def self.unpack(hClassData, responseObj)
|
17
|
+
|
18
|
+
# instance classes needed in script
|
19
|
+
intMetadataClass = InternalMetadata.new
|
20
|
+
hClass = intMetadataClass.newClassedData
|
21
|
+
|
22
|
+
# classed data - number of classed items
|
23
|
+
if hClassData.has_key?('numberOfClasses')
|
24
|
+
s = hClassData['numberOfClasses']
|
25
|
+
if s != ''
|
26
|
+
hClass[:numberOfClasses] = s
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# classed data - classed data items
|
31
|
+
if hClassData.has_key?('classifiedDataItem')
|
32
|
+
aClassItems = hClassData['classifiedDataItem']
|
33
|
+
aClassItems.each do |hClassItem|
|
34
|
+
if !hClassItem.empty?
|
35
|
+
hClass[:classedDataItems] << ClassedDataItem.unpack(hClassItem, responseObj)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
return hClass
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# unpack classed data item
|
2
|
+
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2015-08-20 original script
|
6
|
+
|
7
|
+
module ADIWG
|
8
|
+
module Mdtranslator
|
9
|
+
module Readers
|
10
|
+
module MdJson
|
11
|
+
|
12
|
+
module ClassedDataItem
|
13
|
+
|
14
|
+
def self.unpack(hClassData, responseObj)
|
15
|
+
|
16
|
+
# instance classes needed in script
|
17
|
+
intMetadataClass = InternalMetadata.new
|
18
|
+
hClassItem = intMetadataClass.newClassedDataItem
|
19
|
+
|
20
|
+
# classed data item - name
|
21
|
+
if hClassData.has_key?('className')
|
22
|
+
s = hClassData['className']
|
23
|
+
if s != ''
|
24
|
+
hClassItem[:className] = s
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
# classed data item - description
|
29
|
+
if hClassData.has_key?('classDescription')
|
30
|
+
s = hClassData['classDescription']
|
31
|
+
if s != ''
|
32
|
+
hClassItem[:classDescription] = s
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# classed data item - value
|
37
|
+
if hClassData.has_key?('classValue')
|
38
|
+
s = hClassData['classValue']
|
39
|
+
if s != ''
|
40
|
+
hClassItem[:classValue] = s
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
return hClassItem
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -14,10 +14,12 @@
|
|
14
14
|
# Stan Smith 2014-12-19 added testing and messages for '' and missing contactId
|
15
15
|
# Stan Smith 2014-12-19 added testing to not place nil address into internal object
|
16
16
|
# Stan Smith 2014-12-30 refactored
|
17
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
|
18
|
+
# Stan Smith 2015-07-14 refactored to remove global namespace constants
|
17
19
|
|
18
|
-
require
|
19
|
-
require
|
20
|
-
require
|
20
|
+
require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_address')
|
21
|
+
require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_onlineResource')
|
22
|
+
require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_phone')
|
21
23
|
|
22
24
|
module ADIWG
|
23
25
|
module Mdtranslator
|
@@ -26,10 +28,10 @@ module ADIWG
|
|
26
28
|
|
27
29
|
module Contact
|
28
30
|
|
29
|
-
def self.unpack(hContact)
|
31
|
+
def self.unpack(hContact, responseObj)
|
30
32
|
|
31
33
|
# return nil object if input is empty
|
32
|
-
|
34
|
+
intCont = nil
|
33
35
|
return if hContact.empty?
|
34
36
|
|
35
37
|
# instance classes needed in script
|
@@ -45,13 +47,13 @@ module ADIWG
|
|
45
47
|
if s != ''
|
46
48
|
intCont[:contactId] = s
|
47
49
|
else
|
48
|
-
|
49
|
-
|
50
|
+
responseObj[:readerExecutionPass] = false
|
51
|
+
responseObj[:readerExecutionMessages] << 'contact: {contactId: } is blank.'
|
50
52
|
return nil
|
51
53
|
end
|
52
54
|
else
|
53
|
-
|
54
|
-
|
55
|
+
responseObj[:readerExecutionPass] = false
|
56
|
+
responseObj[:readerExecutionMessages] << 'contact: {contactId: } is missing.'
|
55
57
|
return nil
|
56
58
|
end
|
57
59
|
|
@@ -84,7 +86,7 @@ module ADIWG
|
|
84
86
|
aOlRes = hContact['onlineResource']
|
85
87
|
aOlRes.each do |hOlRes|
|
86
88
|
unless hOlRes.empty?
|
87
|
-
intCont[:onlineRes] <<
|
89
|
+
intCont[:onlineRes] << OnlineResource.unpack(hOlRes, responseObj)
|
88
90
|
end
|
89
91
|
end
|
90
92
|
end
|
@@ -101,14 +103,14 @@ module ADIWG
|
|
101
103
|
if hContact.has_key?('phoneBook')
|
102
104
|
aPhones = hContact['phoneBook']
|
103
105
|
aPhones.each do |hPhone|
|
104
|
-
intCont[:phones].concat(
|
106
|
+
intCont[:phones].concat(Phone.unpack(hPhone, responseObj))
|
105
107
|
end
|
106
108
|
end
|
107
109
|
|
108
110
|
# address
|
109
111
|
if hContact.has_key?('address')
|
110
112
|
conAddress = hContact['address']
|
111
|
-
hAddress = $ReaderNS::Address.unpack(conAddress)
|
113
|
+
hAddress = $ReaderNS::Address.unpack(conAddress, responseObj)
|
112
114
|
unless hAddress.nil?
|
113
115
|
intCont[:address] = hAddress
|
114
116
|
end
|