Search in sources :

Example 1 with StudyImporterFactoryImpl

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

the class DatasetImportUtil method importDataset.

public static void importDataset(StudyImporterConfigurator studyImporterConfigurator, Dataset dataset, NodeFactory nodeFactory, ImportLogger logger, GeoNamesService geoNamesService) throws StudyImporterException {
    nodeFactory.getOrCreateDataset(dataset);
    NodeFactory nodeFactoryForDataset = new NodeFactoryWithDatasetContext(nodeFactory, dataset);
    DatasetImporter datasetImporter = new StudyImporterFactoryImpl(nodeFactoryForDataset).createImporter(dataset);
    datasetImporter.setDataset(dataset);
    if (studyImporterConfigurator != null) {
        studyImporterConfigurator.configure(datasetImporter);
    }
    if (logger != null) {
        datasetImporter.setLogger(logger);
    }
    if (geoNamesService != null) {
        datasetImporter.setGeoNamesService(geoNamesService);
    }
    datasetImporter.importStudy();
}
Also used : NodeFactory(org.eol.globi.data.NodeFactory) DatasetImporter(org.eol.globi.data.DatasetImporter) NodeFactoryWithDatasetContext(org.eol.globi.data.NodeFactoryWithDatasetContext) StudyImporterFactoryImpl(org.eol.globi.service.StudyImporterFactoryImpl)

Aggregations

DatasetImporter (org.eol.globi.data.DatasetImporter)1 NodeFactory (org.eol.globi.data.NodeFactory)1 NodeFactoryWithDatasetContext (org.eol.globi.data.NodeFactoryWithDatasetContext)1 StudyImporterFactoryImpl (org.eol.globi.service.StudyImporterFactoryImpl)1