Merge "Issue #2855 - Implement HPC menus for NDM, refactor NDM code so more code is common. Peer review comments" into development

Former-commit-id: 61c5a25407 [formerly 85e3ac041a] [formerly 7e7745cd7b [formerly 5e03b83061e1cd7f1a15e939c2bc98d3b99cf393]]
Former-commit-id: 7e7745cd7b
Former-commit-id: 3e32812f13
This commit is contained in:
Nate Jensen 2014-03-18 13:13:53 -05:00 committed by Gerrit Code Review
commit e3bc322d49
17 changed files with 1244 additions and 682 deletions

View file

@ -23,14 +23,7 @@
<contribute xsi:type="bundleItem" file="bundles/ncepHydro/hpc/HPC6hrQPF.xml"
menuText="HPC QPF 6hr (Grid)" id="HPCQPF6hr">
</contribute>
<contribute xsi:type="subMenu" menuText="Precipitation"
id="ncepHydro.hpc.precipitation">
<contribute xsi:type="subinclude" fileName="menus/ncepHydro/hpc/precipitation.xml"/>
</contribute>
<contribute xsi:type="subMenu" menuText="Temps &amp;&amp; Weather"
id="ncepHydro.hpc.tempsAndWeather">
<contribute xsi:type="subinclude" fileName="menus/ncepHydro/hpc/tempsAndWeather.xml"/>
</contribute>
<contribute xsi:type="subinclude" fileName="menus/ncepHydro/hpc/hpcMenus.xml"/>
</menuTemplate>

View file

@ -0,0 +1,206 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="subMenu" menuText="Precipitation"
id="ncepHydro.hpc.precipitation">
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Instantaneous Precip" id="instantaneousPrecip">
<substitute key="wmo" value="PEIC61, PEIE62, PEIG63, PEII64" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 1 Excessive Rainfall" id="day1ExcessiveRainfall">
<substitute key="wmo" value="PEI745" />
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/ncepHydro/hpc/HPCqpfNDFD-PPFFG.xml" menuText="1-3 Day Excessive Rainfall (Grid)"
id="day1to3ExcessiveRainfall">
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook_customLegend.xml"
menuText="Precip Accum - 6 hr" id="precipAccum6hr">
<substitute key="wmo"
value="PEIB40, PEIC43, PEID44, PEIE40, PEIF40, PEBF98, PEBG98, PEBH98, PEBI88, PEBI98, PEBJ88, PEBJ98, PEBK98" />
<substitute key="customLegend" value="Precip Fcst - 6hr accum" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Precip Accum - 24 hr" id="precipAccum24hr">
<substitute key="wmo" value="PEIE41, PEII42, PEIK98" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Sig River Flood Outlook" id="sigRiverFloodOutlook">
<substitute key="wmo" value="PENJ88" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Mesoscale Precip Discussion" id="mesoPrecipDisc">
<substitute key="wmo" value="PENA01" />
</contribute>
<contribute xsi:type="separator" id="separator1" />
<contribute xsi:type="subMenu" menuText="Day 1-3 Prob 4+ Inches Snow">
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 1 Prob 4+&quot; Snow" id="day1Prob4InchesSnow">
<substitute key="wmo" value="PSBB04" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 2 Prob 4+&quot; Snow" id="day2Prob4InchesSnow">
<substitute key="wmo" value="PSBC04" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 3 Prob 4+&quot; Snow" id="day3Prob4InchesSnow">
<substitute key="wmo" value="PSBD04" />
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="Day 1-3 Prob 8+ Inches Snow">
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 1 Prob 8+&quot; Snow" id="day1Prob8InchesSnow">
<substitute key="wmo" value="PSBB08" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 2 Prob 8+&quot; Snow" id="day2Prob8InchesSnow">
<substitute key="wmo" value="PSBC08" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 3 Prob 8+&quot; Snow" id="day3Prob8InchesSnow">
<substitute key="wmo" value="PSBD08" />
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="Day 1-3 Prob 12+ Inches Snow">
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 1 Prob 12+&quot; Snow" id="day1Prob12InchesSnow">
<substitute key="wmo" value="PSBB12" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 2 Prob 12+&quot; Snow" id="day2Prob12InchesSnow">
<substitute key="wmo" value="PSBC12" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 3 Prob 12+&quot; Snow" id="day3Prob12InchesSnow">
<substitute key="wmo" value="PSBD12" />
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="Day 1-3 Prob .25 Inches Ice">
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 1 Prob .25+&quot; Ice" id="day1Prob025InchesIce">
<substitute key="wmo" value="PSBB25" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 2 Prob .25+&quot; Ice" id="day2Prob025InchesIce">
<substitute key="wmo" value="PSBC25" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 3 Prob .25+&quot; Ice" id="day3Prob025InchesIce">
<substitute key="wmo" value="PSBD25" />
</contribute>
</contribute>
<contribute xsi:type="separator" id="separator2" />
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="1-5 Day Total Precip" id="oneToFiveDayTotalPrecip">
<substitute key="wmo" value="PEIO46" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="6-10, 8-14 Day Precip Anom" id="sixToTen8to14DayPrecipAnom">
<substitute key="wmo" value="PEIY47, PETT00" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="30 Day Precip Anom" id="thirtyDayPrecipAnom">
<substitute key="wmo" value="PEIV98" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="90 Day Seasonal Precip Outlook" id="ninetyDaySeasonalPrecipOutlook">
<substitute key="wmo"
value="PEIW01,PEIW02,PEIW03,PEIW04,PEIW05,PEIW06,PEIW07,PEIW08,PEIW09,PEIW10,PEIW11,PEIW12,PEIW13" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="0.5 Mo (15-105 day) 50% POE Precip Outlook" id="fiftyPercentPOEPrecipOutlook2">
<substitute key="wmo"
value="PENV01,PENV02,PENV03,PENV04,PENV05,PENV06,PENV07,PENV08,PENV09,PENV10,PENV11,PENV12,PENV13" />
</contribute>
<contribute xsi:type="separator" id="separator3" />
<contribute xsi:type="bundleItem"
file="bundles/ncepHydro/hpc/HPCqpfNDFD6hr.xml" menuText="1-3 Day HPC QPF (6-Hourly Grid)"
id="oneTo3HPCQPF">
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/ncepHydro/hpc/HPCqpfNDFD48hr.xml" menuText="4-5 Day HPC QPF (Grid)"
id="fourTo5DayHPCQPF">
</contribute>
<contribute xsi:type="bundleItem"
file="bundles/ncepHydro/hpc/HPCqpfNDFD120hr.xml" menuText="1-5 Day HPC QPF Total (Grid)"
id="oneTo5HPCQPF">
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="Temps &amp;&amp; Weather"
id="ncepHydro.hpc.tempsAndWeather">
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="1-5 Day Max Temp Anomaly" id="fiveDayMaxTempAnomaly">
<substitute key="wmo" value="PTIO52" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="1-5 Day Min Temp Anomaly" id="fiveDayMinTempAnomaly">
<substitute key="wmo" value="PTIO53" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 3-7 Max/Min/PoP" id="day3To7MaxMinPoP">
<substitute key="wmo" value="PYWK43, PYWM44, PYWO45, PYWQ46, PYWS98" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 3 Heat Index Probabilities" id="day3HeatIndex">
<substitute key="wmo" value="PTNK98" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 4 Heat Index Probabilities" id="day4HeatIndex">
<substitute key="wmo" value="PTNM98" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 5 Heat Index Probabilities" id="day5HeatIndex">
<substitute key="wmo" value="PTNO98" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 6 Heat Index Probabilities" id="day6HeatIndex">
<substitute key="wmo" value="PTNQ98" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 7 Heat Index Probabilities" id="day7HeatIndex">
<substitute key="wmo" value="PTNS98" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="6-10, 8-14 Day Temp Anomaly" id="TempAnomaly6to108to14">
<substitute key="wmo" value="PTTU98, PTIY51" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="30 Day Temp Anomaly" id="thirtyDayTempAnomaly">
<substitute key="wmo" value="PTIV98" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="90 Day Seasonal Temp Outlook" id="ninetyDaySeasonalTempOutlook">
<substitute key="wmo"
value="PTIW01,PTIW02,PTIW03,PTIW04,PTIW05,PTIW06,PTIW07,PTIW08,PTIW09,PTIW10,PTIW11,PTIW12,PTIW13" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="0.5 Mo (15-105 day) 50% POE Temp Outlook" id="fiftyPercentPOEPrecipOutlook2">
<substitute key="wmo"
value="PTNV01,PTNV02,PTNV03,PTNV04,PTNV05,PTNV06,PTNV07,PTNV08,PTNV09,PTNV10,PTNV11,PTNV12,PTNV13" />
</contribute>
<contribute xsi:type="separator" id="separator4" />
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="MSL Pressure Analysis" id="MSLPressureAnalysis">
<substitute key="wmo" value="PPAA89" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Surface Fronts Analysis" id="surfaceFrontsAnalysis">
<substitute key="wmo" value="PYAA98" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="12-48 hr Fronts/Press" id="frontsPress12to48">
<substitute key="wmo" value="PPIC01, PPIE01, PPIG01, PPII01" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="Day 3-7 Fronts/Press" id="day3to7FrontsPress">
<substitute key="wmo" value="PPHK01, PPHM01, PPHO01, PPTG98, PPTR98" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="3-Day Sig Winter Low Tracks" id="threeDaySigWinterLowTracks">
<substitute key="wmo" value="PSAO72" />
</contribute>
</contribute>
</menuTemplate>

