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.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/adiwg-mdtranslator.gemspec +3 -1
  3. data/bin/mdtranslator +5 -5
  4. data/lib/adiwg/mdtranslator.rb +8 -29
  5. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +2 -0
  6. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +21 -2
  7. data/lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_contacts.rb +5 -3
  8. data/lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_mdJson.rb +4 -11
  9. data/lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_metadataInfo.rb +9 -0
  10. data/lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_resourceInfo.rb +9 -0
  11. data/lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_responsibleParty.rb +12 -0
  12. data/lib/adiwg/mdtranslator/version.rb +6 -1
  13. data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +7 -4
  14. data/lib/adiwg/mdtranslator/writers/html/sections/html_bodyScript.js +21 -3
  15. data/lib/adiwg/mdtranslator/writers/html/sections/html_geographicElement.rb +2 -1
  16. data/lib/adiwg/mdtranslator/writers/html/sections/html_inlineCss.css +16 -3
  17. data/lib/adiwg/mdtranslator/writers/html/sections/html_metadataInfo.rb +9 -0
  18. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceGeneral.rb +17 -1
  19. data/lib/adiwg/mdtranslator/writers/iso/classes/class_aggregateInformation.rb +5 -6
  20. data/lib/adiwg/mdtranslator/writers/iso/classes/class_citation.rb +5 -4
  21. data/lib/adiwg/mdtranslator/writers/iso/classes/class_codelist.rb +51 -0
  22. data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataIdentification.rb +23 -11
  23. data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataQuality.rb +4 -3
  24. data/lib/adiwg/mdtranslator/writers/iso/classes/class_date.rb +4 -3
  25. data/lib/adiwg/mdtranslator/writers/iso/classes/class_enumerationList.rb +47 -0
  26. data/lib/adiwg/mdtranslator/writers/iso/classes/class_keyword.rb +4 -3
  27. data/lib/adiwg/mdtranslator/writers/iso/classes/class_legalConstraints.rb +5 -4
  28. data/lib/adiwg/mdtranslator/writers/iso/classes/class_maintenanceInformation.rb +5 -4
  29. data/lib/adiwg/mdtranslator/writers/iso/classes/class_medium.rb +5 -6
  30. data/lib/adiwg/mdtranslator/writers/iso/classes/class_metadataExtension.rb +7 -6
  31. data/lib/adiwg/mdtranslator/writers/iso/classes/class_onlineResource.rb +4 -3
  32. data/lib/adiwg/mdtranslator/writers/iso/classes/class_responsibleParty.rb +4 -3
  33. data/lib/adiwg/mdtranslator/writers/iso/classes/class_securityConstraints.rb +4 -3
  34. data/lib/adiwg/mdtranslator/writers/iso19110/class_FCfeatureCatalogue.rb +5 -1
  35. data/lib/adiwg/mdtranslator/writers/iso19115_2/class_MImetadata.rb +17 -10
  36. data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +1 -1
  37. metadata +19 -24
  38. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_associationType.rb +0 -47
  39. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_characterSet.rb +0 -93
  40. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_classification.rb +0 -53
  41. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_datatype.rb +0 -67
  42. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_dateType.rb +0 -44
  43. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_initiativeType.rb +0 -47
  44. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_keywordType.rb +0 -52
  45. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_maintenanceFrequency.rb +0 -61
  46. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_mediumFormat.rb +0 -50
  47. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_mediumName.rb +0 -74
  48. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_obligation.rb +0 -39
  49. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_onlineFunction.rb +0 -48
  50. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_presentationForm.rb +0 -71
  51. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_progress.rb +0 -52
  52. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_restriction.rb +0 -53
  53. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_role.rb +0 -60
  54. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_scope.rb +0 -69
  55. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_spatialRepresentationType.rb +0 -49
  56. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_topicCategory.rb +0 -57
  57. data/test/readers/mdJson/v1_0/tc_reader_mdjson_responsibleParty.rb +0 -76
