@Test public void embeddedDatasetWithConfig() throws IOException { Dataset embeddedDataset = DatasetImporterForRSS.embeddedDatasetFor(getDatasetGroupWithProperty(), "some other citation", URI.create("http: assertThat(embeddedDataset.getCitation(), is("some other citation")); assertThat(embeddedDataset.getOrDefault(DatasetConstant.SHOULD_RESOLVE_REFERENCES, "true"), is("false")); assertThat(embeddedDataset.getArchiveURI().toString(), is("http: }
static Dataset embeddedDatasetFor(final Dataset datasetOrig, final String embeddedCitation, final URI embeddedArchiveURI) { String hasDependencies = datasetOrig.getOrDefault("hasDependencies", "false"); ObjectNode config = new ObjectMapper().createObjectNode(); config.put("citation", embeddedCitation); config.put("format", PropertyAndValueDictionary.MIME_TYPE_DWCA); config.put("url", embeddedArchiveURI.toString()); config.put(HAS_DEPENDENCIES, hasDependencies); DatasetProxy dataset = new DatasetProxy(datasetOrig) { @Override public URI getArchiveURI() { return embeddedArchiveURI; } }; dataset.setConfig(config); return dataset; }
DatasetImporterForRSS extends NodeBasedImporter { static Dataset embeddedDatasetFor(final Dataset datasetOrig, final String embeddedCitation, final URI embeddedArchiveURI) { String hasDependencies = datasetOrig.getOrDefault("hasDependencies", "false"); ObjectNode config = new ObjectMapper().createObjectNode(); config.put("citation", embeddedCitation); config.put("format", PropertyAndValueDictionary.MIME_TYPE_DWCA); config.put("url", embeddedArchiveURI.toString()); config.put(HAS_DEPENDENCIES, hasDependencies); DatasetProxy dataset = new DatasetProxy(datasetOrig) { @Override public URI getArchiveURI() { return embeddedArchiveURI; } }; dataset.setConfig(config); return dataset; } }
DatasetImporterForRSS extends NodeBasedImporter { static Dataset embeddedDatasetFor(final Dataset datasetOrig, final String embeddedCitation, final URI embeddedArchiveURI) { String hasDependencies = datasetOrig.getOrDefault("hasDependencies", "false"); ObjectNode config = new ObjectMapper().createObjectNode(); config.put("citation", embeddedCitation); config.put("format", PropertyAndValueDictionary.MIME_TYPE_DWCA); config.put("url", embeddedArchiveURI.toString()); config.put(HAS_DEPENDENCIES, hasDependencies); DatasetProxy dataset = new DatasetProxy(datasetOrig) { @Override public URI getArchiveURI() { return embeddedArchiveURI; } }; dataset.setConfig(config); return dataset; } DatasetImporterForRSS(ParserFactory parserFactory, NodeFactory nodeFactory); }
DatasetImporterForRSS extends NodeBasedImporter { static Dataset embeddedDatasetFor(final Dataset datasetOrig, final String embeddedCitation, final URI embeddedArchiveURI) { String hasDependencies = datasetOrig.getOrDefault("hasDependencies", "false"); ObjectNode config = new ObjectMapper().createObjectNode(); config.put("citation", embeddedCitation); config.put("format", PropertyAndValueDictionary.MIME_TYPE_DWCA); config.put("url", embeddedArchiveURI.toString()); config.put(HAS_DEPENDENCIES, hasDependencies); DatasetProxy dataset = new DatasetProxy(datasetOrig) { @Override public URI getArchiveURI() { return embeddedArchiveURI; } }; dataset.setConfig(config); return dataset; } DatasetImporterForRSS(ParserFactory parserFactory, NodeFactory nodeFactory); @Override void importStudy(); String getRssFeedUrlString(); static Dataset datasetFor(Dataset datasetOrig, SyndEntry entry); }
DatasetImporterForRSS extends NodeBasedImporter { static Dataset embeddedDatasetFor(final Dataset datasetOrig, final String embeddedCitation, final URI embeddedArchiveURI) { String hasDependencies = datasetOrig.getOrDefault("hasDependencies", "false"); ObjectNode config = new ObjectMapper().createObjectNode(); config.put("citation", embeddedCitation); config.put("format", PropertyAndValueDictionary.MIME_TYPE_DWCA); config.put("url", embeddedArchiveURI.toString()); config.put(HAS_DEPENDENCIES, hasDependencies); DatasetProxy dataset = new DatasetProxy(datasetOrig) { @Override public URI getArchiveURI() { return embeddedArchiveURI; } }; dataset.setConfig(config); return dataset; } DatasetImporterForRSS(ParserFactory parserFactory, NodeFactory nodeFactory); @Override void importStudy(); String getRssFeedUrlString(); static Dataset datasetFor(Dataset datasetOrig, SyndEntry entry); static final String HAS_DEPENDENCIES; }