From eb736d244351be91e519a11d51217a3183329dd9 Mon Sep 17 00:00:00 2001 From: mojahidi Date: Mon, 30 Jul 2018 17:01:26 +0530 Subject: Alligned operation ui model Alligned operation ui model Change-Id: I88f8a443f1a7a7d2e5258ff0dee0f5dc9809d050 Issue-ID: SDC-1535 Signed-off-by: mojahidi --- .../InterfaceOperationParamDataDefinition.java | 57 ++++++++++++++++------ .../elements/OperationInputDefinition.java | 4 +- .../elements/OperationOutputDefinition.java | 7 +-- .../be/datatypes/enums/JsonPresentationFields.java | 17 ++++--- .../InterfaceOperationParamDataDefinitionTest.java | 10 ++-- .../elements/OperationInputDefinitionTest.java | 2 +- 6 files changed, 65 insertions(+), 32 deletions(-) (limited to 'common-be') diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationParamDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationParamDataDefinition.java index 0044ffaf60..e2de5f0d64 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationParamDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationParamDataDefinition.java @@ -21,8 +21,10 @@ import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; import java.io.Serializable; -import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_PARAM_ID; -import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_PARAM_NAME; +import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_MANDATORY; +import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_PROPERTY; +import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_NAME; +import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_TYPE; public class InterfaceOperationParamDataDefinition extends ToscaDataDefinition implements Serializable { @@ -33,28 +35,53 @@ public class InterfaceOperationParamDataDefinition extends ToscaDataDefinition i public InterfaceOperationParamDataDefinition(InterfaceOperationParamDataDefinition iopdd) { super(); - setParamName(iopdd.getParamName()); - setParamId(iopdd.getParamId()); + setName(iopdd.getName()); + setProperty(iopdd.getProperty()); + setMandatory(iopdd.getMandatory()); + setType(iopdd.getType()); } - public InterfaceOperationParamDataDefinition(String paramName, String paramId) { + public InterfaceOperationParamDataDefinition(String paramName, String paramId, boolean mandatory, String type) { super(); - setParamName(paramName); - setParamId(paramId); + setName(paramName); + setProperty(paramId); + setMandatory(mandatory); + setType(type); } - public String getParamName() { - return (String) getToscaPresentationValue(IO_PARAM_NAME); + //used for OperationOutputDefinition + public InterfaceOperationParamDataDefinition(String paramName, boolean mandatory, String type) { + super(); + setName(paramName); + setMandatory(mandatory); + setType(type); + } + + public String getName() { + return (String) getToscaPresentationValue(IO_NAME); + } + public void setName(String paramName) { + setToscaPresentationValue(IO_NAME, paramName); } - public void setParamName(String paramName) { - setToscaPresentationValue(IO_PARAM_NAME, paramName); + + public String getProperty() { + return (String) getToscaPresentationValue(IO_PROPERTY); + } + public void setProperty(String paramId) { + setToscaPresentationValue(IO_PROPERTY, paramId); } - public String getParamId() { - return (String) getToscaPresentationValue(IO_PARAM_ID); + public Boolean getMandatory() { + return (Boolean) getToscaPresentationValue(IO_MANDATORY); } - public void setParamId(String paramId) { - setToscaPresentationValue(IO_PARAM_ID, paramId); + public void setMandatory(Boolean mandatory) { + setToscaPresentationValue(IO_MANDATORY, mandatory); } + public String getType() { + return (String) getToscaPresentationValue(IO_TYPE); + } + public void setType(String type) { + setToscaPresentationValue(IO_TYPE, type); + } } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationInputDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationInputDefinition.java index 0228492bb6..4c941574ae 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationInputDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationInputDefinition.java @@ -33,10 +33,12 @@ public class OperationInputDefinition extends InputDataDefinition { setName(name); } - public OperationInputDefinition(String paramName, String paramId) { + public OperationInputDefinition(String paramName, String paramId, Boolean mandatory, String type) { super(); setName(paramName); setInputId(paramId); + setRequired(mandatory); + setType(type); } public String getLabel() { diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationOutputDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationOutputDefinition.java index af046eaa17..82607d765d 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationOutputDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/OperationOutputDefinition.java @@ -30,10 +30,11 @@ public class OperationOutputDefinition extends InputDataDefinition { super(definition); setName(name); } - public OperationOutputDefinition(String paramName, String paramId) { + public OperationOutputDefinition(String name, Boolean mandatory, String type) { super(); - setName(paramName); - setInputId(paramId); + setName(name); + setRequired(mandatory); + setType(type); } public String getLabel() { return (String) getToscaPresentationValue(JsonPresentationFields.ARTIFACT_LABEL); diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java index 912e3d94b1..689deec4c8 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java @@ -214,13 +214,16 @@ public enum JsonPresentationFields { ARCHIVE_TIME("archiveTime", GraphPropertyEnum.ARCHIVE_TIME), IS_VSP_ARCHIVED("isVspArchived", GraphPropertyEnum.IS_VSP_ARCHIVED), CI_IS_ORIGIN_ARCHIVED("isOriginArchived", null), - //Interface Operation - IO_OPERATION_TYPE("operationType",null), - IO_INPUT_PARAMETERS("inputParams",null), - IO_OUTPUT_PARAMETERS("outputParams",null), - IO_PARAM_NAME("paramName", null), - IO_PARAM_ID("paramId", null), - IO_WORKFLOW_ID("workflowId", null), + + //Interface Operation + IO_OPERATION_TYPE("operationType",null), + IO_INPUT_PARAMETERS("inputParams",null), + IO_OUTPUT_PARAMETERS("outputParams",null), + IO_NAME("name", null), + IO_MANDATORY("mandatory", null), + IO_TYPE("type", null), + IO_PROPERTY("property", null), + IO_WORKFLOW_ID("workflowId", null), IO_WORKFLOW_VERSION_ID("workflowVersionId", null), //Interface diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationParamDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationParamDataDefinitionTest.java index d4f3161ed7..e25adb3c2f 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationParamDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/InterfaceOperationParamDataDefinitionTest.java @@ -16,7 +16,7 @@ public class InterfaceOperationParamDataDefinitionTest { // default test testSubject = createTestSubject(); new InterfaceOperationParamDataDefinition(testSubject); - new InterfaceOperationParamDataDefinition("", ""); + new InterfaceOperationParamDataDefinition("", "",true, ""); } @Test @@ -26,7 +26,7 @@ public class InterfaceOperationParamDataDefinitionTest { // default test testSubject = createTestSubject(); - result = testSubject.getParamName(); + result = testSubject.getName(); } @Test @@ -36,7 +36,7 @@ public class InterfaceOperationParamDataDefinitionTest { // default test testSubject = createTestSubject(); - testSubject.setParamName(paramName); + testSubject.setName(paramName); } @Test @@ -46,7 +46,7 @@ public class InterfaceOperationParamDataDefinitionTest { // default test testSubject = createTestSubject(); - result = testSubject.getParamId(); + result = testSubject.getProperty(); } @Test @@ -56,6 +56,6 @@ public class InterfaceOperationParamDataDefinitionTest { // default test testSubject = createTestSubject(); - testSubject.setParamId(paramId); + testSubject.setProperty(paramId); } } \ No newline at end of file diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/OperationInputDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/OperationInputDefinitionTest.java index 4dc0194f7b..533008ee9b 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/OperationInputDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/OperationInputDefinitionTest.java @@ -15,7 +15,7 @@ public class OperationInputDefinitionTest { // default test testSubject = createTestSubject(); - new OperationInputDefinition("", ""); + new OperationInputDefinition("", "", true, ""); new OperationInputDefinition("stam", testSubject); } -- cgit 1.2.3-korg