From f7d891db891f4fb8db103236d4010de1b7739378 Mon Sep 17 00:00:00 2001 From: Steve Siani Date: Wed, 3 Apr 2019 15:23:27 -0400 Subject: Jinja template for Blueprint template service Change-Id: Iec777e4500c2a040faccc8375b1d2dd24c27cb7f Issue-ID: CCSDK-1193 Signed-off-by: Steve Siani --- .../Definitions/activation-blueprint.json | 4 +- .../Definitions/artifact_types.json | 10 ++- .../Templates/another-template.jinja | 1 + .../Templates/another-template.vtl | 1 - .../artifact_type/artifact-template-jinja.json | 8 ++ .../resolution/ResourceResolutionService.kt | 24 +++--- .../processor/ResourceAssignmentProcessor.kt | 10 ++- .../processor/RestResourceResolutionProcessor.kt | 9 +-- .../resolution/ResourceResolutionServiceTest.kt | 4 +- .../scripts/BlueprintJythonServiceTest.kt | 5 +- ms/blueprintsprocessor/parent/pom.xml | 9 ++- .../artifact_type/artifact-mapping-resource.json | 2 +- .../artifact_type/artifact-template-jinja.json | 8 ++ .../node_type/artifact-config-template.json | 2 +- .../modules/blueprint-core/pom.xml | 6 +- .../core/BluePrintConstants.kt | 5 +- .../core/interfaces/BlueprintTemplateService.kt | 56 +++++++++++++ .../core/service/BluePrintJinjaTemplateService.kt | 52 ++++++++++++ .../core/service/BluePrintTemplateService.kt | 92 ---------------------- .../service/BluePrintVelocityTemplateService.kt | 69 ++++++++++++++++ .../core/service/BlueprintTemplateService.kt | 49 ++++++++++++ .../core/service/BluePrintTemplateServiceTest.kt | 79 +++++++++++++++++-- .../templates/base-config-data-jinja.json | 16 ++++ .../templates/base-config-data-velocity.json | 36 +++++++++ .../test/resources/templates/base-config-data.json | 36 --------- .../templates/base-config-jinja-template.jinja | 42 ++++++++++ .../resources/templates/base-config-template.vtl | 61 -------------- .../templates/base-config-velocity-template.vtl | 61 ++++++++++++++ ms/controllerblueprints/modules/service/pom.xml | 6 ++ ms/controllerblueprints/parent/pom.xml | 8 +- 30 files changed, 539 insertions(+), 232 deletions(-) create mode 100644 components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Templates/another-template.jinja delete mode 100644 components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Templates/another-template.vtl create mode 100644 components/model-catalog/definition-type/starter-type/artifact_type/artifact-template-jinja.json create mode 100644 ms/controllerblueprints/modules/blueprint-core/load/model_type/artifact_type/artifact-template-jinja.json create mode 100644 ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/interfaces/BlueprintTemplateService.kt create mode 100644 ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintJinjaTemplateService.kt delete mode 100644 ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateService.kt create mode 100644 ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintVelocityTemplateService.kt create mode 100644 ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BlueprintTemplateService.kt create mode 100644 ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-data-jinja.json create mode 100755 ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-data-velocity.json delete mode 100755 ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-data.json create mode 100755 ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-jinja-template.jinja delete mode 100755 ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-template.vtl create mode 100755 ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-velocity-template.vtl diff --git a/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Definitions/activation-blueprint.json b/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Definitions/activation-blueprint.json index 78a9d8c69..eae69245b 100644 --- a/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Definitions/activation-blueprint.json +++ b/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Definitions/activation-blueprint.json @@ -173,8 +173,8 @@ "file": "Definitions/baseconfig-mapping.json" }, "another-template": { - "type": "artifact-template-velocity", - "file": "Templates/another-template.vtl" + "type": "artifact-template-jinja", + "file": "Templates/another-template.jinja" }, "another-mapping": { "type": "artifact-mapping-resource", diff --git a/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Definitions/artifact_types.json b/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Definitions/artifact_types.json index d741d151e..f1e5bb14f 100644 --- a/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Definitions/artifact_types.json +++ b/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Definitions/artifact_types.json @@ -8,6 +8,14 @@ ], "derived_from": "tosca.artifacts.Implementation" }, + "artifact-template-jinja": { + "description": "Jinja Template used for Configuration", + "version": "1.0.0", + "file_ext": [ + "jinja" + ], + "derived_from": "tosca.artifacts.Implementation" + }, "artifact-mapping-resource": { "description": "Velocity Template Resource Mapping File used along with Configuration template", "version": "1.0.0", @@ -42,4 +50,4 @@ "derived_from": "tosca.artifacts.Implementation" } } -} \ No newline at end of file +} diff --git a/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Templates/another-template.jinja b/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Templates/another-template.jinja new file mode 100644 index 000000000..026c59176 --- /dev/null +++ b/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Templates/another-template.jinja @@ -0,0 +1 @@ +This is Sample Velocity Template \ No newline at end of file diff --git a/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Templates/another-template.vtl b/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Templates/another-template.vtl deleted file mode 100644 index 026c59176..000000000 --- a/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Templates/another-template.vtl +++ /dev/null @@ -1 +0,0 @@ -This is Sample Velocity Template \ No newline at end of file diff --git a/components/model-catalog/definition-type/starter-type/artifact_type/artifact-template-jinja.json b/components/model-catalog/definition-type/starter-type/artifact_type/artifact-template-jinja.json new file mode 100644 index 000000000..5d4fcc3f6 --- /dev/null +++ b/components/model-catalog/definition-type/starter-type/artifact_type/artifact-template-jinja.json @@ -0,0 +1,8 @@ +{ + "description": " Jinja Template used for Configuration", + "version": "1.0.0", + "file_ext": [ + "jinja" + ], + "derived_from": "tosca.artifacts.Implementation" +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt index 31cb9ca77..51062256d 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt @@ -1,6 +1,6 @@ /* * Copyright © 2017-2018 AT&T Intellectual Property. - * Modifications Copyright © 2018-2019 IBM. + * Modifications Copyright © 2018-2019 IBM, Bell Canada * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,10 +46,10 @@ interface ResourceResolutionService { artifactNames: List, properties: Map): MutableMap suspend fun resolveResources(bluePrintRuntimeService: BluePrintRuntimeService<*>, nodeTemplateName: String, - artifactPrefix: String, properties: Map): String + artifactPrefix: String, properties: Map): String suspend fun resolveResources(bluePrintRuntimeService: BluePrintRuntimeService<*>, nodeTemplateName: String, - artifactMapping: String, artifactTemplate: String?): String + artifactMapping: String, artifactTemplate: String?): String suspend fun resolveResourceAssignments(blueprintRuntimeService: BluePrintRuntimeService<*>, resourceDefinitions: MutableMap, @@ -77,26 +77,27 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica } override suspend fun resolveResources(bluePrintRuntimeService: BluePrintRuntimeService<*>, nodeTemplateName: String, - artifactNames: List, - properties: Map): MutableMap { + artifactNames: List, properties: Map): MutableMap { val resolvedParams: MutableMap = hashMapOf() artifactNames.forEach { artifactName -> - val resolvedContent = resolveResources(bluePrintRuntimeService, nodeTemplateName, artifactName, properties) + val resolvedContent = resolveResources(bluePrintRuntimeService, nodeTemplateName, + artifactName, properties) resolvedParams[artifactName] = resolvedContent } return resolvedParams } override suspend fun resolveResources(bluePrintRuntimeService: BluePrintRuntimeService<*>, nodeTemplateName: String, - artifactPrefix: String, properties: Map): String { + artifactPrefix: String, properties: Map): String { // Velocity Artifact Definition Name val artifactTemplate = "$artifactPrefix-template" // Resource Assignment Artifact Definition Name val artifactMapping = "$artifactPrefix-mapping" - val result = resolveResources(bluePrintRuntimeService, nodeTemplateName, artifactMapping, artifactTemplate) + val result = resolveResources(bluePrintRuntimeService, nodeTemplateName, + artifactMapping, artifactTemplate) if (properties.containsKey(ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_STORE_RESULT) && properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_STORE_RESULT] as Boolean) { @@ -109,7 +110,7 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica override suspend fun resolveResources(bluePrintRuntimeService: BluePrintRuntimeService<*>, nodeTemplateName: String, - artifactMapping: String, artifactTemplate: String?): String { + artifactMapping: String, artifactTemplate: String?): String { val resolvedContent: String log.info("Resolving resource for template artifact($artifactTemplate) with resource assignment artifact($artifactMapping)") @@ -136,9 +137,12 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica // Check Template is there if (artifactTemplate != null) { + val blueprintTemplateService = BluePrintTemplateService(bluePrintRuntimeService, nodeTemplateName, artifactTemplate) val templateContent = bluePrintRuntimeService.resolveNodeTemplateArtifact(nodeTemplateName, artifactTemplate) - resolvedContent = BluePrintTemplateService.generateContent(templateContent, resolvedParamJsonContent) + + resolvedContent = blueprintTemplateService.generateContent(templateContent, resolvedParamJsonContent) + } else { resolvedContent = resolvedParamJsonContent } diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt index e9bb2ffe4..8dbd47cc2 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt @@ -1,6 +1,7 @@ /* * Copyright © 2018 IBM. - * Modifications Copyright © 2017-2018 AT&T Intellectual Property. + * + * Modifications Copyright © 2017-2019 AT&T, Bell Canada * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +26,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintFunctionNode -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintTemplateService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintVelocityTemplateService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition @@ -79,11 +80,12 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode): String { + open suspend fun resolveFromInputKeyMapping(valueToResolve: String, keyMapping: MutableMap): + String { if (valueToResolve.isEmpty() || !valueToResolve.contains("$")) { return valueToResolve } - return BluePrintTemplateService.generateContent(valueToResolve, additionalContext = keyMapping) + return BluePrintVelocityTemplateService.generateContent(valueToResolve, additionalContext = keyMapping) } final override suspend fun applyNB(resourceAssignment: ResourceAssignment): Boolean { diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt index cd93852bd..9852e3438 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt @@ -1,6 +1,6 @@ /* * Copyright © 2018 IBM. - * Modifications Copyright © 2017-2018 AT&T Intellectual Property. + * Modifications Copyright © 2017-2019 AT&T, Bell Canada * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,10 +71,9 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS JacksonUtils.getInstanceFromMap(resourceSourceProperties, RestResourceSource::class.java) val path = nullToEmpty(sourceProperties.path) - val inputKeyMapping = checkNotNull(sourceProperties.inputKeyMapping) { - "failed to get input-key-mappings for $dName under $dSource properties" - } - val resolvedInputKeyMapping = resolveInputKeyMappingVariables(inputKeyMapping) + val inputKeyMapping = + checkNotNull(sourceProperties.inputKeyMapping) { "failed to get input-key-mappings for $dName under $dSource properties" } + val resolvedInputKeyMapping = resolveInputKeyMappingVariables(inputKeyMapping).toMutableMap() // Resolving content Variables val payload = resolveFromInputKeyMapping(nullToEmpty(sourceProperties.payload), resolvedInputKeyMapping) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt index f7f4a98d1..3f251b104 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt @@ -1,9 +1,7 @@ /* * Copyright © 2017-2018 AT&T Intellectual Property. * - * Modifications Copyright © 2018 IBM. - * - * Modifications Copyright © 2019 IBM, Bell Canada. + * Modifications Copyright © 2018 - 2019 IBM, Bell Canada. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/BlueprintJythonServiceTest.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/BlueprintJythonServiceTest.kt index 5c9ae9933..dd417e56d 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/BlueprintJythonServiceTest.kt +++ b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/BlueprintJythonServiceTest.kt @@ -18,7 +18,6 @@ package org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts import io.mockk.every import io.mockk.mockk -import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction @@ -48,7 +47,7 @@ class BlueprintJythonServiceTest { blueprintContext = mockk() every { blueprintContext.rootPath } returns normalizedPathName("target") } - + @Test fun testGetAbstractPythonPlugin() { val content = JacksonUtils.getClassPathFileContent("scripts/SamplePythonComponentNode.py") @@ -60,7 +59,7 @@ class BlueprintJythonServiceTest { assertNotNull(abstractPythonPlugin, "failed to get python component") } - + @Test fun testGetAbstractJythonComponent() { val scriptInstance = "test-classes/scripts/SamplePythonComponentNode.py" diff --git a/ms/blueprintsprocessor/parent/pom.xml b/ms/blueprintsprocessor/parent/pom.xml index 772c73935..c9505cb94 100755 --- a/ms/blueprintsprocessor/parent/pom.xml +++ b/ms/blueprintsprocessor/parent/pom.xml @@ -2,8 +2,7 @@ org.jetbrains.kotlin diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintConstants.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintConstants.kt index 23c52b4b3..9a652fb92 100644 --- a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintConstants.kt +++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintConstants.kt @@ -1,6 +1,6 @@ /* * Copyright © 2017-2018 AT&T Intellectual Property. - * Modifications Copyright © 2018 IBM. + * Modifications Copyright © 2018 - 2019 IBM, Bell Canada * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -180,5 +180,6 @@ object BluePrintConstants { const val PROPERTY_CURRENT_IMPLEMENTATION = "current-implementation" const val PROPERTY_EXECUTION_REQUEST = "execution-request" - + const val ARTIFACT_VELOCITY_TYPE_NAME = "artifact-template-velocity" + const val ARTIFACT_JINJA_TYPE_NAME = "artifact-template-jinja" } \ No newline at end of file diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/interfaces/BlueprintTemplateService.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/interfaces/BlueprintTemplateService.kt new file mode 100644 index 000000000..ec1542cd3 --- /dev/null +++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/interfaces/BlueprintTemplateService.kt @@ -0,0 +1,56 @@ +/* + * Copyright © 2019 IBM, Bell Canada. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.ccsdk.cds.controllerblueprints.core.interfaces + +import com.fasterxml.jackson.core.io.CharTypes +import com.fasterxml.jackson.databind.node.JsonNodeFactory +import com.fasterxml.jackson.databind.node.TextNode + +interface BlueprintTemplateService { + + /** + * Generate dynamique content using Velocity Template or Jinja template + * + * @param template template string content + * @param json json string content + * @param ignoreJsonNull Ignore Null value in the JSON content + * @param additionalContext (Key, value) mutable map for additional variables + * @return Content result + * + **/ + suspend fun generateContent(template: String, json: String = "", ignoreJsonNull: Boolean = false, + additionalContext: MutableMap = mutableMapOf()): String +} + +/** + * Customise JsonNodeFactory and TextNode, Since it introduces quotes for string data. + */ +open class BluePrintJsonNodeFactory : JsonNodeFactory() { + override fun textNode(text: String): TextNode { + return BluePrintTextNode(text) + } +} + +open class BluePrintTextNode(v: String) : TextNode(v) { + override fun toString(): String { + var len = this._value.length + len = len + 2 + (len shr 4) + val sb = StringBuilder(len) + CharTypes.appendQuoted(sb, this._value) + return sb.toString() + } + +} \ No newline at end of file diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintJinjaTemplateService.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintJinjaTemplateService.kt new file mode 100644 index 000000000..f835cbe52 --- /dev/null +++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintJinjaTemplateService.kt @@ -0,0 +1,52 @@ +/* + * Copyright © 2019 IBM, Bell Canada. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.ccsdk.cds.controllerblueprints.core.service + +import com.fasterxml.jackson.databind.JsonNode +import com.fasterxml.jackson.databind.ObjectMapper +import com.hubspot.jinjava.Jinjava +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintJsonNodeFactory +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTemplateService +import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils + + +object BluePrintJinjaTemplateService: BlueprintTemplateService { + + override suspend fun generateContent(template: String, json: String, ignoreJsonNull: Boolean, + additionalContext: MutableMap): String { + // Load template + val jinJava = Jinjava() + val mapper = ObjectMapper() + val nodeFactory = BluePrintJsonNodeFactory() + mapper.nodeFactory = nodeFactory + + // Add the JSON Data to the context + if (json.isNotEmpty()) { + val jsonNode = mapper.readValue(json, JsonNode::class.java) + ?: throw BluePrintProcessorException("couldn't get json node from json") + if (ignoreJsonNull) + JacksonUtils.removeJsonNullNode(jsonNode) + jsonNode.fields().forEach { entry -> + additionalContext[entry.key] = entry.value + } + } + + return jinJava.render(template, additionalContext.toMap()) + } +} + diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateService.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateService.kt deleted file mode 100644 index 4e2184d3f..000000000 --- a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateService.kt +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.onap.ccsdk.cds.controllerblueprints.core.service - -import com.fasterxml.jackson.core.io.CharTypes -import com.fasterxml.jackson.databind.JsonNode -import com.fasterxml.jackson.databind.ObjectMapper -import com.fasterxml.jackson.databind.node.JsonNodeFactory -import com.fasterxml.jackson.databind.node.TextNode -import org.apache.commons.lang3.BooleanUtils -import org.apache.commons.lang3.StringUtils -import org.apache.velocity.VelocityContext -import org.apache.velocity.app.Velocity -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException -import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils -import java.io.StringWriter - -open class BluePrintTemplateService { - - companion object { - - /** - * Generate Content from Velocity Template and JSON Content or property map. - */ - fun generateContent(template: String, json: String = "", - ignoreJsonNull: Boolean = false, - additionalContext: Map = hashMapOf()): String { - Velocity.init() - val mapper = ObjectMapper() - val nodeFactory = BluePrintJsonNodeFactory() - mapper.nodeFactory = nodeFactory - - val velocityContext = VelocityContext() - velocityContext.put("StringUtils", StringUtils::class.java) - velocityContext.put("BooleanUtils", BooleanUtils::class.java) - - // Add the Custom Velocity Context API - additionalContext.forEach { name, value -> velocityContext.put(name, value) } - - // Add the JSON Data to the context - if (json.isNotEmpty()) { - val jsonNode = mapper.readValue(json, JsonNode::class.java) - ?: throw BluePrintProcessorException("couldn't get json node from json") - if (ignoreJsonNull) - JacksonUtils.removeJsonNullNode(jsonNode) - jsonNode.fields().forEach { entry -> - velocityContext.put(entry.key, entry.value) - } - } - - val stringWriter = StringWriter() - Velocity.evaluate(velocityContext, stringWriter, "TemplateData", template) - stringWriter.flush() - return stringWriter.toString() - } - } -} - -/** - * Customise JsonNodeFactory adn TextNode, Since it introduces quotes for string data. - */ -open class BluePrintJsonNodeFactory : JsonNodeFactory() { - override fun textNode(text: String): TextNode { - return BluePrintTextNode(text) - } -} - -open class BluePrintTextNode(v: String) : TextNode(v) { - override fun toString(): String { - var len = this._value.length - len = len + 2 + (len shr 4) - val sb = StringBuilder(len) - CharTypes.appendQuoted(sb, this._value) - return sb.toString() - } - -} - diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintVelocityTemplateService.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintVelocityTemplateService.kt new file mode 100644 index 000000000..4b6905bff --- /dev/null +++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintVelocityTemplateService.kt @@ -0,0 +1,69 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * + * Modifications Copyright © 2019 IBM, Bell Canada. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.ccsdk.cds.controllerblueprints.core.service + +import com.fasterxml.jackson.databind.JsonNode +import com.fasterxml.jackson.databind.ObjectMapper +import org.apache.commons.lang3.BooleanUtils +import org.apache.commons.lang3.StringUtils +import org.apache.velocity.VelocityContext +import org.apache.velocity.app.Velocity +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintJsonNodeFactory +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTemplateService +import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils +import java.io.StringWriter + +object BluePrintVelocityTemplateService: BlueprintTemplateService { + + /** + * Generate Content from Velocity Template and JSON Content or property map. + */ + override suspend fun generateContent(template: String, json: String, ignoreJsonNull: Boolean, additionalContext: + MutableMap): String { + Velocity.init() + val mapper = ObjectMapper() + val nodeFactory = BluePrintJsonNodeFactory() + mapper.nodeFactory = nodeFactory + + val velocityContext = VelocityContext() + velocityContext.put("StringUtils", StringUtils::class.java) + velocityContext.put("BooleanUtils", BooleanUtils::class.java) + + // Add the Custom Velocity Context API + additionalContext.forEach { name, value -> velocityContext.put(name, value) } + + // Add the JSON Data to the context + if (json.isNotEmpty()) { + val jsonNode = mapper.readValue(json, JsonNode::class.java) + ?: throw BluePrintProcessorException("couldn't get json node from json") + if (ignoreJsonNull) + JacksonUtils.removeJsonNullNode(jsonNode) + jsonNode.fields().forEach { entry -> + velocityContext.put(entry.key, entry.value) + } + } + + val stringWriter = StringWriter() + Velocity.evaluate(velocityContext, stringWriter, "TemplateData", template) + stringWriter.flush() + return stringWriter.toString() + } +} + diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BlueprintTemplateService.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BlueprintTemplateService.kt new file mode 100644 index 000000000..73457b986 --- /dev/null +++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BlueprintTemplateService.kt @@ -0,0 +1,49 @@ +/* + * Copyright © 2019 IBM, Bell Canada + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.ccsdk.cds.controllerblueprints.core.service + +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTemplateService +import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils + +class BluePrintTemplateService(val bluePrintRuntimeService: BluePrintRuntimeService<*>, + val nodeTemplateName: String, val artifactName: String): + BlueprintTemplateService { + + override suspend fun generateContent(template: String, json: String, ignoreJsonNull: Boolean, additionalContext: MutableMap): String { + val artifactDefinition = bluePrintRuntimeService.resolveNodeTemplateArtifactDefinition(nodeTemplateName, artifactName) + val templateType = artifactDefinition.type + return when (templateType) { + BluePrintConstants.ARTIFACT_JINJA_TYPE_NAME -> { + BluePrintJinjaTemplateService.generateContent(template, json, ignoreJsonNull, additionalContext) + } + BluePrintConstants.ARTIFACT_VELOCITY_TYPE_NAME -> { + BluePrintVelocityTemplateService.generateContent(template, json, ignoreJsonNull, additionalContext) + } + else -> { + throw BluePrintProcessorException("Unknown Artifact type, expecting ${BluePrintConstants.ARTIFACT_JINJA_TYPE_NAME}" + + "or ${BluePrintConstants.ARTIFACT_VELOCITY_TYPE_NAME}") + } + } + } + + suspend fun generateContentFromFiles(templatePath: String, jsonPath: String, ignoreJsonNull: Boolean, additionalContext: MutableMap): String { + val json = JacksonUtils.getClassPathFileContent(jsonPath) + val template = JacksonUtils.getClassPathFileContent(templatePath) + return generateContent(template, json, ignoreJsonNull, additionalContext) + } +} \ No newline at end of file diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateServiceTest.kt b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateServiceTest.kt index 6a193c37e..e4227180b 100644 --- a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateServiceTest.kt +++ b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateServiceTest.kt @@ -1,6 +1,8 @@ /* * Copyright © 2017-2018 AT&T Intellectual Property. * + * Modifications Copyright © 2019 IBM, Bell Canada. + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,20 +18,85 @@ package org.onap.ccsdk.cds.controllerblueprints.core.service +import kotlinx.coroutines.runBlocking import org.junit.Test +import org.junit.runner.RunWith +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils +import org.springframework.test.context.junit4.SpringRunner +import kotlin.test.BeforeTest import kotlin.test.assertNotNull +@RunWith(SpringRunner::class) class BluePrintTemplateServiceTest { + lateinit var blueprintRuntime: BluePrintRuntimeService<*> + + @BeforeTest + fun setup() { + val blueprintBasePath: String = ("./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration") + blueprintRuntime = BluePrintMetadataUtils.getBluePrintRuntime("1234", blueprintBasePath) + } + @Test - fun testGenerateContent() { + fun testVelocityGeneratedContent() { + runBlocking { + val template = JacksonUtils.getClassPathFileContent("templates/base-config-velocity-template.vtl") + val json = JacksonUtils.getClassPathFileContent("templates/base-config-data-velocity.json") - val template = JacksonUtils.getClassPathFileContent("templates/base-config-template.vtl") - val json = JacksonUtils.getClassPathFileContent("templates/base-config-data.json") + val content = BluePrintVelocityTemplateService.generateContent(template, json) + assertNotNull(content, "failed to generate content for velocity template") + } - val content = BluePrintTemplateService.generateContent(template, json) - assertNotNull(content, "failed to generate content for velocity template") + } + + @Test + fun testJinjaGeneratedContent() { + runBlocking { + val template = JacksonUtils.getClassPathFileContent("templates/base-config-jinja-template.jinja") + val json = JacksonUtils.getClassPathFileContent("templates/base-config-data-jinja.json") + + var element: MutableMap = mutableMapOf() + element["additional_array"] = arrayListOf(hashMapOf("name" to "Element1", "location" to "Region0"), hashMapOf("name" to "Element2", "location" to "Region1")) + + val content = BluePrintJinjaTemplateService.generateContent(template, json, false, element) + assertNotNull(content, "failed to generate content for velocity template") + } } -} \ No newline at end of file + + @Test + fun testVelocityGeneratedContentFromFiles() { + runBlocking { + val bluePrintTemplateService = BluePrintTemplateService(blueprintRuntime, + "resource-assignment", "baseconfig-template") + val templateFile = "templates/base-config-velocity-template.vtl" + val jsonFile = "templates/base-config-data-velocity.json" + + val content = bluePrintTemplateService.generateContentFromFiles( + templateFile, jsonFile, false, mutableMapOf()) + assertNotNull(content, "failed to generate content for velocity template") + } + + } + + @Test + fun testJinjaGeneratedContentFromFiles() { + runBlocking { + var element: MutableMap = mutableMapOf() + element["additional_array"] = arrayListOf(hashMapOf("name" to "Element1", "location" to "Region0"), hashMapOf("name" to "Element2", "location" to "Region1")) + + val bluePrintTemplateService = BluePrintTemplateService(blueprintRuntime, + "resource-assignment", "another-template") + + val templateFile = "templates/base-config-jinja-template.jinja" + val jsonFile = "templates/base-config-data-jinja.json" + + val content = bluePrintTemplateService.generateContentFromFiles( + templateFile, + jsonFile, false, element) + assertNotNull(content, "failed to generate content for velocity template") + } + } +} + diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-data-jinja.json b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-data-jinja.json new file mode 100644 index 000000000..bbfb38d80 --- /dev/null +++ b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-data-jinja.json @@ -0,0 +1,16 @@ +{ + "node_hostname": "sdnc-host", + "node_backup_router_address": "2001:1890:1253::192:168:100:1", + "node_backup_router_d_address": "2011:1090:1253::112:158:100:1", + "servers": [ + "Server1", + "Server2", + "Server3" + ], + "classes": [ + "superuser-class", + "tacacs-adv-class", + "tacacs-base-class" + ], + "system_password": "teamops-system-password" +} \ No newline at end of file diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-data-velocity.json b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-data-velocity.json new file mode 100755 index 000000000..2acc6fcdd --- /dev/null +++ b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-data-velocity.json @@ -0,0 +1,36 @@ +{ + "node0_hostname": "sdnc-host", + "node0_backup_router_address": "2001:1890:1253::192:168:100:1", + "servers": [ + "Server1", + "Server2", + "Server3" + ], + "tacplus-servers": [ + { + "tacplus-server-name": "tacplus-server-name1", + "tacplus-server-source-address": "enc-dsdsasa1" + }, + { + "tacplus-server-name": "tacplus-server-name2", + "tacplus-server-source-address": "enc-dsdsasa2" + } + ], + "classes": [ + { + "name": "superuser-class", + "idle-timeout": 5, + "permissions": "all" + }, + { + "name": "tacacs-adv-class", + "idle-timeout": 5 + }, + { + "name": "tacacs-base-class", + "idle-timeout": 5 + } + ], + "system-password": "teamops-system-password", + "root-password": "teamops-root-password" +} diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-data.json b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-data.json deleted file mode 100755 index 2acc6fcdd..000000000 --- a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-data.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "node0_hostname": "sdnc-host", - "node0_backup_router_address": "2001:1890:1253::192:168:100:1", - "servers": [ - "Server1", - "Server2", - "Server3" - ], - "tacplus-servers": [ - { - "tacplus-server-name": "tacplus-server-name1", - "tacplus-server-source-address": "enc-dsdsasa1" - }, - { - "tacplus-server-name": "tacplus-server-name2", - "tacplus-server-source-address": "enc-dsdsasa2" - } - ], - "classes": [ - { - "name": "superuser-class", - "idle-timeout": 5, - "permissions": "all" - }, - { - "name": "tacacs-adv-class", - "idle-timeout": 5 - }, - { - "name": "tacacs-base-class", - "idle-timeout": 5 - } - ], - "system-password": "teamops-system-password", - "root-password": "teamops-root-password" -} diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-jinja-template.jinja b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-jinja-template.jinja new file mode 100755 index 000000000..db900bc8b --- /dev/null +++ b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-jinja-template.jinja @@ -0,0 +1,42 @@ + + 15.1X49-D50.3 + + node0 + + {%- for server in servers %} + {{ server }} + {%- endfor %} + + + {{ node_hostname }} + +
{{ node_backup_router_address }}
+ {{ node_backup_router_d_address }} +
+ + ONAP information assets + {%- for class in classes %} + + {{ class }} + + {%- endfor %} + + readwrite + Read - Write Account Access + 1002 + tacacs-adv-class + + {{ system_password }} + + + + {%- for element in additional_array %} + + {{ element.name }} + {{ element.location }} + + {%- endfor %} +
+
+
\ No newline at end of file diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-template.vtl b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-template.vtl deleted file mode 100755 index f7b1269b3..000000000 --- a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-template.vtl +++ /dev/null @@ -1,61 +0,0 @@ - - 15.1X49-D50.3 - - node0 - - #foreach($server in ${servers}) - $StringUtils.upperCase("$server") - #end - - - ${node0_hostname} - -
${node0_backup_router_address}
- $node0_backup_router_address -
- #foreach($tacplus-server in ${tacplus-servers}) - - $tacplus-server.tacplus-server-name - $tacplus-server.tacplus-server-source-address - - #end - - ONAP information assets - #foreach($class in ${classes}) - - $class.name - $class.idle-timeout - #if ($class.permissions) - $class.permissions - #end - - #end - - readonly - Read Only Account Access - 1001 - tacacs-base-class - - - readwrite - Read - Write Account Access - 1002 - tacacs-adv-class - - ${system-password} - - - - readwrite - Emergency Access Only - 1000 - superuser-class - - ${root-password} - - - -
-
-
\ No newline at end of file diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-velocity-template.vtl b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-velocity-template.vtl new file mode 100755 index 000000000..f7b1269b3 --- /dev/null +++ b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-velocity-template.vtl @@ -0,0 +1,61 @@ + + 15.1X49-D50.3 + + node0 + + #foreach($server in ${servers}) + $StringUtils.upperCase("$server") + #end + + + ${node0_hostname} + +
${node0_backup_router_address}
+ $node0_backup_router_address +
+ #foreach($tacplus-server in ${tacplus-servers}) + + $tacplus-server.tacplus-server-name + $tacplus-server.tacplus-server-source-address + + #end + + ONAP information assets + #foreach($class in ${classes}) + + $class.name + $class.idle-timeout + #if ($class.permissions) + $class.permissions + #end + + #end + + readonly + Read Only Account Access + 1001 + tacacs-base-class + + + readwrite + Read - Write Account Access + 1002 + tacacs-adv-class + + ${system-password} + + + + readwrite + Emergency Access Only + 1000 + superuser-class + + ${root-password} + + + +
+
+
\ No newline at end of file diff --git a/ms/controllerblueprints/modules/service/pom.xml b/ms/controllerblueprints/modules/service/pom.xml index f47a5b467..40a5c259d 100644 --- a/ms/controllerblueprints/modules/service/pom.xml +++ b/ms/controllerblueprints/modules/service/pom.xml @@ -4,6 +4,8 @@ ~ ~ Modifications Copyright © 2018 IBM. ~ + ~ Modifications Copyright © 2019 IBM, Bell Canada + ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at @@ -51,6 +53,10 @@ org.apache.velocity velocity
+ + com.hubspot.jinjava + jinjava + org.springframework.boot spring-boot-starter-webflux diff --git a/ms/controllerblueprints/parent/pom.xml b/ms/controllerblueprints/parent/pom.xml index 50cfae197..276c4001b 100644 --- a/ms/controllerblueprints/parent/pom.xml +++ b/ms/controllerblueprints/parent/pom.xml @@ -2,7 +2,7 @@