Page 1 of 1

webgateway, listProjects_json and switch user

PostPosted: Wed Aug 24, 2016 3:40 pm
by elmbeech
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

Re: webgateway, listProjects_json and switch user

PostPosted: Thu Aug 25, 2016 9:22 am
by wmoore
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.

Re: webgateway, listProjects_json and switch user

PostPosted: Thu Aug 25, 2016 8:02 pm
by elmbeech
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

Re: webgateway, listProjects_json and switch user

PostPosted: Fri Aug 26, 2016 10:12 am
by wmoore
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.

Re: webgateway, listProjects_json and switch user

PostPosted: Sat Aug 27, 2016 4:57 am
by elmbeech
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