Changed get resources from virtual collection to corpus.
Change-Id: I7c2448305220a544328c207c28995484d525dbcb
diff --git a/src/main/java/de/mannheim/ids/korap/sru/KorapClient.java b/src/main/java/de/mannheim/ids/korap/sru/KorapClient.java
index d3ad13c..f9f560f 100644
--- a/src/main/java/de/mannheim/ids/korap/sru/KorapClient.java
+++ b/src/main/java/de/mannheim/ids/korap/sru/KorapClient.java
@@ -99,8 +99,7 @@
public JsonNode retrieveResources ()
throws URISyntaxException, IOException {
- URIBuilder builder = new URIBuilder(SERVICE_URI + "VirtualCollection");
- // builder.addParameter("type", "VirtualCollection");
+ URIBuilder builder = new URIBuilder(SERVICE_URI + "Corpus");
URI uri = builder.build();
logger.info("Resource URI: " + uri.toString());
HttpGet httpRequest = new HttpGet(uri);
diff --git a/src/main/java/de/mannheim/ids/korap/sru/KorapSRU.java b/src/main/java/de/mannheim/ids/korap/sru/KorapSRU.java
index 706f312..534ca1d 100644
--- a/src/main/java/de/mannheim/ids/korap/sru/KorapSRU.java
+++ b/src/main/java/de/mannheim/ids/korap/sru/KorapSRU.java
@@ -167,7 +167,10 @@
for (DataView dv : korapEndpointDescription
.getSupportedDataViews()) {
if (dv.getIdentifier().equals(requestDataview)) {
- dataviews.add(requestDataview);
+ if (!dataviews.contains(requestDataview)){
+ dataviews.add(requestDataview);
+ }
+ return dataviews;
}
}
diagnostics.addDiagnostic(
diff --git a/src/main/resources/.gitignore b/src/main/resources/.gitignore
new file mode 100644
index 0000000..34f1d0b
--- /dev/null
+++ b/src/main/resources/.gitignore
@@ -0,0 +1 @@
+/kustvakt.conf
diff --git a/src/test/java/de/mannheim/ids/korap/test/KorapClientTest.java b/src/test/java/de/mannheim/ids/korap/test/KorapClientTest.java
index 0f57674..21a9642 100644
--- a/src/test/java/de/mannheim/ids/korap/test/KorapClientTest.java
+++ b/src/test/java/de/mannheim/ids/korap/test/KorapClientTest.java
@@ -51,9 +51,7 @@
public void testResource () throws HttpResponseException, Exception {
JsonNode resources = c.retrieveResources();
- assertEquals(3, resources.size());
- assertEquals("Weimarer Werke", resources.get(0).get("name"));
- assertEquals("Aphorismen", resources.get(0).get("name"));
- assertEquals("Werther", resources.get(0).get("name"));
+ assertEquals(1, resources.size());
+ assertEquals("Wikipedia", resources.get(0).get("name").asText());
}
}