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