From b17800fbd7b9cf64d3e0a7c5ad5e15b65903ab42 Mon Sep 17 00:00:00 2001 From: mbrodhu <brodhun@sub.uni-goettingen.de> Date: Fri, 23 Sep 2016 15:53:22 +0200 Subject: [PATCH] new version, cursorSize configurable --- oaipmh-core/TODO | 6 +++--- oaipmh-core/pom.xml | 2 +- .../textgrid/middleware/RecordListDeliverer.java | 12 ++++++++++-- oaipmh-webapp/pom.xml | 2 +- oaipmh-webapp/src/main/webapp/WEB-INF/beans.xml | 1 + pom.xml | 2 +- 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/oaipmh-core/TODO b/oaipmh-core/TODO index e9522f96..64694748 100644 --- a/oaipmh-core/TODO +++ b/oaipmh-core/TODO @@ -1,22 +1,22 @@ 1. change identifier from 123.0 to textgrid:123.0 in all/the getRecord requests, must be equal to the identifiers we get with the getIdentifiers() method - DONE 2. implement sets (for the prootype :) - DONE 3. implement resumption tokens (later) - +DONE 4. remove "yo" in class RecordDeliverer :-) +DONE 5. DONE :D 6. Fetch earliestTimestamp from ElasticSearch? +DONE diff --git a/oaipmh-core/pom.xml b/oaipmh-core/pom.xml index c8fe00a7..cb3f98ef 100644 --- a/oaipmh-core/pom.xml +++ b/oaipmh-core/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>oaipmh</artifactId> <groupId>info.textgrid.middleware</groupId> - <version>2.5.3-SNAPSHOT</version> + <version>2.5.4-SNAPSHOT</version> </parent> <groupId>info.textgrid.middleware</groupId> <artifactId>oaipmh-core</artifactId> diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordListDeliverer.java b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordListDeliverer.java index e384d2fb..d1e9a73d 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordListDeliverer.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordListDeliverer.java @@ -109,7 +109,7 @@ public class RecordListDeliverer { private static Map<String, Integer> cursorCollector = new Hashtable<String, Integer >(); - long searchResponseSize = 10; + private long searchResponseSize; BigInteger valueToAdd = BigInteger.valueOf(searchResponseSize); ResumptionTokenType resTokenForResponse = new ResumptionTokenType(); @@ -284,7 +284,7 @@ public class RecordListDeliverer { }else { System.out.println("NO RESTOKEN FOUND"); resTokenForResponse.setCursor(BigInteger.valueOf((int)searchResponseSize)); - cursorCollector.put(scrollResp.getScrollId(), (int)searchResponseSize + 90); + cursorCollector.put(scrollResp.getScrollId(), (int)searchResponseSize); System.out.println(cursorCollector.get(scrollResp.getScrollId())); //System.out.println("withOUTtoken" + cursorCollector.get(resumptionToken) + (int)searchResponseSize); } @@ -754,6 +754,14 @@ public class RecordListDeliverer { public void setIdentifierField(String identifierField) { this.identifierField = identifierField; } + + public long getSearchResponseSize() { + return searchResponseSize; + } + + public void setIdentifierField(long searchResponseSize) { + this.searchResponseSize = searchResponseSize; + } diff --git a/oaipmh-webapp/pom.xml b/oaipmh-webapp/pom.xml index 2d8d62d1..a7866a8c 100644 --- a/oaipmh-webapp/pom.xml +++ b/oaipmh-webapp/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>oaipmh</artifactId> <groupId>info.textgrid.middleware</groupId> - <version>2.5.3-SNAPSHOT</version> + <version>2.5.4-SNAPSHOT</version> </parent> <groupId>info.textgrid.middleware</groupId> <artifactId>oaipmh-webapp</artifactId> diff --git a/oaipmh-webapp/src/main/webapp/WEB-INF/beans.xml b/oaipmh-webapp/src/main/webapp/WEB-INF/beans.xml index f4f077d0..98d3c61a 100644 --- a/oaipmh-webapp/src/main/webapp/WEB-INF/beans.xml +++ b/oaipmh-webapp/src/main/webapp/WEB-INF/beans.xml @@ -109,6 +109,7 @@ <property name="types" value="${typeList}" /> <property name="modifiedField" value="${modifiedField}" /> <property name="identifierField" value="${identifierField}" /> + <property name="searchResponseSize" value="${cursorSize}" /> </bean> <bean id="Record" class="info.textgrid.middleware.RecordDeliverer"> diff --git a/pom.xml b/pom.xml index 1513b829..c03e0d29 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>info.textgrid.middleware</groupId> <artifactId>oaipmh</artifactId> - <version>2.5.3-SNAPSHOT</version> + <version>2.5.4-SNAPSHOT</version> <packaging>pom</packaging> <name>DARIAHDE :: OAI-PMH DataProvider</name> <properties> -- GitLab