Skip to content
Snippets Groups Projects
Commit c3693369 authored by Stefan E. Funk's avatar Stefan E. Funk
Browse files

Merge branch 'develop' of...

parents 14cc4bfb 5ef90921
No related branches found
No related tags found
No related merge requests found
......@@ -67,17 +67,29 @@ public class RecordDelivererIDIOM extends RecordDelivererAbstract {
public void setDatestamps(String idInDatabase) {
System.out.println(idInDatabase);
String changedId = idInDatabase;
/*Client oaiESClient;
Settings oaiESClusterSettings = ImmutableSettings.settingsBuilder().put("cluster.name", "tg-esx1-dev-instance").build();
oaiESClient = new TransportClient(oaiESClusterSettings).addTransportAddress(new InetSocketTransportAddress("localhost", 9202));*/
if(idInDatabase.startsWith("textgrid:")) {
changedId = idInDatabase.substring("textgrid:".length());
System.out.println("kill textgrid: " + changedId);
}
if(!idInDatabase.contains(".0")) {
changedId = changedId + ".0";
System.out.println("add .0 : " + changedId);
}
GetRequestBuilder recordById = OAI_ESClient.getOaiESClient()
.prepareGet()
.setIndex("textgrid-nonpublic")
.setType(OAI_ESClient.getEsType())
.setFields(TGConstants.CREATED, TGConstants.MODIFIED_FIELD)
.setId(idInDatabase.replace("textgrid:", "") + ".0");
.setId(changedId);
System.out.println("changed id: " + idInDatabase.replace("textgrid:", "") + ".0");
......@@ -88,6 +100,7 @@ public class RecordDelivererIDIOM extends RecordDelivererAbstract {
System.out.println("MODIFIED_FIELD " + TGConstants.MODIFIED_FIELD);
System.out.println("TYPE FROM SETTER: " + OAI_ESClient.getEsType());
System.out.println("ES_Clustername: " + OAI_ESClient.getClusterName());
System.out.println("FIELDS: " + recordById.get().getFields());
GetResponse objectInDatabase = recordById.execute().actionGet();
......
......@@ -62,7 +62,7 @@ public class OaiPmhTest {
// sc = new
// SesameClient("http://localhost:9091/openrdf-workbench/repositories/textgrid-public");
oaiEsClient = new OAI_ESClient("localhost", "9302", "tg-esx2-instance");
oaiEsClient = new OAI_ESClient("localhost", "9302", "tg-esx1-dev-instance");
// oaiEsClient = new OAI_ESClient("localhost", "9302", "dariah-repository-prototype");
OAI_ESClient.setEsIndex("textgrid-public");
OAI_ESClient.setEsType("metadata");
......@@ -75,6 +75,7 @@ public class OaiPmhTest {
record.setWorkFields(TGConstants.TGWorkFields);
recordIDIOM = new RecordDelivererIDIOM(true, false);
recordIDIOM.setOaiEsClient(oaiEsClient);
recordList = new RecordListDelivererDC(true, false);
......@@ -237,12 +238,12 @@ public class OaiPmhTest {
* @throws ParseException
*/
@Test
@Ignore
//@Ignore
public void testGetRequestGetRecordIDIOM() throws ParseException {
System.out.println("Test for the verb \"GetRecord\" with succesfull response");
JAXBElement<OAIPMHType> p =
this.request.getRequest("GetRecord", "textgrid:255sn", TGConstants.METADATA_IDIOM_PREFIX, "", "", "", "");
this.request.getRequest("GetRecord", "textgrid:vqmx.0", TGConstants.METADATA_IDIOM_PREFIX, "", "", "", "");
JAXB.marshal(p, System.out);
System.out.println("-----------------------------------\n");
}
......
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