Page 1 of 1

Iterating over groups, experimenters and projects

PostPosted: Thu Mar 10, 2011 2:22 pm
by Hawkes
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!

Re: Iterating over groups, experimenters and projects

PostPosted: Tue Mar 15, 2011 6:37 am
by jburel
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

Re: Iterating over groups, experimenters and projects

PostPosted: Sun Mar 20, 2011 4:26 pm
by Hawkes
Hi,

that helped a lot :) Thank you very much.