Search in sources :

Example 1 with DatasetImporterWithListener

use of org.eol.globi.data.DatasetImporterWithListener in project eol-globi-data by jhpoelen.

the class DatasetImportUtil method importDatasets.

public static void importDatasets(Map<Pair<String, String>, Map<String, String>> interactionsWithUnresolvedOccurrenceIds, List<Dataset> datasets, ImportLogger logger, NodeFactory nodeFactory) throws StudyImporterException {
    for (Dataset dataset : datasets) {
        try {
            importDataset(studyImporter -> {
                if (studyImporter instanceof DatasetImporterWithListener) {
                    final InteractionListenerResolving interactionListener = new InteractionListenerResolving(interactionsWithUnresolvedOccurrenceIds, ((DatasetImporterWithListener) studyImporter).getInteractionListener());
                    ((DatasetImporterWithListener) studyImporter).setInteractionListener(interactionListener);
                }
            }, dataset, nodeFactory, logger);
        } catch (StudyImporterException | IllegalStateException ex) {
            LogUtil.logError(logger, ex);
        }
    }
}
Also used : StudyImporterException(org.eol.globi.data.StudyImporterException) Dataset(org.globalbioticinteractions.dataset.Dataset) DatasetImporterWithListener(org.eol.globi.data.DatasetImporterWithListener)

Aggregations

DatasetImporterWithListener (org.eol.globi.data.DatasetImporterWithListener)1 StudyImporterException (org.eol.globi.data.StudyImporterException)1 Dataset (org.globalbioticinteractions.dataset.Dataset)1