Omaha #4897 - reverse fog, safeseas, and snow menu dependencies so that CAVE without the dat and hydro features
can be started without errors. Former-commit-id: acca15e79c59c40c29310d622497c48ee7982844
This commit is contained in:
parent
88ebf298c7
commit
4f930926be
7 changed files with 98 additions and 56 deletions
38
deltaScripts/16.2.1/DR4897/removeDatIndex.sh
Normal file
38
deltaScripts/16.2.1/DR4897/removeDatIndex.sh
Normal file
|
@ -0,0 +1,38 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This delta script is for DR 4897. This delta script has been created
|
||||
# to remove all generated fog, safeseas, and snow index.xml files. The
|
||||
# base versions of the files are now overriden by EDEX.
|
||||
|
||||
_localization_directory=/awips2/edex/data/utility/cave_static/configured
|
||||
for site_dir in `ls -1 ${_localization_directory}`; do
|
||||
site_loc_dir=${_localization_directory}/${site_dir}
|
||||
|
||||
if [ -f ${site_loc_dir}/menus/fog/index.xml ];then
|
||||
echo "Removing: ${site_loc_dir}/menus/fog/index.xml ..."
|
||||
rm -f ${site_loc_dir}/menus/fog/index.xml
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Update Failed!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if [ -f ${site_loc_dir}/menus/safeseas/index.xml ];then
|
||||
echo "Removing: ${site_loc_dir}/menus/safeseas/index.xml ..."
|
||||
rm -f ${site_loc_dir}/menus/safeseas/index.xml
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Update Failed!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if [ -f ${site_loc_dir}/menus/snow/index.xml ];then
|
||||
echo "Removing: ${site_loc_dir}/menus/snow/index.xml ..."
|
||||
rm -f ${site_loc_dir}/menus/snow/index.xml
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Update Failed!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Update Completed Successfully."
|
||||
exit 0
|
|
@ -2,4 +2,5 @@ source.. = src/
|
|||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
res/
|
||||
res/,\
|
||||
utility/
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
package com.raytheon.uf.edex.dat.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
@ -31,9 +33,8 @@ import com.raytheon.uf.common.localization.LocalizationFile;
|
|||
import com.raytheon.uf.common.localization.PathManager;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.menus.xml.CommonAbstractMenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonBundleMenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonIncludeMenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonIncludeMenuItem;
|
||||
import com.raytheon.uf.common.menus.xml.CommonMenuContributionFile;
|
||||
import com.raytheon.uf.common.menus.xml.CommonSeparatorMenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonSubmenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonTitleContribution;
|
||||
|
@ -68,6 +69,7 @@ import com.raytheon.uf.edex.menus.AbstractMenuUtil;
|
|||
* FFMPRunConfig.xml file.
|
||||
* Sep 04, 2014 3220 skorolev Updated menu creation for Fog, Safeseas and Snow monitors.
|
||||
* Sep 18, 2015 3873 skorolev Corrected Fog, Safeseas and Snow monitor's names.
|
||||
* Oct 15, 2015 4897 bkowal Update the base fog, snow, and safeseas menu xml.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -83,6 +85,23 @@ public class DatMenuUtil extends AbstractMenuUtil {
|
|||
|
||||
private String datSite = null;
|
||||
|
||||
protected LocalizationContext commonStaticBase = pm.getContext(
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.BASE);
|
||||
|
||||
private static final String MENUS_PATH = "menus";
|
||||
|
||||
private static final String FOG_PATH = "fog";
|
||||
|
||||
private static final String SAFESEAS_PATH = "safeseas";
|
||||
|
||||
private static final String SNOW_PATH = "snow";
|
||||
|
||||
private static final String BASE_FOG_XML = "baseFog.xml";
|
||||
|
||||
private static final String BASE_SAFESEAS_XML = "baseSafeSeas.xml";
|
||||
|
||||
private static final String BASE_SNOW_XML = "baseSnow.xml";
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -494,18 +513,34 @@ public class DatMenuUtil extends AbstractMenuUtil {
|
|||
stations.append(s);
|
||||
}
|
||||
String ssStations = stations.toString();
|
||||
CommonMenuContributionFile safeMenuContributionFile = new CommonMenuContributionFile();
|
||||
safeMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
|
||||
safeMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
|
||||
safeMenuContributionFile.contribution[0] = processOtherContribution(
|
||||
ssStations, "menus/safeseas/baseSafeSeas.xml",
|
||||
"menu:obs?before=EndOfMaritime", "SAFESEAS",
|
||||
safeMenuContributionFile.contribution[0]);
|
||||
toXml(safeMenuContributionFile, "menus" + File.separator + "safeseas"
|
||||
+ File.separator + "index.xml");
|
||||
Path safeseasPath = Paths.get(MENUS_PATH, SAFESEAS_PATH,
|
||||
BASE_SAFESEAS_XML);
|
||||
MenuTemplateFile menuTemplate = (MenuTemplateFile) this.fromXml(
|
||||
safeseasPath.toString(), this.commonStaticBase);
|
||||
this.updateStations(menuTemplate, "SAFESEASMONITOR", ssStations);
|
||||
this.toXml(menuTemplate, safeseasPath.toString());
|
||||
ssConfig = null;
|
||||
}
|
||||
|
||||
private void updateStations(MenuTemplateFile menuTemplate,
|
||||
final String bundleId, final String stationString) {
|
||||
for (CommonAbstractMenuContribution contribution : menuTemplate.contributions) {
|
||||
if (contribution instanceof CommonBundleMenuContribution
|
||||
&& ((CommonBundleMenuContribution) contribution).id
|
||||
.equals(bundleId)) {
|
||||
CommonBundleMenuContribution bundleContribution = (CommonBundleMenuContribution) contribution;
|
||||
if (bundleId.equals(bundleContribution.id)) {
|
||||
for (VariableSubstitution substitution : bundleContribution.substitutions) {
|
||||
if ("stations".equals(substitution.key)) {
|
||||
substitution.value = stationString;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates Fog Menu.
|
||||
*/
|
||||
|
@ -521,15 +556,11 @@ public class DatMenuUtil extends AbstractMenuUtil {
|
|||
stations.append(s);
|
||||
}
|
||||
String fogStations = stations.toString();
|
||||
CommonMenuContributionFile fogMenuContributionFile = new CommonMenuContributionFile();
|
||||
fogMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
|
||||
fogMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
|
||||
fogMenuContributionFile.contribution[0] = processOtherContribution(
|
||||
fogStations, "menus/fog/baseFog.xml",
|
||||
"menu:obs?after=FOGPLACEHOLDER", "Fog Monitor",
|
||||
fogMenuContributionFile.contribution[0]);
|
||||
toXml(fogMenuContributionFile, "menus" + File.separator + "fog"
|
||||
+ File.separator + "index.xml");
|
||||
Path fogPath = Paths.get(MENUS_PATH, FOG_PATH, BASE_FOG_XML);
|
||||
MenuTemplateFile menuTemplate = (MenuTemplateFile) this.fromXml(
|
||||
fogPath.toString(), this.commonStaticBase);
|
||||
this.updateStations(menuTemplate, "FOGMONITOR", fogStations);
|
||||
this.toXml(menuTemplate, fogPath.toString());
|
||||
fogConfig = null;
|
||||
}
|
||||
|
||||
|
@ -548,43 +579,14 @@ public class DatMenuUtil extends AbstractMenuUtil {
|
|||
stations.append(s);
|
||||
}
|
||||
String snowStations = stations.toString();
|
||||
CommonMenuContributionFile snowMenuContributionFile = new CommonMenuContributionFile();
|
||||
snowMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
|
||||
snowMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
|
||||
snowMenuContributionFile.contribution[0] = processOtherContribution(
|
||||
snowStations, "menus/snow/baseSnow.xml",
|
||||
"menu:obs?after=SNOWPLACEHOLDER", "SNOW",
|
||||
snowMenuContributionFile.contribution[0]);
|
||||
toXml(snowMenuContributionFile, "menus" + File.separator + "snow"
|
||||
+ File.separator + "index.xml");
|
||||
Path snowPath = Paths.get(MENUS_PATH, SNOW_PATH, BASE_SNOW_XML);
|
||||
MenuTemplateFile menuTemplate = (MenuTemplateFile) this.fromXml(
|
||||
snowPath.toString(), this.commonStaticBase);
|
||||
this.updateStations(menuTemplate, "SNOWMONITOR", snowStations);
|
||||
this.toXml(menuTemplate, snowPath.toString());
|
||||
snowConfig = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process Other(Fog, Safaseas and Snow) Contribution.
|
||||
*
|
||||
* @param stations
|
||||
* @param filePath
|
||||
* @param installLoc
|
||||
* @param subMenuName
|
||||
* @param commonIncludeMenu
|
||||
* @return
|
||||
*/
|
||||
private CommonIncludeMenuItem processOtherContribution(String stations,
|
||||
String filePath, String installLoc, String subMenuName,
|
||||
CommonIncludeMenuItem commonIncludeMenu) {
|
||||
|
||||
commonIncludeMenu.substitutions = new VariableSubstitution[1];
|
||||
commonIncludeMenu.substitutions[0] = new VariableSubstitution();
|
||||
commonIncludeMenu.substitutions[0].key = "stations";
|
||||
commonIncludeMenu.substitutions[0].value = stations;
|
||||
commonIncludeMenu.fileName = new File(filePath);
|
||||
commonIncludeMenu.installationLocation = installLoc;
|
||||
commonIncludeMenu.subMenuName = subMenuName;
|
||||
|
||||
return commonIncludeMenu;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
|
|
@ -50,6 +50,7 @@ import com.raytheon.uf.common.status.UFStatus;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 08, 2012 mschenke Initial javadoc creation
|
||||
* Mar 11, 2014 2858 mpduff javadoc updates
|
||||
* Oct 15, 2015 4897 bkowal Made {@link #pm} protected.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -60,7 +61,7 @@ public abstract class AbstractMenuUtil {
|
|||
private static final IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(AbstractMenuUtil.class);
|
||||
|
||||
private final PathManager pm = (PathManager) PathManagerFactory
|
||||
protected final PathManager pm = (PathManager) PathManagerFactory
|
||||
.getPathManager();
|
||||
|
||||
protected LocalizationContext caveConfigured = pm.getContext(
|
||||
|
|
Loading…
Add table
Reference in a new issue