+
/*-
* ============LICENSE_START=======================================================
* ONAP : APP-C
* 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
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;
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);
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) {
QueryStatus status = null;
if (isUpdate)
key = "update " + SdcArtifactHandlerConstants.DB_DEVICE_AUTHENTICATION + " set USER_NAME = $"
- + SdcArtifactHandlerConstants.USER_NAME + " , PASSWORD = 'dummy' " + " , PORT_NUMBER = $"
+ + SdcArtifactHandlerConstants.USER_NAME +/* " , PASSWORD = 'dummy' " +*/ " , PORT_NUMBER = $"
+ SdcArtifactHandlerConstants.PORT_NUMBER + " where VNF_TYPE = $"
+ SdcArtifactHandlerConstants.VNF_TYPE;
else
key = "insert into " + SdcArtifactHandlerConstants.DB_DEVICE_AUTHENTICATION + " set VNF_TYPE = $"
+ SdcArtifactHandlerConstants.VNF_TYPE + " , USER_NAME = $" + SdcArtifactHandlerConstants.USER_NAME
- + " , PASSWORD = 'dummy' " + " , PORT_NUMBER = $" + SdcArtifactHandlerConstants.PORT_NUMBER;
+ +/* " , PASSWORD = 'dummy' " + */ " , PORT_NUMBER = $" + SdcArtifactHandlerConstants.PORT_NUMBER;
if (serviceLogic != null && context != null) {
status = serviceLogic.save("SQL", false, false, key, null, null, context);