DatasetMapper.fillListAnnotatedImages(dataset, retVal, l, uc.getUserID(), images);
DatasetMapper.fillListAnnotatedImages(dataset, retVal, l, images);
    public List retrieveImagesWithAnnotations(int datasetID,                                             ImageSummary retVal)        throws DSOutOfServiceException, DSAccessException    {        //Create a new dataObject if none provided.        //Object used as prototype.        if (retVal == null) retVal = new ImageSummary();        //Define the criteria by which the object graph is pulled out.        List datasetIDs = new ArrayList();        datasetIDs.add(new Integer(datasetID));        Criteria c = DatasetMapper.buildImagesCriteria(datasetIDs);        //Load the graph defined by criteria.        Dataset dataset = (Dataset) gateway.retrieveData(Dataset.class, c);        //List of image summary object.        List images = new ArrayList();        //Put the server data into the corresponding client object.        if (dataset == null) return images;        //Retrieve the user ID.        UserCredentials uc = (UserCredentials)                            registry.lookup(LookupNames.USER_CREDENTIALS);        List ids = DatasetMapper.prepareListImagesID(dataset);        c = AnnotationMapper.buildImageAnnotationCriteria(ids);        if (ids != null && ids.size() != 0) {            List l = (List) gateway.retrieveListSTSData("ImageAnnotation",                                     c);            DatasetMapper.fillListAnnotatedImages(dataset, retVal, l,                                 uc.getUserID(), images);        }          return images;    }