summaryrefslogtreecommitdiffstats
path: root/catalog-model
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2023-01-23 20:10:43 +0000
committerVasyl Razinkov <vasyl.razinkov@est.tech>2023-01-25 19:34:46 +0000
commit6e12c8ad59f11426e49f81c4a7032480b126bfbc (patch)
tree95ed2d948183f08afae133d16a6b0275f41f1058 /catalog-model
parentbd98d1022cac4cd0aaa6827b8eb4b7772b2fc033 (diff)
Implement hiding mechanism
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Change-Id: I799af15e31b724ca394eebe435223c03186fb6d3 Issue-ID: SDC-4344
Diffstat (limited to 'catalog-model')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/TopologyTemplateOperation.java13
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java20
2 files changed, 19 insertions, 14 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 790499c0da..603e09b590 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
@@ -1184,14 +1184,15 @@ public class TopologyTemplateOperation extends ToscaElementOperation {
category.setUniqueId(categoryV.getUniqueId());
category.setNormalizedName((String) metadataProperties.get(GraphPropertyEnum.NORMALIZED_NAME));
category.setName((String) metadataProperties.get(GraphPropertyEnum.NAME));
- final Boolean useServiceSubstitutionForNestedServices = (Boolean) metadataProperties
- .get(GraphPropertyEnum.USE_SUBSTITUTION_FOR_NESTED_SERVICES);
+ final Object useServiceSubstitutionForNestedServices = metadataProperties.get(GraphPropertyEnum.USE_SUBSTITUTION_FOR_NESTED_SERVICES);
category.setUseServiceSubstitutionForNestedServices(
- useServiceSubstitutionForNestedServices == null ? false : useServiceSubstitutionForNestedServices);
+ useServiceSubstitutionForNestedServices != null && (boolean) useServiceSubstitutionForNestedServices);
Type listTypeCat = new TypeToken<List<String>>() {
}.getType();
- List<String> iconsfromJsonCat = getGson().fromJson((String) metadataProperties.get(GraphPropertyEnum.ICONS.getProperty()), listTypeCat);
- category.setIcons(iconsfromJsonCat);
+ category.setNotApplicableMetadataKeys(
+ (getGson().fromJson((String) metadataProperties.get(GraphPropertyEnum.NOT_APPLICABLE_METADATA_KEYS.getProperty()), listTypeCat)));
+ 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();
@@ -1589,7 +1590,7 @@ public class TopologyTemplateOperation extends ToscaElementOperation {
String policyName = policyDefinition.getName();
if (StringUtils.isBlank(policyName)) {
policyName = buildSubComponentName((String) componentV.getJsonMetadataField(JsonPresentationFields.NAME),
- policyDefinition.getPolicyTypeName(), counter);
+ policyDefinition.getPolicyTypeName(), counter);
policyDefinition.setName(policyName);
}
policyDefinition.setInvariantName(policyName);
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 910d7ae1b6..327ece3da7 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
@@ -152,7 +152,7 @@ public abstract class ToscaElementOperation extends BaseOperation {
protected GraphVertex getHighestVersionFrom(GraphVertex v) {
Either<GraphVertex, JanusGraphOperationStatus> childVertexE = janusGraphDao
- .getChildVertex(v, EdgeLabelEnum.VERSION, JsonParseFlagEnum.NoParse);
+ .getChildVertex(v, EdgeLabelEnum.VERSION, JsonParseFlagEnum.NoParse);
GraphVertex highestVersionVertex = v;
while (childVertexE.isLeft()) {
highestVersionVertex = childVertexE.left().value();
@@ -279,9 +279,10 @@ public abstract class ToscaElementOperation extends BaseOperation {
/**
* Creates the MODEL in case it exits on the previous version
- * @param previousToscaElement previous element version
- * @param nextToscaElement latest element version
- * @param user user
+ *
+ * @param previousToscaElement previous element version
+ * @param nextToscaElement latest element version
+ * @param user user
* @param createdToscaElementVertex created tosca element
* @param edgeLabelEnum
* @return
@@ -1079,6 +1080,10 @@ public abstract class ToscaElementOperation extends BaseOperation {
List<MetadataKeyDataDefinition> metadataKeys = categoryV.property(GraphPropertyEnum.METADATA_KEYS.getProperty()).isPresent() ? getGson()
.fromJson((String) categoryV.property(GraphPropertyEnum.METADATA_KEYS.getProperty()).value(), listTypeCat) : Collections.emptyList();
category.setMetadataKeys(metadataKeys);
+ VertexProperty<Object> property = categoryV.property(GraphPropertyEnum.NOT_APPLICABLE_METADATA_KEYS.getProperty());
+ category.setNotApplicableMetadataKeys(
+ property.isPresent() ? getGson().fromJson((String) property.value(), new TypeToken<List<String>>() {
+ }.getType()) : Collections.emptyList());
categories.add(category);
catalogComponent.setCategories(categories);
return JanusGraphOperationStatus.OK;
@@ -1241,11 +1246,10 @@ public abstract class ToscaElementOperation extends BaseOperation {
private void generateNewToscaFileName(String componentType, String componentName, ArtifactDataDefinition artifactInfo) {
Optional<Entry<String, Object>> oConfig = ConfigurationManager.getConfigurationManager().getConfiguration().getToscaArtifacts()
- .entrySet().stream().filter(p -> p.getKey().equalsIgnoreCase(artifactInfo.getArtifactLabel())).findAny();
+ .entrySet().stream().filter(p -> p.getKey().equalsIgnoreCase(artifactInfo.getArtifactLabel())).findAny();
if (oConfig.isPresent()) {
- artifactInfo.setArtifactName(componentType + "-" + componentName + ((Map<String, Object>)oConfig.get().getValue()).get("artifactName"));
- }
- else {
+ artifactInfo.setArtifactName(componentType + "-" + componentName + ((Map<String, Object>) oConfig.get().getValue()).get("artifactName"));
+ } else {
artifactInfo.setArtifactName(componentType + "-" + componentName);
}
}