diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/ServiceBackupComponent.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/ServiceBackupComponent.java index d81c2aeed3..efa8e7f9bf 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/ServiceBackupComponent.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/ServiceBackupComponent.java @@ -19,9 +19,6 @@ **/ package com.raytheon.viz.gfe; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - import com.raytheon.viz.gfe.dialogs.sbu.ServiceBackupDlg; import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent; @@ -36,6 +33,8 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent; * ------------ ---------- ----------- -------------------------- * Aug 12, 2011 bphillip Initial creation * Oct 26, 2012 1287 rferrel Change to force blocking of ServiceBackupDlg. + * Mar 21, 2013 1447 dgilling Fix dialog construction so this dialog + * is created as a top-level shell. * * * @@ -54,8 +53,7 @@ public class ServiceBackupComponent extends AbstractCAVEComponent { */ @Override protected void startInternal(String componentName) throws Exception { - ServiceBackupDlg svcBuDlg = new ServiceBackupDlg(new Shell( - Display.getCurrent())); + ServiceBackupDlg svcBuDlg = new ServiceBackupDlg(null); svcBuDlg.setBlockOnOpen(true); svcBuDlg.open(); } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/sbu/QueryOptionsDlg.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/sbu/QueryOptionsDlg.java index 23e8322a9a..c1eb5d1a88 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/sbu/QueryOptionsDlg.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/sbu/QueryOptionsDlg.java @@ -31,7 +31,7 @@ import org.eclipse.swt.widgets.Shell; import com.raytheon.viz.ui.dialogs.CaveJFACEDialog; /** - * TODO Add Description + * Asks the user if they want to import digital data and/or start GFE. * *
* @@ -39,7 +39,9 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Aug 4, 2011 randerso Initial creation + * Aug 04, 2011 randerso Initial creation + * Mar 20, 2013 1447 dgilling Implement changes from A1 DR 21404, + * make default selections match A1. * ** @@ -54,9 +56,11 @@ public class QueryOptionsDlg extends CaveJFACEDialog { private boolean importGrids; private boolean startGfe; - + + private boolean trMode; + private Button importGridsBtn; - + private Button startGfeBtn; /** @@ -96,23 +100,37 @@ public class QueryOptionsDlg extends CaveJFACEDialog { if (doImCon) { importGridsBtn = new Button(top, SWT.CHECK); importGridsBtn.setText("Import Digital Forecast"); + importGridsBtn.setSelection(true); importGridsBtn.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { importGrids = importGridsBtn.getSelection(); } }); - importGridsBtn.getSelection(); + importGrids = importGridsBtn.getSelection(); + + final Button trModeBtn = new Button(top, SWT.CHECK); + trModeBtn.setText("Troubleshooting Mode (no ISC/VTEC AT sharing)"); + trModeBtn.setSelection(false); + trModeBtn.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + trMode = trModeBtn.getSelection(); + } + }); + trMode = trModeBtn.getSelection(); } startGfeBtn = new Button(top, SWT.CHECK); startGfeBtn.setText("Start GFE"); + startGfeBtn.setSelection(true); startGfeBtn.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { startGfe = startGfeBtn.getSelection(); } }); + startGfe = startGfeBtn.getSelection(); return top; } @@ -124,4 +142,8 @@ public class QueryOptionsDlg extends CaveJFACEDialog { public boolean startGFE() { return this.startGfe; } + + public boolean trMode() { + return this.trMode; + } } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/sbu/ServiceBackupDlg.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/sbu/ServiceBackupDlg.java index 4f03ab588e..6bad0dedca 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/sbu/ServiceBackupDlg.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/sbu/ServiceBackupDlg.java @@ -19,7 +19,6 @@ **/ package com.raytheon.viz.gfe.dialogs.sbu; -import java.io.IOException; import java.util.List; import org.eclipse.core.runtime.IProgressMonitor; @@ -39,6 +38,7 @@ import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.program.Program; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; @@ -57,7 +57,6 @@ import com.raytheon.uf.common.site.requests.GetActiveSitesRequest; 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.common.util.RunProcess; import com.raytheon.uf.viz.core.RGBColors; import com.raytheon.uf.viz.core.VizApp; import com.raytheon.uf.viz.core.auth.UserController; @@ -87,10 +86,12 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Aug 4, 2011 randerso Initial creation - * Sep 19,2011 10955 rferrel Use RunProcess - * Oct 25, 2012 1287 rferrel Code clean up for non-blocking dialog. - * Nov 15,2012 15614 jdynina Added check for national center + * Aug 04, 2011 randerso Initial creation + * Sep 19, 2011 10955 rferrel Use RunProcess + * Oct 25, 2012 1287 rferrel Code clean up for non-blocking dialog. + * Nov 15, 2012 15614 jdynina Added check for national center + * Mar 20, 2013 1447 dgilling Port troubleshooting mode changes + * from A1 DR 21404, some code cleanup. * * * @@ -156,7 +157,7 @@ public class ServiceBackupDlg extends CaveJFACEDialog { private Job updateJob; private boolean authorized; - + private boolean nationalCenter; private SVCBU_OP currentOperation = SVCBU_OP.no_backup; @@ -342,15 +343,11 @@ public class ServiceBackupDlg extends CaveJFACEDialog { helpItem.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - try { - // DR#10955 - RunProcess - .getRunProcess() - .exec("/usr/bin/firefox http://" - + getServiceBackupServer() - + ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_help.html"); - } catch (IOException e1) { - statusHandler.error("Unable to open Help page!", e1); + final String url = "http://" + + getServiceBackupServer() + + ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_help.html"; + if (!Program.launch(url)) { + statusHandler.error("Unable to open Help page: " + url); } } }); @@ -360,15 +357,12 @@ public class ServiceBackupDlg extends CaveJFACEDialog { instructionsItem.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - try { - // DR#10955 - RunProcess - .getRunProcess() - .exec("/usr/bin/firefox http://" - + getServiceBackupServer() - + ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_instructions.html"); - } catch (IOException e1) { - statusHandler.error("Unable to open Help page!", e1); + final String url = "http://" + + getServiceBackupServer() + + ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_instructions.html"; + if (!Program.launch(url)) { + statusHandler.error("Unable to open Instructions page: " + + url); } } }); @@ -378,15 +372,11 @@ public class ServiceBackupDlg extends CaveJFACEDialog { faqItem.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - try { - // DR#10955 - RunProcess - .getRunProcess() - .exec("/usr/bin/firefox http://" - + getServiceBackupServer() - + ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_faq.html"); - } catch (IOException e1) { - statusHandler.error("Unable to open Help page!", e1); + final String url = "http://" + + getServiceBackupServer() + + ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_faq.html"; + if (!Program.launch(url)) { + statusHandler.error("Unable to open FAQ page: " + url); } } }); @@ -493,7 +483,7 @@ public class ServiceBackupDlg extends CaveJFACEDialog { jobManager.addJob(new SvcbuDeactivateSiteJob(failedSite, this.site)); jobManager.addJob(new SvcbuImportConfJob(site, failedSite, - progress)); + false, progress)); jobManager.addJob(new SvcbuActivateSiteJob(failedSite, this.site)); jobManager.addJob(new SvcbuStartGfeJob(failedSite, this.site)); @@ -544,11 +534,12 @@ public class ServiceBackupDlg extends CaveJFACEDialog { if (dlg.open() == Window.OK) { boolean importGrids = dlg.importGrids(); boolean startGFE = dlg.startGFE(); + boolean trMode = dlg.trMode(); String failedSite = getFailedSite(); jobManager.addJob(new SvcbuDeactivateSiteJob(failedSite, this.site)); jobManager.addJob(new SvcbuImportConfJob(site, failedSite, - progress)); + trMode, progress)); jobManager.addJob(new SvcbuActivateSiteJob(failedSite, this.site)); if (importGrids) { @@ -1191,8 +1182,8 @@ public class ServiceBackupDlg extends CaveJFACEDialog { doExGrids.setEnabled(true); doExGrids.setText("Export " + this.site + "'s Digital Forecast to the Central Server"); - updateBanner("YOU ARE NOT IN BACKUP MODE", getShell().getParent() - .getFont(), black, gray); + updateBanner("YOU ARE NOT IN BACKUP MODE", getShell().getFont(), + black, gray); currentOperation = SVCBU_OP.no_backup; } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/sbu/jobs/SvcbuImportConfJob.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/sbu/jobs/SvcbuImportConfJob.java index 46adf650ee..895a576fdd 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/sbu/jobs/SvcbuImportConfJob.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/sbu/jobs/SvcbuImportConfJob.java @@ -49,7 +49,9 @@ import com.raytheon.viz.gfe.dialogs.sbu.ServiceBackupDlg; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Aug 5, 2011 bphillip Initial creation + * Aug 05, 2011 bphillip Initial creation + * Mar 20, 2013 1447 dgilling Add support for service backup + * troubleshooting mode from A1. * * * @@ -62,6 +64,8 @@ public class SvcbuImportConfJob extends ServiceBackupJob implements private String failedSite; + private boolean trMode; + private ProgressDlg progress; private boolean complete; @@ -70,21 +74,19 @@ public class SvcbuImportConfJob extends ServiceBackupJob implements private String errorMsg; - /** - * @param name - */ public SvcbuImportConfJob(String primarySite, String failedSite, - ProgressDlg progress) { + boolean trMode, ProgressDlg progress) { super("Import Configuration: " + failedSite, primarySite); this.failedSite = failedSite; this.progress = progress; + this.trMode = trMode; NotificationManagerJob.addObserver(ServiceBackupDlg.NOTIFY_TOPIC, this); } @Override public void run() { ImportConfRequest request = new ImportConfRequest(primarySite, - failedSite); + failedSite, trMode); try { VizApp.runAsync(new Runnable() { @@ -158,7 +160,7 @@ public class SvcbuImportConfJob extends ServiceBackupJob implements + failedSite, e); } catch (Exception e) { statusHandler.handle(Priority.PROBLEM, - "SERVICE BACKUP: "+e.getLocalizedMessage()); + "SERVICE BACKUP: " + e.getLocalizedMessage()); } finally { NotificationManagerJob.removeObserver( ServiceBackupDlg.NOTIFY_TOPIC, this); diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.edex.plugin.gfe/META-INF/MANIFEST.MF index 330a924e0b..fc96aa057f 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/META-INF/MANIFEST.MF @@ -26,7 +26,8 @@ Require-Bundle: com.raytheon.uf.common.dataplugin.gfe;bundle-version="1.12.1174" ucar.nc2;bundle-version="1.0.0", com.raytheon.uf.common.parameter;bundle-version="1.0.0", com.raytheon.uf.common.dataplugin.grid;bundle-version="1.0.0", - com.google.guava;bundle-version="1.0.0" + com.google.guava;bundle-version="1.0.0", + org.apache.commons.lang;bundle-version="2.3.0" Export-Package: com.raytheon.edex.plugin.gfe, com.raytheon.edex.plugin.gfe.config, com.raytheon.edex.plugin.gfe.db.dao, diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/handler/svcbu/ImportConfRequestHandler.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/handler/svcbu/ImportConfRequestHandler.java index f30eb6bbf4..3462bbf8c3 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/handler/svcbu/ImportConfRequestHandler.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/handler/svcbu/ImportConfRequestHandler.java @@ -19,6 +19,8 @@ **/ package com.raytheon.edex.plugin.gfe.server.handler.svcbu; +import org.apache.commons.lang.BooleanUtils; + import com.raytheon.edex.plugin.gfe.svcbackup.SvcBackupUtil; import com.raytheon.uf.common.dataplugin.gfe.request.ImportConfRequest; import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse; @@ -33,7 +35,9 @@ import com.raytheon.uf.common.serialization.comm.IRequestHandler; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Aug 4, 2011 bphillip Initial creation + * Aug 04, 2011 bphillip Initial creation + * Mar 20, 2013 1447 dgilling Support troubleshooting mode + * added to match A1 DR 21404. * * * @@ -49,7 +53,8 @@ public class ImportConfRequestHandler implements ServerResponse