summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2020-03-13 15:27:41 -0700
committersebdet <sebastien.determe@intl.att.com>2020-03-16 06:30:33 -0700
commit49ab84a916e96fde4fc39258fa10f8b5ce775f48 (patch)
tree4a82e5adccade8fc1d660172662efb7f043bfbee /src/main/java
parent723de7f63f0951d0cfe7a23956cf9d00128809b1 (diff)
Fix the legacy policies
Fix the legacy policies not displayed in the UI properly due to the new PolicyModal dialog. Issue-ID: CLAMP-779 Signed-off-by: sebdet <sebastien.determe@intl.att.com> Change-Id: I8070d8c57e43c9a386e09475f0d377f91104aef1
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java3
-rw-r--r--src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java6
2 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java
index 355a889e0..528d695c3 100644
--- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java
+++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java
@@ -152,6 +152,7 @@ public class OperationalPolicy extends Policy implements Serializable {
/**
* This method can generate a Json representation (json schema) for an operational policy.
* This is mainly to support a legacy case and a generic case.
+ * For the legacy case the operational policy given is modified (configurationJson).
*
* @param operationalPolicy The operational policy
* @param toscaConverter The tosca converter
@@ -166,7 +167,7 @@ public class OperationalPolicy extends Policy implements Serializable {
}
if (operationalPolicy.isLegacy()) {
// Op policy Legacy case
- LegacyOperationalPolicy.preloadConfiguration(jsonReturned, operationalPolicy.loop);
+ LegacyOperationalPolicy.preloadConfiguration(operationalPolicy.getConfigurationsJson(), operationalPolicy.loop);
jsonReturned = OperationalPolicyRepresentationBuilder
.generateOperationalPolicySchema(operationalPolicy.loop.getModelService());
}
diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
index 0298cfde7..c88c1b984 100644
--- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
+++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
@@ -52,15 +52,13 @@ public class OperationalPolicyRepresentationBuilder {
JsonObject jsonSchema = JsonUtils.GSON.fromJson(
ResourceFileUtil.getResourceAsString("clds/json-schema/operational_policies/operational_policy.json"),
JsonObject.class);
- jsonSchema.get("schema").getAsJsonObject().get("items").getAsJsonObject().get("properties").getAsJsonObject()
- .get("configurationsJson").getAsJsonObject().get("properties").getAsJsonObject()
+ jsonSchema.get("properties").getAsJsonObject()
.get("operational_policy").getAsJsonObject().get("properties").getAsJsonObject().get("policies")
.getAsJsonObject().get("items").getAsJsonObject().get("properties").getAsJsonObject().get("target")
.getAsJsonObject().get("anyOf").getAsJsonArray().addAll(createAnyOfArray(modelJson));
// update CDS recipe and payload information to schema
- JsonArray actors = jsonSchema.get("schema").getAsJsonObject().get("items").getAsJsonObject().get("properties")
- .getAsJsonObject().get("configurationsJson").getAsJsonObject().get("properties").getAsJsonObject()
+ JsonArray actors = jsonSchema.get("properties").getAsJsonObject()
.get("operational_policy").getAsJsonObject().get("properties").getAsJsonObject().get("policies")
.getAsJsonObject().get("items").getAsJsonObject().get("properties").getAsJsonObject().get("actor")
.getAsJsonObject().get("anyOf").getAsJsonArray();