Micha Bayer wrote:
> Hi all,
> 
> I am in the final throes of adding the custom interface to the tab2mage
> importer plugin but I have one more thing to do before it all works as
> specified, and that is to set values for the experimental factors on
> each of the raw bioassays added to the experiment so they can all be
> displayed in the experiment's detail view (at the moment I am just
> getting an empty list). 
> 
> I have been looking through the API and the dev docu for this but to no
> avail. Can anyone point me in the right direction here? 
> 
> I think the raw bioassays should probably be inheriting these values
> from the Sample objects they are linked to but I figure out how to a)
 > add an annotation to a sample or any other item

Annotatable item = ...
AnnotationType at = ...
Annotation a = item.getAnnotationSet().getAnnotation(at);

// For a single annotation value
a.setValue(...);

// if it is multiple values
a.setValues(...);

> b) how to let the bioassay inherit this programmatically.

Annotatable child = ...
Annotatable parent = ...
AnnotationType at = ...
Annotation a = parent.getAnnotationSet().getAnnotation(at);

// To inherit a single annotation
child.getAnnotationSet().inheritAnnotation(a);

// To inherit all annotations
child.getAnnotationSet().inheritAnnotationSet(parent.getAnnotationSet());

/Nicklas

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
basedb-devel mailing list
basedb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/basedb-devel

Reply via email to