Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add (temp) LookupName for checking server >= 5.4.8 #3

Open
wants to merge 1 commit into
base: update_thumbnail_loading
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ public class LookupNames
/** Field to access the <code>Version</code> information. */
public static final String VERSION = "Version";

/**
* Field to check if the server version is 5.4.8 or later.
* TODO: Can be removed for >= 5.5.0 release
* */
public static final String SERVER_5_4_8_OR_LATER = "5.4.8 or later";

/** Field to access the <code>Name of the software</code>. */
public static final String SOFTWARE_NAME = "SoftwareName";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import org.openmicroscopy.shoola.env.ui.UserNotifier;
import org.openmicroscopy.shoola.svc.proxy.ProxyUtil;
import org.openmicroscopy.shoola.util.CommonsLangUtils;
import org.openmicroscopy.shoola.util.VersionCompare;
import org.openmicroscopy.shoola.util.ui.IconManager;
import org.openmicroscopy.shoola.util.ui.MessageBox;
import org.openmicroscopy.shoola.util.ui.NotificationDialog;
Expand Down Expand Up @@ -586,6 +587,9 @@ public void connect(UserCredentials uc)
return;
}

// TODO: Can be removed for >= 5.5.0 release
container.getRegistry().bind(LookupNames.SERVER_5_4_8_OR_LATER, VersionCompare.compare(version, "5.4.8") >= 0);

//Upgrade check only if client and server are compatible
omeroGateway.isUpgradeRequired(name);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@
import omero.gateway.model.ImageData;
import omero.gateway.model.PixelsData;
import omero.log.LogMessage;

import org.openmicroscopy.shoola.env.LookupNames;
import org.openmicroscopy.shoola.env.data.OmeroImageService;
import org.openmicroscopy.shoola.env.data.model.ThumbnailData;
import org.openmicroscopy.shoola.env.data.views.BatchCall;
import org.openmicroscopy.shoola.env.data.views.BatchCallTree;
import org.openmicroscopy.shoola.util.VersionCompare;
import org.openmicroscopy.shoola.util.image.geom.Factory;
import org.openmicroscopy.shoola.util.image.io.WriterImage;

Expand Down Expand Up @@ -69,11 +70,6 @@
*/
public class ThumbnailLoader extends BatchCallTree {

/**
* Version of OMERO.server with {@code getThumbnailWithoutDefault}
*/
private static final String VERSION_THUMBNAIL_NO_DEFAULT = "5.4.8";

/**
* The images for which we need thumbnails.
*/
Expand Down Expand Up @@ -333,9 +329,10 @@ private byte[] loadThumbnail(ThumbnailStorePrx store, PixelsData pxd, long userI
store.setRenderingDefId(rndDefId);
}

if (VersionCompare.compare(context.getGateway().getServerVersion(), VERSION_THUMBNAIL_NO_DEFAULT) >= 0) {
if ((boolean) context.lookup(LookupNames.SERVER_5_4_8_OR_LATER)) {
// If the client is connecting to a server with version 5.4.8 or greater, use the thumbnail
// loading function that doesn't return a clock.
// TODO: Can be removed for >= 5.5.0 release
return store.getThumbnailWithoutDefault(omero.rtypes.rint(sizeX),
omero.rtypes.rint(sizeY));
} else {
Expand Down