Skip to content
Snippets Groups Projects
Commit aecf0955 authored by mbrodhu's avatar mbrodhu
Browse files

enable get idiom image record by verb GetRecord for prefix oai_idiom_mets

parent 51cea4cc
No related branches found
No related tags found
No related merge requests found
Pipeline #276321 passed
......@@ -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
......
......@@ -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:")) {
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment