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

Add logging

parent 5899d73a
No related branches found
No related tags found
No related merge requests found
......@@ -68,6 +68,14 @@ public abstract class IdentifierListDelivererAbstract implements IdentifierListD
}
/**
* @param from
* @param until
* @param set
* @param resumptionToken
* @return
* @throws IOException
*/
public List<String> getUriListOfAllEditions(String from, String until, String set, String resumptionToken) throws IOException {
/* InputStream input = null;
......@@ -110,6 +118,13 @@ public abstract class IdentifierListDelivererAbstract implements IdentifierListD
return getConentFromESIndex(query, resumptionToken, set);
}
/**
* @param query
* @param resumptionToken
* @param set
* @return
* @throws IOException
*/
private List<String> getConentFromESIndex(QueryBuilder query, String resumptionToken,
String set) throws IOException {
......
......@@ -18,7 +18,6 @@ import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
import info.textgrid.middleware.oaipmh.HeaderType;
import info.textgrid.middleware.oaipmh.ListIdentifiersType;
import info.textgrid.middleware.oaipmh.ResumptionTokenType;
......@@ -79,8 +78,8 @@ public class IdentifierListDelivererDC extends IdentifierListDelivererAbstract {
private static ListIdentifiersType setListIdentifierHeader(String datestamp, String identifier,
ListIdentifiersType lit, String set) {
// FIXME Delete this function and check for empty set string in setListIdentifierHeaderWithSet
// FIXME Delete this function and check for empty set string in setListIdentifierHeaderWithSet
HeaderType header = new HeaderType();
header.setDatestamp(datestamp);
header.setIdentifier(identifier);
......@@ -120,9 +119,9 @@ public class IdentifierListDelivererDC extends IdentifierListDelivererAbstract {
String[] includes = this.identifierListFields;
String[] excludes = Strings.EMPTY_ARRAY;
//TODO: necessary?
// TODO: necessary?
FetchSourceContext fetchSourceContext = new FetchSourceContext(true, includes, excludes);
SearchRequest searchRequest =
new SearchRequest(OAI_ESClient.getEsIndex()).searchType(SearchType.QUERY_THEN_FETCH);
......@@ -161,9 +160,16 @@ public class IdentifierListDelivererDC extends IdentifierListDelivererAbstract {
String set, String resumptionToken) {
int i = 0;
setResultSize(listFurtherValues.getHits().totalHits);
long size = listFurtherValues.getHits().totalHits;
setResultSize(size);
log.debug(" ## hits --> " + size);
for (SearchHit hit : listFurtherValues.getHits().getHits()) {
i++;
log.debug(" ## hit --> " + hit.getId());
if (this.textgrid) {
// hit.getSourceAsMap().get(this.dateOfObjectCreation).toString();
String datestamp = hit.getSourceAsMap().get(this.dateOfObjectCreation).toString();
......@@ -175,19 +181,15 @@ public class IdentifierListDelivererDC extends IdentifierListDelivererAbstract {
log.debug(e1);
}
String identifier = hit.getSourceAsMap().get(this.identifierField).toString();
lit = setListIdentifierHeader(datestamp, identifier, lit, set);
}
if (this.dariah) {
this.datestamp = hit.getSourceAsMap().get(this.dateOfObjectCreation).toString();
try {
this.datestamp = hit.getSourceAsMap().get(this.dateOfObjectCreation).toString();
this.datestamp = OAIPMHUtilities.convertDateFormat(this.datestamp).toXMLFormat();
} catch (ParseException e1) {
log.debug(e1);
} catch (DatatypeConfigurationException e1) {
......
......@@ -12,7 +12,7 @@ public class MetadataFormatListDelivererDH extends MetadataFormatListDelivererAb
* @param dariah
*/
public MetadataFormatListDelivererDH() {
//
// NOTE We do not have specific metadata formats for DHREP right now.
}
/*
......@@ -23,11 +23,6 @@ public class MetadataFormatListDelivererDH extends MetadataFormatListDelivererAb
* String)
*/
public ListMetadataFormatsType setMetadataFormatList(String id) {
System.out.println(" ## setMetadataFormatList ID --> " + id);
// TODO Add DH specific method here!
return setMetadataFormatList();
}
......
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