Commit d4287809 by Steinberg, Jan

optimizations for setSpec functionality

parent 63f60878
......@@ -135,6 +135,9 @@ public class XsltTransformerOaiPmhBundlesStreamSource implements BundlesStreamSo
stream().
flatMap(mp -> {
LOG.debug("filling list identifier stream with mp {}, from {}, until {}, setSpec {}", mp, from, until, setSpec);
if (setSpec.isEmpty() || setSpec == null) {
return client.listIdentifiersStream(mp, from, until, null);
}
return client.listIdentifiersStream(mp, from, until, setSpec);
});
......
......@@ -96,18 +96,18 @@ public class FeederService {
Stream<Bundle> bundlesStream = bundlesStreamSource.getBundlesStream();
BundleState fullIngestionResult = bundlesStream.
map(bundle -> {
BundleState result;
log.info("bundle iterate: {}", bundle.getReference());
org.gesis.dda.wizard.domain.Bundle bundleEntity = createOrUpdateBundle(bundle, savedBundlesSourceEntity);
log.info("bundleEntity= {}", bundleEntity.getId());
// by now, we have an existing bundleEntity
result = feedBundle(feedingContext, bundleEntity, bundle);
BundlesSourceEntityDataModificationStrategy dataModificationStrategy = feedingContext.getBundlesSourceEntityDataModificationStrategy();
BundlesSource bse = dataModificationStrategy.updateDataOnBundleIngestionResult(savedBundlesSourceEntity, bundle, result);
log.info("BSE= {}", bse.getId());
bse = bundlesSourceRepository.save(bse);
return result;
}).
BundleState result;
log.info("bundle iterate: {}", bundle.getReference());
org.gesis.dda.wizard.domain.Bundle bundleEntity = createOrUpdateBundle(bundle, savedBundlesSourceEntity);
log.info("bundleEntity= {}", bundleEntity.getId());
// by now, we have an existing bundleEntity
result = feedBundle(feedingContext, bundleEntity, bundle);
BundlesSourceEntityDataModificationStrategy dataModificationStrategy = feedingContext.getBundlesSourceEntityDataModificationStrategy();
BundlesSource bse = dataModificationStrategy.updateDataOnBundleIngestionResult(savedBundlesSourceEntity, bundle, result);
log.info("BSE= {}", bse.getId());
bse = bundlesSourceRepository.save(bse);
return result;
}).
reduce(BundleState.PROCESSING, this::isAcceptableBundleState);
bundlesSourceService.updateAfterFeeding(feedingContext);
......
......@@ -11,6 +11,8 @@
<label>Base URL
<input type="text" name="input" ng-model="dataDto.oaiPmhEndpoint">
</label>
</div>
<div>
<label>Set Specification
<input type="text" name="input" ng-model="dataDto.setSpec">
</label>
......
......@@ -1175,6 +1175,21 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
}
/*
@Test
public void streamWzbSpecificSet() throws IOException {
Map<String, String> map = new HashMap<>();
String oaiDcXsltString = IOUtils.toString(
getClass().
getClassLoader().
getResourceAsStream("xslt/wzb-oai_dc-2-xmlbundle.xslt"), StandardCharsets.UTF_8);
map.put("oai_dc", oaiDcXsltString);
XsltTransformerOaiPmhBundlesStreamSource bss = new XsltTransformerOaiPmhBundlesStreamSource("https://www.econstor.eu/oai/request", "col_10419_48639", map);
bss.getBundlesStream().map(Object::toString).forEach(LOG::info);
}
*/
@Test
public void getSinglePublicationWzb() throws IOException {
......
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