@@ -1,74 +0,0 @@
1
- # ISO <<CodeLists>> gmd:MD_MediumNameCode
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_MediumNameCode
16
-
17
- def initialize(xml)
18
- @xml = xml
19
- end
20
-
21
- def writeXML(codeName)
22
- case (codeName)
23
- when 'cdRom' then
24
- codeID = '001'
25
- when 'dvd' then
26
- codeID = '002'
27
- when 'dvdRom' then
28
- codeID = '003'
29
- when '3halfInchFloppy' then
30
- codeID = '004'
31
- when '5quarterInchFloppy' then
32
- codeID = '005'
33
- when '7trackTape' then
34
- codeID = '006'
35
- when '9trackTape' then
36
- codeID = '007'
37
- when '3480Cartridge' then
38
- codeID = '008'
39
- when '3490Cartridge' then
40
- codeID = '009'
41
- when '3580Cartridge' then
42
- codeID = '010'
43
- when '4mmCartridgeTape' then
44
- codeID = '011'
45
- when '8mmCartridgeTape' then
46
- codeID = '012'
47
- when '1quarterInchCartridgeTape' then
48
- codeID = '013'
49
- when 'digitalLinearTape' then
50
- codeID = '014'
51
- when 'online' then
52
- codeID = '015'
53
- when 'satellite' then
54
- codeID = '016'
55
- when 'telephoneLink' then
56
- codeID = '017'
57
- when 'hardcopy' then
58
- codeID = '018'
59
- else
60
- codeID = 'non-ISO codeName'
61
- end
62
-
63
- # write xml
64
- @xml.tag!('gmd:MD_MediumNameCode', {:codeList => 'http://mdtranslator.adiwg.org/api/codelists?format=xml#MD_MediumNameCode',
65
- :codeListValue => "#{codeName}",
66
- :codeSpace => "#{codeID}"})
67
- end
68
-
69
- end
70
-
71
- end
72
- end
73
- end
74
- end
@@ -1,39 +0,0 @@
1
- # ISO <<CodeLists>> gmd:MD_ObligationCode
2
- # enumeration
3
-
4
- # from http://mdtranslator.adiwg.org/api/codelists?format=xml
5
-
6
- # History:
7
- # Stan Smith 2013-10-21 original script
8
- # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
9
- # Stan Smith 2014-12-15 replaced NOAA CT_CodelistCatalogue with mdTranslator CT_CodelistCatalogue
10
-
11
- module ADIWG
12
- module Mdtranslator
13
- module Writers
14
- module Iso
15
-
16
- class MD_ObligationCode
17
- def initialize(xml)
18
- @xml = xml
19
- end
20
-
21
- def writeXML(codeName)
22
- case (codeName)
23
- when 'mandatory',
24
- 'optional',
25
- 'conditional'
26
- else
27
- codeName = 'INVALID OBLIGATION'
28
- end
29
-
30
- # write xml
31
- @xml.tag!('gmd:MD_ObligationCode', codeName)
32
- end
33
-
34
- end
35
-
36
- end
37
- end
38
- end
39
- end
@@ -1,48 +0,0 @@
1
- # ISO <<CodeLists>> gmd:CI_OnLineFunctionCode
2
-
3
- # from http://mdtranslator.adiwg.org/api/codelists?format=xml
4
- # History:
5
- # Stan Smith 2013-09-26 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_OnLineFunctionCode
16
-
17
- def initialize(xml)
18
- @xml = xml
19
- end
20
-
21
- def writeXML(codeName)
22
- case (codeName)
23
- when 'download' then
24
- codeID = '001'
25
- when 'information' then
26
- codeID = '002'
27
- when 'offlineAccess' then
28
- codeID = '003'
29
- when 'order' then
30
- codeID = '004'
31
- when 'search' then
32
- codeID = '005'
33
- else
34
- codeID = 'non-ISO codeName'
35
- end
36
-
37
- # write xml
38
- @xml.tag!('gmd:CI_OnLineFunctionCode', {:codeList => 'http://mdtranslator.adiwg.org/api/codelists?format=xml#CI_OnLineFunctionCode',
39
- :codeListValue => "#{codeName}",
40
- :codeSpace => "#{codeID}"})
41
- end
42
-
43
- end
44
-
45
- end
46
- end
47
- end
48
- end
@@ -1,71 +0,0 @@
1
- # ISO <<CodeLists>> gmd:CI_PresentationForm
2
-
3
- # from http://mdtranslator.adiwg.org/api/codelists?format=xml
4
- # History:
5
- # Stan Smith 2013-11-20 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_PresentationFormCode
16
- def initialize(xml)
17
- @xml = xml
18
- end
19
-
20
- def writeXML(codeName)
21
- case (codeName)
22
- when 'documentDigital' then
23
- codeID = '001'
24
- when 'documentHardcopy' then
25
- codeID = '002'
26
- when 'imageDigital' then
27
- codeID = '003'
28
- when 'imageHardcopy' then
29
- codeID = '004'
30
- when 'mapDigital' then
31
- codeID = '005'
32
- when 'mapHardcopy' then
33
- codeID = '006'
34
- when 'modelDigital' then
35
- codeID = '007'
36
- when 'modelHardcopy' then
37
- codeID = '008'
38
- when 'profileDigital' then
39
- codeID = '009'
40
- when 'profileHardcopy' then
41
- codeID = '010'
42
- when 'tableDigital' then
43
- codeID = '011'
44
- when 'tableHardcopy' then
45
- codeID = '012'
46
- when 'videoDigital' then
47
- codeID = '013'
48
- when 'videoHardcopy' then
49
- codeID = '014'
50
- else
51
- codeID = 'non-ISO codeName'
52
- end
53
-
54
- # write xml
55
- @xml.tag!('gmd:CI_PresentationFormCode', {:codeList => 'http://mdtranslator.adiwg.org/api/codelists?format=xml#CI_PresentationFormCode',
56
- :codeListValue => "#{codeName}",
57
- :codeSpace => "#{codeID}"})
58
- end
59
-
60
- end
61
-
62
- end
63
- end
64
- end
65
- end
66
-
67
-
68
-
69
-
70
-
71
-
@@ -1,52 +0,0 @@
1
- # ISO <<CodeLists>> gmd:MD_ProgressCode
2
-
3
- # from http://mdtranslator.adiwg.org/api/codelists?format=xml
4
- # History:
5
- # Stan Smith 2013-08-26 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_ProgressCode
16
- def initialize(xml)
17
- @xml = xml
18
- end
19
-
20
- def writeXML(codeName)
21
-
22
- case (codeName)
23
- when 'completed' then
24
- codeID = '001'
25
- when 'historicalArchive' then
26
- codeID = '002'
27
- when 'obsolete' then
28
- codeID = '003'
29
- when 'onGoing' then
30
- codeID = '004'
31
- when 'planned' then
32
- codeID = '005'
33
- when 'required' then
34
- codeID = '006'
35
- when 'underDevelopment' then
36
- codeID = '007'
37
- else
38
- codeID = 'non-ISO codeName'
39
- end
40
-
41
- # write xml
42
- @xml.tag!('gmd:MD_ProgressCode', {:codeList => 'http://mdtranslator.adiwg.org/api/codelists?format=xml#CI_ProgressCode',
43
- :codeListValue => "#{codeName}",
44
- :codeSpace => "#{codeID}"})
45
- end
46
-
47
- end
48
-
49
- end
50
- end
51
- end
52
- end
@@ -1,53 +0,0 @@
1
- # ISO <<CodeLists>> gmd:MD_RestrictionCode
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_RestrictionCode
16
- def initialize(xml)
17
- @xml = xml
18
- end
19
-
20
- def writeXML(codeName)
21
- case (codeName)
22
- when 'copyright' then
23
- codeID = '001'
24
- when 'patent' then
25
- codeID = '002'
26
- when 'patentPending' then
27
- codeID = '003'
28
- when 'trademark' then
29
- codeID = '004'
30
- when 'license' then
31
- codeID = '005'
32
- when 'intellectualPropertyRights' then
33
- codeID = '006'
34
- when 'restricted' then
35
- codeID = '007'
36
- when 'otherRestrictions' then
37
- codeID = '008'
38
- else
39
- codeID = 'non-ISO codeName'
40
- end
41
-
42
- # write xml
43
- @xml.tag!('gmd:MD_RestrictionCode', {:codeList => 'http://mdtranslator.adiwg.org/api/codelists?format=xml#MD_RestrictionCode',
44
- :codeListValue => "#{codeName}",
45
- :codeSpace => "#{codeID}"})
46
- end
47
-
48
- end
49
-
50
- end
51
- end
52
- end
53
- end
@@ -1,60 +0,0 @@
1
- # ISO <<CodeLists>> gmd:CI_RoleCode
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_RoleCode
16
- def initialize(xml)
17
- @xml = xml
18
- end
19
-
20
- def writeXML(codeName)
21
-
22
- case (codeName)
23
- when 'resourceProvider' then
24
- codeID = '001'
25
- when 'custodian' then
26
- codeID = '002'
27
- when 'owner' then
28
- codeID = '003'
29
- when 'user' then
30
- codeID = '004'
31
- when 'distributor' then
32
- codeID = '005'
33
- when 'originator' then
34
- codeID = '006'
35
- when 'pointOfContact' then
36
- codeID = '007'
37
- when 'principalInvestigator' then
38
- codeID = '008'
39
- when 'processor' then
40
- codeID = '009'
41
- when 'publisher' then
42
- codeID = '010'
43
- when 'author' then
44
- codeID = '011'
45
- else
46
- codeID = 'non-ISO codeName'
47
- end
48
-
49
- # write xml
50
- @xml.tag!('gmd:CI_RoleCode', {:codeList => 'http://mdtranslator.adiwg.org/api/codelists?format=xml#CI_RoleCode',
51
- :codeListValue => "#{codeName}",
52
- :codeSpace => "#{codeID}"})
53
- end
54
-
55
- end
56
-
57
- end
58
- end
59
- end
60
- end
@@ -1,69 +0,0 @@
1
- # ISO <<CodeLists>> gmd:MD_ScopeCode
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_ScopeCode
16
- def initialize(xml)
17
- @xml = xml
18
- end
19
-
20
- def writeXML(codeName)
21
- case (codeName)
22
- when 'attribute' then
23
- codeID = '001'
24
- when 'attributeType' then
25
- codeID = '002'
26
- when 'collectionHardware' then
27
- codeID = '003'
28
- when 'collectionSession' then
29
- codeID = '004'
30
- when 'dataset' then
31
- codeID = '005'
32
- when 'series' then
33
- codeID = '006'
34
- when 'nonGeographicDataset' then
35
- codeID = '007'
36
- when 'dimensionGroup' then
37
- codeID = '008'
38
- when 'feature' then
39
- codeID = '009'
40
- when 'featureType' then
41
- codeID = '010'
42
- when 'propertyType' then
43
- codeID = '011'
44
- when 'fieldSession' then
45
- codeID = '012'
46
- when 'software' then
47
- codeID = '013'
48
- when 'service' then
49
- codeID = '014'
50
- when 'model' then
51
- codeID = '015'
52
- when 'tile' then
53
- codeID = '016'
54
- else
55
- codeID = 'non-ISO codeName'
56
- end
57
-
58
- # write xml
59
- @xml.tag!('gmd:MD_ScopeCode', {:codeList => 'http://mdtranslator.adiwg.org/api/codelists?format=xml#MD_ScopeCode',
60
- :codeListValue => "#{codeName}",
61
- :codeSpace => "#{codeID}"})
62
- end
63
-
64
- end
65
-
66
- end
67
- end
68
- end
69
- end