thanks Jmaria.
Exactly following your guide causes <long> type problem, so I modify a little bit:
IMetadataPrx metadataService = myEntry.getMetadataService();
ArrayList imageIds = new ArrayList();
Long image1 = Long.valueOf(1227); // image 1 with some tags;
Long image2 = Long.valueOf(1247); // image 2 without tags;
imageIds.add( image1);
imageIds.add( image2);
ArrayList annotationTypes = new ArrayList();
annotationTypes.add( (String)(""ome.model.annotations.TagAnnotation""));
ArrayList annotatorIds =new ArrayList();
Parameters parameters = new Parameters();
String rootType = "Image";
Map <Long, List <IObject> > idSetMap = metadataService.loadAnnotations(rootType, imageIds, annotationTypes, annotatorIds, parameters);
Iterator <Long> itr = idSetMap.keySet().iterator();
String tag_value = "";
String tag_descrp ="";
System.out.print("meta data: .\n\n");
while (itr.hasNext())
{
Long ids = (Long) itr.next();
System.out.print("image id is :"+Long.toString(ids)+"*.\n\n");
Iterator <IObject> j = idSetMap.get(ids).iterator();
while (j.hasNext())
{
String tag_= j.next().getClass().getName();
System.out.print("iobject class name :"+tag_ +"*.\n\n");
// TagAnnotation tag = (TagAnnotation) j.next();
}//
Here is the output :
meta data: .
image id is :1247*.
image id is :1227*.
iobject class name
mero.model.TagAnnotationI*.
iobject class name
mero.model.TagAnnotationI*.
IF ' TagAnnotation tag = (TagAnnotation) j.next(); ' is activated, then error comes up as
inconvertible types
found : omero.model.IObject
required: ome.model.annotations.TagAnnotation
TagAnnotation tag = (TagAnnotation) j.next();
^
.
can you help me further on this? thanks a lot.
jiez