Changes so far for REGION and WORKSTATION localization levels
This commit is contained in:
parent
132a15cbd5
commit
35796da613
11 changed files with 26 additions and 81 deletions
|
@ -76,6 +76,7 @@ import com.raytheon.uf.viz.alertviz.config.Source;
|
|||
* Oct 04, 2018 7484 randerso Changed to use AV_ADMIN for internal errors
|
||||
* Oct 08, 2018 7515 randerso Adjusted priorities of AlertViz internal
|
||||
* errors.
|
||||
* Sep 01, 2022 srcarter Remove workstation and set site to default
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -91,9 +92,6 @@ public class ConfigurationManager {
|
|||
public static final ConfigContext DEFAULT_SITE_CONFIG = new ConfigContext(
|
||||
ConfigContext.DEFAULT_NAME, LocalizationLevel.SITE);
|
||||
|
||||
public static final ConfigContext DEFAULT_WORKSTATION_CONFIG = new ConfigContext(
|
||||
ConfigContext.DEFAULT_NAME, LocalizationLevel.WORKSTATION);
|
||||
|
||||
private static final String CONFIG_DIR = ConfigContext.ALERTVIZ_DIR
|
||||
+ IPathManager.SEPARATOR + ConfigContext.DEFAULT_SUBDIR;
|
||||
|
||||
|
@ -165,32 +163,13 @@ public class ConfigurationManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get default WORKSTATION configuration file for host machine. When it does
|
||||
* not exist create from Default SITE or BASE.
|
||||
* Get default config (SITE)
|
||||
*
|
||||
* @return hostContext
|
||||
*/
|
||||
private ConfigContext getDefaultHostContext() {
|
||||
ConfigContext workstationContext = DEFAULT_WORKSTATION_CONFIG;
|
||||
|
||||
try {
|
||||
ILocalizationFile file = getLocalizationFile(workstationContext);
|
||||
|
||||
if (file == null || !file.exists()) {
|
||||
ConfigContext sourceContext = DEFAULT_SITE_CONFIG;
|
||||
file = getLocalizationFile(sourceContext);
|
||||
|
||||
if (file == null || !file.exists()) {
|
||||
sourceContext = DEFAULT_BASE_CONFIG;
|
||||
}
|
||||
Configuration config = retrieveConfiguration(sourceContext);
|
||||
saveToFile(workstationContext, config);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
statusHandler.fatal(
|
||||
"Unable to load configuration context " + context, ex);
|
||||
}
|
||||
return workstationContext;
|
||||
ConfigContext siteContext = DEFAULT_SITE_CONFIG;
|
||||
return siteContext;
|
||||
}
|
||||
|
||||
public ConfigContext[] getConfigurations() {
|
||||
|
@ -278,7 +257,7 @@ public class ConfigurationManager {
|
|||
}
|
||||
if (configurationMap.containsKey(context)) {
|
||||
if (current.equals(context)) {
|
||||
loadAsCurrent(DEFAULT_WORKSTATION_CONFIG);
|
||||
loadAsCurrent(DEFAULT_SITE_CONFIG);
|
||||
}
|
||||
ILocalizationFile file = getLocalizationFile(context);
|
||||
try {
|
||||
|
@ -566,8 +545,7 @@ public class ConfigurationManager {
|
|||
}
|
||||
|
||||
public static boolean isDefaultConfig(ConfigContext context) {
|
||||
return DEFAULT_WORKSTATION_CONFIG.equals(context)
|
||||
|| DEFAULT_SITE_CONFIG.equals(context)
|
||||
return DEFAULT_SITE_CONFIG.equals(context)
|
||||
|| DEFAULT_BASE_CONFIG.equals(context);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,6 +76,7 @@ import com.raytheon.uf.viz.core.notification.jobs.NotificationManagerJob;
|
|||
* errors.
|
||||
* Oct 12, 2018 7515 randerso Implemented AlertVizStatusHandlerFactory to
|
||||
* handle internal AlertViz errors properly.
|
||||
* Sep 01, 2022 srcarter Remove extra levels during initialization
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -227,7 +228,6 @@ public class AlertVizApplication implements IStandaloneComponent {
|
|||
protected void initializeLocalization() throws Exception {
|
||||
PathManagerFactory.setAdapter(new CAVELocalizationAdapter());
|
||||
new LocalizationInitializer(true, false).run();
|
||||
AlertVizLocalizationConfigurer.registerExtraLevels();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ public class TextWorkstationConstants {
|
|||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
ILocalizationFile lf = pm.getLocalizationFile(
|
||||
pm.getContext(LocalizationType.CAVE_STATIC,
|
||||
LocalizationLevel.WORKSTATION),
|
||||
LocalizationLevel.SITE),
|
||||
LocalizationUtil.join("textWs", "textws.prefs"));
|
||||
|
||||
return lf;
|
||||
|
|
|
@ -667,44 +667,21 @@ public class AlarmAlertFunctions {
|
|||
}
|
||||
|
||||
/*
|
||||
* Try to load the workstation file. If there is no workstation file then
|
||||
* try to load the site file and create a new workstation file from it. If
|
||||
* there is no site file, then create a new default workstation file.
|
||||
* Try to load the site file.
|
||||
*/
|
||||
public static AAPACombined loadSiteAlarms(
|
||||
ILocalizationFileObserver listener) {
|
||||
LocalizationFile workstationFile = getFile(
|
||||
initLocalization(LocalizationLevel.WORKSTATION), SITE_FILE);
|
||||
public static AAPACombined loadSiteAlarms(ILocalizationFileObserver listener) {
|
||||
AAPACombined aapaCombined = null;
|
||||
|
||||
if (workstationFile == null || !workstationFile.exists()) {
|
||||
// no workstation file found. try the site file
|
||||
LocalizationFile siteFile = getFile(initSiteLocalization(),
|
||||
SITE_FILE);
|
||||
if (siteFile == null) {
|
||||
aapaCombined = createDefaultAAPACombined();
|
||||
} else {
|
||||
try {
|
||||
aapaCombined = loadFile(siteFile.getFile());
|
||||
} catch (FileNotFoundException e) {
|
||||
aapaCombined = createDefaultAAPACombined();
|
||||
}
|
||||
}
|
||||
// save work file
|
||||
if (workstationFile != null) {
|
||||
saveAlarms(aapaCombined, workstationFile);
|
||||
}
|
||||
} else {
|
||||
LocalizationFile siteFile = getFile(initSiteLocalization(), SITE_FILE);
|
||||
if (siteFile == null) {
|
||||
aapaCombined = createDefaultAAPACombined();
|
||||
try {
|
||||
aapaCombined = loadFile(workstationFile.getFile());
|
||||
aapaCombined = loadFile(siteFile.getFile());
|
||||
} catch (FileNotFoundException e) {
|
||||
aapaCombined = createDefaultAAPACombined();
|
||||
}
|
||||
}
|
||||
|
||||
if (workstationFile != null) {
|
||||
workstationFile.addFileUpdatedObserver(listener);
|
||||
}
|
||||
return aapaCombined;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
# 12/08/2014 #4953 randerso Made for generic allowing specification of LocalizationLevel
|
||||
# Re-exported Java enums for easier use.
|
||||
# Apr 25, 2015 4952 njensen Updated for new JEP API
|
||||
# Sep 01, 2022 srcarter Remove workstation and region references
|
||||
##
|
||||
|
||||
##
|
||||
|
@ -48,10 +49,8 @@ CAVE_CONFIG = LocalizationType.CAVE_CONFIG
|
|||
COMMON_STATIC = LocalizationType.COMMON_STATIC
|
||||
|
||||
BASE = LocalizationLevel.BASE
|
||||
REGION = LocalizationLevel.REGION
|
||||
CONFIGURED = LocalizationLevel.CONFIGURED
|
||||
SITE = LocalizationLevel.SITE
|
||||
WORKSTATION = LocalizationLevel.WORKSTATION
|
||||
USER = LocalizationLevel.USER
|
||||
|
||||
def getLocalizationFile(loctype, loclevel, contextname, filename):
|
||||
|
|
|
@ -76,6 +76,7 @@ import com.raytheon.uf.common.status.UFStatus;
|
|||
* Apr 11, 2016 5564 bsteffen Move localization files to common_static
|
||||
* Apr 15, 2016 5182 tjensen Changed processorMap population to be done
|
||||
* during processing instead of up front.
|
||||
* Sep 01, 2022 srcarter Remove region localization level
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -317,8 +318,8 @@ public class GribPostProcessor {
|
|||
private synchronized void initProcessorMap() {
|
||||
IPathManager pathMgr = PathManagerFactory.getPathManager();
|
||||
LocalizationLevel[] levels = new LocalizationLevel[] {
|
||||
LocalizationLevel.BASE, LocalizationLevel.REGION,
|
||||
LocalizationLevel.CONFIGURED, LocalizationLevel.SITE };
|
||||
LocalizationLevel.BASE, LocalizationLevel.CONFIGURED,
|
||||
LocalizationLevel.SITE };
|
||||
|
||||
Map<LocalizationLevel, ? extends ILocalizationFile> files = pathMgr
|
||||
.getTieredLocalizationFile(LocalizationType.COMMON_STATIC,
|
||||
|
|
|
@ -68,6 +68,7 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
|||
* ------------- -------- --------- -----------------------------------------
|
||||
* Sep 28, 2015 3756 nabowle Initial creation
|
||||
* Apr 11, 2016 5564 bsteffen Move localization files to common_static
|
||||
* Sep 01, 2022 srcarter Remove region localization level
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -438,8 +439,8 @@ public class PrecipAccumPostProcessor extends DecoderPostProcessor {
|
|||
|
||||
IPathManager pathMgr = PathManagerFactory.getPathManager();
|
||||
LocalizationLevel[] levels = new LocalizationLevel[] {
|
||||
LocalizationLevel.BASE, LocalizationLevel.REGION,
|
||||
LocalizationLevel.CONFIGURED, LocalizationLevel.SITE };
|
||||
LocalizationLevel.BASE, LocalizationLevel.CONFIGURED,
|
||||
LocalizationLevel.SITE };
|
||||
|
||||
Map<LocalizationLevel, ? extends ILocalizationFile> files = pathMgr
|
||||
.getTieredLocalizationFile(LocalizationType.COMMON_STATIC,
|
||||
|
|
|
@ -52,7 +52,6 @@ Import-Package: com.raytheon.uf.common.activetable,
|
|||
com.raytheon.uf.common.gridcoverage,
|
||||
com.raytheon.uf.common.localization,
|
||||
com.raytheon.uf.common.localization.exception,
|
||||
com.raytheon.uf.common.localization.region,
|
||||
com.raytheon.uf.common.message,
|
||||
com.raytheon.uf.common.pointdata,
|
||||
com.raytheon.uf.common.python,
|
||||
|
|
|
@ -66,6 +66,7 @@ import com.raytheon.uf.common.util.FileUtil;
|
|||
* gfe/python
|
||||
* Feb 20, 2018 6602 dgilling Updated for consolidated text utilities.
|
||||
* May 05, 2020 8151 randerso Include EDEX site in getCommonGfeIncludePath
|
||||
* Sep 01, 2022 srcarter Change for Workstation and Region removal
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -426,7 +427,6 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
|
|||
}
|
||||
|
||||
public static String getVCModUtilsIncludePath() {
|
||||
return getPath(PATH_MANAGER.getContext(LocalizationType.COMMON_STATIC,
|
||||
LocalizationLevel.BASE), VCMOD_UTILS);
|
||||
return buildIncludePath(LocalizationType.COMMON_STATIC, VCMOD_UTILS, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,6 @@ import com.raytheon.uf.common.localization.LocalizationUtil;
|
|||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.localization.SaveableOutputStream;
|
||||
import com.raytheon.uf.common.localization.exception.LocalizationException;
|
||||
import com.raytheon.uf.common.localization.region.RegionLookup;
|
||||
import com.raytheon.uf.common.protectedfiles.ProtectedFileLookup;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.SingleTypeJAXBManager;
|
||||
|
@ -74,6 +73,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
* Aug 07, 2017 6379 njensen Use ProtectedFileLookup
|
||||
* Jul 31, 2017 6342 randerso Added save and delete edit area methods.
|
||||
* Code cleanup.
|
||||
* Sep 13, 2022 srcarter@ucar Remove REGION level.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -433,8 +433,6 @@ public class ReferenceMgr {
|
|||
private LocalizationContext[] getSiteSearchContexts() {
|
||||
String siteId = dbGridLocation.getSiteId();
|
||||
|
||||
String regionName = RegionLookup.getWfoRegion(siteId);
|
||||
|
||||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
LocalizationContext[] searchContexts = pm
|
||||
.getLocalSearchHierarchy(LocalizationType.COMMON_STATIC);
|
||||
|
@ -447,13 +445,6 @@ public class ReferenceMgr {
|
|||
if (((level.equals(LocalizationLevel.SITE))
|
||||
|| (level.equals(LocalizationLevel.CONFIGURED)))) {
|
||||
ctx.setContextName(siteId);
|
||||
} else if (level.equals(LocalizationLevel.REGION)) {
|
||||
if (regionName == null) {
|
||||
// Don't include REGION context if no regionName
|
||||
continue;
|
||||
} else {
|
||||
ctx.setContextName(regionName);
|
||||
}
|
||||
}
|
||||
|
||||
fixedContexts.add(ctx);
|
||||
|
|
|
@ -31,8 +31,7 @@
|
|||
# 03/12/13 bkowal Initial Creation.
|
||||
# 02/17/14 2712 bkowal Provide a default value for localization site.
|
||||
# 03/19/14 2929 bkowal 'REGION' is now recognized as a valid localization level.
|
||||
#
|
||||
#
|
||||
# 02/04/19 mjames@ucar Removed REGION.
|
||||
#
|
||||
|
||||
#
|
||||
|
@ -53,7 +52,7 @@ from dynamicserialize.dstypes.com.raytheon.uf.common.localization import Localiz
|
|||
from dynamicserialize.dstypes.com.raytheon.uf.common.localization.stream import LocalizationStreamGetRequest
|
||||
|
||||
BUFFER_SIZE = 512 * 1024
|
||||
availableLevels = ['BASE', 'REGION', 'CONFIGURED', 'SITE', 'USER']
|
||||
availableLevels = ['BASE', 'CONFIGURED', 'SITE', 'USER']
|
||||
|
||||
def importModule(name, localizationHost, localizationPort, localizedSite=None, localizationUser=None,
|
||||
loctype='COMMON_STATIC', level=None):
|
||||
|
|
Loading…
Add table
Reference in a new issue