Commit 1144bd55 authored by Steinberg, Jan's avatar Steinberg, Jan
Browse files

added BundlesSourceStatus to getSetSpec method

parent b7e0f9e3
......@@ -104,14 +104,14 @@ public class BundlesSourceResource {
.body(result);
}
private String getSetSpec(String data) {
if (null != data) {
private String getSetSpec(String data, BundlesSourceType bundlesSourceType) {
if (null != data && bundlesSourceType == BundlesSourceType.XSLT_OAI_PMH) {
final JSONObject obj = new JSONObject(data);
if (null != obj.get("setSpec")) {
return (String) obj.get("setSpec");
}
}
return null;
return "";
}
/**
......@@ -305,7 +305,7 @@ public class BundlesSourceResource {
log.debug("REST request to harvest BundlesSource : {}", id);
BundlesSource bundlesSource = bundlesSourceRepository.findOne(id);
if (null != bundlesSource) {
final String setSpec = getSetSpec(bundlesSource.getData());
final String setSpec = getSetSpec(bundlesSource.getData(), bundlesSource.getType());
if (null != setSpec) {
final String referenceOfBS = bundlesSource.getReference();
bundlesSource.setReference(referenceOfBS + "___" + setSpec);
......
Supports Markdown
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