Search in sources :

Example 1 with DataManagerFacility

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);
    }
}
Also used : ExperimenterData(omero.gateway.model.ExperimenterData) ImageData(omero.gateway.model.ImageData) SecurityContext(omero.gateway.SecurityContext) DataManagerFacility(omero.gateway.facility.DataManagerFacility) BrowseFacility(omero.gateway.facility.BrowseFacility)

Aggregations

SecurityContext (omero.gateway.SecurityContext)1 BrowseFacility (omero.gateway.facility.BrowseFacility)1 DataManagerFacility (omero.gateway.facility.DataManagerFacility)1 ExperimenterData (omero.gateway.model.ExperimenterData)1 ImageData (omero.gateway.model.ImageData)1