diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererDATACITE.java b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererDATACITE.java index 8dce51be74d0ca66fe37d0824d473597bcb94126..75402cddcc1b69b91756d67e78b6d97b644ebb56 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererDATACITE.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererDATACITE.java @@ -175,11 +175,6 @@ public class RecordDelivererDATACITE extends RecordDelivererAbstract { OAIPMHtype oai = new OAIPMHtype(); HeaderType header = new HeaderType(); - System.out.println(" ## fields (getRecord): "); - for (int i = 0; i < this.fields.length; i++) { - System.out.println("\t" + this.fields[i]); - } - this.jsonObj = new JSONObject(OAIPMHUtilities.getRcordByIDFromElasticSearch(OAI_ESClient.getEsIndex(), idInElasticSearchIndex, this.fields, Strings.EMPTY_ARRAY).getSource()); @@ -206,47 +201,6 @@ public class RecordDelivererDATACITE extends RecordDelivererAbstract { return oaijaxb; } - /** - * @param idInElasticSearchIndex - * @return - * @throws ParseException - * @throws DatatypeConfigurationException - * @throws IOException - */ - @Deprecated - public GetRecordType getRecordTESTITEST(String idInElasticSearchIndex) - throws ParseException, DatatypeConfigurationException, IOException { - - HeaderType header = new HeaderType(); - - System.out.println(" ## fields (getRecord): "); - for (int i = 0; i < this.fields.length; i++) { - System.out.println("\t" + this.fields[i]); - } - - this.jsonObj = - new JSONObject(OAIPMHUtilities.getRcordByIDFromElasticSearch(OAI_ESClient.getEsIndex(), - idInElasticSearchIndex, this.fields, Strings.EMPTY_ARRAY).getSource()); - - // Setting the header for the oaipmh response - header.setDatestamp(OAIPMHUtilities - .datestampAsString(OAIPMHUtilities.fieldLoader(this.jsonObj, this.dateOfObjectCreation))); - - // The id for the response has to be starts with "textgrid:" or "hdl:". The id in elasticsearch - // is missing. In consequence is optional in oaipmh request to write textgrid:1233.0 or - // hdl:blubb-bla or just 1233.0 or blubb-bla. For the response the prefix has to be added. - if (!idInElasticSearchIndex.startsWith(this.repositoryObjectURIPrefix)) { - header.setIdentifier(this.repositoryObjectURIPrefix + idInElasticSearchIndex); - } else { - header.setIdentifier(idInElasticSearchIndex); - } - - // It is necessary to add the GetRecordType to the OAIPMH object. - GetRecordType grt = OAIPMHUtilities.getRecordType(this.setOpenAireRecord(), header); - - return grt; - } - /** * Adding the openaire record fields to the openaire record object * diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordListDelivererDATACITE.java b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordListDelivererDATACITE.java index 285c3aadaf05e0d5d83d47f7318fa2fccf84f8a7..80e0515c4e38645f0fd962a11965c7b5540a01b1 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordListDelivererDATACITE.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordListDelivererDATACITE.java @@ -48,8 +48,7 @@ public class RecordListDelivererDATACITE extends RecordListDelivererAbstract { try { openAireRecord = new RecordDelivererDATACITE(true, false); - // GetRecordType grt = openAireRecord.getRecordById(uri.replace("textgrid:", "")); - GetRecordType grt = openAireRecord.getRecordTESTITEST(uri.replace("textgrid:", "")); + GetRecordType grt = openAireRecord.getRecordById(uri.replace("textgrid:", "")); openAireRecordList.getRecord().add(grt.getRecord()); } catch (ParseException | DatatypeConfigurationException | IOException e) { // TODO Auto-generated catch block diff --git a/oaipmh-webapp/src/main/webapp/WEB-INF/beans.xml b/oaipmh-webapp/src/main/webapp/WEB-INF/beans.xml index b345185cd38d333d59bc1e81ce44e1c7b563fcb9..34d8f5c1714e7e798322925bd973edf24c57a879 100644 --- a/oaipmh-webapp/src/main/webapp/WEB-INF/beans.xml +++ b/oaipmh-webapp/src/main/webapp/WEB-INF/beans.xml @@ -103,7 +103,6 @@ <constructor-arg index="0" value="${textgrid}" /> <constructor-arg index="1" value="${dariah}" /> - <!-- Properties from abstract class --> <property name="fields" value="${fields}" /> <property name="workFields" value="${workFields}" /> @@ -141,7 +140,6 @@ <constructor-arg index="0" value="${textgrid}" /> <constructor-arg index="1" value="${dariah}" /> - <!-- Properties from abstract class --> <property name="fields" value="${fields}" /> <property name="workFields" value="${workFields}" /> @@ -195,7 +193,6 @@ <constructor-arg index="0" value="${textgrid}" /> <constructor-arg index="1" value="${dariah}" /> - <!-- Properties from abstract class --> <property name="fields" value="${fields}" /> <property name="workFields" value="${workFields}" /> @@ -269,7 +266,6 @@ <constructor-arg index="0" value="${textgrid}" /> <constructor-arg index="1" value="${dariah}" /> - <!-- Properties from abstract class --> <property name="fields" value="${fields}" /> <property name="workFields" value="${workFields}" /> @@ -287,7 +283,6 @@ <property name="searchResponseSize" value="${searchResponseSize}" /> - <!-- Properties from DC implementation class --> <property name="contributors" value="${contributorList}" /> <property name="coverages" value="${coverageList}" /> <property name="creators" value="${creatorList}" /> @@ -324,7 +319,6 @@ <constructor-arg index="0" value="${textgrid}" /> <constructor-arg index="1" value="${dariah}" /> - <!-- Properties from abstract class --> <property name="fields" value="${fields}" /> <property name="workFields" value="${workFields}" /> @@ -341,6 +335,24 @@ <property name="formatToFilter" value="${formatToFilter}" /> <property name="searchResponseSize" value="${searchResponseSize}" /> + + <property name="contributors" value="${contributorList}" /> + <property name="coverages" value="${coverageList}" /> + <property name="creators" value="${creatorList}" /> + <property name="dates" value="${dateList}" /> + <property name="descriptions" value="${descriptionList}" /> + <property name="formats" value="${formatList}" /> + <property name="identifiers" value="${identifierList}" /> + <property name="languages" value="${languageList}" /> + <property name="publishers" value="${publisherList}" /> + <property name="relations" value="${relationList}" /> + <property name="relationsForWork" + value="${relationsForWorkList}" /> + <property name="rights" value="${rightsList}" /> + <property name="sources" value="${sourceList}" /> + <property name="subjects" value="${subjectList}" /> + <property name="titles" value="${titleList}" /> + <property name="types" value="${typeList}" /> </bean> <!-- Beans for verb=ListIdentifiers -->