Woodbridge, Mark R wrote:
> Hi,
> 
>  
> 
> I’m linking to experiments in BASE from another web application. This 
> works fine, including automatically logging in, as long as the 
> experiment belongs to the user’s active project. I’d like to ensure that 
> the correct project is activated before the user clicks on the link. 
> Does anyone know if I can get the relevant project id from an experiment 
> id? There doesn’t seem to be an ExperimentInfo.getProject() method.

There is no such method since an experiment can belong to more than one 
project. The web service API has very limited functionality. The 
functionality that currently exists was implemented to support some 
specific use cases (mainly related to downloading data files) for a 
project that we participated in.

Using the regular BASE API you can find the projects by putting the 
experiment in a collection and then using a multi-permissions object:

Collection<Experiment> experiments = ...
MultiPermissions mp = new MultiPermissions(experiments);
ItemQuery<Project> q = mp.getProjects();
List<Project> project = q.list(dc);

The code is a bit awkward, but for some reason the obvious approach, 
Experiment.getProjectKey().getProjects(), is missing.

/Nicklas

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
basedb-devel mailing list
basedb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/basedb-devel

Reply via email to