summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Conway <mikeconway@dhcp152-54-6-70.wireless.europa.renci.org>2011-07-13 14:00:36 (GMT)
committer Mike Conway <mikeconway@dhcp152-54-6-70.wireless.europa.renci.org>2011-07-13 14:00:36 (GMT)
commitef26b66cad0f283336f0fc4cf27ed16e9e04b0c0 (patch)
treec622b7c224bc7d8f7c3af7bba1631646fed34cd7
parent4f3b132005b6c151781d3afaf4ea7e04c7c5a584 (diff)
downloadQCG-Data-ef26b66cad0f283336f0fc4cf27ed16e9e04b0c0.zip
QCG-Data-ef26b66cad0f283336f0fc4cf27ed16e9e04b0c0.tar.gz
QCG-Data-ef26b66cad0f283336f0fc4cf27ed16e9e04b0c0.tar.bz2
initial setup wizard comes up properly, guarded by prop in idrop.config
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java52
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java2
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java17
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java13
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropPropertiesHelper.java2
-rw-r--r--idrop-swing/src/main/resources/idrop.properties1
6 files changed, 66 insertions, 21 deletions
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java
index a92068f..2d7534d 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java
@@ -17,6 +17,7 @@ import org.irods.jargon.idrop.desktop.systraygui.services.IdropConfigurationServ
import org.irods.jargon.idrop.desktop.systraygui.services.IdropConfigurationServiceImpl;
import org.irods.jargon.idrop.desktop.systraygui.services.QueueSchedulerTimerTask;
import org.irods.jargon.idrop.desktop.systraygui.utils.IdropConfig;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.SetupWizard;
import org.irods.jargon.idrop.exceptions.IdropAlreadyRunningException;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
@@ -137,22 +138,7 @@ public class StartupSequencer {
loginDialog.setVisible(true);
idropSplashWindow.toFront();
- log.info("logged in, now checking for first run...");
-
- try {
- Thread.sleep(STARTUP_SEQUENCE_PAUSE_INTERVAL);
- } catch (InterruptedException e) {
- throw new IdropRuntimeException(e);
- }
-
- idropSplashWindow.setStatus("Checking if this is the first time run to set up synch...", ++count);
-
- String synchDeviceName = idropCore.getIdropConfig().getSynchDeviceName();
-
- if (synchDeviceName == null) {
- log.info("first time running idrop, starting configuration wizard");
- doFirstTimeConfigurationWizard();
- }
+
try {
Thread.sleep(STARTUP_SEQUENCE_PAUSE_INTERVAL);
@@ -204,13 +190,32 @@ public class StartupSequencer {
Timer timer = new Timer();
timer.scheduleAtFixedRate(queueSchedulerTimerTask, 10000, 120000);
idropCore.setQueueTimer(timer);
+ idrop.signalIdropCoreReadyAndSplashComplete();
} catch (IdropException ex) {
Logger.getLogger(StartupSequencer.class.getName()).log(Level.SEVERE, null, ex);
}
+
+ log.info("logged in, now checking for first run...");
+
+ try {
+ Thread.sleep(STARTUP_SEQUENCE_PAUSE_INTERVAL);
+ } catch (InterruptedException e) {
+ throw new IdropRuntimeException(e);
+ }
+
+ idropSplashWindow.setStatus("Checking if this is the first time run to set up synch...", ++count);
+
+ String synchDeviceName = idropCore.getIdropConfig().getSynchDeviceName();
+
+ if (synchDeviceName == null) {
+ log.info("first time running idrop, starting configuration wizard");
+ doFirstTimeConfigurationWizard();
+ }
+
log.info("signal that the startup sequence is complete");
try {
- idrop.signalIdropCoreReadyAndSplashComplete();
+
idropSplashWindow.setVisible(false);
idropSplashWindow = null;
} catch (Exception e) {
@@ -218,7 +223,8 @@ public class StartupSequencer {
throw new IdropRuntimeException("error starting idrop gui", e);
}
-
+
+
}
/**
@@ -238,6 +244,14 @@ public class StartupSequencer {
}
private void doFirstTimeConfigurationWizard() {
- log.info("doFirstTimeConfigurationWizard()");
+ log.info("doFirstTimeConfigurationWizard()..do I show");
+ // there is a force.no.synch property in idrop.properties that prevents synch from coming up if in the build that way
+
+
+ if (idropCore.getIdropConfig().isShowStartupWizard()) {
+ log.info("doing setup wizard");
+ SetupWizard setupWizard = new SetupWizard(idrop, true);
+ setupWizard.setVisible(true);
+ }
}
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
index c279dac..e736152 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
@@ -15,7 +15,9 @@ import org.irods.jargon.idrop.exceptions.IdropException;
public interface IdropConfigurationService {
String IDROP_PROPS_FILE_NAME = "idrop.properties";
String FORCE_MODE = "force.mode";
+ String FORCE_NO_SYNCH = "force.no.synch";
String LOGIN_PRESET = "login.preset";
+ String SHOW_STARTUP = "show.startup";
Properties bootstrapConfiguration() throws IdropException;
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java
index 4284534..573d082 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java
@@ -83,7 +83,7 @@ public class IdropConfigurationServiceImpl implements IdropConfigurationService
}
log.info("now storing derived properties in idrop configuration");
-
+ log.info("checking for force mode, which forces certain properties to be loaded from the idrop.properties file");
/*
* This is something of a shim right now until config things settle down. For lifetime library, force into login preset mode
*/
@@ -98,7 +98,20 @@ public class IdropConfigurationServiceImpl implements IdropConfigurationService
}
}
- log.info("checking for force mode, which forces certain properties to be loaded from the idrop.properties file");
+ /*
+ * If the distro has the idrop.properties to force.no.synch=true, then override the force option in effect
+ */
+ forceMode = (String) configFileProperties.getProperty(FORCE_NO_SYNCH);
+ if (forceMode != null) {
+ boolean isForce = Boolean.valueOf(forceMode);
+ log.info("force no synch mode mode is:{}", isForce);
+ if (isForce) {
+ log.warn("forcing into no synch mode");
+ databaseProperties.setProperty(SHOW_STARTUP, "false");
+ }
+ }
+
+
saveConfigurationToPropertiesFile();
return databaseProperties;
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java
index 135ae1e..758b1da 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java
@@ -119,6 +119,19 @@ public class IdropConfig {
return idropProperties.getProperty(IdropPropertiesHelper.SYNCH_DEVICE_NAME);
}
+
+ public boolean isShowStartupWizard() {
+ boolean showWizard = false;
+ String showStartup = idropProperties
+ .getProperty(IdropPropertiesHelper.SHOW_STARTUP);
+
+ if (showStartup != null && showStartup.equals("true")) {
+ showWizard = true;
+ }
+
+ return showWizard;
+
+ }
/**
* Should I have a rolling log in the user dir? Will return null of no logging desired, otherwise, will return a log
* level
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropPropertiesHelper.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropPropertiesHelper.java
index 2315d38..40154cc 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropPropertiesHelper.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropPropertiesHelper.java
@@ -34,6 +34,8 @@ public class IdropPropertiesHelper {
public static final String ROLLING_LOG_LEVEL = "rolling.log.level";
public static final String SYNCH_DEVICE_NAME = "synch.device.name";
+
+ public static final String SHOW_STARTUP = "show.startup";
/**
* Load the default iDrop poperties file
diff --git a/idrop-swing/src/main/resources/idrop.properties b/idrop-swing/src/main/resources/idrop.properties
index b4b728f..2595c94 100644
--- a/idrop-swing/src/main/resources/idrop.properties
+++ b/idrop-swing/src/main/resources/idrop.properties
@@ -3,6 +3,7 @@ login.preset=false
force.mode=false
force.no.synch=true
advanced.view=true
+show.startup=true
transfer.database=transferDatabase
login.preset.host=diamond.ils.unc.edu
login.preset.zone=lifelibZone