use of omero.gateway.facility.DataManagerFacility in project imagej-omero by imagej.
the class ModuleAdapter method createOutputLinks.
/**
* Attempts to attach the outputs to the appropriate items.
*/
private void createOutputLinks(final HashMap<String, Object> inputMap, final HashMap<String, TableData> tables) throws ExecutionException, ServerError, DSOutOfServiceException, DSAccessException {
final ExperimenterData user = createUser();
final BrowseFacility browse = gateway.getFacility(BrowseFacility.class);
final DataManagerFacility dm = gateway.getFacility(DataManagerFacility.class);
final SecurityContext ctx = new SecurityContext(user.getGroupId());
final List<ImageData> outImages = getOutputImages(user.getId(), browse, ctx);
final List<ImageData> inputImages = getInputImages(inputMap, browse, ctx);
if (!outImages.isEmpty()) {
attachImagesToDatasets(inputImages, outImages, dm, browse, ctx);
}
if (!tables.isEmpty()) {
if (inputImages.isEmpty())
throw new IllegalArgumentException("Input image(s) required to upload table to OMERO");
attachTablesToImages(inputImages, tables, ctx, dm);
}
}
Aggregations