Skip to content

Commit fb49a41

Browse files
authored
Merge pull request #8 from jburel/version-check
Version
2 parents 9919a47 + b48f98e commit fb49a41

File tree

6 files changed

+10
-39
lines changed

6 files changed

+10
-39
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id "java"
33
id "application"
4-
id "org.openmicroscopy.project" version "5.5.0-m4"
4+
id "org.openmicroscopy.project" version "5.5.0-m5"
55
}
66

77
group = "org.openmicroscopy"
@@ -30,7 +30,7 @@ dependencies {
3030
implementation("org.apache.httpcomponents:httpclient:4.5.7")
3131
implementation("org.apache.httpcomponents:httpcomponents-client:4.5.7")
3232
implementation("org.jfree:jfreechart:1.0.19")
33-
implementation("org.openmicroscopy:omero-blitz:5.5.0-m4")
33+
implementation("org.openmicroscopy:omero-blitz:5.5.0-m5")
3434
implementation("org.swinglabs:swingx:1.6.1")
3535
if (JavaVersion.current().isJava9Compatible()) {
3636
implementation("javax.activation:activation:1.1.1")

src/config/container.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@
314314
* etc.
315315
* <entry name="SplashScreenLogo">client_splashscreen.png</entry>
316316
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
317-
<entry name="Version">@OMERO_DISPLAY_VERSION@</entry>
318317
<entry name="SoftwareName">OMERO.insight</entry>
319318
<entry name="AboutFile">about.xml</entry>
320319
<entry name="HelpOnLine">https://help.openmicroscopy.org/</entry>

src/config/containerImporter.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@
295295
* etc.
296296
* <entry name="SplashScreenLogo">client_splashscreen.png</entry>
297297
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
298-
<entry name="Version">@OMERO_DISPLAY_VERSION@</entry>
299298
<entry name="SoftwareName">OMERO.importer</entry>
300299
<entry name="AboutFile">about.xml</entry>
301300
<entry name="HelpOnLine">https://help.openmicroscopy.org/</entry>

src/main/java/org/openmicroscopy/shoola/env/data/DataServicesFactory.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,6 @@ public void connect(UserCredentials uc)
516516
registry.getLogger().warn(this, "Could not access ConfigService");
517517
}
518518

519-
//Upgrade check only if client and server are compatible
520-
omeroGateway.isUpgradeRequired(name);
521-
522519
//Post an event to indicate that the user is connected.
523520
EventBus bus = container.getRegistry().getEventBus();
524521
bus.post(new ConnectedEvent());

src/main/java/org/openmicroscopy/shoola/env/data/OMEROGateway.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import java.util.LinkedHashMap;
3838
import java.util.List;
3939
import java.util.Map;
40-
import java.util.ResourceBundle;
4140
import java.util.Set;
4241
import java.util.Map.Entry;
4342
import java.util.concurrent.ExecutionException;
@@ -94,7 +93,6 @@
9493
import ome.formats.importer.OMEROWrapper;
9594
import ome.formats.importer.util.ProportionalTimeEstimatorImpl;
9695
import ome.formats.importer.util.TimeEstimator;
97-
import ome.system.UpgradeCheck;
9896
import ome.util.checksum.ChecksumProvider;
9997
import ome.util.checksum.ChecksumProviderFactory;
10098
import ome.util.checksum.ChecksumProviderFactoryImpl;
@@ -1413,30 +1411,6 @@ ExperimenterData getUserDetails(SecurityContext ctx, String name,
14131411
}
14141412
}
14151413

1416-
/**
1417-
* Returns <code>true</code> if an upgrade is required, <code>false</code>
1418-
* otherwise.
1419-
*
1420-
* @param name The name of the agent.
1421-
* @return See above.
1422-
*/
1423-
boolean isUpgradeRequired(String name)
1424-
{
1425-
ResourceBundle bundle = ResourceBundle.getBundle("omero");
1426-
String version = bundle.getString("omero.version");
1427-
String url = bundle.getString("omero.upgrades.url");
1428-
//Strip the "OMERO" part of the string
1429-
if (CommonsLangUtils.isBlank(name)) {
1430-
name = "insight";
1431-
}
1432-
if (name.startsWith("OMERO.")) {
1433-
name = name.substring("OMERO.".length());
1434-
}
1435-
UpgradeCheck check = new UpgradeCheck(url, version, name);
1436-
check.run();
1437-
return check.isUpgradeNeeded();
1438-
}
1439-
14401414
/**
14411415
* Connects to the server and returns details about the logged in user.
14421416
*

src/main/java/org/openmicroscopy/shoola/env/ui/SplashScreenManager.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import javax.swing.JFrame;
3737

3838

39+
import org.openmicroscopy.shoola.Main;
3940
import org.openmicroscopy.shoola.env.Container;
4041
import org.openmicroscopy.shoola.env.LookupNames;
4142
import org.openmicroscopy.shoola.env.config.OMEROInfo;
@@ -153,7 +154,7 @@ private void updateView()
153154
view.requestFocusOnField();
154155
}
155156
}
156-
157+
157158
/**
158159
* Initializes the view.
159160
*
@@ -163,10 +164,11 @@ private void initializedView(Icon splashscreen)
163164
{
164165
if (view != null) return;
165166
Image img = IconManager.getOMEImageIcon();
166-
Object version = container.getRegistry().lookup(LookupNames.VERSION);
167-
String v = "";
168-
if (version != null && version instanceof String)
169-
v = (String) version;
167+
String clientVersion = SplashScreenManager.class.getPackage().getImplementationVersion();
168+
if (clientVersion == null) {
169+
clientVersion = "Unknown";
170+
}
171+
container.getRegistry().bind(LookupNames.VERSION, clientVersion);
170172
OMEROInfo info =
171173
(OMEROInfo) container.getRegistry().lookup(LookupNames.OMERODS);
172174
int p = -1;
@@ -175,7 +177,7 @@ private void initializedView(Icon splashscreen)
175177
boolean configurable = info.isHostNameConfigurable();
176178

177179
boolean serverAvailable = connectToServer();
178-
view = new ScreenLogin(Container.TITLE, splashscreen, img, v, port,
180+
view = new ScreenLogin(Container.TITLE, splashscreen, img, clientVersion, port,
179181
host, serverAvailable);
180182
view.setEncryptionConfiguration(info.isEncrypted(),
181183
info.isEncryptedConfigurable());

0 commit comments

Comments
 (0)