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

resolving dc attach error in dariah RecordListDeliverer

parent 24ac0883
No related branches found
No related tags found
No related merge requests found
......@@ -3,11 +3,11 @@ package info.textgrid.middleware;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import javax.xml.datatype.DatatypeConfigurationException;
import org.apache.commons.logging.LogFactory;
import org.elasticsearch.action.get.GetRequestBuilder;
import org.elasticsearch.action.get.GetResponse;
......@@ -17,11 +17,10 @@ import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit;
import info.textgrid.middleware.oaipmh.HeaderType;
import info.textgrid.middleware.oaipmh.ListRecordsType;
import info.textgrid.middleware.oaipmh.MetadataType;
import info.textgrid.middleware.oaipmh.OaiDcType;
import info.textgrid.middleware.oaipmh.ObjectFactory;
import info.textgrid.middleware.oaipmh.RecordType;
import info.textgrid.middleware.oaipmh.ResumptionTokenType;
......@@ -60,22 +59,6 @@ public class RecordListDelivererDC extends RecordListDelivererAbstract {
// DC-Field Lists
// **
/*private List<String> contributors = new ArrayList<String>();
private List<String> coverages = new ArrayList<String>();
private List<String> creators = new ArrayList<String>();
private List<String> dates = new ArrayList<String>();
private List<String> descriptions = new ArrayList<String>();
private List<String> formats = new ArrayList<String>();
private List<String> identifiers = new ArrayList<String>();
private List<String> languages = new ArrayList<String>();
private List<String> publishers = new ArrayList<String>();
private List<String> relations = new ArrayList<String>();
private List<String> rights = new ArrayList<String>();
private List<String> sources = new ArrayList<String>();
private List<String> subjects = new ArrayList<String>();
private List<String> titles = new ArrayList<String>();
private List<String> types = new ArrayList<String>();*/
private String[] contributorList;
private String[] coverageList;
private String[] creatorList;
......@@ -232,15 +215,13 @@ public class RecordListDelivererDC extends RecordListDelivererAbstract {
buildRecord(recordList, set,
hit.getFields().get(this.identifierField).getValue().toString(), dublinCoreBuilder);
//listClearer();
}
if (this.dariah == true) {
putContentIntoDCFieldLists2(hit,
dublinCoreBuilder = putContentIntoDCFieldLists2(hit,
furtherDCElements(hit.getId(), OAI_ESClient.getOaiESClient()));
buildRecord(recordList, set,
hit.getFields().get(this.identifierField).getValue().toString(), dublinCoreBuilder);
//listClearer();
}
}
}
......@@ -283,30 +264,13 @@ public class RecordListDelivererDC extends RecordListDelivererAbstract {
result.setType(DublinCoreFieldLoader.setType(responseWorkValues, this.typeList));
return result;
/*this.coverages = DublinCoreFieldLoader.setCoverage(responseWorkValues, this.coverageList);
this.creators = DublinCoreFieldLoader.setCreator(responseWorkValues, this.creatorList);
this.dates = DublinCoreFieldLoader.setDate(responseWorkValues, this.dateList);
this.descriptions =
DublinCoreFieldLoader.setDescription(responseWorkValues, this.descriptionList);
this.formats = DublinCoreFieldLoader.setFormat(hit, this.formatList);
this.identifiers = DublinCoreFieldLoader.setIdentifier(hit, this.identifierList);
this.languages = DublinCoreFieldLoader.setLanguage(hit, this.languageList);
this.publishers = DublinCoreFieldLoader.setPublisher(hit, this.publisherList);
this.relations = DublinCoreFieldLoader.setRelation(hit, this.relationList);
this.relations =
DublinCoreFieldLoader.setRelationForWork(responseWorkValues, this.relationForWorkList);
this.rights = DublinCoreFieldLoader.setRights(hit, this.rightList);
this.sources = DublinCoreFieldLoader.setSources(hit, this.sourceList);
this.subjects = DublinCoreFieldLoader.setSubject(hit, this.subjectList);
this.titles = DublinCoreFieldLoader.setTitle(hit, this.titleList);
this.types = DublinCoreFieldLoader.setType(responseWorkValues, this.typeList);*/
}
/**
* @param hit
* @param responseWorkValues
*/
public void putContentIntoDCFieldLists2(SearchHit hit, GetResponse responseWorkValues) {
public DublinCoreBuilder putContentIntoDCFieldLists2(SearchHit hit, GetResponse responseWorkValues) {
DublinCoreBuilder result = new DublinCoreBuilder();
......@@ -325,22 +289,8 @@ public class RecordListDelivererDC extends RecordListDelivererAbstract {
result.setSubject(DublinCoreFieldLoader.setSources(hit, this.subjectList));
result.setTitle(DublinCoreFieldLoader.setTitle(hit, this.titleList));
result.setType(DublinCoreFieldLoader.setType(hit, this.typeList));
/*this.contributors = DublinCoreFieldLoader.setContributor(hit, this.contributorList);
this.coverages = DublinCoreFieldLoader.setCoverage(hit, this.coverageList);
this.creators = DublinCoreFieldLoader.setCreator(hit, this.creatorList);
this.dates = DublinCoreFieldLoader.setDate(hit, this.dateList);
this.descriptions = DublinCoreFieldLoader.setDescription(hit, this.descriptionList);
this.formats = DublinCoreFieldLoader.setFormat(hit, this.formatList);
this.identifiers = DublinCoreFieldLoader.setIdentifier(hit, this.identifierList);
this.languages = DublinCoreFieldLoader.setLanguage(hit, this.languageList);
this.publishers = DublinCoreFieldLoader.setPublisher(hit, this.publisherList);
this.relations = DublinCoreFieldLoader.setRelation(hit, this.relationList);
this.rights = DublinCoreFieldLoader.setRights(hit, this.rightList);
this.sources = DublinCoreFieldLoader.setSources(hit, this.sourceList);
this.subjects = DublinCoreFieldLoader.setSources(hit, this.subjectList);
this.titles = DublinCoreFieldLoader.setTitle(hit, this.titleList);
this.types = DublinCoreFieldLoader.setType(hit, this.typeList);*/
return result;
}
/**
......@@ -351,8 +301,8 @@ public class RecordListDelivererDC extends RecordListDelivererAbstract {
*/
public RecordType buildRecord(ListRecordsType recordList, String set, String headerIdentifier, DublinCoreBuilder dublinCoreBuilder) {
ObjectFactory of = new ObjectFactory();
OaiDcType odt = new OaiDcType();
/*ObjectFactory of = new ObjectFactory();
OaiDcType odt = new OaiDcType();*/
//DublinCoreBuilder dublinCoreBuilder = new DublinCoreBuilder();
MetadataType metadata = new MetadataType();
RecordType record = new RecordType();
......
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