View file

@ -27,5 +27,5 @@
menuText="Svr Wx Plot" id="spcWxPlot">
</contribute>
<contribute xsi:type="subinclude" fileName="menus/spc/hazardMenus.xml"/>
<contribute xsi:type="subinclude" fileName="menus/ncepHydro/spc/hazardMenus.xml"/>
</menuTemplate>

View file

@ -0,0 +1,215 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
This file is the A2 NDM replacement for redbookHPCMenus.txt.
Dropping RedbookHPCMenus.xml into the /awips2/edex/data/ndm directory
will generate an override of the HPC menu.
RedbookHPCMenus.xml as written here will generate the base version
of the HPC menus.
-->
<redbookMenu>
<menuEntry type="submenu" text="Precipitation"
id="ncepHydro.hpc.precipitation">
<menuEntry type="productButton"
text="Instantaneous Precip" id="instantaneousPrecip">
<menuEntry type="substitute" key="wmo" value="PEIC61, PEIE62, PEIG63, PEII64" />
</menuEntry>
<menuEntry type="productButton"
text="Day 1 Excessive Rainfall" id="day1ExcessiveRainfall">
<menuEntry type="substitute" key="wmo" value="PEI745" />
</menuEntry>
<menuEntry type="productButton"
file="bundles/ncepHydro/hpc/HPCqpfNDFD-PPFFG.xml" text="1-3 Day Excessive Rainfall (Grid)"
id="day1to3ExcessiveRainfall">
</menuEntry>
<menuEntry type="productButton" file="bundles/Redbook_customLegend.xml"
text="Precip Accum - 6 hr" id="precipAccum6hr">
<menuEntry type="substitute" key="wmo"
value="PEIB40, PEIC43, PEID44, PEIE40, PEIF40, PEBF98, PEBG98, PEBH98, PEBI88, PEBI98, PEBJ88, PEBJ98, PEBK98" />
<menuEntry type="substitute" key="customLegend" value="Precip Fcst - 6hr accum" />
</menuEntry>
<menuEntry type="productButton"
text="Precip Accum - 24 hr" id="precipAccum24hr">
<menuEntry type="substitute" key="wmo" value="PEIE41, PEII42, PEIK98" />
</menuEntry>
<menuEntry type="productButton"
text="Sig River Flood Outlook" id="sigRiverFloodOutlook">
<menuEntry type="substitute" key="wmo" value="PENJ88" />
</menuEntry>
<menuEntry type="productButton"
text="Mesoscale Precip Discussion" id="mesoPrecipDisc">
<menuEntry type="substitute" key="wmo" value="PENA01" />
</menuEntry>
<menuEntry type="separator" id="separator1" />
<menuEntry type="submenu" text="Day 1-3 Prob 4+ Inches Snow">
<menuEntry type="productButton"
text="Day 1 Prob 4+&quot; Snow" id="day1Prob4InchesSnow">
<menuEntry type="substitute" key="wmo" value="PSBB04" />
</menuEntry>
<menuEntry type="productButton"
text="Day 2 Prob 4+&quot; Snow" id="day2Prob4InchesSnow">
<menuEntry type="substitute" key="wmo" value="PSBC04" />
</menuEntry>
<menuEntry type="productButton"
text="Day 3 Prob 4+&quot; Snow" id="day3Prob4InchesSnow">
<menuEntry type="substitute" key="wmo" value="PSBD04" />
</menuEntry>
</menuEntry>
<menuEntry type="submenu" text="Day 1-3 Prob 8+ Inches Snow">
<menuEntry type="productButton"
text="Day 1 Prob 8+&quot; Snow" id="day1Prob8InchesSnow">
<menuEntry type="substitute" key="wmo" value="PSBB08" />
</menuEntry>
<menuEntry type="productButton"
text="Day 2 Prob 8+&quot; Snow" id="day2Prob8InchesSnow">
<menuEntry type="substitute" key="wmo" value="PSBC08" />
</menuEntry>
<menuEntry type="productButton"
text="Day 3 Prob 8+&quot; Snow" id="day3Prob8InchesSnow">
<menuEntry type="substitute" key="wmo" value="PSBD08" />
</menuEntry>
</menuEntry>
<menuEntry type="submenu" text="Day 1-3 Prob 12+ Inches Snow">
<menuEntry type="productButton"
text="Day 1 Prob 12+&quot; Snow" id="day1Prob12InchesSnow">
<menuEntry type="substitute" key="wmo" value="PSBB12" />
</menuEntry>
<menuEntry type="productButton"
text="Day 2 Prob 12+&quot; Snow" id="day2Prob12InchesSnow">
<menuEntry type="substitute" key="wmo" value="PSBC12" />
</menuEntry>
<menuEntry type="productButton"
text="Day 3 Prob 12+&quot; Snow" id="day3Prob12InchesSnow">
<menuEntry type="substitute" key="wmo" value="PSBD12" />
</menuEntry>
</menuEntry>
<menuEntry type="submenu" text="Day 1-3 Prob .25 Inches Ice">
<menuEntry type="productButton"
text="Day 1 Prob .25+&quot; Ice" id="day1Prob025InchesIce">
<menuEntry type="substitute" key="wmo" value="PSBB25" />
</menuEntry>
<menuEntry type="productButton"
text="Day 2 Prob .25+&quot; Ice" id="day2Prob025InchesIce">
<menuEntry type="substitute" key="wmo" value="PSBC25" />
</menuEntry>
<menuEntry type="productButton"
text="Day 3 Prob .25+&quot; Ice" id="day3Prob025InchesIce">
<menuEntry type="substitute" key="wmo" value="PSBD25" />
</menuEntry>
</menuEntry>
<menuEntry type="separator" id="separator2" />
<menuEntry type="productButton"
text="1-5 Day Total Precip" id="oneToFiveDayTotalPrecip">
<menuEntry type="substitute" key="wmo" value="PEIO46" />
</menuEntry>
<menuEntry type="productButton"
text="6-10, 8-14 Day Precip Anom" id="sixToTen8to14DayPrecipAnom">
<menuEntry type="substitute" key="wmo" value="PEIY47, PETT00" />
</menuEntry>
<menuEntry type="productButton"
text="30 Day Precip Anom" id="thirtyDayPrecipAnom">
<menuEntry type="substitute" key="wmo" value="PEIV98" />
</menuEntry>
<menuEntry type="productButton"
text="90 Day Seasonal Precip Outlook" id="ninetyDaySeasonalPrecipOutlook">
<menuEntry type="substitute" key="wmo"
value="PEIW01,PEIW02,PEIW03,PEIW04,PEIW05,PEIW06,PEIW07,PEIW08,PEIW09,PEIW10,PEIW11,PEIW12,PEIW13" />
</menuEntry>
<menuEntry type="productButton"
text="0.5 Mo (15-105 day) 50% POE Precip Outlook" id="fiftyPercentPOEPrecipOutlook2">
<menuEntry type="substitute" key="wmo"
value="PENV01,PENV02,PENV03,PENV04,PENV05,PENV06,PENV07,PENV08,PENV09,PENV10,PENV11,PENV12,PENV13" />
</menuEntry>
<menuEntry type="separator" id="separator3" />
<menuEntry type="productButton"
file="bundles/ncepHydro/hpc/HPCqpfNDFD6hr.xml" text="1-3 Day HPC QPF (6-Hourly Grid)"
id="oneTo3HPCQPF">
</menuEntry>
<menuEntry type="productButton"
file="bundles/ncepHydro/hpc/HPCqpfNDFD48hr.xml" text="4-5 Day HPC QPF (Grid)"
id="fourTo5DayHPCQPF">
</menuEntry>
<menuEntry type="productButton"
file="bundles/ncepHydro/hpc/HPCqpfNDFD120hr.xml" text="1-5 Day HPC QPF Total (Grid)"
id="oneTo5HPCQPF">
</menuEntry>
</menuEntry>
<menuEntry type="submenu" text="Temps &amp;&amp; Weather"
id="ncepHydro.hpc.tempsAndWeather">
<menuEntry type="productButton"
text="1-5 Day Max Temp Anomaly" id="fiveDayMaxTempAnomaly">
<menuEntry type="substitute" key="wmo" value="PTIO52" />
</menuEntry>
<menuEntry type="productButton"
text="1-5 Day Min Temp Anomaly" id="fiveDayMinTempAnomaly">
<menuEntry type="substitute" key="wmo" value="PTIO53" />
</menuEntry>
<menuEntry type="productButton"
text="Day 3-7 Max/Min/PoP" id="day3To7MaxMinPoP">
<menuEntry type="substitute" key="wmo" value="PYWK43, PYWM44, PYWO45, PYWQ46, PYWS98" />
</menuEntry>
<menuEntry type="productButton"
text="Day 3 Heat Index Probabilities" id="day3HeatIndex">
<menuEntry type="substitute" key="wmo" value="PTNK98" />
</menuEntry>
<menuEntry type="productButton"
text="Day 4 Heat Index Probabilities" id="day4HeatIndex">
<menuEntry type="substitute" key="wmo" value="PTNM98" />
</menuEntry>
<menuEntry type="productButton"
text="Day 5 Heat Index Probabilities" id="day5HeatIndex">
<menuEntry type="substitute" key="wmo" value="PTNO98" />
</menuEntry>
<menuEntry type="productButton"
text="Day 6 Heat Index Probabilities" id="day6HeatIndex">
<menuEntry type="substitute" key="wmo" value="PTNQ98" />
</menuEntry>
<menuEntry type="productButton"
text="Day 7 Heat Index Probabilities" id="day7HeatIndex">
<menuEntry type="substitute" key="wmo" value="PTNS98" />
</menuEntry>
<menuEntry type="productButton"
text="6-10, 8-14 Day Temp Anomaly" id="TempAnomaly6to108to14">
<menuEntry type="substitute" key="wmo" value="PTTU98, PTIY51" />
</menuEntry>
<menuEntry type="productButton"
text="30 Day Temp Anomaly" id="thirtyDayTempAnomaly">
<menuEntry type="substitute" key="wmo" value="PTIV98" />
</menuEntry>
<menuEntry type="productButton"
text="90 Day Seasonal Temp Outlook" id="ninetyDaySeasonalTempOutlook">
<menuEntry type="substitute" key="wmo"
value="PTIW01,PTIW02,PTIW03,PTIW04,PTIW05,PTIW06,PTIW07,PTIW08,PTIW09,PTIW10,PTIW11,PTIW12,PTIW13" />
</menuEntry>
<menuEntry type="productButton"
text="0.5 Mo (15-105 day) 50% POE Temp Outlook" id="fiftyPercentPOEPrecipOutlook2">
<menuEntry type="substitute" key="wmo"
value="PTNV01,PTNV02,PTNV03,PTNV04,PTNV05,PTNV06,PTNV07,PTNV08,PTNV09,PTNV10,PTNV11,PTNV12,PTNV13" />
</menuEntry>
<menuEntry type="separator" id="separator4" />
<menuEntry type="productButton"
text="MSL Pressure Analysis" id="MSLPressureAnalysis">
<menuEntry type="substitute" key="wmo" value="PPAA89" />
</menuEntry>
<menuEntry type="productButton"
text="Surface Fronts Analysis" id="surfaceFrontsAnalysis">
<menuEntry type="substitute" key="wmo" value="PYAA98" />
</menuEntry>
<menuEntry type="productButton"
text="12-48 hr Fronts/Press" id="frontsPress12to48">
<menuEntry type="substitute" key="wmo" value="PPIC01, PPIE01, PPIG01, PPII01" />
</menuEntry>
<menuEntry type="productButton"
text="Day 3-7 Fronts/Press" id="day3to7FrontsPress">
<menuEntry type="substitute" key="wmo" value="PPHK01, PPHM01, PPHO01, PPTG98, PPTR98" />
</menuEntry>
<menuEntry type="productButton"
text="3-Day Sig Winter Low Tracks" id="threeDaySigWinterLowTracks">
<menuEntry type="substitute" key="wmo" value="PSAO72" />
</menuEntry>
</menuEntry>
</redbookMenu>

