summaryrefslogtreecommitdiffstats
path: root/appc-config
diff options
context:
space:
mode:
authorSonali Das <sd394g@att.com>2017-10-06 14:38:04 -0400
committerSkip Wonnell <skip@att.com>2017-10-10 18:39:28 +0000
commitc4842e4992d4f8dfc7ec38da6c4f6d69a1e223ab (patch)
tree4abbe71f0208537296c578ad37f6899db7d5cdd5 /appc-config
parent42526790eb146a842307bcfb35adb50d1673a7f6 (diff)
Change for Quote Issue
Issue-ID : APPC-221 Change in appc-config-generator appc-artifact-handler Change-Id: I9abaef2839ca60f10855a61c48fa696be012db5f Signed-off-by: Sonali Das <sd394g@att.com>
Diffstat (limited to 'appc-config')
-rw-r--r--appc-config/appc-config-generator/provider/src/main/java/org/openecomp/sdnc/config/generator/merge/MergeNode.java8
-rw-r--r--appc-config/appc-config-generator/provider/src/main/java/org/openecomp/sdnc/config/generator/tool/EscapeUtils.java11
2 files changed, 17 insertions, 2 deletions
diff --git a/appc-config/appc-config-generator/provider/src/main/java/org/openecomp/sdnc/config/generator/merge/MergeNode.java b/appc-config/appc-config-generator/provider/src/main/java/org/openecomp/sdnc/config/generator/merge/MergeNode.java
index b7dd32893..3369f7588 100644
--- a/appc-config/appc-config-generator/provider/src/main/java/org/openecomp/sdnc/config/generator/merge/MergeNode.java
+++ b/appc-config/appc-config-generator/provider/src/main/java/org/openecomp/sdnc/config/generator/merge/MergeNode.java
@@ -1,3 +1,4 @@
+
/*-
* ============LICENSE_START=======================================================
* ONAP : APP-C
@@ -5,7 +6,7 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+i * 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
@@ -28,6 +29,7 @@ import org.apache.commons.lang3.StringUtils;
import org.openecomp.sdnc.config.generator.ConfigGeneratorConstant;
import org.openecomp.sdnc.config.generator.tool.JSONTool;
import org.openecomp.sdnc.config.generator.tool.MergeTool;
+import org.openecomp.sdnc.config.generator.tool.EscapeUtils;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
@@ -71,7 +73,9 @@ public class MergeNode implements SvcLogicJavaPlugin {
if(dataMap != null){
String mergedData = MergeTool.mergeMap2TemplateData(templateData, dataMap);
if(mergedData != null){
- ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_MERGED_DATA,mergedData);
+ // ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_MERGED_DATA,mergedData);
+ ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_MERGED_DATA,EscapeUtils.unescapeSql(mergedData));
+
}
}
ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
diff --git a/appc-config/appc-config-generator/provider/src/main/java/org/openecomp/sdnc/config/generator/tool/EscapeUtils.java b/appc-config/appc-config-generator/provider/src/main/java/org/openecomp/sdnc/config/generator/tool/EscapeUtils.java
index f783d4c69..36afe76ae 100644
--- a/appc-config/appc-config-generator/provider/src/main/java/org/openecomp/sdnc/config/generator/tool/EscapeUtils.java
+++ b/appc-config/appc-config-generator/provider/src/main/java/org/openecomp/sdnc/config/generator/tool/EscapeUtils.java
@@ -36,6 +36,17 @@ public class EscapeUtils {
String replacementList[] = new String[]{ "''","\\\\"};
return StringUtils.replaceEach(str,searchList, replacementList);
}
+
+ public static String unescapeSql(String str) {
+ if (str == null) {
+ return null;
+ }
+
+ String searchList[] = new String[] {"''"};
+ String replacementList[] = new String[] {"'"};
+ return StringUtils.replaceEach(str, searchList, replacementList);
+ }
+
// For Generic Purpose
public static String escapeSQL(String s) {