adiwg-mdtranslator 1.0.0 → 1.1.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/lib/adiwg/mdtranslator.rb +40 -1
  3. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +6 -23
  4. data/lib/adiwg/mdtranslator/internal/module_geoFormat.rb +226 -0
  5. data/lib/adiwg/mdtranslator/version.rb +2 -1
  6. data/lib/adiwg/mdtranslator/writers/html/html_writer.rb +0 -2
  7. data/lib/adiwg/mdtranslator/writers/html/md_html_writer.rb +34 -3
  8. data/lib/adiwg/mdtranslator/writers/html/readme.md +6 -2
  9. data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +321 -0
  10. data/lib/adiwg/mdtranslator/writers/html/sections/html_bodyScript.js +111 -0
  11. data/lib/adiwg/mdtranslator/writers/html/sections/html_browseGraphic.rb +58 -0
  12. data/lib/adiwg/mdtranslator/writers/html/sections/html_citation.rb +91 -0
  13. data/lib/adiwg/mdtranslator/writers/html/sections/html_contact.rb +132 -0
  14. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataDictionary.rb +110 -0
  15. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataLineage.rb +67 -0
  16. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataSource.rb +66 -0
  17. data/lib/adiwg/mdtranslator/writers/html/sections/html_dateTime.rb +41 -0
  18. data/lib/adiwg/mdtranslator/writers/html/sections/html_domain.rb +80 -0
  19. data/lib/adiwg/mdtranslator/writers/html/sections/html_domainMember.rb +52 -0
  20. data/lib/adiwg/mdtranslator/writers/html/sections/html_entity.rb +137 -0
  21. data/lib/adiwg/mdtranslator/writers/html/sections/html_entityAttribute.rb +107 -0
  22. data/lib/adiwg/mdtranslator/writers/html/sections/html_entityIndex.rb +50 -0
  23. data/lib/adiwg/mdtranslator/writers/html/sections/html_extent.rb +107 -0
  24. data/lib/adiwg/mdtranslator/writers/html/sections/html_format.rb +39 -0
  25. data/lib/adiwg/mdtranslator/writers/html/sections/html_geographicElement.rb +211 -0
  26. data/lib/adiwg/mdtranslator/writers/html/sections/html_head.rb +53 -0
  27. data/lib/adiwg/mdtranslator/writers/html/sections/html_headScript.js +18 -0
  28. data/lib/adiwg/mdtranslator/writers/html/sections/html_inlineCss.css +223 -0
  29. data/lib/adiwg/mdtranslator/writers/html/sections/html_keyword.rb +59 -0
  30. data/lib/adiwg/mdtranslator/writers/html/sections/html_legalConstraint.rb +56 -0
  31. data/lib/adiwg/mdtranslator/writers/html/sections/html_medium.rb +51 -0
  32. data/lib/adiwg/mdtranslator/writers/html/sections/html_metadataInfo.rb +119 -0
  33. data/lib/adiwg/mdtranslator/writers/html/sections/html_onlineResource.rb +63 -0
  34. data/lib/adiwg/mdtranslator/writers/html/sections/html_orderProcess.rb +63 -0
  35. data/lib/adiwg/mdtranslator/writers/html/sections/html_processStep.rb +74 -0
  36. data/lib/adiwg/mdtranslator/writers/html/sections/html_resolution.rb +46 -0
  37. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceContact.rb +36 -0
  38. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceFormat.rb +39 -0
  39. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceGeneral.rb +106 -0
  40. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceId.rb +50 -0
  41. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceInfo.rb +261 -0
  42. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceMaint.rb +55 -0
  43. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceOther.rb +87 -0
  44. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceUsage.rb +55 -0
  45. data/lib/adiwg/mdtranslator/writers/html/sections/html_responsibleParty.rb +38 -0
  46. data/lib/adiwg/mdtranslator/writers/html/sections/html_securityConstraint.rb +55 -0
  47. data/lib/adiwg/mdtranslator/writers/html/sections/html_spatialReferenceSystem.rb +58 -0
  48. data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomy.rb +108 -0
  49. data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomyClass.rb +62 -0
  50. data/lib/adiwg/mdtranslator/writers/html/sections/html_temporalElement.rb +60 -0
  51. data/lib/adiwg/mdtranslator/writers/html/sections/html_timeInstant.rb +55 -0
  52. data/lib/adiwg/mdtranslator/writers/html/sections/html_timePeriod.rb +59 -0
  53. data/lib/adiwg/mdtranslator/writers/html/sections/html_transferOption.rb +51 -0
  54. data/lib/adiwg/mdtranslator/writers/html/sections/html_verticalElement.rb +59 -0
  55. data/lib/adiwg/mdtranslator/writers/html/sections/logo150.txt +25 -0
  56. data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicDescription.rb +12 -12
  57. metadata +50 -2
