diff --git a/lib/adiwg/mdtranslator/writers/simple_html/sections/html_acquisition.rb b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_acquisition.rb new file mode 100644 index 00000000..e71ef4a6 --- /dev/null +++ b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_acquisition.rb @@ -0,0 +1,195 @@ +require_relative 'html_scope' +require_relative 'html_plan' +require_relative 'html_requirement' +require_relative 'html_objective' +require_relative 'html_platform' +require_relative 'html_instrument' +require_relative 'html_operation' +require_relative 'html_event' +require_relative 'html_pass' +require_relative 'html_environment' + +module ADIWG + module Mdtranslator + module Writers + module Simple_html + class Html_Acquisition + def initialize(html) + @html = html + end + + def writeHtml(hAcquisition) + scopeClass = Html_Scope.new(@html) + planClass = Html_Plan.new(@html) + requirementClass = Html_Requirement.new(@html) + objectiveClass = Html_Objective.new(@html) + platformClass = Html_Platform.new(@html) + instrumentClass = Html_Instrument.new(@html) + operationClass = Html_Operation.new(@html) + eventClass = Html_Event.new(@html) + passClass = Html_Pass.new(@html) + environmentClass = Html_Environment.new(@html) + + # scope + unless hAcquisition[:scope].empty? + @html.div do + @html.h5('Scope', {'class' => 'h5'}) + @html.div(:class => 'block') do + scopeClass.writeHtml(hDataQuality[:scope]) + end + end + end + + # plan + unless hAcquisition[:plans].empty? + @html.div(:class =>'block') do + @html.div do + @html.h4('Plans', {'class' => 'h4'}) + hAcquisition[:plans].each do |plan| + @html.div(:class =>'block') do + @html.div do + @html.h5('Plan', {'class' => 'h5'}) + planClass.writeHtml(plan) + end + end + end + end + end + end + + # requirement + unless hAcquisition[:requirements].empty? + @html.div(:class =>'block') do + @html.div do + @html.h4('Requirements', {'class' => 'h4'}) + hAcquisition[:requirements].each do |requirement| + @html.div(:class =>'block') do + @html.div do + @html.h5('Requirement', {'class' => 'h5'}) + requirementClass.writeHtml(requirement) + end + end + end + end + end + end + + # objective + unless hAcquisition[:objectives].empty? + @html.div(:class =>'block') do + @html.div do + @html.h4('Objectives', {'class' => 'h4'}) + hAcquisition[:objectives].each do |objective| + @html.div(:class =>'block') do + @html.div do + @html.h5('Objective', {'class' => 'h5'}) + objectiveClass.writeHtml(objective) + end + end + end + end + end + end + + + # platform + unless hAcquisition[:platforms].empty? + @html.div(:class =>'block') do + @html.div do + @html.h4('Platforms', {'class' => 'h4'}) + hAcquisition[:platforms].each do |platform| + @html.div(:class =>'block') do + @html.div do + @html.h5('Platform', {'class' => 'h5'}) + platformClass.writeHtml(platform) + end + end + end + end + end + end + + # Instrument + unless hAcquisition[:instruments].empty? + @html.div(:class =>'block') do + @html.div do + @html.h4('Instrument', {'class' => 'h4'}) + hAcquisition[:instruments].each do |instrument| + @html.div(:class =>'block') do + @html.div do + @html.h5('Instrument', {'class' => 'h5'}) + instrumentClass.writeHtml(instrument) + end + end + end + end + end + end + + # operation + unless hAcquisition[:operations].empty? + @html.div(:class =>'block') do + @html.div do + @html.h4('Operations', {'class' => 'h4'}) + hAcquisition[:operations].each do |operations| + @html.div(:class =>'block') do + @html.div do + @html.h5('Operation', {'class' => 'h5'}) + operationClass.writeHtml(operations) + end + end + end + end + end + end + + # Event + unless hAcquisition[:events].empty? + @html.div(:class =>'block') do + @html.div do + @html.h4('Events', {'class' => 'h4'}) + hAcquisition[:events].each do |event| + @html.div(:class =>'block') do + @html.div do + @html.h5('Event', {'class' => 'h5'}) + eventClass.writeHtml(event) + end + end + end + end + end + end + + # Pass + unless hAcquisition[:passes].empty? + @html.div(:class =>'block') do + @html.div do + @html.h4('Passes', {'class' => 'h4'}) + hAcquisition[:passes].each do |pass| + @html.div(:class =>'block') do + @html.div do + @html.h5('Pass', {'class' => 'h5'}) + passClass.writeHtml(pass) + end + end + end + end + end + end + + # Environment + unless hAcquisition[:environment].empty? + @html.div do + @html.h5('Scope', {'class' => 'h5'}) + @html.div(:class => 'block') do + environmentClass.writeHtml(hAcquisition[:environment]) + end + end + end + + end + end + end + end + end +end diff --git a/lib/adiwg/mdtranslator/writers/simple_html/sections/html_body.rb b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_body.rb index 3b2d1474..5f7c3ef8 100644 --- a/lib/adiwg/mdtranslator/writers/simple_html/sections/html_body.rb +++ b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_body.rb @@ -20,6 +20,7 @@ require_relative 'html_funding' require_relative 'html_dataDictionary' require_relative 'html_metadataRepository' +require_relative 'html_acquisition' module ADIWG module Mdtranslator @@ -47,6 +48,7 @@ def writeHtml(version, intObj) fundingClass = Html_Funding.new(@html) dictionaryClass = Html_DataDictionary.new(@html) repositoryClass = Html_Repository.new(@html) + aquisitionClass = Html_Acquisition.new(@html) # make sections of the internal data store convenient hSchema = intObj[:schema] @@ -61,6 +63,7 @@ def writeHtml(version, intObj) aFunding = intObj[:metadata][:funding] aDictionaries = intObj[:dataDictionaries] aRepositories = intObj[:metadataRepositories] + aAcquisitions = intObj[:metadata][:acquisitions] # set page title and logo # side navigation @@ -78,6 +81,7 @@ def writeHtml(version, intObj) @html.a(' Dictionary', {'href' => '#body-dataDictionary', 'class' => 'btn navBtn', 'id' => 'dictionaryButton'}) @html.a(' Funding', {'href' => '#body-funding', 'class' => 'btn navBtn', 'id' => 'fundingButton'}) @html.a(' Repository', {'href' => '#body-repository', 'class' => 'btn navBtn', 'id' => 'repositoryButton'}) + @html.a(' Acquisition', {'href' => '#body-acquisition', 'class' => 'btn navBtn', 'id' => 'acquisitionButton'}) end @@ -298,6 +302,18 @@ def writeHtml(version, intObj) end end + unless aAcquisitions.nil? || aAcquisitions.empty? + @html.div do + @html.h2('Acquisitions', {'id' => 'body-acquisition', 'class' => 'h2'}) + @html.span('', {'style' => 'mso-bookmark:body-acquisition'}) + aAcquisitions.each do |hAcquisition| + @html.div(:class => 'block') do + aquisitionClass.writeHtml(hAcquisition) + end + end + end + end + end # body end # writeHtml end # Html_Body diff --git a/lib/adiwg/mdtranslator/writers/simple_html/sections/html_environment.rb b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_environment.rb new file mode 100644 index 00000000..7d99966c --- /dev/null +++ b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_environment.rb @@ -0,0 +1,58 @@ +module ADIWG + module Mdtranslator + module Writers + module Simple_html + class Html_Environment + def initialize(html) + @html = html + end + + def writeHtml(hEnvironment) + # averageAirTemperature + unless hEnvironment[:averageAirTemperature].nil? + @html.em('Average Air Temperature: ') + @html.text!(hEnvironment[:averageAirTemperature].to_s) + @html.br + end + + # maxRelativeHumidity + unless hEnvironment[:maxRelativeHumidity].nil? + @html.em('Maximum Relative Humidity: ') + @html.text!(hEnvironment[:maxRelativeHumidity].to_s) + @html.br + end + + # maxAltitude + unless hEnvironment[:maxAltitude].nil? + @html.em('Maximum Altitude: ') + @html.text!(hEnvironment[:maxAltitude].to_s) + @html.br + end + + # meteorologicalConditions + unless hEnvironment[:meteorologicalConditions].nil? + @html.em('Meteorological Conditions: ') + @html.text!(hEnvironment[:meteorologicalConditions]) + @html.br + end + + # solarAzimuth + unless hEnvironment[:solarAzimuth].nil? + @html.em('Solar Azimuth: ') + @html.text!(hEnvironment[:solarAzimuth].to_s) + @html.br + end + + # solarElevation + unless hEnvironment[:solarElevation].nil? + @html.em('Solar Elevation: ') + @html.text!(hEnvironment[:solarElevation].to_s) + @html.br + end + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/adiwg/mdtranslator/writers/simple_html/sections/html_event.rb b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_event.rb new file mode 100644 index 00000000..0c4ad78a --- /dev/null +++ b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_event.rb @@ -0,0 +1,121 @@ +require_relative 'html_pass' +require_relative 'html_instrument' +require_relative 'html_extent' +require_relative 'html_identifier' + +module ADIWG + module Mdtranslator + module Writers + module Simple_html + class Html_Event + def initialize(html) + @html = html + end + + def writeHtml(hEvent) + passClass = Html_Pass.new(@html) + instrumentClass = Html_Instrument.new(@html) + extentClass = Html_Extent.new(@html) + identifierClass = Html_Identifier.new(@html) + + # eventId + unless hEvent[:eventId].nil? + @html.em('Event ID: ') + @html.text!(hEvent[:eventId]) + @html.br + end + + # identifier + unless hEvent[:identifier].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Identifier', {'class' => 'h4'}) + @html.div(:class => 'block') do + identifierClass.writeHtml(hEvent[:identifier]) + end + end + end + end + + # trigger + unless hEvent[:trigger].nil? + @html.em('Trigger: ') + @html.text!(hEvent[:trigger]) + @html.br + end + + # context + unless hEvent[:context].nil? + @html.em('Context: ') + @html.text!(hEvent[:context]) + @html.br + end + + # sequence + unless hEvent[:sequence].nil? + @html.em('Sequence: ') + @html.text!(hEvent[:sequence]) + @html.br + end + + # time + unless hEvent[:dateTime].nil? || hEvent[:dateTime].empty? + @html.em('Datetime: ') + @html.div(:class => 'block') do + @html.text!.writeHtml(hEvent[:dateTime][:dateTime].to_s) + end + end + + # expectedObjective + unless hEvent[:expectedObjectives].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Expected Objective', {'class' => 'h4'}) + hEvent[:expectedObjectives].each do |objective| + @html.div(:class => 'block') do + @html.div do + @html.summary('Objective', {'class' => 'h5'}) + objectiveClass.writeHtml(objective) + end + end + end + end + end + end + + # relatedPass + unless hEvent[:relatedPass].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Related Pass', {'class' => 'h4'}) + @html.div(:class => 'block') do + passClass.writeHtml(hEvent[:relatedPass]) + end + end + end + end + + #relatedSensor + unless hEvent[:relatedSensors].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Related Sensors', {'class' => 'h4'}) + hEvent[:relatedSensors].each do |instrument| + @html.div(:class => 'block') do + @html.div do + @html.summary('Instrument', {'class' => 'h5'}) + instrumentClass.writeHtml(instrument) + end + end + end + end + end + end + + end # writeHtml + end # Html_Event + + end + end + end +end \ No newline at end of file diff --git a/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrument.rb b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrument.rb new file mode 100644 index 00000000..6afef5a0 --- /dev/null +++ b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrument.rb @@ -0,0 +1,98 @@ +require_relative 'html_identifier' +require_relative 'html_platform' +require_relative 'html_instrumentationEventList' + +module ADIWG + module Mdtranslator + module Writers + module Simple_html + class Html_Instrument + def initialize(html) + @html = html + end + + def writeHtml(hInstrument) + identifierClass = Html_Identifier.new(@html) + platformClass = Html_Platform.new(@html) + instrumentationEventListClass = Html_InstrumentationEventList.new(@html) + + # instrumentId + unless hInstrument[:instrumentId].nil? + @html.em('Instrument ID: ') + @html.text!(hInstrument[:instrumentId]) + @html.br + end + + # identifier + unless hInstrument[:identifier].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Identifier', {'class' => 'h4'}) + @html.div(:class => 'block') do + identifierClass.writeHtml(hInstrument[:identifier]) + end + end + end + end + + # instrumentType + unless hInstrument[:instrumentType].nil? + @html.em('Instrument Type: ') + @html.text!(hInstrument[:instrumentType]) + @html.br + end + + # description + unless hInstrument[:description].nil? + @html.em('Description: ') + @html.text!(hInstrument[:description]) + @html.br + end + + # mountedOn + unless hInstrument[:mountedOn].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Mounted On', {'class' => 'h4'}) + @html.div(:class => 'block') do + platformClass.writeHtml(hInstrument[:mountedOn]) + end + end + end + end + + # history + unless hInstrument[:histories].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Histories', {'class' => 'h4'}) + hInstrument[:histories].each do |instrumentationEventList| + @html.div(:class => 'block') do + @html.div do + @html.summary('Instrumentation Event List', {'class' => 'h5'}) + instrumentationEventListClass.writeHtml(instrumentationEventList) + end + end + end + end + end + end + + # hostId + unless hInstrument[:hostId].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Host ID', {'class' => 'h4'}) + @html.div(:class => 'block') do + identifierClass.writeHtml(hInstrument[:hostId]) + end + end + end + end + + end # writeHtml + end # Html_Instrument + end + end + end +end \ No newline at end of file diff --git a/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrumentationEvent.rb b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrumentationEvent.rb new file mode 100644 index 00000000..1beb3b24 --- /dev/null +++ b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrumentationEvent.rb @@ -0,0 +1,84 @@ +require_relative 'html_citation' +require_relative 'html_extent' +require_relative 'html_revision' + +module ADIWG + module Mdtranslator + module Writers + module Simple_html + class Html_InstrumentationEvent + def initialize(html) + @html = html + end + + def writeHtml(hInstrumentationEvent) + citationClass = Html_Citation.new(@html) + extentClass = Html_Extent.new(@html) + revisionClass = Html_Revision.new(@html) + + # citation + unless hInstrumentationEvent[:citations].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Citations', {'class' => 'h4'}) + hInstrumentationEvent[:citations].each do |citation| + @html.div(:class => 'block') do + @html.div do + @html.summary('Citation', {'class' => 'h5'}) + citationClass.writeHtml(citation) + end + end + end + end + end + end + + # description + unless hInstrumentationEvent[:description].nil? + @html.em('Description: ') + @html.text!(hInstrumentationEvent[:description]) + @html.br + end + + # extent + unless hInstrumentationEvent[:extent].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Extent', {'class' => 'h4'}) + @html.div(:class => 'block') do + extentClass.writeHtml(hInstrumentationEvent[:extent]) + end + end + end + end + + # eventType + unless hInstrumentationEvent[:eventType].nil? + @html.em('Event Type: ') + @html.text!(hInstrumentationEvent[:eventType]) + @html.br + end + + # revisionHistory + unless hInstrumentationEvent[:revisionHistories].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Revision History', {'class' => 'h4'}) + hInstrumentationEvent[:revisionHistories].each do |revision| + @html.div(:class => 'block') do + @html.div do + @html.summary('Revision', {'class' => 'h5'}) + revisionClass.writeHtml(revision) + end + end + end + end + end + end + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrumentationEventList.rb b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrumentationEventList.rb new file mode 100644 index 00000000..8decfcc7 --- /dev/null +++ b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrumentationEventList.rb @@ -0,0 +1,90 @@ +require_relative 'html_citation' +require_relative 'html_locale' +require_relative 'html_constraint' +require_relative 'html_instrumentationEvent' + +module ADIWG + module Mdtranslator + module Writers + module Simple_html + class Html_InstrumentationEventList + def initialize(html) + @html = html + end + + def writeHtml(hInstrumentationEventList) + citationClass = Html_Citation.new(@html) + localeClass = Html_Locale.new(@html) + constraintClass = Html_Constraint.new(@html) + instrumentationEventClass = Html_InstrumentationEvent.new(@html) + + # citation + unless hInstrumentationEventList[:citation].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Citation', {'class' => 'h4'}) + @html.div(:class => 'block') do + citationClass.writeHtml(hInstrumentationEventList[:citation]) + end + end + end + end + + # desctiption + unless hInstrumentationEventList[:description].nil? + @html.em('Description: ') + @html.text!(hInstrumentationEventList[:description]) + @html.br + end + + # locale + unless hInstrumentationEventList[:locale].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Locale', {'class' => 'h4'}) + @html.div(:class => 'block') do + localeClass.writeHtml(hInstrumentationEventList[:locale]) + end + end + end + end + + # constraints + unless hInstrumentationEventList[:constraints].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Constraints', {'class' => 'h4'}) + hInstrumentationEventList[:constraints].each do |constraint| + @html.div(:class => 'block') do + @html.div do + @html.summary('Constraint', {'class' => 'h5'}) + constraintClass.writeHtml(constraint) + end + end + end + end + end + end + + # instrumentationEvent + unless hInstrumentationEventList[:instrumentationEvents].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Instrumentation Events', {'class' => 'h4'}) + hInstrumentationEventList[:instrumentationEvents].each do |instrumentationEvent| + @html.div(:class => 'block') do + @html.div do + @html.summary('Instrumentation Event', {'class' => 'h5'}) + instrumentationEventClass.writeHtml(instrumentationEvent) + end + end + end + end + end + end + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/adiwg/mdtranslator/writers/simple_html/sections/html_objective.rb b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_objective.rb new file mode 100644 index 00000000..538222a0 --- /dev/null +++ b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_objective.rb @@ -0,0 +1,155 @@ +require_relative 'html_identifier' +require_relative 'html_extent' +require_relative 'html_event' +require_relative 'html_pass' +require_relative 'html_instrument' + +module ADIWG + module Mdtranslator + module Writers + module Simple_html + class Html_Objective + def initialize(html) + @html = html + end + + def writeHtml(hObjective) + identifierClass = Html_Identifier.new(@html) + extentClass = Html_Extent.new(@html) + eventClass = Html_Event.new(@html) + passClass = Html_Pass.new(@html) + instrumentClass = Html_Instrument.new(@html) + + # objectiveId + unless hObjective[:objectiveId].nil? + @html.em('Objective ID: ') + @html.text!(hObjective[:objectiveId]) + @html.br + end + + # identifier + unless hObjective[:identifiers].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Identifiers', {'class' => 'h4'}) + hObjective[:identifiers].each do |identifier| + @html.div(:class => 'block') do + @html.div do + @html.summary('Identifier', {'class' => 'h5'}) + identifierClass.writeHtml(identifier) + end + end + end + end + end + end + + # priority + unless hObjective[:priority].nil? + @html.em('Priority: ') + @html.text!(hObjective[:priority]) + @html.br + end + + # objectiveType + unless hObjective[:objectiveTypes].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Objective Types', {'class' => 'h4'}) + hObjective[:objectiveTypes].each do |type| + @html.em('Type: ') + @html.text!(type) + @html.br + end + end + end + end + + # function + unless hObjective[:functions].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Functions', {'class' => 'h4'}) + hObjective[:functions].each do |function| + @html.em('Function: ') + @html.text!(function) + @html.br + end + end + end + end + + # extent + unless hObjective[:extents].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Extents', {'class' => 'h4'}) + hObjective[:extents].each do |extent| + @html.div(:class => 'block') do + @html.div do + @html.summary('Extent', {'class' => 'h5'}) + extentClass.writeHtml(extent) + end + end + end + end + end + end + + # Occurrence + unless hObjective[:occurrences].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Occurrences', {'class' => 'h4'}) + hObjective[:occurrences].each do |occurrence| + @html.div(:class => 'block') do + @html.div do + @html.summary('Occurrence', {'class' => 'h5'}) + eventClass.writeHtml(occurrence) + end + end + end + end + end + end + + # pass + unless hObjective[:passes].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Passes', {'class' => 'h4'}) + hObjective[:passes].each do |pass| + @html.div(:class => 'block') do + @html.div do + @html.summary('Pass', {'class' => 'h5'}) + passClass.writeHtml(pass) + end + end + end + end + end + end + + # sensingInstrument + unless hObjective[:sensingInstruments].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Sensing Instruments', {'class' => 'h4'}) + hObjective[:sensingInstruments].each do |instrument| + @html.div(:class => 'block') do + @html.div do + @html.summary('Instrument', {'class' => 'h5'}) + instrumentClass.writeHtml(instrument) + end + end + end + end + end + end + end # writeHtml + + end # Html_Requirement + end + end + end +end \ No newline at end of file diff --git a/lib/adiwg/mdtranslator/writers/simple_html/sections/html_operation.rb b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_operation.rb new file mode 100644 index 00000000..6ea6e7f1 --- /dev/null +++ b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_operation.rb @@ -0,0 +1,178 @@ +require_relative 'html_citation' +require_relative 'html_identifier' +require_relative 'html_objective' +require_relative 'html_operation' +require_relative 'html_plan' +require_relative 'html_platform' +require_relative 'html_event' + +module ADIWG + module Mdtranslator + module Writers + module Simple_html + class Html_Operation + def initialize(html) + @html = html + end + + def writeHtml(hOperation) + citationClass = Html_Citation.new(@html) + identifierClass = Html_Identifier.new(@html) + objectiveClass = Html_Objective.new(@html) + operationClass = Html_Operation.new(@html) + planClass = Html_Plan.new(@html) + platformClass = Html_Platform.new(@html) + eventClass = Html_Event.new(@html) + + + # operationId + unless hOperation[:operationId].nil? + @html.em('Operation ID: ') + @html.text!(hOperation[:operationId]) + @html.br + end + + # description + unless hOperation[:description].nil? + @html.em('Description: ') + @html.text!(hOperation[:description]) + @html.br + end + + # citation + unless hOperation[:citation].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Citation', {'class' => 'h4'}) + @html.div(:class => 'block') do + citationClass.writeHtml(hOperation[:citation]) + end + end + end + end + + # identifier + unless hOperation[:identifier].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Identifier', {'class' => 'h4'}) + @html.div(:class => 'block') do + identifierClass.writeHtml(hOperation[:identifier]) + end + end + end + end + + # status + unless hOperation[:status].nil? + @html.em('Status: ') + @html.text!(hOperation[:status]) + @html.br + end + + # operationType + unless hOperation[:operationType].nil? + @html.em('Operation Type: ') + @html.text!(hOperation[:operationType]) + @html.br + end + + # objective + unless hOperation[:objectives].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Objectives', {'class' => 'h4'}) + hOperation[:objectives].each do |objective| + @html.div(:class => 'block') do + @html.div do + @html.summary('Objective', {'class' => 'h5'}) + objectiveClass.writeHtml(objective) + end + end + end + end + end + end + + # parentOperation + unless hOperation[:parentOperation].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Parent Operation', {'class' => 'h4'}) + @html.div(:class => 'block') do + operationClass.writeHtml(hOperation[:parentOperation]) + end + end + end + end + + # childOperation + unless hOperation[:childOperations].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Child Operations', {'class' => 'h4'}) + hOperation[:childOperations].each do |operation| + @html.div(:class => 'block') do + @html.div do + @html.summary('Operation', {'class' => 'h5'}) + operationClass.writeHtml(operation) + end + end + end + end + end + end + + # plan + unless hOperation[:plan].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Plan', {'class' => 'h4'}) + @html.div(:class => 'block') do + planClass.writeHtml(hOperation[:plan]) + end + end + end + end + + # platform + unless hOperation[:platforms].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Platforms', {'class' => 'h4'}) + hOperation[:platforms].each do |platform| + @html.div(:class => 'block') do + @html.div do + @html.summary('Platform', {'class' => 'h5'}) + platformClass.writeHtml(platform) + end + end + end + end + end + end + + # significantEvent + unless hOperation[:significantEvents].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Significant Events', {'class' => 'h4'}) + hOperation[:significantEvents].each do |event| + @html.div(:class => 'block') do + @html.div do + @html.summary('Event', {'class' => 'h5'}) + eventClass.writeHtml(event) + end + end + end + end + end + end + + end # writeHtml + + end # Html_Operation + end + end + end +end \ No newline at end of file diff --git a/lib/adiwg/mdtranslator/writers/simple_html/sections/html_pass.rb b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_pass.rb new file mode 100644 index 00000000..131f3c42 --- /dev/null +++ b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_pass.rb @@ -0,0 +1,72 @@ +require_relative 'html_identifier' +require_relative 'html_extent' +require_relative 'html_event' + +module ADIWG + module Mdtranslator + module Writers + module Simple_html + class Html_Pass + def initialize(html) + @html = html + end + + def writeHtml(hPass) + identifierClass = Html_Identifier.new(@html) + extentClass = Html_Extent.new(@html) + eventClass = Html_Event.new(@html) + + # passId + unless hPass[:passId].nil? + @html.em('Pass ID: ') + @html.text!(hPass[:passId]) + @html.br + end + + # identifier + unless hPass[:identifier].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Identifier', {'class' => 'h4'}) + @html.div(:class => 'block') do + identifierClass.writeHtml(hPass[:identifier]) + end + end + end + end + + # extent + unless hPass[:extent].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Extent', {'class' => 'h4'}) + @html.div(:class => 'block') do + extentClass.writeHtml(hPass[:extent]) + end + end + end + end + + # relatedEvent + unless hPass[:relatedEvents].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Related Events', {'class' => 'h4'}) + hPass[:relatedEvents].each do |event| + @html.div(:class => 'block') do + @html.div do + @html.summary('Event', {'class' => 'h5'}) + eventClass.writeHtml(event) + end + end + end + end + end + end + + end # writeHtml + end # Html_Pass + end + end + end +end \ No newline at end of file diff --git a/lib/adiwg/mdtranslator/writers/simple_html/sections/html_plan.rb b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_plan.rb new file mode 100644 index 00000000..d3ee434c --- /dev/null +++ b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_plan.rb @@ -0,0 +1,93 @@ +require_relative 'html_citation' +require_relative 'html_operation' +require_relative 'html_requirement' + +module ADIWG + module Mdtranslator + module Writers + module Simple_html + class Html_Plan + def initialize(html) + @html = html + end + + def writeHtml(hPlan) + citationClass = Html_Citation.new(@html) + operationClass = Html_Operation.new(@html) + requirementClass = Html_Requirement.new(@html) + planClass = Html_Plan.new(@html) + + # planId + unless hPlan[:planId].empty? + @html.em('Plan ID: ') + @html.text!(hPlan[:planId]) + @html.br + end + + # planType + unless hPlan[:planType].empty? + @html.em('Type: ') + @html.text!(hPlan[:planType]) + @html.br + end + + # status + unless hPlan[:status].empty? + @html.em('Status: ') + @html.text!(hPlan[:status]) + @html.br + end + + # citation + unless hPlan[:citation].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Citation', {'class' => 'h4'}) + @html.div(:class => 'block') do + citationClass.writeHtml(hPlan[:citation]) + end + end + end + end + + # planOperation + unless hPlan[:planOperations].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Operations', {'class' => 'h4'}) + hPlan[:planOperations].each do |operation| + @html.div(:class => 'block') do + @html.div do + @html.summary('Operation', {'class' => 'h5'}) + operationClass.writeHtml(operation) + end + end + end + end + end + end + + # satisfiedRequirement + unless hPlan[:satisfiedRequirements].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Requirements', {'class' => 'h4'}) + hPlan[:satisfiedRequirements].each do |requirement| + @html.div(:class => 'block') do + @html.div do + @html.summary('Requirement', {'class' => 'h5'}) + requirementClass.writeHtml(requirement) + end + end + end + end + end + end + + end # writeHtml + + end # Html_Plan + end + end + end +end diff --git a/lib/adiwg/mdtranslator/writers/simple_html/sections/html_platform.rb b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_platform.rb new file mode 100644 index 00000000..5162664e --- /dev/null +++ b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_platform.rb @@ -0,0 +1,117 @@ +require_relative 'html_identifier' +require_relative 'html_citation' +require_relative 'html_responsibility' +require_relative 'html_instrument' +require_relative 'html_instrumentationEventList' + +module ADIWG + module Mdtranslator + module Writers + module Simple_html + class Html_Platform + def initialize(html) + @html = html + end + + def writeHtml(hPlatform) + identifierClass = Html_Identifier.new(@html) + citationClass = Html_Citation.new(@html) + responsibilityClass = Html_Responsibility.new(@html) + instrumentClass = Html_Instrument.new(@html) + instrumentationEventListClass = Html_InstrumentationEventList.new(@html) + + # platformId + unless hPlatform[:platformId].nil? + @html.em('Platform ID: ') + @html.text!(hPlatform[:platformId]) + @html.br + end + + # citation + unless hPlatform[:citation].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Citation', {'class' => 'h4'}) + @html.div(:class => 'block') do + citationClass.writeHtml(hPlatform[:citation]) + end + end + end + end + + # identifier + unless hPlatform[:identifier].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Identifier', {'class' => 'h4'}) + @html.div(:class => 'block') do + identifierClass.writeHtml(hPlatform[:identifier]) + end + end + end + end + + # description + unless hPlatform[:description].nil? + @html.em('Description: ') + @html.text!(hPlatform[:description]) + @html.br + end + + # sponsor + unless hPlatform[:sponsors].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Sponsors', {'class' => 'h4'}) + hPlatform[:sponsors].each do |responsibility| + @html.div(:class => 'block') do + @html.div do + @html.summary('Responsibility', {'class' => 'h5'}) + responsibilityClass.writeHtml(responsibility) + end + end + end + end + end + end + + # instrument + unless hPlatform[:instruments].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Instruments', {'class' => 'h4'}) + hPlatform[:instruments].each do |instrument| + @html.div(:class => 'block') do + @html.div do + @html.summary('Instrument', {'class' => 'h5'}) + instrumentClass.writeHtml(instrument) + end + end + end + end + end + end + + # history + unless hPlatform[:history].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('History', {'class' => 'h4'}) + hPlatform[:history].each do |instrumentationEventList| + @html.div(:class => 'block') do + @html.div do + @html.summary('Instrumentation Event List', {'class' => 'h5'}) + instrumentationEventListClass.writeHtml(instrumentationEventList) + end + end + end + end + end + end + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/adiwg/mdtranslator/writers/simple_html/sections/html_requestedDate.rb b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_requestedDate.rb new file mode 100644 index 00000000..73e85058 --- /dev/null +++ b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_requestedDate.rb @@ -0,0 +1,33 @@ +require_relative 'html_datetime' + +module ADIWG + module Mdtranslator + module Writers + module Simple_html + class Html_RequestedDate + def initialize(html) + @html = html + end + + def writeHtml(hRequestedDate) + datetimeClass = Html_Datetime.new(@html) + + # requestedDateOfCollection + unless hRequestedDate[:requestedDateOfCollection].empty? + @html.em('Requested Date of Collection: ') + @html.text!(hRequestedDate[:requestedDateOfCollection][:dateTime].to_s) + @html.br + end + + # latestAcceptableDate + unless hRequestedDate[:latestAcceptableDate].empty? + @html.em('Latest Acceptable Date: ') + @html.text!(hRequestedDate[:latestAcceptableDate][:dateTime].to_s) + end + + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/adiwg/mdtranslator/writers/simple_html/sections/html_requirement.rb b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_requirement.rb new file mode 100644 index 00000000..ac2d0c75 --- /dev/null +++ b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_requirement.rb @@ -0,0 +1,139 @@ +require_relative 'html_citation' +require_relative 'html_identifier' +require_relative 'html_responsibility' +require_relative 'html_requestedDate' +require_relative 'html_date' +require_relative 'html_plan' + +module ADIWG + module Mdtranslator + module Writers + module Simple_html + class Html_Requirement + def initialize(html) + @html = html + end + + def writeHtml(hRequirement) + citationClass = Html_Citation.new(@html) + identifierClass = Html_Identifier.new(@html) + responsibilityClass = Html_Responsibility.new(@html) + requestedDateClass = Html_RequestedDate.new(@html) + dateClass = Html_Date.new(@html) + planClass = Html_Plan.new(@html) + + # requirementId + unless hRequirement[:requirementId].nil? + @html.em('Requirement ID: ') + @html.text!(hRequirement[:requirementId]) + @html.br + end + + # citation + unless hRequirement[:citation].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Citation', {'class' => 'h4'}) + @html.div(:class => 'block') do + citationClass.writeHtml(hRequirement[:citation]) + end + end + end + end + + # identifier + unless hRequirement[:identifier].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Identifier ', {'class' => 'h4'}) + @html.div(:class => 'block') do + identifierClass.writeHtml(hRequirement[:identifier]) + end + end + end + end + + # requestor + unless hRequirement[:requestors].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Requestors', {'class' => 'h4'}) + hRequirement[:requestors].each do |requestor| + @html.div(:class => 'block') do + @html.div do + @html.summary('Requestor', {'class' => 'h5'}) + operationClass.writeHtml(requestor) + end + end + end + end + end + end + + # recipient + unless hRequirement[:recipients].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Recipients', {'class' => 'h4'}) + hRequirement[:recipients].each do |recipient| + @html.div(:class => 'block') do + @html.div do + @html.summary('Recipient', {'class' => 'h5'}) + operationClass.writeHtml(recipient) + end + end + end + end + end + end + + # priority + unless hRequirement[:priority].nil? + @html.em('Priority: ') + @html.text!(hRequirement[:priority]) + @html.br + end + + # requested date + unless hRequirement[:requestedDate].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Requested Date ', {'class' => 'h4'}) + @html.div(:class => 'block') do + requestedDateClass.writeHtml(hRequirement[:requestedDate]) + end + end + end + end + + # expiry date + unless hRequirement[:expiryDate].nil? + @html.em('Expiry Date: ') + @html.text!(hRequirement[:expiryDate]) + @html.br + end + + # satisfied plan + unless hRequirement[:satisfiedPlans].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Satisfied Plans', {'class' => 'h4'}) + hRequirement[:satisfiedPlans].each do |plan| + @html.div(:class => 'block') do + @html.div do + @html.summary('Plan', {'class' => 'h5'}) + planClass.writeHtml(plan) + end + end + end + end + end + end + + end # writeHtml + end # Html_Requirement + + end + end + end +end \ No newline at end of file diff --git a/lib/adiwg/mdtranslator/writers/simple_html/sections/html_revision.rb b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_revision.rb new file mode 100644 index 00000000..34cf7ff1 --- /dev/null +++ b/lib/adiwg/mdtranslator/writers/simple_html/sections/html_revision.rb @@ -0,0 +1,55 @@ +require_relative 'html_responsibility' +require_relative 'html_date' + +module ADIWG + module Mdtranslator + module Writers + module Simple_html + class Html_Revision + def initialize(html) + @html = html + end + + def writeHtml(hRevision) + responsibilityClass = Html_Responsibility.new(@html) + dateClass = Html_Date.new(@html) + + # description + unless hRevision[:description].nil? + @html.em('Description: ') + @html.text!(hRevision[:description]) + @html.br + end + + # responsibleParty + unless hRevision[:responsibleParty].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Responsible Party', {'class' => 'h4'}) + @html.div(:class => 'block') do + responsibilityClass.writeHtml(hRevision[:responsibleParty]) + end + end + end + end + + # dateInfo + unless hRevision[:dateInfo].empty? + @html.div(:class => 'block') do + @html.div do + @html.summary('Date Info', {'class' => 'h4'}) + hRevision[:dateInfo].each do |date| + @html.em('Datetime: ') + @html.text!(date[:dateTime].to_s) + @html.br + end + end + end + end + + end + end + end + end + end +end \ No newline at end of file