adiwg-mdtranslator 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/adiwg-mdtranslator.gemspec +3 -1
- data/bin/mdtranslator +5 -5
- data/lib/adiwg/mdtranslator.rb +8 -29
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +2 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +21 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_contacts.rb +5 -3
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_mdJson.rb +4 -11
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_metadataInfo.rb +9 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_resourceInfo.rb +9 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_responsibleParty.rb +12 -0
- data/lib/adiwg/mdtranslator/version.rb +6 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +7 -4
- data/lib/adiwg/mdtranslator/writers/html/sections/html_bodyScript.js +21 -3
- data/lib/adiwg/mdtranslator/writers/html/sections/html_geographicElement.rb +2 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_inlineCss.css +16 -3
- data/lib/adiwg/mdtranslator/writers/html/sections/html_metadataInfo.rb +9 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceGeneral.rb +17 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_aggregateInformation.rb +5 -6
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_citation.rb +5 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_codelist.rb +51 -0
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataIdentification.rb +23 -11
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataQuality.rb +4 -3
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_date.rb +4 -3
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_enumerationList.rb +47 -0
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_keyword.rb +4 -3
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_legalConstraints.rb +5 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_maintenanceInformation.rb +5 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_medium.rb +5 -6
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_metadataExtension.rb +7 -6
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_onlineResource.rb +4 -3
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_responsibleParty.rb +4 -3
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_securityConstraints.rb +4 -3
- data/lib/adiwg/mdtranslator/writers/iso19110/class_FCfeatureCatalogue.rb +5 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/class_MImetadata.rb +17 -10
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +1 -1
- metadata +19 -24
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_associationType.rb +0 -47
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_characterSet.rb +0 -93
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_classification.rb +0 -53
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_datatype.rb +0 -67
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_dateType.rb +0 -44
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_initiativeType.rb +0 -47
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_keywordType.rb +0 -52
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_maintenanceFrequency.rb +0 -61
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_mediumFormat.rb +0 -50
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_mediumName.rb +0 -74
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_obligation.rb +0 -39
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_onlineFunction.rb +0 -48
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_presentationForm.rb +0 -71
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_progress.rb +0 -52
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_restriction.rb +0 -53
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_role.rb +0 -60
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_scope.rb +0 -69
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_spatialRepresentationType.rb +0 -49
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_topicCategory.rb +0 -57
- data/test/readers/mdJson/v1_0/tc_reader_mdjson_responsibleParty.rb +0 -76
@@ -1,93 +0,0 @@
|
|
1
|
-
# ISO <<CodeLists>> gmd:MD_CharacterSetCode
|
2
|
-
|
3
|
-
# from http://mdtranslator.adiwg.org/api/codelists?format=xml
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-08-09 original script
|
6
|
-
# Stan Smith 2014-10-15 allow non-ISO codesNames to be rendered
|
7
|
-
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
8
|
-
# Stan Smith 2014-12-15 replaced NOAA CT_CodelistCatalogue with mdTranslator CT_CodelistCatalogue
|
9
|
-
|
10
|
-
module ADIWG
|
11
|
-
module Mdtranslator
|
12
|
-
module Writers
|
13
|
-
module Iso
|
14
|
-
|
15
|
-
class MD_CharacterSetCode
|
16
|
-
def initialize(xml)
|
17
|
-
@xml = xml
|
18
|
-
end
|
19
|
-
|
20
|
-
def writeXML(codeName)
|
21
|
-
case (codeName)
|
22
|
-
when 'ucs2' then
|
23
|
-
codeID = '001'
|
24
|
-
when 'ucs4' then
|
25
|
-
codeID = '002'
|
26
|
-
when 'utf7' then
|
27
|
-
codeID = '003'
|
28
|
-
when 'utf8' then
|
29
|
-
codeID = '004'
|
30
|
-
when 'utf16' then
|
31
|
-
codeID = '005'
|
32
|
-
when '8859part1' then
|
33
|
-
codeID = '006'
|
34
|
-
when '8859part2' then
|
35
|
-
codeID = '007'
|
36
|
-
when '8859part3' then
|
37
|
-
codeID = '008'
|
38
|
-
when '8895part4' then
|
39
|
-
codeID = '009'
|
40
|
-
when '8859part5' then
|
41
|
-
codeID = '010'
|
42
|
-
when '8859part6' then
|
43
|
-
codeID = '011'
|
44
|
-
when '8859part7' then
|
45
|
-
codeID = '012'
|
46
|
-
when '8859part8' then
|
47
|
-
codeID = '013'
|
48
|
-
when '8859part9' then
|
49
|
-
codeID = '014'
|
50
|
-
when '8859part10' then
|
51
|
-
codeID = '015'
|
52
|
-
when '8859part11' then
|
53
|
-
codeID = '016'
|
54
|
-
when '8859part13' then
|
55
|
-
codeID = '018'
|
56
|
-
when '8859part14' then
|
57
|
-
codeID = '019'
|
58
|
-
when '8859part15' then
|
59
|
-
codeID = '020'
|
60
|
-
when '8859part16' then
|
61
|
-
codeID = '021'
|
62
|
-
when 'jis' then
|
63
|
-
codeID = '022'
|
64
|
-
when 'shiftJIS' then
|
65
|
-
codeID = '023'
|
66
|
-
when 'eusJP' then
|
67
|
-
codeID = '024'
|
68
|
-
when 'usAscii' then
|
69
|
-
codeID = '025'
|
70
|
-
when 'ebcdic' then
|
71
|
-
codeID = '026'
|
72
|
-
when 'ecuKR' then
|
73
|
-
codeID = '027'
|
74
|
-
when 'big5' then
|
75
|
-
codeID = '028'
|
76
|
-
when 'GB2312' then
|
77
|
-
codeID = '029'
|
78
|
-
else
|
79
|
-
codeID = 'non-ISO codeName'
|
80
|
-
end
|
81
|
-
|
82
|
-
# write xml
|
83
|
-
@xml.tag!('gmd:MD_CharacterSetCode', {:codeList => 'http://mdtranslator.adiwg.org/api/codelists?format=xml#MD_CharacterSetCode',
|
84
|
-
:codeListValue => "#{codeName}",
|
85
|
-
:codeSpace => "#{codeID}"})
|
86
|
-
end
|
87
|
-
|
88
|
-
end
|
89
|
-
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
# ISO <<CodeLists>> gmd:MD_ClassificationCode
|
2
|
-
|
3
|
-
# from http://mdtranslator.adiwg.org/api/codelists?format=xml
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-10-21 original script
|
6
|
-
# Stan Smith 2014-10-15 allow non-ISO codesNames to be rendered
|
7
|
-
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
8
|
-
# Stan Smith 2014-12-15 replaced NOAA CT_CodelistCatalogue with mdTranslator CT_CodelistCatalogue
|
9
|
-
|
10
|
-
module ADIWG
|
11
|
-
module Mdtranslator
|
12
|
-
module Writers
|
13
|
-
module Iso
|
14
|
-
|
15
|
-
class MD_ClassificationCode
|
16
|
-
|
17
|
-
def initialize(xml)
|
18
|
-
@xml = xml
|
19
|
-
end
|
20
|
-
|
21
|
-
def writeXML(codeName)
|
22
|
-
case (codeName)
|
23
|
-
when 'unclassified' then
|
24
|
-
codeID = '001'
|
25
|
-
when 'restricted' then
|
26
|
-
codeID = '002'
|
27
|
-
when 'confidential' then
|
28
|
-
codeID = '003'
|
29
|
-
when 'secret' then
|
30
|
-
codeID = '004'
|
31
|
-
when 'topSecret' then
|
32
|
-
codeID = '005'
|
33
|
-
else
|
34
|
-
codeID = 'non-ISO codeName'
|
35
|
-
end
|
36
|
-
|
37
|
-
# write xml
|
38
|
-
@xml.tag!('gmd:MD_ClassificationCode', {:codeList => 'http://mdtranslator.adiwg.org/api/codelists?format=xml#MD_ClassificationCode',
|
39
|
-
:codeListValue => "#{codeName}",
|
40
|
-
:codeSpace => "#{codeID}"})
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
44
|
-
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
@@ -1,67 +0,0 @@
|
|
1
|
-
# ISO <<CodeLists>> gmd:MD_DatatypeCode
|
2
|
-
|
3
|
-
# from http://mdtranslator.adiwg.org/api/codelists?format=xml
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-10-21 original script
|
6
|
-
# Stan Smith 2014-10-15 allow non-ISO codesNames to be rendered
|
7
|
-
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
8
|
-
# Stan Smith 2014-12-15 replaced NOAA CT_CodelistCatalogue with mdTranslator CT_CodelistCatalogue
|
9
|
-
|
10
|
-
module ADIWG
|
11
|
-
module Mdtranslator
|
12
|
-
module Writers
|
13
|
-
module Iso
|
14
|
-
|
15
|
-
class MD_DatatypeCode
|
16
|
-
def initialize(xml)
|
17
|
-
@xml = xml
|
18
|
-
end
|
19
|
-
|
20
|
-
def writeXML(codeName)
|
21
|
-
case (codeName)
|
22
|
-
when 'class' then
|
23
|
-
codeID = '001'
|
24
|
-
when 'codelist' then
|
25
|
-
codeID = '002'
|
26
|
-
when 'enumeration' then
|
27
|
-
codeID = '003'
|
28
|
-
when 'codelistElement' then
|
29
|
-
codeID = '004'
|
30
|
-
when 'abstractClass' then
|
31
|
-
codeID = '005'
|
32
|
-
when 'aggregatedClass' then
|
33
|
-
codeID = '006'
|
34
|
-
when 'specifiedClass' then
|
35
|
-
codeID = '007'
|
36
|
-
when 'datatypeClass' then
|
37
|
-
codeID = '008'
|
38
|
-
when 'interfaceClass' then
|
39
|
-
codeID = '009'
|
40
|
-
when 'unionClass' then
|
41
|
-
codeID = '010'
|
42
|
-
when 'metaClass' then
|
43
|
-
codeID = '011'
|
44
|
-
when 'typeClass' then
|
45
|
-
codeID = '012'
|
46
|
-
when 'characterString' then
|
47
|
-
codeID = '013'
|
48
|
-
when 'integer' then
|
49
|
-
codeID = '014'
|
50
|
-
when 'association' then
|
51
|
-
codeID = '015'
|
52
|
-
else
|
53
|
-
codeID = 'non-ISO codeName'
|
54
|
-
end
|
55
|
-
|
56
|
-
# write xml
|
57
|
-
@xml.tag!('gmd:MD_DatatypeCode', {:codeList => 'http://mdtranslator.adiwg.org/api/codelists?format=xml#MD_DatatypeCode',
|
58
|
-
:codeListValue => "#{codeName}",
|
59
|
-
:codeSpace => "#{codeID}"})
|
60
|
-
end
|
61
|
-
|
62
|
-
end
|
63
|
-
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
# ISO <<CodeLists>> gmd:CI_DateTypeCode
|
2
|
-
|
3
|
-
# from http://mdtranslator.adiwg.org/api/codelists?format=xml
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-08-09 original script
|
6
|
-
# Stan Smith 2014-10-15 allow non-ISO codesNames to be rendered
|
7
|
-
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
8
|
-
# Stan Smith 2014-12-15 replaced NOAA CT_CodelistCatalogue with mdTranslator CT_CodelistCatalogue
|
9
|
-
|
10
|
-
module ADIWG
|
11
|
-
module Mdtranslator
|
12
|
-
module Writers
|
13
|
-
module Iso
|
14
|
-
|
15
|
-
class CI_DateTypeCode
|
16
|
-
|
17
|
-
def initialize(xml)
|
18
|
-
@xml = xml
|
19
|
-
end
|
20
|
-
|
21
|
-
def writeXML(codeName)
|
22
|
-
case (codeName)
|
23
|
-
when 'creation' then
|
24
|
-
codeID = '001'
|
25
|
-
when 'publication' then
|
26
|
-
codeID = '002'
|
27
|
-
when 'revision' then
|
28
|
-
codeID = '003'
|
29
|
-
else
|
30
|
-
codeID = 'non-ISO codeName'
|
31
|
-
end
|
32
|
-
|
33
|
-
# write xml
|
34
|
-
@xml.tag!('gmd:CI_DateTypeCode', {:codeList => 'http://mdtranslator.adiwg.org/api/codelists?format=xml#CI_DateTypeCode',
|
35
|
-
:codeListValue => "#{codeName}",
|
36
|
-
:codeSpace => "#{codeID}"})
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# ISO <<CodeLists>> gmd:DS_InitiativeTypeCode
|
2
|
-
|
3
|
-
# from http://mdtranslator.adiwg.org/api/codelists?format=xml
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2014-05-21 original script
|
6
|
-
# Stan Smith 2014-10-15 allow non-ISO codesNames to be rendered
|
7
|
-
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
8
|
-
# Stan Smith 2014-12-15 replaced NOAA CT_CodelistCatalogue with mdTranslator CT_CodelistCatalogue
|
9
|
-
|
10
|
-
module ADIWG
|
11
|
-
module Mdtranslator
|
12
|
-
module Writers
|
13
|
-
module Iso
|
14
|
-
|
15
|
-
class DS_InitiativeTypeCode
|
16
|
-
def initialize(xml)
|
17
|
-
@xml = xml
|
18
|
-
end
|
19
|
-
|
20
|
-
def writeXML(codeName)
|
21
|
-
case (codeName)
|
22
|
-
when 'campaign' then
|
23
|
-
codeID = '001'
|
24
|
-
when 'collection' then
|
25
|
-
codeID = '002'
|
26
|
-
when 'exercise' then
|
27
|
-
codeID = '003'
|
28
|
-
when 'experiment' then
|
29
|
-
codeID = '004'
|
30
|
-
when 'investigation' then
|
31
|
-
codeID = '005'
|
32
|
-
else
|
33
|
-
codeID = 'non-ISO codeName'
|
34
|
-
end
|
35
|
-
|
36
|
-
# write xml
|
37
|
-
@xml.tag!('gmd:DS_InitiativeTypeCode', {:codeList => 'http://mdtranslator.adiwg.org/api/codelists?format=xml#DS_InitiativeTypeCode',
|
38
|
-
:codeListValue => "#{codeName}",
|
39
|
-
:codeSpace => "#{codeID}"})
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
@@ -1,52 +0,0 @@
|
|
1
|
-
# ISO <<CodeLists>> gmd:MD_KeywordTypeCode
|
2
|
-
|
3
|
-
# from http://mdtranslator.adiwg.org/api/codelists?format=xml
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-09-18 original script
|
6
|
-
# Stan Smith 2014-10-15 allow non-ISO codesNames to be rendered
|
7
|
-
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
8
|
-
# Stan Smith 2014-12-15 replaced NOAA CT_CodelistCatalogue with mdTranslator CT_CodelistCatalogue
|
9
|
-
|
10
|
-
module ADIWG
|
11
|
-
module Mdtranslator
|
12
|
-
module Writers
|
13
|
-
module Iso
|
14
|
-
|
15
|
-
class MD_KeywordTypeCode
|
16
|
-
|
17
|
-
def initialize(xml)
|
18
|
-
@xml = xml
|
19
|
-
end
|
20
|
-
|
21
|
-
def writeXML(codeName)
|
22
|
-
case (codeName)
|
23
|
-
when 'discipline' then
|
24
|
-
codeID = '001'
|
25
|
-
when 'place' then
|
26
|
-
codeID = '002'
|
27
|
-
when 'stratum' then
|
28
|
-
codeID = '003'
|
29
|
-
when 'temporal' then
|
30
|
-
codeID = '004'
|
31
|
-
when 'theme' then
|
32
|
-
codeID = '005'
|
33
|
-
when 'taxon' then
|
34
|
-
codeID = '006'
|
35
|
-
when 'instrument' then
|
36
|
-
codeID = 'ADIwg-001'
|
37
|
-
else
|
38
|
-
codeID = 'non-ISO codeName'
|
39
|
-
end
|
40
|
-
|
41
|
-
# write xml
|
42
|
-
@xml.tag!('gmd:MD_KeywordTypeCode', {:codeList => 'http://mdtranslator.adiwg.org/api/codelists?format=xml#MD_KeywordTypeCode',
|
43
|
-
:codeListValue => "#{codeName}",
|
44
|
-
:codeSpace => "#{codeID}"})
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
48
|
-
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
@@ -1,61 +0,0 @@
|
|
1
|
-
# ISO <<CodeLists>> gmd:MD_MaintenanceFrequencyCode
|
2
|
-
|
3
|
-
# from http://mdtranslator.adiwg.org/api/codelists?format=xml
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-10-21 original script
|
6
|
-
# Stan Smith 2014-10-15 allow non-ISO codesNames to be rendered
|
7
|
-
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
8
|
-
# Stan Smith 2014-12-15 replaced NOAA CT_CodelistCatalogue with mdTranslator CT_CodelistCatalogue
|
9
|
-
|
10
|
-
module ADIWG
|
11
|
-
module Mdtranslator
|
12
|
-
module Writers
|
13
|
-
module Iso
|
14
|
-
|
15
|
-
class MD_MaintenanceFrequencyCode
|
16
|
-
def initialize(xml)
|
17
|
-
@xml = xml
|
18
|
-
end
|
19
|
-
|
20
|
-
def writeXML(codeName)
|
21
|
-
case (codeName)
|
22
|
-
when 'continual' then
|
23
|
-
codeID = '001'
|
24
|
-
when 'daily' then
|
25
|
-
codeID = '002'
|
26
|
-
when 'weekly' then
|
27
|
-
codeID = '003'
|
28
|
-
when 'fortnightly' then
|
29
|
-
codeID = '004'
|
30
|
-
when 'monthly' then
|
31
|
-
codeID = '005'
|
32
|
-
when 'quarterly' then
|
33
|
-
codeID = '006'
|
34
|
-
when 'biannually' then
|
35
|
-
codeID = '007'
|
36
|
-
when 'annually' then
|
37
|
-
codeID = '008'
|
38
|
-
when 'asNeeded' then
|
39
|
-
codeID = '009'
|
40
|
-
when 'irregular' then
|
41
|
-
codeID = '010'
|
42
|
-
when 'notPlanned' then
|
43
|
-
codeID = '011'
|
44
|
-
when 'unknown' then
|
45
|
-
codeID = '012'
|
46
|
-
else
|
47
|
-
codeID = 'non-ISO codeName'
|
48
|
-
end
|
49
|
-
|
50
|
-
# write xml
|
51
|
-
@xml.tag!('gmd:MD_MaintenanceFrequencyCode', {:codeList => 'http://mdtranslator.adiwg.org/api/codelists?format=xml#MD_MaintenanceFrequencyCode',
|
52
|
-
:codeListValue => "#{codeName}",
|
53
|
-
:codeSpace => "#{codeID}"})
|
54
|
-
end
|
55
|
-
|
56
|
-
end
|
57
|
-
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
# ISO <<CodeLists>> gmd:MD_MediumFormatCode
|
2
|
-
|
3
|
-
# from http://mdtranslator.adiwg.org/api/codelists?format=xml
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-09-24 original script
|
6
|
-
# Stan Smith 2014-10-15 allow non-ISO codesNames to be rendered
|
7
|
-
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
8
|
-
# Stan Smith 2014-12-15 replaced NOAA CT_CodelistCatalogue with mdTranslator CT_CodelistCatalogue
|
9
|
-
|
10
|
-
module ADIWG
|
11
|
-
module Mdtranslator
|
12
|
-
module Writers
|
13
|
-
module Iso
|
14
|
-
|
15
|
-
class MD_MediumFormatCode
|
16
|
-
|
17
|
-
def initialize(xml)
|
18
|
-
@xml = xml
|
19
|
-
end
|
20
|
-
|
21
|
-
def writeXML(codeName)
|
22
|
-
case (codeName)
|
23
|
-
when 'cpio' then
|
24
|
-
codeID = '001'
|
25
|
-
when 'tar' then
|
26
|
-
codeID = '002'
|
27
|
-
when 'highSierra' then
|
28
|
-
codeID = '003'
|
29
|
-
when 'iso9660' then
|
30
|
-
codeID = '004'
|
31
|
-
when 'iso9660RockRidge' then
|
32
|
-
codeID = '005'
|
33
|
-
when 'iso9660AppleHFS' then
|
34
|
-
codeID = '006'
|
35
|
-
else
|
36
|
-
codeID = 'non-ISO codeName'
|
37
|
-
end
|
38
|
-
|
39
|
-
# write xml
|
40
|
-
@xml.tag!('gmd:MD_MediumFormatCode', {:codeList => 'http://mdtranslator.adiwg.org/api/codelists?format=xml#MD_MediumFormatCode',
|
41
|
-
:codeListValue => "#{codeName}",
|
42
|
-
:codeSpace => "#{codeID}"})
|
43
|
-
end
|
44
|
-
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|