We're Hiring!

Iterating over groups, experimenters and projects

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.

Iterating over groups, experimenters and projects

Postby Hawkes » Thu Mar 10, 2011 2:22 pm

Hello,

I'm currently trying to access our OMERO server from another Java application using your API. I didn't find much documentation in the wiki so I'm trying to learn how to use it by reading the code of the ImageJ plugin.

I've succeeded in accessing the server and retrieving all images inside all accessible groups of the current user which is my main objective. Now I want to access some meta information of these images but using getOwner().getUserName() on the ProjectData objects returns null values as this information seems to be unloaded. The important codebit to access all projects is
Code: Select all
public Collection loadProjects() throws DSAccessException,
            DSOutOfServiceException {
        ParametersI p = new ParametersI();
        p.allExps();
        p.allGrps();
        return gateway.loadContainerHierarchy(ProjectData.class, null, p);
    }


Now I'm stuck loading this information (group name and experimenter name). I hope somebody could give me a hint on how to achieve this.

Thank you in advance!
Hawkes
 
Posts: 2
Joined: Thu Mar 10, 2011 1:54 pm

Re: Iterating over groups, experimenters and projects

Postby jburel » Tue Mar 15, 2011 6:37 am

Good Morning
Details about owner are not loaded in that call, this will require a change in the implementation of the service (server side).
You may want to load the groups and the experimenters with in a group. Note that an experimenter can be in multiple groups.
Have a look at the
Code: Select all
List<GroupData> loadGroups(long id)
in the OMEROGateway (insight code, not ImageJ plugin). This method loads the groups and the experimenters.

Depending on the presentation you wish to achieve, you may want to first load the groups then
load the projects per group by setting only the groupID i.e. p.grp()
It might be then easier to organise the projects per owner.

Jmarie
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee

Re: Iterating over groups, experimenters and projects

Postby Hawkes » Sun Mar 20, 2011 4:26 pm

Hi,

that helped a lot :) Thank you very much.
Hawkes
 
Posts: 2
Joined: Thu Mar 10, 2011 1:54 pm


Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 1 guest