View file

@ -9,80 +9,80 @@ RedbookHazardMenus.xml as written here will generate the base version
of the SPC hazard menus.
-->
<redbookHazardMenu>
<subMenu name="SPC Convective Outlooks" id="ncepHydro.spc.convectiveOutlooks">
<button type="product" menuText="Day 1 Convective Outlook" id="day1ConvectiveOutlook">
<menuEntry type="submenu" text="SPC Convective Outlooks" id="ncepHydro.spc.convectiveOutlooks">
<menuEntry type="productButton" text="Day 1 Convective Outlook" id="day1ConvectiveOutlook">
<!-- Redbook Key: 5069 -->
<substitute key="wmo" value="PGWE46"/>
<substitute key="posOff" value="0"/>
</button>
<button type="product" menuText="Day 2 Convective Outlook" id="day2ConvectiveOutlook">
<menuEntry type="substitute" key="wmo" value="PGWE46"/>
<menuEntry type="substitute" key="posOff" value="0"/>
</menuEntry>
<menuEntry type="productButton" text="Day 2 Convective Outlook" id="day2ConvectiveOutlook">
<!-- Redbook Key: 5072 -->
<substitute key="wmo" value="PGWI47"/>
<substitute key="posOff" value="0"/>
</button>
<button type="product" menuText="Day 3 Convective Outlook" id="day3ConvectiveOutlook">
<menuEntry type="substitute" key="wmo" value="PGWI47"/>
<menuEntry type="substitute" key="posOff" value="0"/>
</menuEntry>
<menuEntry type="productButton" text="Day 3 Convective Outlook" id="day3ConvectiveOutlook">
<!-- Redbook Key: 5385 -->
<substitute key="wmo" value="PGWK48"/>
<substitute key="posOff" value="0"/>
</button>
<button type="product" menuText="Thunderstorm Prob" id="thunderstormProb">
<menuEntry type="substitute" key="wmo" value="PGWK48"/>
<menuEntry type="substitute" key="posOff" value="0"/>
</menuEntry>
<menuEntry type="productButton" text="Thunderstorm Prob" id="thunderstormProb">
<!-- Redbook Key: 5067 -->
<substitute key="wmo" value="PGWB44"/>
<substitute key="posOff" value="0"/>
</button>
<button type="product" menuText="Severe Thunderstorm Prob" id="severeThunderstormProb">
<menuEntry type="substitute" key="wmo" value="PGWB44"/>
<menuEntry type="substitute" key="posOff" value="0"/>
</menuEntry>
<menuEntry type="productButton" text="Severe Thunderstorm Prob" id="severeThunderstormProb">
<!-- Redbook Key: 5068 -->
<substitute key="wmo" value="PGWB45"/>
<substitute key="posOff" value="0"/>
</button>
<button type="product" menuText="Day 1 Hail outlook" id="day1Hailoutlook">
<menuEntry type="substitute" key="wmo" value="PGWB45"/>
<menuEntry type="substitute" key="posOff" value="0"/>
</menuEntry>
<menuEntry type="productButton" text="Day 1 Hail outlook" id="day1Hailoutlook">
<!-- Redbook Key: 5376 -->
<substitute key="wmo" value="PENE00"/>
<substitute key="posOff" value="0"/>
</button>
<button type="product" menuText="Day 1 Convective Wind Outlook" id="day1ConvectiveWindOutlook">
<menuEntry type="substitute" key="wmo" value="PENE00"/>
<menuEntry type="substitute" key="posOff" value="0"/>
</menuEntry>
<menuEntry type="productButton" text="Day 1 Convective Wind Outlook" id="day1ConvectiveWindOutlook">
<!-- Redbook Key: 5377 -->
<substitute key="wmo" value="PWNE00"/>
<substitute key="posOff" value="0"/>
</button>
<button type="product" menuText="Day 1 Tornado Outlook" id="day1TornadoOutlook">
<menuEntry type="substitute" key="wmo" value="PWNE00"/>
<menuEntry type="substitute" key="posOff" value="0"/>
</menuEntry>
<menuEntry type="productButton" text="Day 1 Tornado Outlook" id="day1TornadoOutlook">
<!-- Redbook Key: 5378 -->
<substitute key="wmo" value="PGNE00"/>
<substitute key="posOff" value="0"/>
</button>
<button type="product" menuText="Day 2 Combined Severe Outlook" id="day2CombinedSevereOutlook">
<menuEntry type="substitute" key="wmo" value="PGNE00"/>
<menuEntry type="substitute" key="posOff" value="0"/>
</menuEntry>
<menuEntry type="productButton" text="Day 2 Combined Severe Outlook" id="day2CombinedSevereOutlook">
<!-- Redbook Key: 5379 -->
<substitute key="wmo" value="PGNI00"/>
<substitute key="posOff" value="0"/>
</button>
<button type="product" menuText="Day 3 Combined Severe Outlook" id="day3CombinedSevereOutlook">
<menuEntry type="substitute" key="wmo" value="PGNI00"/>
<menuEntry type="substitute" key="posOff" value="0"/>
</menuEntry>
<menuEntry type="productButton" text="Day 3 Combined Severe Outlook" id="day3CombinedSevereOutlook">
<!-- Redbook Key: 5384 -->
<substitute key="wmo" value="PZNK00"/>
<substitute key="posOff" value="0"/>
</button>
<button type="product" menuText="Day 4-8 Composite Severe Outlook" id="day4to8CompositeSevereOutlook">
<menuEntry type="substitute" key="wmo" value="PZNK00"/>
<menuEntry type="substitute" key="posOff" value="0"/>
</menuEntry>
<menuEntry type="productButton" text="Day 4-8 Composite Severe Outlook" id="day4to8CompositeSevereOutlook">
<!-- Redbook Key: 5430 -->
<substitute key="wmo" value="PGNM98"/>
<substitute key="posOff" value="0"/>
</button>
<button type="product" menuText="Active Mesoscale Disc Summary" id="activeMesoscaleDiscSummary">
<menuEntry type="substitute" key="wmo" value="PGNM98"/>
<menuEntry type="substitute" key="posOff" value="0"/>
</menuEntry>
<menuEntry type="productButton" text="Active Mesoscale Disc Summary" id="activeMesoscaleDiscSummary">
<!-- Redbook Key: 5390 -->
<substitute key="wmo" value="PGNA00"/>
<substitute key="posOff" value="0"/>
</button>
</subMenu>
<subMenu name="Fire Weather" id="ncepHydro.spc.fireWeather">
<button type="product" menuText="Fire Wx Outlook - Day 1" id="fireWxOutlookDay1">
<menuEntry type="substitute" key="wmo" value="PGNA00"/>
<menuEntry type="substitute" key="posOff" value="0"/>
</menuEntry>
</menuEntry>
<menuEntry type="submenu" text="Fire Weather" id="ncepHydro.spc.fireWeather">
<menuEntry type="productButton" text="Fire Wx Outlook - Day 1" id="fireWxOutlookDay1">
<!-- Redbook Key: 5370 -->
<substitute key="wmo" value="PMWE98"/>
</button>
<button type="product" menuText="Fire Wx Outlook - Day 2" id="fireWxOutlookDay2">
<menuEntry type="substitute" key="wmo" value="PMWE98"/>
</menuEntry>
<menuEntry type="productButton" text="Fire Wx Outlook - Day 2" id="fireWxOutlookDay2">
<!-- Redbook Key: 5371 -->
<substitute key="wmo" value="PMWI98"/>
</button>
<button type="product" A1Id="5431" menuText="Fire Wx Outlook - Day 3-8" id="fireWxOutlookDay3to82">
<menuEntry type="substitute" key="wmo" value="PMWI98"/>
</menuEntry>
<menuEntry type="productButton" text="Fire Wx Outlook - Day 3-8" id="fireWxOutlookDay3to82">
<!-- Redbook Key: 5431 -->
<substitute key="wmo" value="PGNO98"/>
</button>
</subMenu>
<menuEntry type="substitute" key="wmo" value="PGNO98"/>
</menuEntry>
</menuEntry>
</redbookHazardMenu>

