Search in sources :

Example 1 with DatasetProxy

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

the class StudyImporterForMetaTable method importStudy.

@Override
public void importStudy() throws StudyImporterException {
    try {
        for (JsonNode tableConfig : collectTables(dataset)) {
            Dataset datasetProxy = new DatasetProxy(dataset);
            datasetProxy.setConfig(tableConfig);
            InteractionListenerImpl interactionListener = new InteractionListenerImpl(nodeFactory, getGeoNamesService(), getLogger());
            final InteractionListener listener = new TableInteractionListenerProxy(datasetProxy, interactionListener);
            importTable(listener, new TableParserFactoryImpl(), tableConfig, datasetProxy, getLogger());
        }
    } catch (IOException | NodeFactoryException e) {
        throw new StudyImporterException("problem importing from [" + getBaseUrl() + "]", e);
    }
}
Also used : Dataset(org.eol.globi.service.Dataset) JsonNode(org.codehaus.jackson.JsonNode) IOException(java.io.IOException) DatasetProxy(org.eol.globi.service.DatasetProxy)

Example 2 with DatasetProxy

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

the class StudyImporterForArthopodEasyCapture method embeddedDatasetFor.

static Dataset embeddedDatasetFor(Dataset datasetOrig, String embeddedCitation, URI embeddedArchiveURI) {
    ObjectNode config = new ObjectMapper().createObjectNode();
    config.put("citation", embeddedCitation);
    ObjectNode referencesNode = new ObjectMapper().createObjectNode();
    referencesNode.put("archive", embeddedArchiveURI.toString());
    config.put("resources", referencesNode);
    DatasetProxy dataset = new DatasetProxy(datasetOrig);
    dataset.setConfig(config);
    return dataset;
}
Also used : ObjectNode(org.codehaus.jackson.node.ObjectNode) ObjectMapper(org.codehaus.jackson.map.ObjectMapper) DatasetProxy(org.eol.globi.service.DatasetProxy)

Aggregations

DatasetProxy (org.eol.globi.service.DatasetProxy)2 IOException (java.io.IOException)1 JsonNode (org.codehaus.jackson.JsonNode)1 ObjectMapper (org.codehaus.jackson.map.ObjectMapper)1 ObjectNode (org.codehaus.jackson.node.ObjectNode)1 Dataset (org.eol.globi.service.Dataset)1