From a804d9162cfb5365412c69b0164c121ba0abe711 Mon Sep 17 00:00:00 2001 From: Maximilian Brodhun <brodhun@sub.uni-goettingen.de> Date: Wed, 27 May 2020 10:43:49 +0200 Subject: [PATCH] some tests --- .../middleware/IdentifierListDelivererDC.java | 6 +- oaipmh-core/src/main/resources/bindings.xjb | 67 ++++++++++--------- 2 files changed, 39 insertions(+), 34 deletions(-) diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/IdentifierListDelivererDC.java b/oaipmh-core/src/main/java/info/textgrid/middleware/IdentifierListDelivererDC.java index f4cfecbc..9b837353 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/IdentifierListDelivererDC.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/IdentifierListDelivererDC.java @@ -18,6 +18,8 @@ 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.ContributorType; import info.textgrid.middleware.oaipmh.HeaderType; import info.textgrid.middleware.oaipmh.ListIdentifiersType; import info.textgrid.middleware.oaipmh.ResumptionTokenType; @@ -78,8 +80,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); diff --git a/oaipmh-core/src/main/resources/bindings.xjb b/oaipmh-core/src/main/resources/bindings.xjb index 3914cddf..2a55fe38 100644 --- a/oaipmh-core/src/main/resources/bindings.xjb +++ b/oaipmh-core/src/main/resources/bindings.xjb @@ -1,35 +1,38 @@ <?xml version="1.0"?> <jxb:bindings version="1.0" - xmlns:jxb="http://java.sun.com/xml/ns/jaxb" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:namespace="http://jaxb2-commons.dev.java.net/namespace-prefix" - xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb https://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd - http://jaxb2-commons.dev.java.net/namespace-prefix https://raw.githubusercontent.com/Siggen/jaxb2-namespace-prefix/master/src/main/resources/prefix-namespace-schema.xsd"> - <jxb:bindings schemaLocation="oai_pmh.xsd"> - <jxb:schemaBindings> - <jxb:package name="info.textgrid.middleware.oaipmh" /> - </jxb:schemaBindings> - <jxb:bindings> - <!-- We want no prefix for default namespace... --> - <namespace:prefix name="" /> - </jxb:bindings> - <jxb:bindings> - <!-- ...but we want prefixes for oai_dc and dc! --> - <namespace:prefix - namespaceURI="http://www.openarchives.org/OAI/2.0/oai_dc/" - name="oai_dc" /> - <namespace:prefix - namespaceURI="http://purl.org/dc/elements/1.1/" name="dc" /> - </jxb:bindings> - </jxb:bindings> - <!--jxb:bindings schemaLocation="openaire.xsd"> - <jxb:bindings> - <jxb:nameXmlTransform> - <jxb:elementName suffix="Element"/> - </jxb:nameXmlTransform> - <jxb:bindings node="//xs:attribute[@ref='xml:lang']"> - <jxb:property name="secondlang"/> - </jxb:bindings> - </jxb:bindings> - </jxb:bindings--> + xmlns:jxb="http://java.sun.com/xml/ns/jaxb" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:namespace="http://jaxb2-commons.dev.java.net/namespace-prefix" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb https://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd + http://jaxb2-commons.dev.java.net/namespace-prefix https://raw.githubusercontent.com/Siggen/jaxb2-namespace-prefix/master/src/main/resources/prefix-namespace-schema.xsd"> + + <jxb:bindings schemaLocation="oai_pmh.xsd"> + <jxb:schemaBindings> + <jxb:package name="info.textgrid.middleware.oaipmh" /> + </jxb:schemaBindings> + <jxb:bindings> + <!-- We want no prefix for default namespace... --> + <namespace:prefix name="" /> + </jxb:bindings> + <jxb:bindings> + <!-- ...but we want prefixes for oai_dc and dc! --> + <namespace:prefix + namespaceURI="http://www.openarchives.org/OAI/2.0/oai_dc/" + name="oai_dc" /> + <namespace:prefix + namespaceURI="http://purl.org/dc/elements/1.1/" name="dc" /> + </jxb:bindings> + </jxb:bindings> + + <jxb:bindings schemaLocation="oaf-project-1.0.xsd"> + + <jxb:bindings node=".//xs:attribute[@type='qualifierType']"> + <jxb:property type="projectqualifierType"/> + </jxb:bindings> + + </jxb:bindings> + + + </jxb:bindings> -- GitLab