View file

@ -20,6 +20,11 @@
<constructor-arg ref="spcMenuListener" />
</bean>
<bean factory-bean="ndmProc" factory-method="registerListener">
<constructor-arg value="RedbookHPCMenus.xml" />
<constructor-arg ref="spcMenuListener" />
</bean>
<!--
<bean id="redbookCamelRegistered" factory-bean="contextManager"
factory-method="register" depends-on="persistCamelRegistered">

View file

@ -1,187 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.edex.plugin.redbook.ingest;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import com.raytheon.edex.plugin.redbook.ingest.xml.ButtonXML;
import com.raytheon.edex.plugin.redbook.ingest.xml.RedbookHazardMenusXML;
import com.raytheon.edex.plugin.redbook.ingest.xml.SubmenuXML;
import com.raytheon.edex.plugin.redbook.ingest.xml.SubstituteXML;
import com.raytheon.uf.common.menus.xml.CommonBundleMenuContribution;
import com.raytheon.uf.common.menus.xml.CommonSubmenuContribution;
import com.raytheon.uf.common.menus.xml.MenuTemplateFile;
import com.raytheon.uf.common.menus.xml.VariableSubstitution;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.edex.menus.AbstractMenuUtil;
/**
* Builds the NCEP/Hydro SPC menu contributions for NDM (Redbook hazards).
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 7, 2014 2858 mpduff Initial creation
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public class RedbookHazardsMenuUtil extends AbstractMenuUtil {
/** Status handler */
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(RedbookHazardsMenuUtil.class);
/** Menu type constant */
private static final String MENU_TYPE = "spc";
/** SPC hazard menu file */
private static final String HAZARD_MENU = "hazardMenus.xml";
/** Redbook bundle file */
private static final String BUNDLE_FILE = "bundles/Redbook.xml";
/** Redbook SPC hazard menu xml object */
private RedbookHazardMenusXML xml;
/** Jaxb unmarshaller */
private Unmarshaller unmarshaller;
/**
* Constructor.
*/
public RedbookHazardsMenuUtil() {
createContext();
}
/**
* {@inheritDoc}
*/
@Override
public void createMenus(String filename) {
xml = read(filename);
createMenus();
}
/**
* Create the JAXB context
*/
private void createContext() {
Class[] classes = new Class[] { SubmenuXML.class, SubstituteXML.class,
ButtonXML.class, RedbookHazardMenusXML.class };
try {
JAXBContext jax = JAXBContext.newInstance(classes);
this.unmarshaller = jax.createUnmarshaller();
} catch (JAXBException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
}
}
/**
* Read the xml file.
*
* @param filename
* fully qualified file name to read.
*
* @return The xml object
*/
private RedbookHazardMenusXML read(String filename) {
RedbookHazardMenusXML xml = null;
File f = new File(filename);
try {
xml = (RedbookHazardMenusXML) unmarshaller.unmarshal(f);
} catch (JAXBException e) {
statusHandler.handle(Priority.PROBLEM, "Error unmarshalling "
+ filename, e);
}
return xml;
}
/**
* {@inheritDoc}
*/
@Override
public void createMenus() {
MenuTemplateFile menuTemplate = new MenuTemplateFile();
List<CommonSubmenuContribution> submenuList = new ArrayList<CommonSubmenuContribution>();
for (SubmenuXML submenu : xml.getSubMenus()) {
CommonSubmenuContribution subMenuContribution = new CommonSubmenuContribution();
List<CommonBundleMenuContribution> commonBundleMenuContributions = new ArrayList<CommonBundleMenuContribution>();
subMenuContribution.menuText = submenu.getName();
subMenuContribution.id = submenu.getId();
List<ButtonXML> buttonList = submenu.getButtonList();
for (ButtonXML button : buttonList) {
CommonBundleMenuContribution commonBundleMenuContribution = new CommonBundleMenuContribution();
commonBundleMenuContribution.bundleFile = BUNDLE_FILE;
commonBundleMenuContribution.id = button.getId();
commonBundleMenuContribution.text = button.getMenuText();
List<VariableSubstitution> subList = new ArrayList<VariableSubstitution>();
for (int i = 0; i < button.getSubstitutionList().size(); i++) {
SubstituteXML sub = button.getSubstitutionList().get(i);
VariableSubstitution var = new VariableSubstitution();
var.key = sub.getKey();
var.value = sub.getValue();
subList.add(var);
}
commonBundleMenuContribution.substitutions = subList
.toArray(new VariableSubstitution[subList.size()]);
commonBundleMenuContributions.add(commonBundleMenuContribution);
}
subMenuContribution.contributions = commonBundleMenuContributions
.toArray(new CommonBundleMenuContribution[commonBundleMenuContributions
.size()]);
submenuList.add(subMenuContribution);
}
menuTemplate.contributions = submenuList
.toArray(new CommonSubmenuContribution[submenuList.size()]);
toXml(menuTemplate, "menus" + File.separator + MENU_TYPE
+ File.separator + HAZARD_MENU);
}
/**
* {@inheritDoc}
*/
@Override
protected boolean checkCreated() {
return super.checkCreated(HAZARD_MENU, MENU_TYPE);
}
}

