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 4b48dfabae6f5961c330239a120e4d7e5b58ea40..71020a6d950a26b608ef550cad915ff9382e8b90 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/OAIPMHImpl.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/OAIPMHImpl.java @@ -173,6 +173,7 @@ public class OAIPMHImpl implements OAIPMHProducer { */ public JAXBElement<OAIPMHType> getRecordRequest(ObjectFactory obf, OAIPMHType oai, RequestType request) { + JAXBElement<OAIPMHType> oaipmhRoot = obf.createOAIPMH(oai); /** @@ -197,15 +198,10 @@ public class OAIPMHImpl implements OAIPMHProducer { recDeliv = this.recDelivIDIOM; } - System.out.println(" ## GetRecordRequest"); - // Finally start the QUERY! GetRecordType getRecord = new GetRecordType(); String id = request.getIdentifier(); - - System.out.println(" ## " + id); - getRecord = recDeliv.getRecordById(id); if (getRecord != null) { @@ -242,16 +238,16 @@ public class OAIPMHImpl implements OAIPMHProducer { } else { // Default is DC. - IdentifierListDelivererInterface listDeliv = identifierListDC; - log.info("Actual Value of IDIOM MetsMods Boolean is: " + IdentifierListDelivererInterface listDeliv = this.identifierListDC; + this.log.info("Actual Value of IDIOM MetsMods Boolean is: " + IdentifierListDelivererAbstract.isIdiomMets()); - log.info("Actual Value of DublinCore Boolean is: " + this.log.info("Actual Value of DublinCore Boolean is: " + IdentifierListDelivererAbstract.isDublinCore()); if (IdentifierListDelivererAbstract.isIdiomMets()) { - listDeliv = identifierListIDIOM; + listDeliv = this.identifierListIDIOM; } else if (IdentifierListDelivererAbstract.isDublinCore()) { - listDeliv = identifierListDC; + listDeliv = this.identifierListDC; } ListIdentifiersType listIdentifiers = new ListIdentifiersType(); @@ -366,9 +362,9 @@ public class OAIPMHImpl implements OAIPMHProducer { RecordListDelivererInterface recListDeliv = this.recordListDC; if (RecordListDelivererAbstract.isIdiomMets()) { - recListDeliv = recordListIDIOM; + recListDeliv = this.recordListIDIOM; } else if (RecordListDelivererAbstract.isDublinCore()) { - recListDeliv = recordListDC; + recListDeliv = this.recordListDC; } // Take IDIOM if IDIOM prefix. @@ -386,6 +382,7 @@ public class OAIPMHImpl implements OAIPMHProducer { oai.setListRecords(listRecords); } } + return oaipmhRoot; } @@ -579,7 +576,7 @@ public class OAIPMHImpl implements OAIPMHProducer { oaipmhRoot = listRecordsRequest(obf, response, request); } } else { - error.setError("VerbError", "Illegal OAI verb"); + this.error.setError("VerbError", "Illegal OAI verb"); response.getError().add(this.error.getError()); } diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordListDelivererDC.java b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordListDelivererDC.java index 8e50bb60067acd56d34465c18aeca5554c5f49fe..97936597a4f09101e34869f94d978690f074a3ee 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordListDelivererDC.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordListDelivererDC.java @@ -27,6 +27,8 @@ import info.textgrid.middleware.oaipmh.ResumptionTokenType; /** * FIXME Care about all repeatable fields as done in TITLE! + * + * FIXME Do refactor list handling as in RecordDelivererDC! */ public class RecordListDelivererDC extends RecordListDelivererAbstract { diff --git a/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhTextgridOnlineTests.java b/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhTextgridOnlineTests.java index 4b6a8e016bfca2969f9cdc5d2c378d39c61fe9c5..b22341c3593b410e570da2abc9c212e0ec7353cd 100644 --- a/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhTextgridOnlineTests.java +++ b/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhTextgridOnlineTests.java @@ -51,8 +51,9 @@ public class OaiPmhTextgridOnlineTests { // 9302:localhost:9302 -l username textgrid-esx2.gwdg.de", please use original OAIPMH config file // from /etc/dhrep/oaipmh/oaipmh.textgrid.properties and copy it to // /etc/dhrep/oaipmh/oaipmh.config on your local machine! - // private static String host = "http://localhost:8095/oaipmh/"; - private static String host = "http://localhost:8080/oaipmh-webapp/"; + private static String host = "http://localhost:8095/oaipmh/"; + // NOTE Use "mvn tomcat:run" here + // private static String host = "http://localhost:8080/oaipmh-webapp/"; // Time to wait between the single queries using resumption tokens in milliseconds. private static final Long TIME = 250l; @@ -205,10 +206,8 @@ public class OaiPmhTextgridOnlineTests { System.out.println(TESTING + "testListSets()"); // Testing for set: Digital Bibliothek. - String shouldContainTEXTGRIDLABORG = - "<setSpec>project:TGPR-372fe6dc-57f2-6cd4-01b5-2c4bbefcfd3c</setSpec>"; - String shouldContainDEFTEXTGRIDLABORG = - "<setSpec>project:TGPR-372fe6dc-57f2-6cd4-01b5-2c4bbefcfd3c</setSpec>"; + String shouldContainTEXTGRIDLABORG = "project:TGPR-372fe6dc-57f2-6cd4-01b5-2c4bbefcfd3c"; + String shouldContainDEFTEXTGRIDLABORG = "project:TGPR-372fe6dc-57f2-6cd4-01b5-2c4bbefcfd3c"; TGHttpResponse httpResponse = getHttpResponse(host + "oai?verb=" + VERB_LIST_SETS, NO_THREAD_NAME);