diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/IdentifierListDelivererAbstract.java b/oaipmh-core/src/main/java/info/textgrid/middleware/IdentifierListDelivererAbstract.java index 53c51563491ae2928fee1851fd69c4f874c207a7..94a774d6b5ab8b1a29102f3dbcc4a9abcf8614a9 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/IdentifierListDelivererAbstract.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/IdentifierListDelivererAbstract.java @@ -27,7 +27,7 @@ import org.elasticsearch.search.builder.SearchSourceBuilder; import info.textgrid.middleware.oaipmh.ListIdentifiersType; import info.textgrid.middleware.oaipmh.RequestType; import info.textgrid.middleware.oaipmh.ResumptionTokenType; -import info.textgrid.namespaces.middleware.tgcrud.common.TextGridMimetypes; +import info.textgrid.middleware.common.TextGridMimetypes; /** * diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/IdentifierListDelivererDC.java b/oaipmh-core/src/main/java/info/textgrid/middleware/IdentifierListDelivererDC.java index 56d9d4024a50f8799eafc9e7bc0f092f22b66a76..3df314a6925c19f412a05f132b72340398833961 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/IdentifierListDelivererDC.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/IdentifierListDelivererDC.java @@ -22,7 +22,7 @@ import org.elasticsearch.search.fetch.subphase.FetchSourceContext; import info.textgrid.middleware.oaipmh.HeaderType; import info.textgrid.middleware.oaipmh.ListIdentifiersType; import info.textgrid.middleware.oaipmh.ResumptionTokenType; -import info.textgrid.namespaces.middleware.tgcrud.common.TextGridMimetypes; +import info.textgrid.middleware.common.TextGridMimetypes; /** diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/OAIPMHImpl.java b/oaipmh-core/src/main/java/info/textgrid/middleware/OAIPMHImpl.java index 4edbd9b2c0c1e3e850e1191c412dfb2f29631d0d..e8d3f3c5d4830c59126ff192f3743676f507a5f5 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/OAIPMHImpl.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/OAIPMHImpl.java @@ -504,12 +504,12 @@ public class OAIPMHImpl implements OAIPMHProducer { && RecordListDelivererDC.cursorCollector.containsKey(request.getResumptionToken()); boolean restokIDIOMExisting = RecordListDelivererIDIOM.cursorCollector != null && RecordListDelivererIDIOM.cursorCollector.containsKey(request.getResumptionToken()); -<<<<<<< HEAD - -======= +//<<<<<<< HEAD +// +//======= boolean restokOpenAireExisting = RecordListDelivererAbstract.cursorCollector != null && RecordListDelivererAbstract.cursorCollector.containsKey(request.getResumptionToken()); ->>>>>>> feature/elastic6 +//>>>>>>> feature/elastic6 if (restokDCExisting) { recListDeliv = this.recordListDC; } else if (restokIDIOMExisting) { diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/OAIPMHUtilities.java b/oaipmh-core/src/main/java/info/textgrid/middleware/OAIPMHUtilities.java index 14e0b94fbf07e18cd657aa01e03f226d8ee15161..ec8064c850509e7ced4a3f2e32bc7b5fdc56b354 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/OAIPMHUtilities.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/OAIPMHUtilities.java @@ -61,7 +61,7 @@ import info.textgrid.middleware.oaipmh.RecordType; import info.textgrid.middleware.oaipmh.Resource; import info.textgrid.middleware.oaipmh.ResumptionTokenType; import info.textgrid.namespaces.middleware.tgauth.ProjectInfo; -import info.textgrid.namespaces.middleware.tgcrud.common.TextGridMimetypes; +import info.textgrid.middleware.common.TextGridMimetypes; /** * <p> @@ -245,66 +245,66 @@ public class OAIPMHUtilities { * @return A resumption token if applicable, null otherwise. */ public static ResumptionTokenType getResumptionToken(final long completeListSize, -<<<<<<< HEAD - final String resumptionToken, Map<String, Integer> cursorCollector, final String scrollID, - final int searchResponseSize, final int i) { - - log.info("Creating a ResumptionToken:\n " + - "CompleteListSize: " + completeListSize + "\n" + - "ResumptionToken: " + resumptionToken + "\n" + - "CursorCollector: " + cursorCollector + "\n" + - "ScrollID: " + scrollID + "\n" + - "SearchResponseSize: " + scrollID + "\n" + - "IterationStep: " + i); - - int cursor; - - // Three cases here: - // 1. Complete list size is > searchResponseSize and a token already is existing: we need to - // check hash map! - // 2. Complete list size is > searchResponseSize and we have no token: we do need one! - // 3. Complete list size is <= searchResponseSize (we do not need a token! do nothing!) - - if (completeListSize > searchResponseSize) { - ResumptionTokenType resTokenForResponse = new ResumptionTokenType(); - - if (resumptionToken != null && cursorCollector.containsKey(resumptionToken)) { - cursor = cursorCollector.get(resumptionToken).intValue() + i; - if(cursor-searchResponseSize == 0) { - cursor *= 2; - } - resTokenForResponse.setCursor(BigInteger.valueOf((long) cursor)); - cursorCollector.put(scrollID, cursor); - } else { - resTokenForResponse.setCursor(BigInteger.valueOf(searchResponseSize)); - cursorCollector.put(scrollID, searchResponseSize); - cursor = searchResponseSize; - resTokenForResponse.setCursor(BigInteger.valueOf((long) cursor)); - - } - - // Set resumption token string if cursor is less then complete list size: More objects can be - // delivered! - if (cursor < completeListSize) { - resTokenForResponse.setValue(scrollID); - } - - // Remove resumption token string if cursor is bigger then or equal complete list size: This - // is the last response, no more objects are available! - if (cursor >= completeListSize) { - //cursor =; - resTokenForResponse.setValue(""); - } - - // Set complete list size. - resTokenForResponse.setCompleteListSize(BigInteger.valueOf(completeListSize)); - - return resTokenForResponse; - } - - return null; - } -======= +//<<<<<<< HEAD +// final String resumptionToken, Map<String, Integer> cursorCollector, final String scrollID, +// final int searchResponseSize, final int i) { +// +// log.info("Creating a ResumptionToken:\n " + +// "CompleteListSize: " + completeListSize + "\n" + +// "ResumptionToken: " + resumptionToken + "\n" + +// "CursorCollector: " + cursorCollector + "\n" + +// "ScrollID: " + scrollID + "\n" + +// "SearchResponseSize: " + scrollID + "\n" + +// "IterationStep: " + i); +// +// int cursor; +// +// // Three cases here: +// // 1. Complete list size is > searchResponseSize and a token already is existing: we need to +// // check hash map! +// // 2. Complete list size is > searchResponseSize and we have no token: we do need one! +// // 3. Complete list size is <= searchResponseSize (we do not need a token! do nothing!) +// +// if (completeListSize > searchResponseSize) { +// ResumptionTokenType resTokenForResponse = new ResumptionTokenType(); +// +// if (resumptionToken != null && cursorCollector.containsKey(resumptionToken)) { +// cursor = cursorCollector.get(resumptionToken).intValue() + i; +// if(cursor-searchResponseSize == 0) { +// cursor *= 2; +// } +// resTokenForResponse.setCursor(BigInteger.valueOf((long) cursor)); +// cursorCollector.put(scrollID, cursor); +// } else { +// resTokenForResponse.setCursor(BigInteger.valueOf(searchResponseSize)); +// cursorCollector.put(scrollID, searchResponseSize); +// cursor = searchResponseSize; +// resTokenForResponse.setCursor(BigInteger.valueOf((long) cursor)); +// +// } +// +// // Set resumption token string if cursor is less then complete list size: More objects can be +// // delivered! +// if (cursor < completeListSize) { +// resTokenForResponse.setValue(scrollID); +// } +// +// // Remove resumption token string if cursor is bigger then or equal complete list size: This +// // is the last response, no more objects are available! +// if (cursor >= completeListSize) { +// //cursor =; +// resTokenForResponse.setValue(""); +// } +// +// // Set complete list size. +// resTokenForResponse.setCompleteListSize(BigInteger.valueOf(completeListSize)); +// +// return resTokenForResponse; +// } +// +// return null; +// } +//======= final String resumptionToken, Map<String, Integer> cursorCollector, final String scrollID, final int searchResponseSize, final int i) { @@ -415,7 +415,7 @@ public class OAIPMHUtilities { } return d; } ->>>>>>> feature/elastic6 +//>>>>>>> feature/elastic6 public static List<String> fieldLoader(JSONObject resultFromGetRequestInES, String[] fields){ diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/SetDeliverer.java b/oaipmh-core/src/main/java/info/textgrid/middleware/SetDeliverer.java index 320a03a0c1cab3904b88e76e5e016df53355c209..789cb0edde3add6b3b1827f1fb5403eb743f9247 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/SetDeliverer.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/SetDeliverer.java @@ -33,7 +33,7 @@ import info.textgrid.clients.tgauth.AuthClientException; import info.textgrid.middleware.oaipmh.ListSetsType; import info.textgrid.middleware.oaipmh.RequestType; import info.textgrid.middleware.oaipmh.SetType; -import info.textgrid.namespaces.middleware.tgcrud.common.TextGridMimetypes; +import info.textgrid.middleware.common.TextGridMimetypes; /** @@ -71,24 +71,24 @@ public class SetDeliverer { public ListSetsType setListBuilder() { ListSetsType setList = new ListSetsType(); -<<<<<<< HEAD - QueryBuilder aggQuery; - if (this.textgrid) { - aggQuery = QueryBuilders.matchPhraseQuery("format", TextGridMimetypes.EDITION); - } else { - aggQuery = QueryBuilders.matchPhraseQuery("descriptiveMetadata.dc:format", - TextGridMimetypes.DARIAH_COLLECTION); - } - - SearchRequestBuilder request = OAI_ESClient.getOaiESClient() - .prepareSearch(OAI_ESClient.getEsIndex()).setTypes(OAI_ESClient.getEsType()) - .setQuery(aggQuery) - .addField(this.formatField) - .addField(this.identifierField) - .addField("project.value") - .addField("project.id") - .setSize(100000); -======= +//<<<<<<< HEAD +// QueryBuilder aggQuery; +// if (this.textgrid) { +// aggQuery = QueryBuilders.matchPhraseQuery("format", TextGridMimetypes.EDITION); +// } else { +// aggQuery = QueryBuilders.matchPhraseQuery("descriptiveMetadata.dc:format", +// TextGridMimetypes.DARIAH_COLLECTION); +// } +// +// SearchRequestBuilder request = OAI_ESClient.getOaiESClient() +// .prepareSearch(OAI_ESClient.getEsIndex()).setTypes(OAI_ESClient.getEsType()) +// .setQuery(aggQuery) +// .addField(this.formatField) +// .addField(this.identifierField) +// .addField("project.value") +// .addField("project.id") +// .setSize(100000); +//======= //TODO looking for DARIAH if DARIAH works on ES6 @@ -111,7 +111,7 @@ public class SetDeliverer { .size(1000); filterPublicProjects.subAggregation(projectNameAndID); ->>>>>>> feature/elastic6 +//>>>>>>> feature/elastic6 } diff --git a/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhDARIAHTest.java b/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhDARIAHTest.java index bb4a1f96c6a686c6f6327a075baaecfa25863a3e..dd2293d0b58919e2db4e6625eb7a25c47a194d05 100644 --- a/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhDARIAHTest.java +++ b/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhDARIAHTest.java @@ -6,7 +6,7 @@ import org.junit.Ignore; import org.junit.Test; import info.textgrid.middleware.oaipmh.DeletedRecordType; import info.textgrid.middleware.oaipmh.GranularityType; -import info.textgrid.namespaces.middleware.tgcrud.common.TextGridMimetypes; +import info.textgrid.middleware.common.TextGridMimetypes; /** * diff --git a/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhTest.java b/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhTest.java index ca9c2a4eb3494ecb08cb8078133bd8c3a14f29ed..683b3b2940822ba1fe7d165418e6f47e4da27400 100644 --- a/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhTest.java +++ b/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhTest.java @@ -14,7 +14,7 @@ import org.junit.Test; import info.textgrid.middleware.oaipmh.DeletedRecordType; import info.textgrid.middleware.oaipmh.GranularityType; -import info.textgrid.namespaces.middleware.tgcrud.common.TextGridMimetypes; +import info.textgrid.middleware.common.TextGridMimetypes; /** * @author Maximilian Brodhun, SUB Göttingen