View file

@ -21,6 +21,8 @@ package com.raytheon.edex.plugin.redbook.ingest;
import java.io.File;
import com.raytheon.edex.plugin.redbook.menu.RedbookHazardsMenuUtil;
import com.raytheon.edex.plugin.redbook.menu.RedbookHpcMenuUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.edex.ndm.ingest.INationalDatasetSubscriber;
@ -36,6 +38,7 @@ import com.raytheon.uf.edex.ndm.ingest.INationalDatasetSubscriber;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 10, 2014 2858 mpduff Initial creation.
* Mar 17, 2014 2855 mpduff Implement HPC.
*
* </pre>
*
@ -51,6 +54,9 @@ public class RedbookMenuSubscriber implements INationalDatasetSubscriber {
/** Hazard menu file */
private static final String HAZARD_MENU_FILE = "RedbookHazardMenus.xml";
/** HPC menu file */
private static final String HPC_MENU_FILE = "RedbookHPCMenus.xml";
/**
* {@inheritDoc}
*/
@ -60,7 +66,10 @@ public class RedbookMenuSubscriber implements INationalDatasetSubscriber {
if (HAZARD_MENU_FILE.equals(fileName)) {
// Convert input file to output menu format
RedbookHazardsMenuUtil menuUtil = new RedbookHazardsMenuUtil();
menuUtil.createMenus(file.getAbsolutePath());
menuUtil.createMenusFromFile(file.getAbsolutePath());
} else if (HPC_MENU_FILE.equals(fileName)) {
RedbookHpcMenuUtil menuUtil = new RedbookHpcMenuUtil();
menuUtil.createMenusFromFile(file.getAbsolutePath());
}
}
}

