Commit 26a4c291 authored by Gerrit Hübbers's avatar Gerrit Hübbers 🃏
Browse files

Fix filtering

parent 2bb44f74
......@@ -141,7 +141,6 @@ public class XsltTransformerOaiPmhBundlesStreamSource implements BundlesStreamSo
}
public Bundle getBundle(String oaiPmhIdentifier) {
LOG.info("DEBUG!! with oaiPmhIdentifier={}", oaiPmhIdentifier);
//Bundle bundleResult = new AutonomouslyContentResolvingBundle(ImmutableSet.of() );
Set<Metadatum> bundleMetadata = new HashSet<>();
Set<String> metadataPrefixes = metadataPrefix2XsltMap.keySet();
......@@ -215,6 +214,8 @@ public class XsltTransformerOaiPmhBundlesStreamSource implements BundlesStreamSo
if (null != errorCode) {
if ("filteraway".equals(errorCode) ) {
LOG.debug("filtering away oaiPmhIdentifier={}", oaiPmhIdentifier);
resultBundle = null;
break;
}
else {
LOG.warn("fatalError. Filtering away oaiPmhIdentifier=" + oaiPmhIdentifier, e);
......
......@@ -687,20 +687,19 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertNull(bundle);
bss.getBundlesStream().forEach(b -> {
b.getMetadata().stream().filter(m -> m.getKey().equals("internal.dda.reference")).forEach(refM -> {
String refValue = refM.getValue();
LOG.info("checking {} for to-be-filtered away editorial publication", refValue);
String bundleReference = b.getReference();
LOG.info("checking {} for to-be-filtered away editorial publication", bundleReference);
// following strings indicate editorials
assertFalse(refValue.contains("oai:ojs.www.librelloph.com:article/12"));
assertFalse(refValue.contains("oai:ojs.www.librelloph.com:article/138"));
assertFalse(refValue.contains("oai:ojs.www.librelloph.com:article/216"));
assertFalse(refValue.contains("oai:ojs.www.librelloph.com:article/224"));
assertFalse(refValue.contains("oai:ojs.www.librelloph.com:article/259"));
assertFalse(refValue.contains("oai:ojs.www.librelloph.com:article/320"));
assertFalse(refValue.contains("oai:ojs.www.librelloph.com:article/366"));
});
assertFalse(bundleReference.contains("oai:ojs.www.librelloph.com:article/12"));
assertFalse(bundleReference.contains("oai:ojs.www.librelloph.com:article/138"));
assertFalse(bundleReference.contains("oai:ojs.www.librelloph.com:article/216"));
assertFalse(bundleReference.contains("oai:ojs.www.librelloph.com:article/224"));
assertFalse(bundleReference.contains("oai:ojs.www.librelloph.com:article/259"));
assertFalse(bundleReference.contains("oai:ojs.www.librelloph.com:article/320"));
assertFalse(bundleReference.contains("oai:ojs.www.librelloph.com:article/366"));
});
}
@Test
public void getSinglePublicationCis() throws IOException {
Map<String, String> map = new HashMap<>();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment