Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • dariah-de/dariah-de-oai-pmh-services
1 result
Show changes
Commits on Source (7)
## [4.4.4](https://gitlab.gwdg.de/dariah-de/dariah-de-oai-pmh-services/compare/v4.4.3...v4.4.4) (2022-08-18)
### Bug Fixes
* looking for NPE ([35fe2e1](https://gitlab.gwdg.de/dariah-de/dariah-de-oai-pmh-services/commit/35fe2e1b98c683dba866260f220710a28ae2dd4d))
* still looking for NPE... :-D ([854ded6](https://gitlab.gwdg.de/dariah-de/dariah-de-oai-pmh-services/commit/854ded619af3bc74be6b4c780825ef55a1d93c1c))
* store latest changes ([25a43df](https://gitlab.gwdg.de/dariah-de/dariah-de-oai-pmh-services/commit/25a43df0b63ccd666126ac25c3f6d6d62b8a2ce4))
## [4.4.3](https://gitlab.gwdg.de/dariah-de/dariah-de-oai-pmh-services/compare/v4.4.2...v4.4.3) (2022-08-17)
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>oaipmh</artifactId>
<groupId>info.textgrid.middleware</groupId>
<version>4.4.3</version>
<version>4.4.4</version>
</parent>
<artifactId>oaipmh-core</artifactId>
<packaging>jar</packaging>
......
......@@ -8,7 +8,6 @@ import java.text.ParseException;
import java.util.Hashtable;
import java.util.Map;
import java.util.UUID;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
......@@ -19,7 +18,6 @@ import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerFactoryConfigurationError;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.apache.jena.atlas.logging.Log;
import org.classicmayan.tools.ImageMetsMods;
import org.classicmayan.tools.MediaHarvester;
import org.classicmayan.tools.TextGridUri;
......@@ -28,7 +26,6 @@ import org.json.JSONException;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import info.textgrid.clients.tgcrud.CrudClientException;
import info.textgrid.middleware.oaipmh.GetRecordType;
import info.textgrid.middleware.oaipmh.HeaderType;
......
......@@ -23,7 +23,7 @@ import info.textgrid.middleware.oaipmh.RecordType;
/**
* @author Maximilian Brodhun, SUB Göttingen
* @author Stefan E. Funk, SUB Göttingen
* @version 2022-04-19
* @version 2022-08-17
* @since 2019-03-12
*/
@Component
......@@ -43,18 +43,10 @@ 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
* last modification date in TextGrid-Repo.
* last modification date in TextGridRep.
* </p>
*
* @param idInDatabase
......@@ -95,8 +87,8 @@ public class RecordDelivererIDIOM extends RecordDelivererAbstract {
.getRcordByIDFromElasticSearch("textgrid-nonpublic", changedId, fields, Strings.EMPTY_ARRAY)
.getSource());
this.dateOfObjectCreation = OAIPMHUtilities
.datestampAsString(OAIPMHUtilities.fieldLoader(json, TGConstants.CREATED));
this.dateOfObjectCreation =
OAIPMHUtilities.datestampAsString(OAIPMHUtilities.fieldLoader(json, TGConstants.CREATED));
this.dateOfLastOblectModification = OAIPMHUtilities
.datestampAsString(OAIPMHUtilities.fieldLoader(json, TGConstants.MODIFIED_FIELD));
......@@ -105,11 +97,14 @@ public class RecordDelivererIDIOM extends RecordDelivererAbstract {
}
/**
* building the record XML object for the OAI-PMH response
* <p>
* Building the record XML object for the OAI-PMH response.
* </p>
*
* @throws ParseException
* @throws IOException
*/
@Override
public GetRecordType getRecordById(String id) throws ParseException, IOException {
GetRecordType grt = new GetRecordType();
......@@ -128,7 +123,19 @@ public class RecordDelivererIDIOM extends RecordDelivererAbstract {
this.dateOfLastOblectModification);
this.record.setMetadata(idiomMets());
} else if (this.getObjectType().startsWith("ConedaKorMediumData")) {
this.record = new IDIOMImages().getRecordById(id).getRecord();
System.out.println(" ++ id: " + id);
System.out.println(" ++ tgBaseURI: " + textgridBaseURI_FromID);
GetRecordType idi = new IDIOMImages().getRecordById(id);
System.out.println(
" ++ idi: " + (idi == null ? "NULL" : idi.getRecord().getHeader().getIdentifier()));
if (idi != null) {
this.record = idi.getRecord();
}
}
// See that IDs begin with "textgrid:"
......@@ -146,8 +153,8 @@ public class RecordDelivererIDIOM extends RecordDelivererAbstract {
// No setSpec needed here!
String setSpec = "";
HeaderType header = OAIPMHUtilities.computeResponseHeader(this.dateOfObjectCreation,
identifierToSet, setSpec);
HeaderType header =
OAIPMHUtilities.computeResponseHeader(this.dateOfObjectCreation, identifierToSet, setSpec);
this.record.setHeader(header);
grt.setRecord(this.record);
......@@ -161,7 +168,7 @@ public class RecordDelivererIDIOM extends RecordDelivererAbstract {
/**
* <p>
* Getting the Mets/Mods object for the ClassicMayan artifact and put them into metadata element
* Getting the METS/MODS object for the ClassicMayan artifact and put them into metadata element
* of the OAI-PMH response.
* </p>
*
......@@ -184,4 +191,22 @@ public class RecordDelivererIDIOM extends RecordDelivererAbstract {
return metadataMets;
}
// **
// GETTERS & SETTERS
// **
/**
* @return
*/
public String getObjectType() {
return this.objectType;
}
/**
* @param objectType
*/
public void setObjectType(String objectType) {
this.objectType = objectType;
}
}
......@@ -34,7 +34,7 @@ import org.junit.Test;
*
* @author Stefan E. Funk, SUB Göttingen
*/
//@Ignore
// @Ignore
public class OaiPmhTextgridOnlineTests {
// **
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>oaipmh</artifactId>
<groupId>info.textgrid.middleware</groupId>
<version>4.4.3</version>
<version>4.4.4</version>
</parent>
<artifactId>oaipmh-webapp</artifactId>
<packaging>war</packaging>
......
......@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>info.textgrid.middleware</groupId>
<artifactId>oaipmh</artifactId>
<version>4.4.3</version>
<version>4.4.4</version>
<packaging>pom</packaging>
<name>DARIAHDE :: OAI-PMH DataProvider</name>
<properties>
......