summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/main')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/YamlTemplateParsingHandler.java7
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java8
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java1
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaTemplateArtifact.java3
4 files changed, 19 insertions, 0 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/YamlTemplateParsingHandler.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/YamlTemplateParsingHandler.java
index a991f7e0d4..3faf750a73 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/YamlTemplateParsingHandler.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/YamlTemplateParsingHandler.java
@@ -832,6 +832,13 @@ public class YamlTemplateParsingHandler {
if (nodeTemplateJsonMap.containsKey(FILE.getElementName())) {
artifactTemplateInfo.setFile((String) nodeTemplateJsonMap.get(FILE.getElementName()));
}
+ if (nodeTemplateJsonMap.containsKey(PROPERTIES.getElementName())) {
+ Map<String, List<UploadPropInfo>> props = buildPropModuleFromYaml(nodeTemplateJsonMap);
+ if (!props.isEmpty()) {
+ List<UploadPropInfo> properties = props.values().stream().flatMap(Collection::stream).collect(toList());
+ artifactTemplateInfo.setProperties(properties);
+ }
+ }
}
@SuppressWarnings("unchecked")
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java
index 666529986c..8c97a04a74 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java
@@ -3409,6 +3409,14 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic {
ToscaArtifactDataDefinition to = new ToscaArtifactDataDefinition();
to.setFile(entry.getValue().getFile());
to.setType(entry.getValue().getType());
+ if(isNotEmpty(entry.getValue().getProperties())) {
+ Map<String, Object> newPropertiesMap = new HashMap<>();
+ List<UploadPropInfo> artifactPropsInfo = entry.getValue().getProperties();
+ for(UploadPropInfo propInfo: artifactPropsInfo) {
+ newPropertiesMap.put(propInfo.getName(), propInfo.getValue());
+ }
+ to.setProperties(newPropertiesMap);
+ }
toscaArtifacts.put(entry.getKey(), to);
}
componentInstance.setToscaArtifacts(toscaArtifacts);
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
index cdd5d60ed4..b6bd2a3967 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
@@ -1548,6 +1548,7 @@ public class ToscaExportHandler {
ToscaTemplateArtifact artifact = new ToscaTemplateArtifact();
artifact.setFile(entry.getValue().getFile());
artifact.setType(entry.getValue().getType());
+ artifact.setProperties(entry.getValue().getProperties());
arts.put(entry.getKey(), artifact);
}
return arts;
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaTemplateArtifact.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaTemplateArtifact.java
index 894a806de0..9824552f6f 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaTemplateArtifact.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaTemplateArtifact.java
@@ -22,10 +22,13 @@ package org.openecomp.sdc.be.tosca.model;
import lombok.Getter;
import lombok.Setter;
+import java.util.Map;
+
@Getter
@Setter
public class ToscaTemplateArtifact {
private String file;
private String type;
+ private Map<String, Object> properties;
}