From 3c370a1d36c4470de867bba7c69dda1b8a08eee0 Mon Sep 17 00:00:00 2001 From: Pierre Pouchin Date: Wed, 1 Mar 2023 00:41:23 +0100 Subject: [PATCH] Fix copyAnnotationLinks for folders and plate acquisitions (#52) * Fix copyAnnotations for PlateAcquisitionWrapper and FolderWrapper --- pom.xml | 2 +- src/main/java/fr/igred/omero/repository/FolderWrapper.java | 6 +++--- .../fr/igred/omero/repository/PlateAcquisitionWrapper.java | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index fc9ca888..822f3200 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ fr.igred simple-omero-client - 5.12.0 + 5.12.1 jar Simple OMERO Client diff --git a/src/main/java/fr/igred/omero/repository/FolderWrapper.java b/src/main/java/fr/igred/omero/repository/FolderWrapper.java index b95e08e3..7635da06 100644 --- a/src/main/java/fr/igred/omero/repository/FolderWrapper.java +++ b/src/main/java/fr/igred/omero/repository/FolderWrapper.java @@ -20,13 +20,13 @@ import fr.igred.omero.Client; import fr.igred.omero.GenericObjectWrapper; -import fr.igred.omero.annotations.GenericAnnotationWrapper; import fr.igred.omero.exception.AccessException; import fr.igred.omero.exception.ExceptionHandler; import fr.igred.omero.exception.OMEROServerError; import fr.igred.omero.exception.ServiceException; import fr.igred.omero.roi.ROIWrapper; import omero.gateway.facility.ROIFacility; +import omero.gateway.model.AnnotationData; import omero.gateway.model.DataObject; import omero.gateway.model.FolderData; import omero.gateway.model.ROIData; @@ -128,10 +128,10 @@ protected String annotationLinkType() { * @throws ExecutionException A Facility can't be retrieved or instantiated. */ @Override - public > void link(Client client, A annotation) + protected void link(Client client, A annotation) throws ServiceException, AccessException, ExecutionException { FolderAnnotationLink link = new FolderAnnotationLinkI(); - link.setChild(annotation.asDataObject().asAnnotation()); + link.setChild(annotation.asAnnotation()); link.setParent(data.asFolder()); client.save(link); } diff --git a/src/main/java/fr/igred/omero/repository/PlateAcquisitionWrapper.java b/src/main/java/fr/igred/omero/repository/PlateAcquisitionWrapper.java index 0180a057..35fd2feb 100644 --- a/src/main/java/fr/igred/omero/repository/PlateAcquisitionWrapper.java +++ b/src/main/java/fr/igred/omero/repository/PlateAcquisitionWrapper.java @@ -20,10 +20,10 @@ import fr.igred.omero.Client; import fr.igred.omero.GenericObjectWrapper; -import fr.igred.omero.annotations.GenericAnnotationWrapper; import fr.igred.omero.exception.AccessException; import fr.igred.omero.exception.OMEROServerError; import fr.igred.omero.exception.ServiceException; +import omero.gateway.model.AnnotationData; import omero.gateway.model.PlateAcquisitionData; import omero.model.PlateAcquisitionAnnotationLink; import omero.model.PlateAcquisitionAnnotationLinkI; @@ -137,10 +137,10 @@ public void setDescription(String description) { * @throws ExecutionException A Facility can't be retrieved or instantiated. */ @Override - public > void link(Client client, A annotation) + protected void link(Client client, A annotation) throws ServiceException, AccessException, ExecutionException { PlateAcquisitionAnnotationLink link = new PlateAcquisitionAnnotationLinkI(); - link.setChild(annotation.asDataObject().asAnnotation()); + link.setChild(annotation.asAnnotation()); link.setParent((omero.model.PlateAcquisition) data.asIObject()); client.save(link); }