summaryrefslogtreecommitdiffstats
path: root/catalog-model/src/main
diff options
context:
space:
mode:
authoraribeiro <anderson.ribeiro@est.tech>2021-08-30 15:18:40 +0100
committerMichael Morris <michael.morris@est.tech>2021-10-05 16:03:26 +0000
commit6ecc7c3e150f86528d36cdbaa94912b965619a70 (patch)
tree089180b4df1919c555f07ffd4107fec823f48ca1 /catalog-model/src/main
parent32312ca12dc40f724d248104c16df5e46a4bc5cc (diff)
Filter categories by model name
Issue-ID: SDC-3706 Signed-off-by: aribeiro <anderson.ribeiro@est.tech> Change-Id: I457151f09ce0ed2edfa09340e9e08a126e114002
Diffstat (limited to 'catalog-model/src/main')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/TopologyTemplateOperation.java4
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java3
2 files changed, 6 insertions, 1 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/TopologyTemplateOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/TopologyTemplateOperation.java
index 61b11b3168..b45dae9c68 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/TopologyTemplateOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/TopologyTemplateOperation.java
@@ -609,7 +609,8 @@ public class TopologyTemplateOperation extends ToscaElementOperation {
private StorageOperationStatus associateServiceMetadataToCategory(GraphVertex nodeTypeVertex, TopologyTemplate topologyTemplate) {
String categoryName = topologyTemplate.getCategories().get(0).getName();
- Either<GraphVertex, StorageOperationStatus> category = categoryOperation.getCategory(categoryName, VertexTypeEnum.SERVICE_CATEGORY);
+ Either<GraphVertex, StorageOperationStatus> category = categoryOperation.getCategory(categoryName,
+ VertexTypeEnum.SERVICE_CATEGORY);
if (category.isRight()) {
log.trace("NO category {} for service {}", categoryName, topologyTemplate.getUniqueId());
return StorageOperationStatus.CATEGORY_NOT_FOUND;
@@ -1176,6 +1177,7 @@ public class TopologyTemplateOperation extends ToscaElementOperation {
}.getType();
List<String> iconsfromJsonCat = getGson().fromJson((String) metadataProperties.get(GraphPropertyEnum.ICONS.getProperty()), listTypeCat);
category.setIcons(iconsfromJsonCat);
+ category.setModels((getGson().fromJson((String) metadataProperties.get(GraphPropertyEnum.MODEL.getProperty()), listTypeCat)));
final Type metadataKeysTypeCat = new TypeToken<List<MetadataKeyDataDefinition>>() {
}.getType();
final List<MetadataKeyDataDefinition> metadataKeysfromJsonCat = getGson()
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java
index 1037935ab5..2ff3b49a00 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java
@@ -1060,6 +1060,9 @@ public abstract class ToscaElementOperation extends BaseOperation {
CategoryDefinition category = new CategoryDefinition();
category.setUniqueId((String) categoryV.property(GraphPropertyEnum.UNIQUE_ID.getProperty()).value());
category.setNormalizedName(categoryNormalizedName);
+ category.setModels(categoryV.property(GraphPropertyEnum.MODEL.getProperty()).isPresent() ? getGson()
+ .fromJson((String) categoryV.property(GraphPropertyEnum.MODEL.getProperty()).value(), new TypeToken<List<String>>() {
+ }.getType()) : Collections.emptyList());
category.setName((String) categoryV.property(GraphPropertyEnum.NAME.getProperty()).value());
category.setUseServiceSubstitutionForNestedServices(
(Boolean) categoryV.property(GraphPropertyEnum.USE_SUBSTITUTION_FOR_NESTED_SERVICES.getProperty()).orElse(false));