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

Script gui file upload #6096

Closed
wants to merge 4 commits into from

Conversation

will-moore
Copy link
Member

See #6095

Currently, some scripts that require a File use the convention of a parameter named File_Annotation to allow the user to choose a previously created FileAnnotation ID.

This PR adds a File chooser input to parameter named File_Annotation which allows users to pick a local file from the Run-Script dialog in webclient. This will be used to create a File Annotation in OMERO and the ID will be passed to the File_Annotation script parameter.

To test:

Screen Shot 2019-08-02 at 23 53 57

  • This will allow you to pick a local File to upload
  • When the script is run, a new FileAnnotation is created in OMERO (not linked to anything) and the ID is passed to the File_Annotation script parameter (so the script should work as expected)

@jburel
Copy link
Member

jburel commented Aug 3, 2019

The upload is not specifically for file annotation.
The script they are writing is to import an image
so we will need a new type I think

@will-moore
Copy link
Member Author

This would work for an image file too.
The only limitation is that this supports just 1 file per script (since you can only have 1 File_Annotation parameter).
However, it is still a big improvement to the usability of scripts with a File Annotation parameter. Previously, users had to know to create a File Annotation before-hand and to know how to pick it. Now, users can use this with no other instructions or preparation.

@jburel
Copy link
Member

jburel commented Aug 3, 2019

I mean an image to import not an image as an attachment
I can image the script in that case uploading the file to dropbox
this will only work for single file image

@will-moore
Copy link
Member Author

OK, so after reading https://forum.image.sc/t/file-browser-in-omero-script-gui/28117 more carefully I see what's wanted is a UI for browsing a drive mounted on the server.
But regardless, this PR is useful for the workflow described above.

@rgozim
Copy link
Member

rgozim commented Aug 6, 2019

Tested and works fine.

@jburel
Copy link
Member

jburel commented Aug 6, 2019

  • Select populate metadata
  • Choose a file. I deliberately selected a non CSV file.
  • Click Run script. The button is greyed out but nothing happens. The dialog does not close. Nothing in the activity.
    Feedback should be given if the type is not supported. Ideally the dialog used to select the file should only allow to upload the supported type if specified.

@will-moore
Copy link
Member Author

@jburel We have no way for the script to tell the UI script dialog about which files are supported.
This PR does not change the handling of files but is simply a short-cut to populating the existing File_Annotation input (which simply accepts an ID).
I don't know what the issue you had with the script dialog, but it wasn't caused by you picking a non CSV file since the file would not have been opened until the script started running on the server.

@will-moore
Copy link
Member Author

Ported to ome/omero-web#128

@will-moore will-moore closed this Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude transfer Migrate to another repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants