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

Make Insight login work with websocket URLs #66

Merged
merged 12 commits into from
Dec 17, 2019
Merged

Conversation

dominikl
Copy link
Member

@dominikl dominikl commented Aug 21, 2019

With this PR:

Test

Connect to IDR next via websocket URLwss://[OMERO SERVER]/omero-ws (this again depends on ome/omero-blitz#66 ) . Connect to another server using usual hostname and port.

Note

There's actually one caveat: This PR slightly changes the appearance of the server list dialog: There are no separate fields any longer for hostname and port. If a port other than default port is used, one has to add it with a : after the hostname. Will probably need updating various help and training docs /cc @pwalczysko .
Screen Shot 2019-09-02 at 09 56 16

@snoopycrimecop
Copy link
Member

snoopycrimecop commented Aug 22, 2019

Conflicting PR. Removed from build OMERO-insight-push#138. See the console output for more details.
Possible conflicts:

  • PR Imagej script #53 jburel 'Imagej script'
    • src/main/java/org/openmicroscopy/shoola/env/data/DataServicesFactory.java

--conflicts Conflict resolved in build OMERO-insight-push#59. See the console output for more details.

@@ -546,7 +546,7 @@ private void initialize(String userName, String hostName)
serverName = i.next();
if (k == n) {
value = servers.get(serverName);
if (value != null) {
if (value != null && value.length() > 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CommonsLangUtils.isNotBlank can be handy for this kind of thing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, thought we want to gradually get rid off external apache/google dependencies?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where the JDK now offers an equivalent method, sure. For our heavyweight full-application JARs I wasn't aware of a broader push but I may have missed something? I'd have thought they were worth it for readability and reusing others' work but happy to go in the other direction if that's what's been decided. Certainly not a blocker for this PR anyway.

@mtbc
Copy link
Member

mtbc commented Sep 2, 2019

Initial functional testing looking promising. Can't see any data on IDR next but also can't via 4064 so maybe expected.

@manics
Copy link
Member

manics commented Sep 2, 2019

Works fine to me too, for idr had to play around with selecting/unselecting users/groups to view the data.

I couldn't find the insight logs (OS X, the menu option doesn't load anything). I wanted to check the error message was informative when using an incorrect URL, but that's unrelated to this PR.

@dominikl
Copy link
Member Author

dominikl commented Sep 2, 2019

That's a good point. The omeroinsight.log file is usually in ~/omero/log. Opening the directory from the menu option in Insight works for me.

@dominikl
Copy link
Member Author

dominikl commented Sep 2, 2019

Sorry, there's actually way more to it. The server editor / dialog still has the two cells (one for hostname and one for the port); unbelievable complex to remove that.

@mtbc
Copy link
Member

mtbc commented Sep 2, 2019

I suppose it would be too optimistic to let the port number imply the protocol?

@dominikl
Copy link
Member Author

dominikl commented Sep 2, 2019

The problem is just the UI, this server list/editor is a monster (re complexity) :-/

- A URL can now be entered as hostname
- Port can now be empty (default is set in the java gateway)
@dominikl
Copy link
Member Author

dominikl commented Sep 4, 2019

This PR got much bigger than I intended initially, now also:

@manics
Copy link
Member

manics commented Sep 5, 2019

Configuration:
Screen Shot 2019-09-05 at 16 39 11
Quit, then reload Insight. The configuration is messed up:
Screen Shot 2019-09-05 at 16 41 40

edit: just realised from the description...this PR is probably missing from the merge-ci build

@manics
Copy link
Member

manics commented Sep 5, 2019

@dominikl Can you remove the exclude comment from #66 (comment)

@dominikl
Copy link
Member Author

dominikl commented Sep 6, 2019

Argh, sorry, yes forgot about the exclude in the comment above; removed now.

@manics
Copy link
Member

manics commented Sep 9, 2019

The new functionality works well. I've got a UI issue on OS X 10.13.6 openjdk version "1.8.0_212": When + is clicked the Add new server dialogue is behind the Servers dialog:

Screen Shot 2019-09-09 at 11 50 34

@jburel
Copy link
Member

jburel commented Sep 20, 2019

This certainly allows to have the same server name with different port.
This is major change in the UI configuration.
Doc needs to be updated. The message could be added to "new server dialog"
cc @pwalczysko

@pwalczysko
Copy link
Member

Yes, but the addition of the port manually is adding a burden on each and every insight user - no user now will be able to ignore the port, it will never be prepopulated, do I get it right ? Thus, the user will have to know it is "colon 4064"
I am not sure that this is a wise move

@dominikl
Copy link
Member Author

No, if it's the default port (which probably is the case for the vast majority of the users) you don't have to enter a port, ie demo.openmicroscopy.org will do. Oh, but that reminds me about the case people entering https://demo.openmicroscopy.org, that's probably gonna mess things up now.

@@ -214,12 +204,20 @@ public void actionPerformed(ActionEvent e)
removeButton.setEnabled(!this.servers.isEmpty());
addButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String add = JOptionPane.showInputDialog(ServerEditor.this, "", "Add new server",
String add = JOptionPane.showInputDialog(ServerEditor.this,
"Enter hostname or IP address (:port as needed)\n(e.g. test.openmicroscopy.org or 192.168.0.1:1234",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the port example should be indicated when the hostname is changed. It will probably be missed when the IP is used

@pwalczysko
Copy link
Member

Screen Shot 2019-09-23 at 12 52 28

See above - some servers have ports listed, some not. This is probably because I had the list of servers "from old insight" and all these have ports explicitly listed. But, when I entered a new server (nightshade) I have not listed the port with a colon. But, the port number was not automatically added either. This could be explained in the dialog above, where it just says "Enter a new server or use existing one" - not very informatinve actually.

@pwalczysko
Copy link
Member

Screen Shot 2019-09-23 at 12 55 39

This should actually say "Connecting to" - at the moment when I am dealing with the dialog here, I am not connected yet.

@pwalczysko
Copy link
Member

Discussed with @dominikl - the solution might be to put the info in the first dialog,

Screen Shot 2019-09-23 at 13 35 36

There is space for it and maybe it can be formatted as well.
I would imagine 3 separate lines with 3 examples, introduced by
Server address can be entered as:

  1. my.server.name (default case)
  2. my.server.name:port (for non-default ports)
  3. 124.133.0.343:1245 (if you have an IP address)
  4. websocket-example (connecting via websocket)

@pwalczysko
Copy link
Member

Screen Shot 2019-09-25 at 11 11 35

That is much better, couple of further suggestions:

  • remove the e.g. , maybe replacing it by making the header to read Server address examples
  • swap the italicising of the brackets with the addresses (i.e. italicise the address examples, leave the explanations non-italics) -> see how that looks like please though
  • make either quite a few spaces between the server address and the explanation, or, even better, make it so that the explanations are indented in the same way for all 4 examples

@dominikl
Copy link
Member Author

dominikl commented Oct 23, 2019

Had to fix some more issues, hence some more tests needs to be taken:

  1. Apart from testing with an already existing list of servers, also delete (or temporary rename) your existing Insight preferences (rm -rf ~/.java/.userPrefs/org/openmicroscopy), then test again. Make sure you're connecting by default to 'localhost' (and there is exactly one entry in the serverlist 'localhost').

  2. Delete preferences again. Open the container.xml and enter a different default server.
    Check that this (and only this) server shows up as default server on the login dialog.

  3. Delete preferences again. Open the container.xml and set the configurable flag to false. Check that the specified server shows up as default, and that the 'Server Editor' button is disabled.

That's additionally to the previous tests of the actual PR, which are:

  1. Test connection to websocket URL: wss://pub-omero.openmicroscopy.org/omero-ws

  2. Test connection to normal hostname/port.

Note:
On OSX to access Insight's preferences use "Go to folder" /Users/[YOU]/Library/Preferences and delete or tmp rename the file org.openmicroscopy.shoola.plist.

- Handle case that no config doesn't exists yet
- Take default values from container.xml
- Handle case that config is set to not editable
@pwalczysko
Copy link
Member

All works as expected here. Also tested import using websocket into the pub-omero server, went fine.

Ready to merge FMPOV

@jburel
Copy link
Member

jburel commented Dec 17, 2019

Breaking UI change so this needs to go in for 5.6

@jburel
Copy link
Member

jburel commented Dec 17, 2019

@pwalczysko The import guide will need to be adjusted to indicate how to change the port.

@jburel
Copy link
Member

jburel commented Dec 17, 2019

ome/omero-guide-upload#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants