We're Hiring!

Batch download of 'public' data & scripts.

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Re: Batch download of 'public' data & scripts.

Postby wmoore » Thu Mar 27, 2014 10:56 am

I can maybe answer the first two bullet points:

In general, you can restrict what the public user can access via a regex filter on urls.
Here is a little script you can use to test regexes: https://gist.github.com/will-moore/8315580
It has an example regex that will restrict access to urls for running scripts,
creating Projects & Datasets etc.
The script also prints out the command you need to enter in the OMERO command line to configure this.

If you want to allow particular functions, it may be possible to achieve this simply with the regex alone if there is a unique url for it. However, if you need something a bit more flexible - E.g. allowing only particular scripts to be run, you probably need to add urls and views.py code to handle this.

An example of this is the ome_tiff_script: https://github.com/openmicroscopy/openm ... s.py#L2751

This provides a url that you can then allow via the regex. You'd probably also want to provide a link or a dialog where the user can launch the script and start the Activities polling for script completion (javascript: OME.showActivities(); will do this in the main window).

It's worth bearing in mind that these scripts were not designed with public use in mind. The OME-TIFF UI attempts to check if anyone has already created an OME-TIFF for the chosen image and offers a download if they have, but this approach is not particularly robust.
We also don't have any way of deleting the OME-TIFF after download, so disk space will get used up. It's only been tested on a small scale and might need a bit more work to make it 'production ready'.

Anyway, I hope this is helpful info.

Cheers,

Will.
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm

Re: Batch download of 'public' data & scripts.

Postby jmoore » Tue Apr 01, 2014 7:31 pm

The third bullet is also essentially doable, but the trick will be having the UI show the right list of scripts to the public user. I.e. the front-end query will need to match the back-end (processor) query, which would take some investigation.

Cheers,
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Batch download of 'public' data & scripts.

Postby wmoore » Tue Apr 01, 2014 8:10 pm

After discussion with Ian, we realised that we don't need scripts to 'batch download' original files (only need scripts for OME-TIFF export).
PR is opened at http://github.com/openmicroscopy/openmi ... ssues/2220

Limitation is going to be the size of the zips that could be created when you try to download a reasonable number of large images. Will be easy to reach multi-GB.

Maybe we could add a configuration for the maximum size of zip download?

Will.
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm

Previous

Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest