Conversation
|
Tested with https://cowfish.openmicroscopy.org/merge/webclient/ user-3 read-only-1 The workflows all make sense and are good. Cuts out a few steps creating a figure and should make sense with use of different viewers. |
|
Before merging, I'd be up for a design discussion on this (sorry if I already missed one) similar to the API one. For example, is there any potential for allowing the registered functions to filter themselves out of a list, for example if a 3D viewer doesn't want to show up for 2D images? Do external URLs work as well or must they be installed as an app in OMERO.web? Will the menu be available for all elements in the UI or just for the images in the left-hand panel? Can we do anything with PDF file annotations or OMERO.tables down the road? |
|
Also before merging anything on |
|
Actually I wanted to have a call about it this am |
|
card https://trello.com/c/RLvGaXUK/16-list-of-available-viewer-plugins for further discussion |
|
@joshmoore There's not been a design discussion yet since this was initially considered to be a very simple "list of image viewers". In this PR I've gone a bit beyond that to support all objects that are in the left-hand tree (E.g. "dataset" in the example above). |
|
The workflow for Figure works for me as well and seems logical. I suppose the Dataset on Figure makes no sense, as it does not open anything, but I understand this is just for now and just for testing. |
|
Marking it as onhold so it is not listed. Further discussion to happen |
|
Updated description with how to use JavaScript to handle enabled status and "Open With" action. |
A possible next step for the IDR metadata, @will-moore, might be to convert the multiple map annotation rows for a gene (name, URL, identifier, etc) into a single-annotation with a given namespace. For something like this, would using the namespace and/or the contents of the map annotation be possible for triggering the open with? |
|
You could add a namespace attr to |
That'll need a design issue itself 😄 |
|
@joshmoore You'd need to have the "Open with" menu on the annotation itself, not on the parent in the tree, since the tree has no knowledge of annotations. |
|
@joshmoore With that last commit, I added experimental support for File Annotations. I've used a simple select chooser (we might want to make a nicer dropdown in due course) that uses the same 'Open With' list as in the jsTree. The json data that is passed to the Since there's quite a bit to digest here, I think the easiest would be for me to demo this to those interested and we can discuss where we go from here. cc @aleksandra-tarkowska |
|
Nice, @will-moore. Looking forward to it. |
|
@waxenegger I made |
|
@will-moore: that's working nicely. and if there is a script error in the handed in script the option is disabled which is good as well I'd say. |
|
Thinking more about making this re-usable by other apps, such as OMERO.figure. |
|
I changed the |
|
@will-moore : What impact does that change have on some of the as yet unimplemented ideas expressed earlier like #4630 (comment)? |
|
@joshmoore The last change doesn't affect extending the Open With functionality to other types or use in other places. In fact, it will make it more versatile. |
|
Updated docs at ome/omero-documentation#1543 to use |
|
Open With works perfectly within the webclient, I used both figure and viewer-ng (incl.setOpenWithUrlProvider) to open an image. I could not manage to set it up for figure as shown in ome/omero-figure#179. The only option available in the info tab was to open it in the webclient. |
|
@waxenegger I tried with your config but didn't see any problems with omero-figure. Maybe we can try again next week? |
|
no worries, perhaps I was not quite up-to-date with the code, although I did use the latest master. |
|
So, I think we are "Good to merge" on this PR. Let's move discussion of OMERO.figure open_with to ome/omero-figure#179. |
|
Sounds good @will-moore. I believe the documentation is good, in general. I like the code snippets, they helped me most. I did forget about syncing after I created a script file in the plugin which is something that I do naturally when I develop. Perhaps it's that this was more of a configuration task almost that I forgot it was necessary. People who might approach it from that direction could forget as well and think all that was needed is call set/append config although one could argue that ideally the files for open with are/should be already part of the plugin. Don't know of if a mention of restarting/syncing web is useful or not...up to you. |
|
Thanks @waxenegger I'll move your comment to the docs PR and update the docs. |
|
Merging: Further improvements can be done in subsequent PRs |


"Open With" plugins allow configuration of additional viewers etc for objects in web.
In this PR, we define the open_with setting and implement this in right-click menu of jsTree.
Docs at ome/omero-documentation#1543 are the starting point for testing this PR. More (same) details below if needed.
In the simplest case, viewers are specified as a url that takes no IDs, E.g.
webtest/myViewer/and when an image(s) is opened with the viewer, webclient will open the url aswebtest/myViewer/?image=1.This allows the
reverse(url_name)to be called without any image IDs and selected images etc can be added by JavaScript.The minimum needed to specify a viewer is "label" and "url_name".
We use
reverse(url_name)to resolve viewer.The 'Open With...' > viewer will only be enabled for single images by default and will be opened in a new window (same as standard viewer).
To allow multiple images or other objects to be opened in the viewer, the open_with config can include an options dictionary with:
supported_objects: list of supported types. E.g.["dataset", "images"]will enable the viewer when a single Dataset or 1 or more Images is selected.target: set this to"_blank"to open the viewer in a new tab (instead of new window).E.g. OMERO.figure - enabled with multiple images selected.
Further customisation can be provided by including a script with JavaScript functions to define whether the plugin is enabled (for a selected set of jsTree nodes) and how to handle the menu "action".
To test 'open with' with script. E.g. with viewer-ng installed:
omeroweb/webclient/static/webclient/viewer-ng-openwith.jswith this to provide custom Url provider:You can see the config that the webclient consumes by visiting:
webgateway/open_with/