View file

@ -1,181 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.edex.plugin.redbook.ingest.xml;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
/**
* Button type xml object.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 07, 2014 2858 mpduff Initial creation
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
public class ButtonXML {
/**
* Button type
*/
@XmlAttribute(name = "type")
protected String type;
/**
* Awips 1 id
*/
@XmlAttribute(name = "A1Id")
protected String a1Id;
/**
* The menu text
*/
@XmlAttribute(name = "menuText")
protected String menuText;
/**
* A unique id for the menu
*/
@XmlAttribute(name = "id")
protected String id;
/**
* List of substitution items
*/
@XmlElements({ @XmlElement(name = "substitute", type = SubstituteXML.class) })
protected List<SubstituteXML> substitutionList = new ArrayList<SubstituteXML>();
/**
* Default constructor
*/
public ButtonXML() {
}
/**
* @return the type
*/
public String getType() {
return type;
}
/**
* @param type
* the type to set
*/
public void setType(String type) {
this.type = type;
}
/**
* @return the a1Id
*/
public String getA1Id() {
return a1Id;
}
/**
* @param a1Id
* the a1Id to set
*/
public void setA1Id(String a1Id) {
this.a1Id = a1Id;
}
/**
* @return the menuText
*/
public String getMenuText() {
return menuText;
}
/**
* @param menuText
* the menuText to set
*/
public void setMenuText(String menuText) {
this.menuText = menuText;
}
/**
* @return the id
*/
public String getId() {
return id;
}
/**
* @param id
* the id to set
*/
public void setId(String id) {
this.id = id;
}
/**
* @return the substitutionList
*/
public List<SubstituteXML> getSubstitutionList() {
return substitutionList;
}
/**
* @param substitutionList
* the substitutionList to set
*/
public void setSubstitutionList(List<SubstituteXML> substitutionList) {
this.substitutionList = substitutionList;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
final String nl = System.getProperty("line.separator");
StringBuilder sb = new StringBuilder();
sb.append(" A1Id: ").append(this.getA1Id()).append(nl);
sb.append(" ID: ").append(this.getId()).append(nl);
sb.append(" Text: ").append(this.getMenuText()).append(nl);
sb.append(" Type: ").append(this.getType()).append(nl);
for (SubstituteXML xml : substitutionList) {
sb.append(xml.toString());
}
return sb.toString();
}
}

View file

@ -0,0 +1,243 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.edex.plugin.redbook.ingest.xml;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
/**
* MenuEntry JaxB object for the Redbook user created NDM XML files.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 12, 2014 2855 mpduff Initial creation
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
public class MenuEntry {
/**
* Entry type.
*/
@XmlAttribute(name = "type")
protected MenuEntryType type;
/**
* Text value.
*/
@XmlAttribute(name = "text")
protected String text;
/**
* Unique id.
*/
@XmlAttribute(name = "id")
protected String id;
/**
* Key if entry is of type substitute.
*/
@XmlAttribute(name = "key")
protected String key;
/**
* Value if entry is of type substitute.
*/
@XmlAttribute(name = "value")
protected String value;
/**
* Bundle file if type is productButton
*/
@XmlAttribute(name = "file")
protected String file = "bundles/Redbook.xml";
/**
* List of MenuEntry items
*/
@XmlElements({ @XmlElement(name = "menuEntry", type = MenuEntry.class) })
protected List<MenuEntry> menuEntryList = new ArrayList<MenuEntry>();
/**
* Default constructor.
*/
public MenuEntry() {
}
public MenuEntry(MenuEntryType type) {
this.type = type;
}
/**
* @return the type
*/
public MenuEntryType getType() {
return type;
}
/**
* @param type
* the type to set
*/
public void setType(MenuEntryType type) {
this.type = type;
}
/**
* @return the text
*/
public String getText() {
return text;
}
/**
* @param text
* the text to set
*/
public void setText(String text) {
this.text = text;
}
/**
* @return the id
*/
public String getId() {
return id;
}
/**
* @param id
* the id to set
*/
public void setId(String id) {
this.id = id;
}
/**
* @return the key
*/
public String getKey() {
return key;
}
/**
* @param key
* the key to set
*/
public void setKey(String key) {
this.key = key;
}
/**
* @return the value
*/
public String getValue() {
return value;
}
/**
* @param value
* the value to set
*/
public void setValue(String value) {
this.value = value;
}
/**
* @return the file
*/
public String getFile() {
return file;
}
/**
* @param file
* the file to set
*/
public void setFile(String file) {
this.file = file;
}
/**
* @return the menuEntryList
*/
public List<MenuEntry> getMenuEntryList() {
return menuEntryList;
}
/**
* @param menuEntryList
* the menuEntryList to set
*/
public void setMenuEntryyList(List<MenuEntry> menuEntryList) {
this.menuEntryList = menuEntryList;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
final String nl = System.getProperty("line.separator");
StringBuilder sb = new StringBuilder("Menu Entry: ");
if (type != null) {
sb.append("Type: ").append(this.type).append(nl);
} else {
sb.append(nl);
}
if (text != null) {
sb.append(" Text: ").append(this.text).append(nl);
}
if (id != null) {
sb.append(" ID: ").append(this.id).append(nl);
}
if (key != null) {
sb.append(" Key: ").append(this.key).append(nl);
}
if (value != null) {
sb.append(" Value: ").append(this.value).append(nl);
}
sb.append(" File: ").append(this.file).append(nl);
for (MenuEntry sub : menuEntryList) {
sb.append(sub.toString());
}
return sb.toString();
}
}

