diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/IDIOMImages.java b/oaipmh-core/src/main/java/info/textgrid/middleware/IDIOMImages.java index 3b5fbbb09dfc39329e8bec96dccb389f937b3354..7e0cff75d2f5295c6ff7e91ae06dca676bb45d85 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/IDIOMImages.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/IDIOMImages.java @@ -20,9 +20,9 @@ import javax.xml.transform.TransformerFactoryConfigurationError; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import org.classicmayan.tools.TextGridUri; import org.classicmayan.tools.ImageMetsMods; import org.classicmayan.tools.MediaHarvester; +import org.classicmayan.tools.TextGridUri; import org.json.JSONArray; import org.json.JSONException; import org.w3c.dom.Document; @@ -144,6 +144,9 @@ public class IDIOMImages implements RecordDelivererInterface, RecordListDelivere try { System.out.println(id); //TextGridUri asa = new TextGridUri(); + if(!id.startsWith("textgrid:")){ + id = "textgrid:" + id; + } immByTGURI = new ImageMetsMods(new TextGridUri(id)); } catch (CrudClientException e1) { // TODO Auto-generated catch block diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererIDIOM.java b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererIDIOM.java index 6ff64cec575d51147ca84616d846ac00d36fd8af..e2ef5125b730847d0c53da821074305eaca09f9b 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererIDIOM.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererIDIOM.java @@ -30,6 +30,7 @@ import info.textgrid.middleware.oaipmh.RecordType; public class RecordDelivererIDIOM extends RecordDelivererAbstract { private String dateOfLastOblectModification; + private String objectType; RecordType record = new RecordType(); ClassicMayanMetsMods metsmods; @@ -42,6 +43,14 @@ public class RecordDelivererIDIOM extends RecordDelivererAbstract { super(textgrid, dariah); } + public String getObjectType() { + return objectType; + } + + public void setObjectType(String objectType) { + this.objectType = objectType; + } + /** * <p> * ElasticSearch request in non-public index to get the datestamps for the object creation and @@ -81,7 +90,7 @@ public class RecordDelivererIDIOM extends RecordDelivererAbstract { e.printStackTrace(); } JSONObject json = new JSONObject(); - String[] fields = {TGConstants.CREATED, TGConstants.MODIFIED_FIELD}; + String[] fields = {TGConstants.CREATED, TGConstants.MODIFIED_FIELD, "notes"}; json = new JSONObject(OAIPMHUtilities .getRcordByIDFromElasticSearch("textgrid-nonpublic", changedId, fields, Strings.EMPTY_ARRAY) .getSource()); @@ -91,6 +100,8 @@ public class RecordDelivererIDIOM extends RecordDelivererAbstract { this.dateOfLastOblectModification = OAIPMHUtilities .datestampAsString(OAIPMHUtilities.fieldLoader(json, TGConstants.MODIFIED_FIELD)); + + this.setObjectType(OAIPMHUtilities.fieldLoader(json, "notes")); } /** @@ -110,12 +121,18 @@ public class RecordDelivererIDIOM extends RecordDelivererAbstract { } else { textgridBaseURI_FromID = id; } - - this.metsmods = new ClassicMayanMetsMods( + if(this.getObjectType().equals("ARTEFACT")){ + this.metsmods = new ClassicMayanMetsMods( textgridBaseURI_FromID, this.dateOfObjectCreation, this.dateOfLastOblectModification); - this.record.setMetadata(idiomMets()); + this.record.setMetadata(idiomMets()); + }else if(this.getObjectType().startsWith("ConedaKorMediumData")){ + System.out.println("HOORAY"); + this.record = new IDIOMImages().getRecordById(id).getRecord(); + //grt.setRecord(new IDIOMImages().getRecordById(id).getRecord()); + } + String identifierToSet = ""; if (!id.startsWith("textgrid:")) { diff --git a/pom.xml b/pom.xml index f4e4f3071e6d7446b8f97f4430e4aefe7fa2b6e1..6520cfffe8ea9c644417b0508f3a65d1953269fc 100644 --- a/pom.xml +++ b/pom.xml @@ -9,13 +9,8 @@ <name>DARIAHDE :: OAI-PMH DataProvider</name> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> -<<<<<<< HEAD -<<<<<<< HEAD <cxf.version>3.3.11</cxf.version> <mets-mods-mapping.version>1.1.27-SNAPSHOT</mets-mods-mapping.version> -======= -======= ->>>>>>> 7e89cc408ce6f16778cd28c5819b8ed77503da52 <jdk.version>1.8</jdk.version> <antlr-maven-plugin.version>3.2</antlr-maven-plugin.version> <antlr-runtime.version>3.2</antlr-runtime.version> @@ -36,10 +31,6 @@ <properties-maven-plugin.version>1.0-alpha-2</properties-maven-plugin.version> <!-- <slf4j.version>1.7.5</slf4j.version> --> <rdf4j-repository-api.version>3.0.2</rdf4j-repository-api.version> -<<<<<<< HEAD ->>>>>>> f99f34faaef73f54b4a361c770a66ae5884ddee0 -======= ->>>>>>> 7e89cc408ce6f16778cd28c5819b8ed77503da52 <spring.version>4.0.2.RELEASE</spring.version> <xstream.version>1.4.18</xstream.version> </properties>