We're Hiring!

webgateway, listProjects_json and switch user

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.

webgateway, listProjects_json and switch user

Postby elmbeech » Wed Aug 24, 2016 3:40 pm

hi There,

I use the web getaway to communicate with our local omero installation.
in our local installation i am a member of the heierlab group, which is owned by the heiserlab user.
I have no own project, but I would like to do analysis of heierlab group projets.

unfortunately, when I utilize a method like:
https://my_host/webgateway/proj/list/
I get a empty JSON list [] back.

the reason I guess is, that I somehow should switch to user heierlab to be able to get the project listed.
i think this is the reasen, because in the listProjects_json documentation
(https://downloads.openmicroscopy.org/om ... teway.urls)
is written: json method, returning list of all projects available to current user.

I tried to use omeroweb.webgateway.urls.webgateway_su (https://my_host/webgateway/su/hesierlab/) to switch to the heiserlab user.
with out success. I guess this is because I am not an admin but just a member of the heierlab group.

is there a webgateway way to get this working?
any hint is appreciated.

thank you,
Elmar
elmbeech
 
Posts: 3
Joined: Tue Aug 23, 2016 6:51 pm

Re: webgateway, listProjects_json and switch user

Postby wmoore » Thu Aug 25, 2016 9:22 am

Hi Elmar,

What version of OMERO are you using?
What are the permissions on the heiserlab group?

The /webgateway/proj/list url certainly should list all the Projects that are available to you in all your groups (including Projects belonging to other users).

If you create a Project yourself, does this show up in the json list?

Regards,

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

Re: webgateway, listProjects_json and switch user

Postby elmbeech » Thu Aug 25, 2016 8:02 pm

hi Will,

thank you for this prompt answer!
we are running OMERO 5.2.5 and the group has rwra-- rights.
however, I am still quit new to omero.
in the meanwhile I found out more about the Project / Dataset / Screen "hierarchy".
and I found out that we here locally only make use of Screen and the Screen / Plate / Well / Image hierarchy.
so, no wonder that https://my_host/webgateway/proj/list/ returns an empty [] JSON list!
this problem is solved.

but the API is still not working as expected.
according to the webclient, a plate_id of interest is for example 1101.

when I enter:
https://my_host/webgateway/annotations/plate/1101/
i get the following answer:
{"query": "select obj0 from plate obj0\n\n left outer join fetch obj0.annotationLinks links\n left outer join fetch links.child\n join fetch links.details.owner\n join fetch links.details.creationEvent\n where obj0.id=:id", "error": "[u'plate'] cannot be queried"}

when I enter:
https://my_host/webgateway/annotations/Plate/1101/
i get the following answer:
{"query": "select obj0 from late obj0\n\n left outer join fetch obj0.annotationLinks links\n left outer join fetch links.child\n join fetch links.details.owner\n join fetch links.details.creationEvent\n where obj0.id=:id", "error": "[u'Plate'] with id 1101 not found"}

because of the "error" statements I conclude that "Plate" is a valid <objtype> where as "plate" is not.
anyhow, the database query seems somehow not to find any annotation.
I assume, some annotation should be found anyway, as this plate / plate_id via webclient clearly exist. is this assumption wrong? or where am I doing the mistake?
additionally, is there somewhere a list of valid objtypes? it is hard to figure them out by try and error.

there are some really nice "commands" like imgData and wellData.
unfortunately seems plateData and screenData not yet to be implemented, but those would exactly the command I am looking for : ).

above all, I really enjoy to work with omero so far.
maybe you have some insights about the new emerged questions. so I would be happy to hear them.

thank you once again,
Elmar
elmbeech
 
Posts: 3
Joined: Tue Aug 23, 2016 6:51 pm

Re: webgateway, listProjects_json and switch user

Postby wmoore » Fri Aug 26, 2016 10:12 am

Hi Elmar,

I'm afraid that the webgateway api really just provides for the webgateway image viewer, which only supports display of OMERO.table data (annotations) so other types of annotations are not returned by that url. Apologies for the confusion.

You'll need to use the webclient url:
```
/webclient/api/annotations/?type=tag&plate=353
```
Supported objects for this url are:
project, dataset, image, screen, plate, acquisition.
Annotation types are:
tag, file, comment, rating, map and 'custom' (everything else)
OR, don't use any 'type' filter if you want all annotations.

Just a warning: The 'webclient' api is not considered "public" in the same way as webgateway (hence the lack of docs etc). Also it is not guaranteed to be unchanged for minor (point) releases.

However, the next release is a major release (5.3.0) and we are currently working on a new json API that will be much more feature-complete.


To get json data for a plate, you can use
/webgateway/plate/:plateId/:fieldIndex/

E.g. /webgateway/plate/103/0/ to get the plate data for first field of plate 103.

This is what the webclient uses for displaying Plates.

For Screen data I'm afraid you need to use the webclient api again:
This will list all the "Top Level" objects in the webclient 'tree'. E.g. 'projects', 'datasets', 'screens', 'plates' (Plates that are not under Screens). Optional filter by group:

/webclient/api/containers/?group=5

Then you can use this to list Plates (id filters Plates by parent Screen ID)

/webclient/api/plates/?id=701

Hope that helps.
Regards,

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

Re: webgateway, listProjects_json and switch user

Postby elmbeech » Sat Aug 27, 2016 4:57 am

hi Will,

thank you for all the detailed answers.
this helps a lot!
I can definitely solves now all of the omero challenges I was at the moment facing.
for the future I am looking forward to the JSON api.

best whishes,
Elmar
elmbeech
 
Posts: 3
Joined: Tue Aug 23, 2016 6:51 pm


Return to Developer Discussion

Who is online

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

cron