View file

@ -0,0 +1,85 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.edex.plugin.redbook.ingest.xml;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* NDM Menu Entry Types.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 12, 2014 2855 mpduff Initial creation
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
@XmlType(name = "type")
@XmlEnum
public enum MenuEntryType {
/** Menu Item type */
@XmlEnumValue("productButton")
ProductButton("productButton"),
/** Menu Separator type */
@XmlEnumValue("separator")
Separator("separator"),
/** Submenu type */
@XmlEnumValue("submenu")
Submenu("submenu"),
/** Substitute xml element type */
@XmlEnumValue("substitute")
Substitute("substitute"),
/** Menu Title type */
@XmlEnumValue("title")
Title("title");
/** Menu entry type */
private String entryType;
/**
* Private constructor.
*
* @param entryType
*/
private MenuEntryType(String entryType) {
this.entryType = entryType;
}
/**
* Get the type.
*
* @return The type
*/
public String getType() {
return entryType;
}
}

View file

@ -37,7 +37,8 @@ import javax.xml.bind.annotation.XmlRootElement;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 07, 2014 2858 mpduff Initial creation
* Mar 07, 2014 2858 mpduff Initial creation.
* Mar 17, 2014 2855 mpduff Renamed to RedbookMenusXML.java.
*
* </pre>
*
@ -45,36 +46,36 @@ import javax.xml.bind.annotation.XmlRootElement;
* @version 1.0
*/
@XmlRootElement(name = "redbookHazardMenu")
@XmlRootElement(name = "redbookMenu")
@XmlAccessorType(XmlAccessType.NONE)
public class RedbookHazardMenusXML {
public class RedbookMenusXML {
/**
* Submenus
* List of MenuEntry items
*/
@XmlElements({ @XmlElement(name = "subMenu", type = SubmenuXML.class) })
protected List<SubmenuXML> subMenus = new ArrayList<SubmenuXML>();
@XmlElements({ @XmlElement(name = "menuEntry", type = MenuEntry.class) })
protected List<MenuEntry> menuEntryList = new ArrayList<MenuEntry>();
/**
* Default constructor
*/
public RedbookHazardMenusXML() {
public RedbookMenusXML() {
}
/**
* @return the subMenus
* @return the menuEntryList
*/
public List<SubmenuXML> getSubMenus() {
return subMenus;
public List<MenuEntry> getMenuEntryList() {
return menuEntryList;
}
/**
* @param subMenus
* the subMenus to set
* @param menuEntryList
* the menuEntryList to set
*/
public void setSubMenus(List<SubmenuXML> subMenus) {
this.subMenus = subMenus;
public void setMenuEntryList(List<MenuEntry> menuEntryList) {
this.menuEntryList = menuEntryList;
}
/*
@ -84,8 +85,9 @@ public class RedbookHazardMenusXML {
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
for (SubmenuXML sub : subMenus) {
final String nl = System.getProperty("line.separator");
StringBuilder sb = new StringBuilder("RedbookMenusXML").append(nl);
for (MenuEntry sub : menuEntryList) {
sb.append(sub.toString());
}
return sb.toString();

View file

@ -1,128 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.edex.plugin.redbook.ingest.xml;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
/**
* Redbook hazard submenu object.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 07, 2014 2858 mpduff Initial creation
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
public class SubmenuXML {
/**
* Submenu text
*/
@XmlAttribute(name = "name")
protected String name;
/**
* Submenu unique id
*/
@XmlAttribute(name = "id")
protected String id;
/**
* List of menu items (buttons) for the submenu
*/
@XmlElements({ @XmlElement(name = "button", type = ButtonXML.class) })
protected List<ButtonXML> buttonList = new ArrayList<ButtonXML>();
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name
* the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the buttonList
*/
public List<ButtonXML> getButtonList() {
return buttonList;
}
/**
* @param buttonList
* the buttonList to set
*/
public void setButtonList(List<ButtonXML> buttonList) {
this.buttonList = buttonList;
}
/**
* @return the id
*/
public String getId() {
return id;
}
/**
* @param id
* the id to set
*/
public void setId(String id) {
this.id = id;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
final String nl = System.getProperty("line.separator");
StringBuilder sb = new StringBuilder();
sb.append("Submenu Name: ").append(this.name).append(nl);
for (ButtonXML xml : this.buttonList) {
sb.append(xml.toString());
}
return sb.toString();
}
}

View file

@ -1,97 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.edex.plugin.redbook.ingest.xml;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
/**
* Redbook hazard substitute object.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 07, 2014 2858 mpduff Initial creation
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
public class SubstituteXML {
/** Substitute key */
@XmlAttribute(name = "key")
protected String key;
/** Substitute value */
@XmlAttribute(name = "value")
protected String value;
/**
* @return the key
*/
public String getKey() {
return key;
}
/**
* @param key
* the key to set
*/
public void setKey(String key) {
this.key = key;
}
/**
* @return the value
*/
public String getValue() {
return value;
}
/**
* @param value
* the value to set
*/
public void setValue(String value) {
this.value = value;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
final String nl = System.getProperty("line.separator");
StringBuilder sb = new StringBuilder();
sb.append(" Key: ").append(this.key).append(nl);
sb.append(" Value: ").append(this.value).append(nl);
return sb.toString();
}
}

View file

@ -0,0 +1,94 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.edex.plugin.redbook.menu;
import java.io.File;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
/**
* Builds the NCEP/Hydro SPC menu contributions for NDM (Redbook hazards).
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 07, 2014 2858 mpduff Initial creation
* Mar 14, 2014 2855 mpduff Renamed and refactored common code.
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public class RedbookHazardsMenuUtil extends RedbookMenuUtil {
/** Status handler */
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(RedbookHpcMenuUtil.class);
/** Menu type constant */
private static final String MENU_TYPE = "ncepHydro" + File.separator
+ "spc";
/** SPC hazard menu file */
private static final String HAZARD_MENU = "hazardMenus.xml";
/** SPC hazard menu file including full path */
private static final String MENU_FILE = "menus" + File.separator
+ MENU_TYPE + File.separator + HAZARD_MENU;
/**
* Constructor.
*/
public RedbookHazardsMenuUtil() {
super();
}
/**
* {@inheritDoc}
*/
@Override
public void createMenusFromFile(String filename) {
xml = read(filename);
createMenus();
}
/**
* {@inheritDoc}
*/
@Override
public void createMenus() {
statusHandler.info("Creating menus for " + MENU_FILE);
createMenusForFile(MENU_FILE);
}
/**
* {@inheritDoc}
*/
@Override
protected boolean checkCreated() {
return super.checkCreated(HAZARD_MENU, MENU_TYPE);
}
}

View file

@ -0,0 +1,93 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.edex.plugin.redbook.menu;
import java.io.File;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
/**
* Builds the NCEP/Hydro HPC menu contributions for NDM (Redbook HPC).
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 12, 2014 2855 mpduff Initial creation.
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public class RedbookHpcMenuUtil extends RedbookMenuUtil {
/** Status handler */
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(RedbookHpcMenuUtil.class);
/** Menu type constant */
private static final String MENU_TYPE = "ncepHydro" + File.separator
+ "hpc";
/** HPC menu file */
private static final String HPC_MENU = "hpcMenus.xml";
/** HPC menu file full path */
private static final String MENU_FILE = "menus" + File.separator
+ MENU_TYPE + File.separator + HPC_MENU;
/**
* Constructor.
*/
public RedbookHpcMenuUtil() {
super();
}
/**
* {@inheritDoc}
*/
@Override
public void createMenusFromFile(String filename) {
xml = read(filename);
createMenus();
}
/**
* {@inheritDoc}
*/
@Override
public void createMenus() {
statusHandler.info("Creating menus for " + MENU_FILE);
createMenusForFile(MENU_FILE);
}
/**
* {@inheritDoc}
*/
@Override
protected boolean checkCreated() {
return super.checkCreated(HPC_MENU, MENU_TYPE);
}
}

View file

@ -0,0 +1,210 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.edex.plugin.redbook.menu;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import com.raytheon.edex.plugin.redbook.ingest.xml.MenuEntry;
import com.raytheon.edex.plugin.redbook.ingest.xml.MenuEntryType;
import com.raytheon.edex.plugin.redbook.ingest.xml.RedbookMenusXML;
import com.raytheon.uf.common.menus.xml.CommonAbstractMenuContribution;
import com.raytheon.uf.common.menus.xml.CommonBundleMenuContribution;
import com.raytheon.uf.common.menus.xml.CommonSeparatorMenuContribution;
import com.raytheon.uf.common.menus.xml.CommonSubmenuContribution;
import com.raytheon.uf.common.menus.xml.CommonTitleContribution;
import com.raytheon.uf.common.menus.xml.MenuTemplateFile;
import com.raytheon.uf.common.menus.xml.VariableSubstitution;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.edex.menus.AbstractMenuUtil;
/**
* Parent class for NCEP/Hydro Redbook menu contributions for NDM.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 07, 2014 2858 mpduff Initial creation
* Mar 14, 2014 2855 mpduff Refactored common code.
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public abstract class RedbookMenuUtil extends AbstractMenuUtil {
/** Status handler */
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(RedbookMenuUtil.class);
/** Jaxb unmarshaller */
protected Unmarshaller unmarshaller;
/** Redbook menu xml object */
protected RedbookMenusXML xml;
/**
* Constructor.
*/
public RedbookMenuUtil() {
createContext();
}
/**
* Method called from the RedbookMenuSubscriber when new NDM files are
* placed in /awips2/edex/data/ndm
*
* @param filename
* The file droped into /awips2/edex/data/ndm
*/
public abstract void createMenusFromFile(String filename);
/**
* Create the JaxB context.
*/
protected void createContext() {
try {
Class[] classes = new Class[] { RedbookMenusXML.class };
JAXBContext jax = JAXBContext.newInstance(classes);
this.unmarshaller = jax.createUnmarshaller();
} catch (JAXBException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
}
}
/**
* Read the xml file.
*
* @param filename
* fully qualified file name to read.
*
* @return The xml object
*/
protected RedbookMenusXML read(String filename) {
File f = new File(filename);
try {
xml = (RedbookMenusXML) unmarshaller.unmarshal(f);
} catch (JAXBException e) {
statusHandler.handle(Priority.PROBLEM, "Error unmarshalling "
+ filename, e);
}
return xml;
}
/**
* Recursively called to process the nested MenuEntity items.
*
* @param menuEntry
* The menu entry to process
*
* @return The generated menu contribution item
*/
protected CommonAbstractMenuContribution processEntry(MenuEntry menuEntry) {
if (menuEntry.getType() == MenuEntryType.Title) {
CommonTitleContribution title = new CommonTitleContribution();
title.titleText = menuEntry.getText();
title.id = menuEntry.getId();
return title;
} else if (menuEntry.getType() == MenuEntryType.Separator) {
CommonSeparatorMenuContribution separator = new CommonSeparatorMenuContribution();
separator.id = menuEntry.getId();
return separator;
} else if (menuEntry.getType() == MenuEntryType.Submenu) {
List<CommonAbstractMenuContribution> menuContributionList = new ArrayList<CommonAbstractMenuContribution>();
CommonSubmenuContribution subMenuContribution = new CommonSubmenuContribution();
subMenuContribution.menuText = menuEntry.getText();
subMenuContribution.id = menuEntry.getId();
for (MenuEntry menu : menuEntry.getMenuEntryList()) {
CommonAbstractMenuContribution menuC = processEntry(menu);
menuContributionList.add(menuC);
}
subMenuContribution.contributions = menuContributionList
.toArray(new CommonAbstractMenuContribution[menuContributionList
.size()]);
return subMenuContribution;
} else if (menuEntry.getType() == MenuEntryType.ProductButton) {
CommonBundleMenuContribution commonBundleMenuContribution = new CommonBundleMenuContribution();
commonBundleMenuContribution.bundleFile = menuEntry.getFile();
commonBundleMenuContribution.id = menuEntry.getId();
commonBundleMenuContribution.text = menuEntry.getText();
if (menuEntry.getMenuEntryList().size() > 0) {
List<VariableSubstitution> subList = new ArrayList<VariableSubstitution>();
for (MenuEntry substitute : menuEntry.getMenuEntryList()) {
VariableSubstitution var = new VariableSubstitution();
var.key = substitute.getKey();
var.value = substitute.getValue();
statusHandler.info("Substitution: " + var.key + " <> "
+ var.value);
subList.add(var);
}
commonBundleMenuContribution.substitutions = subList
.toArray(new VariableSubstitution[subList.size()]);
}
return commonBundleMenuContribution;
} else {
throw new IllegalArgumentException("Unknown menu type: "
+ menuEntry.getType());
}
}
/**
* Create menus for the provided file.
*
* @param file
* The file defining the menu
*/
protected void createMenusForFile(String file) {
MenuTemplateFile menuTemplate = new MenuTemplateFile();
List<CommonAbstractMenuContribution> menuContributionList = new ArrayList<CommonAbstractMenuContribution>();
for (MenuEntry entry : xml.getMenuEntryList()) {
CommonAbstractMenuContribution menuC = processEntry(entry);
menuContributionList.add(menuC);
}
menuTemplate.contributions = menuContributionList
.toArray(new CommonAbstractMenuContribution[menuContributionList
.size()]);
toXml(menuTemplate, file);
}
}