@@ -0,0 +1,53 @@
1
+ # HTML writer
2
+ # html head
3
+
4
+ # History:
5
+ # Stan Smith 2015-03-23 original script
6
+ # Stan Smith 2015-04-07 added metadata tag to head
7
+
8
+ module ADIWG
9
+ module Mdtranslator
10
+ module Writers
11
+ module Html
12
+
13
+ class MdHtmlHead
14
+ def initialize(html)
15
+ @html = html
16
+ end
17
+
18
+ def writeHtml()
19
+ @html.head do
20
+ @html.meta({'http-equiv'=>'Content-Type','content'=>'text/html; charset=utf-8'})
21
+ @html.title('ADIWG mdTranslator HTML writer output')
22
+
23
+ # add inline css
24
+ # read css from file
25
+ path = File.join(File.dirname(__FILE__), 'html_inlineCss.css')
26
+ file = File.open(path, 'r')
27
+ css = file.read
28
+ file.close
29
+
30
+ @html.style do
31
+ @html.text!(css)
32
+ end
33
+
34
+ # add inline javascript
35
+ # read javascript from file
36
+ path = File.join(File.dirname(__FILE__), 'html_headScript.js')
37
+ file = File.open(path, 'r')
38
+ js = file.read
39
+ file.close
40
+
41
+ @html.script('type'=>'text/javascript') do
42
+ @html << js
43
+ end
44
+
45
+ end
46
+ end
47
+
48
+ end
49
+
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,18 @@
1
+
2
+ function closeAllDetails(){
3
+ var arr = document.getElementsByTagName("details")
4
+ var len = arr.length;
5
+
6
+ for(var i=0; i < len; i++){
7
+ arr[i].open = false;
8
+ }
9
+ }
10
+
11
+ function openAllDetails(){
12
+ var arr = document.getElementsByTagName("details")
13
+ var len = arr.length;
14
+
15
+ for(var i=0; i < len; i++){
16
+ arr[i].open = true;
17
+ }
18
+ }
@@ -0,0 +1,223 @@
1
+ /*
2
+ css borrowed from http://mixu.net/markdown-styles/jasonm23-markdown and modified
3
+ */
4
+
5
+ html { font-size: 100%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
6
+
7
+ body{
8
+ color: #202020;
9
+ font-family: Consolas, sans-serif;
10
+ font-size: small;
11
+ line-height: 1.3em;
12
+ padding: 1em;
13
+ margin: auto;
14
+ max-width: 55em;
15
+ background: #fefefe;
16
+ }
17
+
18
+ a{ color: #0645ad; text-decoration:none;}
19
+ a:visited{ color: #0b0080; }
20
+ a:hover{ color: #06e; }
21
+ a:active{ color:#faa700; }
22
+ a:focus{ outline: thin dotted; }
23
+ a:hover, a:active{ outline: 0; }
24
+
25
+ ::-moz-selection{background:rgba(255,255,0,0.3);color:#000}
26
+ ::selection{background:rgba(255,255,0,0.3);color:#000}
27
+
28
+ a::-moz-selection{background:rgba(255,255,0,0.3);color:#0645ad}
29
+ a::selection{background:rgba(255,255,0,0.3);color:#0645ad}
30
+
31
+ p{
32
+ margin: 1em 0;
33
+ }
34
+
35
+ img{
36
+ max-width: 100%;
37
+ }
38
+
39
+ h1,h2,h3,h4,h5,h6,
40
+ .h1,.h2,.h3,.h4,.h5,.h6{
41
+ font-family: 'Lucida Grande', Tahoma, Arial, Verdana, sans-serif;
42
+ font-weight: normal;
43
+ color: #111;
44
+ margin-top: .7em;
45
+ margin-bottom: .5em;
46
+ line-height: 1em;
47
+ }
48
+
49
+ h1,.h1{ font-size: 2.5em; }
50
+ h2,.h2{ font-size: 2em; }
51
+ h3,.h3{ font-size: 1.5em; }
52
+ h4,.h4{ font-size: 1.2em; }
53
+ h5,.h5{ font-size: 1em; }
54
+ h6,.h6{ font-size: 0.9em; }
55
+
56
+ em{
57
+ font-family: Tahoma, Arial, Verdana, sans-serif;
58
+ color: #666666;
59
+ font-size: small;
60
+ margin-right: 1em;
61
+ }
62
+
63
+ blockquote, section.block{
64
+ margin: 0;
65
+ padding-left: 2em;
66
+ border-left: 0.1em #e3e3e3 solid;
67
+ }
68
+
69
+ summary:focus {outline: none}
70
+
71
+ hr { display: block; height: 2px; border: 0; border-top: 1px solid #aaa;border-bottom: 1px solid #eee; margin: 1em 0; padding: 0; }
72
+
73
+ pre, code, kbd, samp { color: #000; font-family: monospace, monospace; _font-family: 'courier new', monospace; font-size: 0.98em; }
74
+ pre { white-space: pre-wrap; word-wrap: break-word; }
75
+
76
+ b, strong { font-weight: bold; }
77
+
78
+ dfn { font-style: italic; }
79
+
80
+ ins { background: #ff9; color: #000; text-decoration: none; }
81
+
82
+ mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; }
83
+
84
+ sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
85
+ sup { top: -0.5em; }
86
+ sub { bottom: -0.25em; }
87
+
88
+ ul, ol { margin: .25em 0; padding: 0 0 0 2em; }
89
+ li p:last-child { margin:0 }
90
+ dd { margin: 0 0 0 2em; }
91
+
92
+ img { border: 0; -ms-interpolation-mode: bicubic; vertical-align: middle; }
93
+
94
+ table { border-collapse: collapse; border-spacing: 0; }
95
+ td { vertical-align: top; }
96
+
97
+ @media only screen and (min-width: 480px) {
98
+ body{font-size: 14px;}
99
+ }
100
+
101
+ @media only screen and (min-width: 768px) {
102
+ body{font-size: 16px;}
103
+ }
104
+
105
+ @media print {
106
+ * { background: transparent !important; color: black !important; filter: none !important; -ms-filter: none !important; }
107
+ body{font-size:12pt; max-width:100%;}
108
+ a, a:visited { text-decoration: underline; }
109
+ hr { height: 1px; border:0; border-bottom:1px solid black; }
110
+ a[href]:after { content: " (" attr(href) ")"; }
111
+ abbr[title]:after { content: " (" attr(title) ")"; }
112
+ .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }
113
+ pre, blockquote,section.block { padding-right: 1em; page-break-inside: avoid; }
114
+ tr, img { page-break-inside: avoid; }
115
+ img { max-width: 100% !important; }
116
+ @page :left { margin: 15mm 20mm 15mm 10mm; }
117
+ @page :right { margin: 15mm 10mm 15mm 20mm; }
118
+ p, h2, h3 { orphans: 3; widows: 3; }
119
+ h2, h3 { page-break-after: avoid; }
120
+ }
121
+
122
+ #mainHeader {
123
+ margin: 0 0 1em;
124
+ padding-top: 1em;
125
+ color: #808080;
126
+ text-align: center;
127
+ }
128
+ #mainHeader .logo{
129
+ height: 39px;
130
+ width: 150px;
131
+ vertical-align: middle;
132
+ }
133
+ #mainHeader .version {
134
+ color: #FF8700;
135
+ position: relative;
136
+ bottom: 0.6em;
137
+ font-size: 0.7em;
138
+ font-weight: 500;
139
+ }
140
+ #mainHeader {
141
+ margin: 0 0 1em;
142
+ padding-top: 1em;
143
+ color: #808080;
144
+ text-align: center;
145
+ }
146
+ #mainHeader .logo{
147
+ height: 39px;
148
+ width: 150px;
149
+ vertical-align: middle;
150
+ }
151
+ #mainHeader .version {
152
+ color: #FF8700;
153
+ position: relative;
154
+ bottom: 0.6em;
155
+ font-size: 0.7em;
156
+ font-weight: 500;
157
+ }
158
+
159
+ .btn {
160
+ display: inline-block;
161
+ width: 65px;
162
+ padding: 6px 12px;
163
+ margin-bottom: 0;
164
+ font-size: 14px;
165
+ font-weight: 500;
166
+ line-height: 1.42857143;
167
+ text-align: center;
168
+ white-space: nowrap;
169
+ vertical-align: middle;
170
+ -ms-touch-action: manipulation;
171
+ touch-action: manipulation;
172
+ cursor: pointer;
173
+ -webkit-user-select: none;
174
+ -moz-user-select: none;
175
+ -ms-user-select: none;
176
+ user-select: none;
177
+ background-image: none;
178
+ border: 1px solid transparent;
179
+ border-radius: 4px;
180
+ background-color: aliceblue;
181
+ opacity: 0.8;
182
+ }
183
+ .btn:focus {outline: none}
184
+ .btn:hover {
185
+ background-color: antiquewhite;
186
+ }
187
+
188
+ @font-face {
189
+ font-family: 'meta';
190
+ src: url('fonts/meta.eot');
191
+ }
192
+ @font-face {
193
+ font-family: 'meta';
194
+ src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SDgQAAAC8AAAAYGNtYXDxFfFbAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5Zswu1ZIAAAF4AAABFGhlYWQEAuE8AAACjAAAADZoaGVhBgsDyAAAAsQAAAAkaG10eAgAAAAAAALoAAAAHGxvY2EAjgDgAAADBAAAABBtYXhwAAkAFgAAAxQAAAAgbmFtZXuznNEAAAM0AAABKnBvc3QAAwAAAAAEYAAAACAAAwQAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADw2gPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEAEAAAAAMAAgAAgAEAAEAIPDY8Nr//f//AAAAAAAg8Nfw2v/9//8AAf/jDy0PLAADAAEAAAAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAAABAAJJAkkAEwAAARQHAQYjIicBJjU0NzYzITIXFhUCSQv/AAsODwv/AAsLCw8CAA4LCwIlDwv/AAsLAQALDw4LCwsLDgABAAAA2wJJAiUAEwAAARQHBiMhIicmNTQ3ATYzMhcBFhUCSQsLDv4ADwsLCwEACw8OCwEACwEADwsLCwsPDwsBAAsL/wALDwABAAAAkgFJAtsAEwAAARQHAQYjIicmNRE0NzYzMhcBFhUBSQv/AAsODwsLCwsPDgsBAAsBtw8L/wALCwsPAgAPCwoK/wALDwABAAAAAQAAiNFrr18PPPUACwQAAAAAANFNzrIAAAAA0U3OsgAAAAACSQLbAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAJJAAEAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAgAAAAJJAAACSQAAAW4AAAAAAAAACgAUAB4AQgBmAIoAAQAAAAcAFAABAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAgAAAABAAAAAAACAA4AMgABAAAAAAADAAgAHgABAAAAAAAEAAgAQAABAAAAAAAFABYACAABAAAAAAAGAAQAJgABAAAAAAAKADQASAADAAEECQABAAgAAAADAAEECQACAA4AMgADAAEECQADAAgAHgADAAEECQAEAAgAQAADAAEECQAFABYACAADAAEECQAGAAgAKgADAAEECQAKADQASABtAGUAdABhAFYAZQByAHMAaQBvAG4AIAAxAC4AMABtAGUAdABhbWV0YQBtAGUAdABhAFIAZQBnAHUAbABhAHIAbQBlAHQAYQBGAG8AbgB0ACAAZwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABJAGMAbwBNAG8AbwBuAC4AAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('truetype');
195
+ font-weight: normal;
196
+ font-style: normal;
197
+ }
198
+ [class^="icon-"], [class*=" icon-"] {
199
+ font-family: 'meta';
200
+ speak: none;
201
+ font-style: normal;
202
+ font-weight: normal;
203
+ font-variant: normal;
204
+ text-transform: none;
205
+ line-height: 1;
206
+
207
+ /* Better Font Rendering =========== */
208
+ -webkit-font-smoothing: antialiased;
209
+ -moz-osx-font-smoothing: grayscale;
210
+ }
211
+ .icon-caret-down:before {
212
+ content: "\f0d7";
213
+ }
214
+ .icon-caret-up:before {
215
+ content: "\f0d8";
216
+ }
217
+ .icon-caret-right:before {
218
+ content: "\f0da";
219
+ }
220
+ /*** Maps ***/
221
+ section.extent-section div.map {
222
+ height: 350px;
223
+ }
@@ -0,0 +1,59 @@
1
+ # HTML writer
2
+ # descriptive keywords
3
+
4
+ # History:
5
+ # Stan Smith 2015-03-23 original script
6
+
7
+ require 'html_citation'
8
+
9
+ module ADIWG
10
+ module Mdtranslator
11
+ module Writers
12
+ module Html
13
+
14
+ class MdHtmlKeyword
15
+ def initialize(html)
16
+ @html = html
17
+ end
18
+
19
+ def writeHtml(hKeyList)
20
+
21
+ # classes used
22
+ htmlCitation = $HtmlNS::MdHtmlCitation.new(@html)
23
+
24
+ # descriptive keywords - type
25
+ s = hKeyList[:keywordType]
26
+ if !s.nil?
27
+ @html.text!(s)
28
+ @html.br
29
+ end
30
+
31
+ @html.section(:class=>'block') do
32
+
33
+ # descriptive keywords - keywords - required
34
+ @html.em('Keywords: ')
35
+ @html.ul do
36
+ hKeyList[:keyword].each do |keyword|
37
+ @html.li(keyword)
38
+ end
39
+ end
40
+
41
+ # descriptive keywords - citation
42
+ hCitation = hKeyList[:keyTheCitation]
43
+ if !hCitation.empty?
44
+ @html.em('Thesaurus citation: ')
45
+ @html.br
46
+ @html.section(:class=>'block') do
47
+ htmlCitation.writeHtml(hCitation)
48
+ end
49
+ end
50
+ end
51
+
52
+ end # writeHtml
53
+
54
+ end # class
55
+
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,56 @@
1
+ # HTML writer
2
+ # legal constraint
3
+
4
+ # History:
5
+ # Stan Smith 2015-03-25 original script
6
+
7
+ module ADIWG
8
+ module Mdtranslator
9
+ module Writers
10
+ module Html
11
+
12
+ class MdHtmlLegalConstraint
13
+ def initialize(html)
14
+ @html = html
15
+ end
16
+
17
+ def writeHtml(hLegalCon)
18
+
19
+ # legal constraint - access constraints
20
+ aAccess = hLegalCon[:accessCodes]
21
+ if !aAccess.empty?
22
+ aAccess.each do |aCon|
23
+ @html.em('Access constraint: ')
24
+ @html.text!(aCon)
25
+ @html.br
26
+ end
27
+ end
28
+
29
+ # legal constraint - use constraints
30
+ aUse = hLegalCon[:useCodes]
31
+ if !aUse.empty?
32
+ aUse.each do |useCon|
33
+ @html.em('Use constraint: ')
34
+ @html.text!(useCon)
35
+ @html.br
36
+ end
37
+ end
38
+
39
+ # legal constraint - other constraints
40
+ aOther = hLegalCon[:otherCons]
41
+ if !aOther.empty?
42
+ aOther.each do |otherCon|
43
+ @html.em('Other constraint: ')
44
+ @html.text!(otherCon)
45
+ @html.br
46
+ end
47
+ end
48
+
49
+ end # writeHtml
50
+
51
+ end # class
52
+
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,51 @@
1
+ # HTML writer
2
+ # medium
3
+
4
+ # History:
5
+ # Stan Smith 2015-03-27 original script
6
+
7
+ module ADIWG
8
+ module Mdtranslator
9
+ module Writers
10
+ module Html
11
+
12
+ class MdHtmlMedium
13
+ def initialize(html)
14
+ @html = html
15
+ end
16
+
17
+ def writeHtml(hMedium)
18
+
19
+ # medium - name
20
+ s = hMedium[:mediumName]
21
+ if !s.nil?
22
+ @html.em('Medium name: ')
23
+ @html.text!(s)
24
+ @html.br
25
+ end
26
+
27
+ # medium - format
28
+ s = hMedium[:mediumFormat]
29
+ if !s.nil?
30
+ @html.em('Medium format: ')
31
+ @html.text!(s)
32
+ @html.br
33
+ end
34
+
35
+ # medium - note
36
+ s = hMedium[:mediumNote]
37
+ if !s.nil?
38
+ @html.em('Medium note: ')
39
+ @html.section(:class=>'block') do
40
+ @html.text!(s)
41
+ end
42
+ end
43
+
44
+ end # writeHtml
45
+
46
+ end # class
47
+
48
+ end
49
+ end
50
+ end
51
+ end