Merge pull request #585 from tiffanycmeyer13/unidata_20.3.2
Add ability to load text products in the text workstation
This commit is contained in:
commit
ad681c397a
3 changed files with 42 additions and 15 deletions
|
@ -90,6 +90,9 @@ import org.locationtech.jts.geom.GeometryFactory;
|
||||||
* code cleanup
|
* code cleanup
|
||||||
* 07/05/2016 19153 mgamazaychikov Fix disappearance of AlarmAlert Bell after initial close
|
* 07/05/2016 19153 mgamazaychikov Fix disappearance of AlarmAlert Bell after initial close
|
||||||
* Jan 24, 2018 7132 tgurney Add destroyAlarmAlertBell()
|
* Jan 24, 2018 7132 tgurney Add destroyAlarmAlertBell()
|
||||||
|
* Sep 13, 2023 tiffanym@ucar Brought back logic that looks at the site level for the
|
||||||
|
* DefaultSiteAlarms.xml if it doesn't exist at the workstation
|
||||||
|
* level
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
|
@ -667,21 +670,44 @@ public class AlarmAlertFunctions {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try to load the site file.
|
* 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.
|
||||||
*/
|
*/
|
||||||
public static AAPACombined loadSiteAlarms(ILocalizationFileObserver listener) {
|
public static AAPACombined loadSiteAlarms(
|
||||||
|
ILocalizationFileObserver listener) {
|
||||||
|
LocalizationFile workstationFile = getFile(
|
||||||
|
initLocalization(LocalizationLevel.SITE), SITE_FILE);
|
||||||
AAPACombined aapaCombined = null;
|
AAPACombined aapaCombined = null;
|
||||||
|
|
||||||
LocalizationFile siteFile = getFile(initSiteLocalization(), SITE_FILE);
|
if (workstationFile == null || !workstationFile.exists()) {
|
||||||
if (siteFile == null) {
|
// no workstation file found. try the site file
|
||||||
aapaCombined = createDefaultAAPACombined();
|
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 {
|
||||||
try {
|
try {
|
||||||
aapaCombined = loadFile(siteFile.getFile());
|
aapaCombined = loadFile(workstationFile.getFile());
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
aapaCombined = createDefaultAAPACombined();
|
aapaCombined = createDefaultAAPACombined();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (workstationFile != null) {
|
||||||
|
workstationFile.addFileUpdatedObserver(listener);
|
||||||
|
}
|
||||||
return aapaCombined;
|
return aapaCombined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,6 +126,10 @@ import com.raytheon.uf.edex.plugin.text.impl.TextDBStaticData;
|
||||||
* Nov 09, 2021 22859 zalberts Added additional sort by datacrc to
|
* Nov 09, 2021 22859 zalberts Added additional sort by datacrc to
|
||||||
* AFOS_QUERY_STMT for consistent results
|
* AFOS_QUERY_STMT for consistent results
|
||||||
* when reftime and inserttime are equal.
|
* when reftime and inserttime are equal.
|
||||||
|
* Sep 13, 2023 tiffanym@@ucar Force text workstation requests to look at the
|
||||||
|
* operational stdtextproducts db table instead
|
||||||
|
* of practicestdtxtproducts db table when CAVE
|
||||||
|
* is running in practice mode (Unidata default)
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -237,10 +241,8 @@ public class StdTextProductDao extends CoreDao {
|
||||||
* true for operational table, false for practice table
|
* true for operational table, false for practice table
|
||||||
*/
|
*/
|
||||||
public StdTextProductDao(boolean operationalModeFlag) {
|
public StdTextProductDao(boolean operationalModeFlag) {
|
||||||
super(DaoConfig.forClass("fxa",
|
super(DaoConfig.forClass("fxa", OperationalStdTextProduct.class));
|
||||||
(operationalModeFlag ? OperationalStdTextProduct.class
|
this.operationalMode = true;
|
||||||
: PracticeStdTextProduct.class)));
|
|
||||||
this.operationalMode = operationalModeFlag;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1073,9 +1075,7 @@ public class StdTextProductDao extends CoreDao {
|
||||||
public List<AFOSProductId> doInTransaction(
|
public List<AFOSProductId> doInTransaction(
|
||||||
TransactionStatus status) {
|
TransactionStatus status) {
|
||||||
Session sess = getCurrentSession();
|
Session sess = getCurrentSession();
|
||||||
Criteria crit = sess.createCriteria(operationalMode
|
Criteria crit = sess.createCriteria(OperationalStdTextProduct.class);
|
||||||
? OperationalStdTextProduct.class
|
|
||||||
: PracticeStdTextProduct.class);
|
|
||||||
ProjectionList fields = Projections.projectionList();
|
ProjectionList fields = Projections.projectionList();
|
||||||
fields.add(Projections.property(CCC_ID));
|
fields.add(Projections.property(CCC_ID));
|
||||||
fields.add(Projections.property(ProdNNN_ID));
|
fields.add(Projections.property(ProdNNN_ID));
|
||||||
|
@ -1598,7 +1598,6 @@ public class StdTextProductDao extends CoreDao {
|
||||||
* @return StdTextProduct, an
|
* @return StdTextProduct, an
|
||||||
*/
|
*/
|
||||||
private StdTextProduct getStdTextProductInstance() {
|
private StdTextProduct getStdTextProductInstance() {
|
||||||
return this.operationalMode ? new OperationalStdTextProduct()
|
return new OperationalStdTextProduct();
|
||||||
: new PracticeStdTextProduct();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<aapaCombined/>
|
Loading…
Add table
Reference in a new issue