2 ============LICENSE_START==========================================
3 ===================================================================
4 Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
5 ===================================================================
6 Copyright (C) 2018 IBM.
7 ===================================================================
9 Unless otherwise specified, all software contained herein is licensed
10 under the Apache License, Version 2.0 (the License);
11 you may not use this software except in compliance with the License.
12 You may obtain a copy of the License at
14 http://www.apache.org/licenses/LICENSE-2.0
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
22 ============LICENSE_END============================================
25 import { Component, Input, OnInit, ViewChild } from '@angular/core';
26 import { HttpUtilService } from '../../../../shared/services/httpUtil/http-util.service';
27 import { MappingEditorService } from '../../../../shared/services/mapping-editor.service';
28 import { ArtifactRequest } from '../../../../shared/models/index';
29 import { ActivatedRoute, Router } from '@angular/router';
30 import { saveAs } from 'file-saver';
31 import { NotificationService } from '../../../../shared/services/notification.service';
32 import { NotificationsService } from 'angular2-notifications';
33 import { ParamShareService } from '../../../../shared/services/paramShare.service';
34 import { DialogService } from 'ng2-bootstrap-modal';
35 import { ConfirmComponent } from '../../../../shared/confirmModal/confirm.component';
36 import { BuildDesignComponent } from '../../build-artifacts.component';
37 import { environment } from '../../../../../environments/environment';
38 import { ModalComponent } from 'ng2-bs3-modal/ng2-bs3-modal';
39 import { NgProgress } from 'ngx-progressbar';
40 import { NgxSpinnerService } from 'ngx-spinner';
41 import { UtilityService } from '../../../../shared/services/utilityService/utility.service';
44 @Component({ selector: 'app-golden-configuration', templateUrl: './template-configuration.component.html', styleUrls: ['./template-configuration.component.css'] })
45 export class GoldenConfigurationComponent implements OnInit {
46 @ViewChild('templateeditor') templateeditor;
47 @Input() configMappingEditorContent: string;
48 @Input() isMappingComp: boolean;
49 @ViewChild('myInput') myInputVariable: any;
50 @ViewChild('myModal') modal: ModalComponent;
53 showTemplateVersionDiv: any;
54 downloadedTemplateFileName: any;
55 downloadedParamFileName: any;
56 templateVersionNo: any = '0.0.1';
57 saveToGuiCacheFlag = 'false';
59 public referenceData: Array<Object> = [];
60 public scopeName: any;
61 public subscription: any;
62 public item: any = {};
63 public goldenActions: Array<string> = [];
64 public refNameObj = {};
66 public artifactName = '';
68 public showError: boolean = false;
69 public tempretrieveFlag: boolean = false;
70 public fileNameForTempSave;
72 showDownloadDiv: boolean = false;
74 enableBrowse: boolean = true;
75 enableMerge: boolean = false;
76 uploadValidationSuccess: boolean = false;
77 fileExtension: any = "xml";
78 apiToken = localStorage['apiToken'];
79 public appDataObject: any;
80 public downloadDataObject: any;
81 public checkNameEntered: boolean = true;
82 public selectedWord: any = this.mappingEditorService.getSelectedWord();
84 { action: "ConfigBackup", value: "ConfigBackup" },
85 { action: "ConfigModify", value: "ConfigModify" },
86 { action: "ConfigRestore", value: "ConfigRestore" },
87 { action: "Configure", value: "Configure" },
88 { action: "GetRunningConfig", value: "GetRunningConfig" },
89 { action: "HealthCheck", value: "HealthCheck" },
90 { action: "StartApplication", value: "StartApplication" },
91 { action: "StopApplication", value: "StopApplication" }
95 showProgressBar: true,
101 public enableDownloadButtons: boolean = false;
103 private buildDesignComponent: BuildDesignComponent,
104 private paramShareService: ParamShareService,
105 private dialogService: DialogService,
106 private notificationService: NotificationService,
107 private httpUtil: HttpUtilService,
108 private mappingEditorService: MappingEditorService,
109 private activeRoutes: ActivatedRoute,
110 private router: Router,
111 private nService: NotificationsService,
112 private ngProgress: NgProgress,
113 private spinner: NgxSpinnerService,
114 private utilityService: UtilityService) {
115 this.artifactRequest.action = '';
116 this.artifactRequest.version = '';
117 this.artifactRequest.paramsContent = '{}';
118 this.artifactRequest.paramKeysContent = '';
120 public templateEditor: any;
121 public fileType: any = '';
122 public actionType: any;
123 public myfileName: any;
124 userId = localStorage['userId'];
125 public artifactRequest: ArtifactRequest = new ArtifactRequest();
126 public showUploadStatus: boolean = false;
127 public uploadStatus: boolean = false;
128 public uploadTypes = [
130 value: 'Generated Template',
131 display: 'Sample Json Param File'
134 value: 'Mapping Data',
135 display: 'Sample Json Param File'
145 enableValidateTemplate: boolean = false;;
146 public selectedUploadType: string = this.uploadTypes[0].value;
148 public tempRetrievalResponse: any;
149 public mergeStatus: boolean = false;
151 //======================================Start of ngOnInit() Method============================================
153 var refObj = this.refObj = this.prepareFileName();
154 if (refObj && refObj != undefined) {
157 this.vnfType = this.item.scope["vnf-type"];
158 this.vnfcType = this.item.scope["vnfc-type"];
159 this.protocol = this.item['device-protocol'];
160 this.action = this.item.action;
161 this.artifactRequest.action = this.item.action;
162 this.artifactRequest.vnfType = this.vnfType;
163 if (this.vnfcType != undefined && this.vnfcType.length != 0) {
164 this.scopeName = this.vnfcType;
167 this.scopeName = this.vnfType;
171 this.item = { "action": "", "scope": { "vnf-type": "", "vnfc-type": "" }, "vm": [], "protocol": "", "download-dg-reference": "", "user-name": "", "port-number": "", "artifact-list": [], "deviceTemplate": "", "scopeType": "" };
173 this.initialAction = this.item.action;
174 this.activeRoutes.url.subscribe(UrlSegment => {
175 this.actionType = UrlSegment[0].path
177 this.mappingEditorService.fromScreen = 'MappingScreen';
178 this.identifier = this.mappingEditorService.identifier;
180 //========================== End of ngOnInit() Method============================================
182 if (this.refObj && this.refObj != undefined) {
183 if (this.configMappingEditorContent && this.configMappingEditorContent != undefined) {
185 this.prepareAppData();
186 this.prepareDownloadData();
187 this.mappingEditorService.changeNavAppData(this.appDataObject);
188 this.mappingEditorService.changeNavDownloadData(this.downloadDataObject);
192 //========================== End of ngOnDestroy() Method============================================
194 if (this.mappingEditorService.latestAction) {
195 this.refNameObj = this.mappingEditorService.latestAction;
196 if (this.vnfcType !== 'null') {
197 this.type = this.vnfcType;
200 this.type = this.vnfType;
202 for (let i = 0; i < this.refNameObj['artifact-list'].length; i++) {
203 let artifactList = this.refNameObj['artifact-list'];
204 if (artifactList[i]['artifact-type'] === 'config_template') {
205 var artifactName = artifactList[i]['artifact-name'];
206 var artifactNameWithoutExtension = '';
208 artifactNameWithoutExtension = artifactName.substring(0, artifactName.lastIndexOf("."));
210 if(this.mappingEditorService.identifier) {
211 if(artifactNameWithoutExtension.endsWith(this.mappingEditorService.identifier)) {
212 this.artifactName = artifactName;
216 this.artifactName = artifactName;
223 this.templateEditor = self.templateeditor.getEditor();
224 this.templateeditor.getEditor().commands.addCommand({
225 name: 'annotateCommandAlternate',
226 bindKey: { win: 'CTRL-4', mac: 'Command-4' },
227 exec: (editor: any) => {
228 this.handleAnnotation(this.modal);
231 this.templateeditor.getEditor().$enableBlockSelect = false;
232 this.templateeditor.getEditor().$enableMultiselect = false;
233 if (this.mappingEditorService.fromScreen === 'MappingScreen') {
234 this.configMappingEditorContent = this.mappingEditorService.getTemplateMappingDataFromStore();
235 this.fileType = sessionStorage.getItem('fileType');
237 if (this.configMappingEditorContent) {
238 this.artifactRequest.templateContent = this.configMappingEditorContent;
239 this.mappingEditorService.initialise(this.templateeditor.getEditor(), this.artifactRequest.templateContent, this.modal);
242 if (this.mappingEditorService.getTemplateMappingDataFromStore() && this.mappingEditorService.getTemplateMappingDataFromStore() != undefined) {
243 this.configMappingEditorContent = this.mappingEditorService.getTemplateMappingDataFromStore();
246 if (this.artifactName) this.retrieveTemplateFromAppc();
251 this.enableBrowse = false;
252 this.nService.error("Error", "Please enter Action and VNF type in Reference Data screen");
256 //========================== End of ngAfterViewInit() Method============================================
258 $("#inputFile").trigger('click');
260 //========================== End of browseOption() Method============================================
262 public saveTemplate() {
263 this.saveToGuiCacheFlag = 'true';
264 this.mappingEditorService.paramData = [];
265 if (this.configMappingEditorContent) {
266 this.initialData = this.configMappingEditorContent;
267 this.mappingEditorService.refreshEditor();
268 let paramArr: any = []
269 if (this.mappingEditorService.paramData && this.mappingEditorService.paramData != undefined) {
270 if (this.mappingEditorService.paramData.length === 0 && this.mappingEditorService.hasErrorCode === true) {
271 this.nService.error("Error", 'Special characters error', 'Error')
275 this.showError = false;
278 this.showTemplateVersionDiv = true;
280 if (this.mappingEditorService.fromScreen === 'MappingScreen') {
281 this.mappingEditorService.setTemplateMappingDataFromStore(this.configMappingEditorContent);
283 if (this.fileType === 'text/xml') {
284 sessionStorage.setItem('fileType', 'text/xml');
286 if (this.fileType === '') {
287 sessionStorage.setItem('fileType', '');
291 //========================== End of saveTemplate() Method============================================
292 retrieveTemplateFromAppc() {
293 let refObj = this.refObj;
294 if (refObj && refObj != undefined) {
296 let fileName = this.artifactName;
297 let input = this.utilityService.createPayloadForRetrieve(false, this.item.action, this.vnfType, fileName);
298 let artifactContent: any;
299 this.ngProgress.start();
301 url: environment.getDesigns,
303 }).subscribe(resp => {
304 if (resp.output.status.code === '400' && resp.output.status.message === "success") {
305 this.nService.success("Success", "Template retrieved successfully from APPC");
306 this.tempRetrievalResponse = resp;
307 let result = JSON.parse(resp.output.data.block).artifactInfo[0];
308 result = result['artifact-content'];
309 if ('Generated Template' === this.selectedUploadType) {
310 this.configMappingEditorContent = result
311 this.artifactRequest.templateContent = this.configMappingEditorContent;
312 this.notificationService.notifySuccessMessage('Configuration Template file successfully uploaded..');
313 if (this.artifactRequest.templateContent) {
314 this.mappingEditorService.initialise(this.templateeditor.getEditor(), this.artifactRequest.templateContent, this.modal);
317 this.tempretrieveFlag = true;
318 this.fileNameForTempSave = fileName;
319 this.enableDownloadButtons = true;
320 this.initialData = result;
324 this.nService.info("Information", "There is no template saved in APPC for the selected action!");
326 this.ngProgress.done();
328 error => this.nService.error("Error", "Error in connecting to APPC Server"));
330 this.ngProgress.done();
334 //========================== End of retrieveTemplateFromAppc() Method============================================
336 let refObj = this.refObj;
337 if (refObj && refObj != undefined) {
338 let paramsKeyValueFromEditor: JSON;
340 paramsKeyValueFromEditor = JSON.parse(localStorage["paramsContent"]);
343 console.log("Could not parse name value pairs==" + error);
345 if (paramsKeyValueFromEditor) {
346 this.showTemplateVersionDiv = true;
347 let action = this.item.action;
348 var scopeName = this.scopeName.replace(/ /g, '').replace(new RegExp('/', "g"), '_').replace(/ /g, '');
350 let id = this.mappingEditorService.identifier;
351 if (id) fileName = this.updateFileNameForConfigScaleOut(this.item.action, scopeName, this.templateVersionNo, id);
352 else fileName = this.updateParamFileName(this.item.action, scopeName, this.templateVersionNo);
354 let vnfType = this.vnfType;
355 let Json = [paramsKeyValueFromEditor];
356 let slashedPayload = this.appendSlashes(JSON.stringify(Json));
359 "userID": this.userId,
360 "vnf-type": this.vnfType,
362 "artifact-name": fileName,
363 "artifact-type": "APPC-CONFIG",
364 "artifact-version": this.templateVersionNo,
365 "artifact-contents": slashedPayload
371 "request-id": this.apiToken,
372 "action": "uploadArtifact",
373 "payload": JSON.stringify(newPayload)
378 this.appDataObject.template.nameValueData = data;
380 if (this.configMappingEditorContent) {
381 let actualContent = this.configMappingEditorContent;
382 this.mappingEditorService.generateTemplate(this.templateEditor);
383 this.showTemplateVersionDiv = true;
384 let action = this.item.action;
385 let versionandFileType: any;
386 if (this.fileType === "text/xml") {
388 versionandFileType = this.templateVersionNo + 'V.xml'
391 versionandFileType = this.templateVersionNo + 'V.json'
394 if (this.tempretrieveFlag) {
395 fileName = this.fileNameForTempSave;
398 fileName = this.artifactName;
400 let vnfType = this.vnfType;
403 "userID": this.userId,
404 "vnf-type": this.vnfType,
406 "artifact-name": fileName,
407 "artifact-type": "APPC-CONFIG",
408 "artifact-version": this.templateVersionNo,
409 "artifact-contents": this.configMappingEditorContent.replace(/\(([^()]|(R))*\)=\(/g, '').replace(/\)}/g, '}')
416 "request-id": this.apiToken,
417 "action": "uploadArtifact",
418 "payload": JSON.stringify(newPayload)
423 this.appDataObject.template.templateData = data;
424 this.mappingEditorService.initialise(this.templateeditor.getEditor(), actualContent, this.modal);
428 //========================== End of prepareAppData() Method============================================
429 prepareFileName(): any {
430 let fileNameObject: any = this.mappingEditorService.latestAction;
431 this.appDataObject = this.mappingEditorService.appDataObject;
432 this.downloadDataObject = this.mappingEditorService.downloadDataObject;
433 this.referenceData = fileNameObject;
434 return fileNameObject;
436 //========================== End of prepareFileName() Method============================================
437 onDownloadParameter() {
438 let refObj = this.refObj;
440 let paramsKeyValueFromEditor: JSON;
442 paramsKeyValueFromEditor = JSON.parse(localStorage["paramsContent"]);
445 console.log("Could not parse name value pairs==" + error);
447 let theJSON = JSON.stringify(paramsKeyValueFromEditor, null, "\t")
448 var blob = new Blob([theJSON], {
451 this.showTemplateVersionDiv = true;
453 var scopeName = this.scopeName.replace(/ /g, '').replace(new RegExp('/', "g"), '_').replace(/ /g, '');
454 let id = this.mappingEditorService.identifier;
455 if (id) fileName = this.updateFileNameForConfigScaleOut(this.item.action, scopeName, this.templateVersionNo, id);
456 else fileName = this.updateParamFileName(this.item.action, scopeName, this.templateVersionNo);
458 this.downloadDataObject.template.nameValueData = theJSON;
459 this.downloadDataObject.template.nameValueFileName = fileName;
462 this.nService.error("Error", "Please enter Action and VNF type in Reference Data screen");
466 //========================== End of onDownloadParameter() Method============================================
467 updateParamFileName(action: any, scopeName: any, versionNo: any) {
468 let fileName = 'param_' + action + '_' + scopeName + '_' + versionNo + 'V.json';
469 this.downloadedParamFileName = fileName;
472 //========================== End of updateParamFileName() Method============================================
473 updateFileNameForConfigScaleOut(action: any, scopeName: any, versionNo: any, id: any) {
474 let fileName = 'param_' + action + '_' + scopeName + '_' + versionNo + 'V_' + id + '.json';
475 this.downloadedParamFileName = fileName;
478 //========================== End of updateFileNameForConfigScaleOut() Method============================================
479 public onDownloadTemplate(artifact: string) {
480 let actualContent = this.configMappingEditorContent;
481 var textToSaveAsBlob: any;
482 var config_template_fileName: any
483 let refObj = this.refObj;
484 let versionandFileType: string;
485 if (artifact == 'Template' && this.artifactRequest && this.configMappingEditorContent && refObj) {
486 this.showTemplateVersionDiv = true;
487 if (this.fileType === "text/xml") {
488 textToSaveAsBlob = new Blob([this.configMappingEditorContent], {
491 versionandFileType = this.templateVersionNo + 'V.xml'
493 if (this.fileType === "text/plain") {
494 textToSaveAsBlob = new Blob([this.configMappingEditorContent], {
497 versionandFileType = this.templateVersionNo + 'V.txt'
499 if (this.fileType === "text/json") {
500 textToSaveAsBlob = new Blob([this.configMappingEditorContent], {
503 versionandFileType = this.templateVersionNo + 'V.json'
505 if (this.tempretrieveFlag) {
506 config_template_fileName = this.fileNameForTempSave;
507 var filextension = config_template_fileName.substring(config_template_fileName.indexOf("V") + 2, config_template_fileName.length);
509 textToSaveAsBlob = new Blob([this.configMappingEditorContent], {
510 type: "text/" + filextension
514 config_template_fileName = this.artifactName;
516 this.mappingEditorService.initialise(this.templateeditor.getEditor(), actualContent, this.modal);
517 this.downloadDataObject.template.templateData = this.configMappingEditorContent.replace(/\(([^()]|(R))*\)=\(/g, '').replace(/\)}/g, '}');
518 this.downloadDataObject.template.templateFileName = config_template_fileName;
522 //========================== End of onDownloadTemplate() Method============================================
526 let refObj = this.refObj;
527 this.enableValidateTemplate = true;
529 if (refObj && refObj != undefined) {
530 if (input.files && input.files[0]) {
532 this.myfileName = input.files[0].name;
533 this.fileName = input.files[0].name;
534 this.fileType = input.files[0].type;
535 let reader = new FileReader();
536 this.readFile(input.files[0], reader, (result) => {
537 if (this.fileType === 'text/xml') {
538 sessionStorage.setItem('fileType', 'text/xml');
540 if (this.fileName.endsWith(".json")) {
541 this.fileType = "text/json";
542 sessionStorage.setItem('fileType', 'text/json');
544 if (this.fileType === '') {
545 sessionStorage.setItem('fileType', '');
549 if ('Generated Template' === this.selectedUploadType) {
550 this.configMappingEditorContent = result
551 this.artifactRequest.templateContent = this.configMappingEditorContent;
552 this.notificationService.notifySuccessMessage('Configuration Template file successfully uploaded..');
553 if (this.artifactRequest.templateContent) {
554 this.mappingEditorService.initialise(this.templateeditor.getEditor(), this.artifactRequest.templateContent, this.modal);
557 this.enableDownloadButtons = true;
558 this.initialData = result;
560 this.templateeditor.getEditor().$enableBlockSelect = false;
561 this.templateeditor.getEditor().$enableMultiselect = false;
563 /** spinner ends after 3.5 seconds */
569 this.nService.error("Error", "Failed to read file");
571 this.myInputVariable.nativeElement.value = "";
574 this.nService.error("Error", "Please enter Action and VNF type in Reference Data screen");
578 //========================== End of fileChange() Method============================================
579 public readFile(file, reader, callback) {
580 // Set a callback funtion to fire after the file is fully loaded
581 reader.onload = () => {
582 // callback with the results
583 callback(reader.result);
585 this.notificationService.notifySuccessMessage('Uploading File ' + file.name + ':' + file.type + ':' + file.size);
587 reader.readAsText(file, "UTF-8");
589 //========================== End of readFile() Method============================================
590 validateUploadedFile(fileExtension) {
592 if (fileExtension.toUpperCase() === 'json'.toUpperCase() || fileExtension.toUpperCase() === 'xml'.toUpperCase()) {
600 //========================== End of validateUploadedFile() Method============================================
601 appendSlashes(artifactData) {
602 let x = artifactData.replace(new RegExp(',"', "g"), ',\"');
603 let y = x.replace(new RegExp('":', 'g'), '\":');
604 let z = y.replace(new RegExp('{"', 'g'), '{\"')
605 let t = z.replace(new RegExp(':"', 'g'), ':\"')
606 let m = t.replace(new RegExp('",', 'g'), '\",');
607 let n = y.replace(new RegExp('"}', 'g'), '\"}')
608 let nw = n.replace(new RegExp('{"', 'g'), '{\"');
609 let nw1 = nw.replace(new RegExp(':"', 'g'), ':\"');
610 let nw2 = nw1.replace(new RegExp('",', 'g'), '\",');
613 //========================== End of appendSlashes() Method============================================
614 prepareDownloadData() {
615 this.onDownloadParameter();
616 this.onDownloadTemplate('Template');
618 //========================== End of prepareDownloadData() Method============================================
620 this.mappingEditorService.replaceNamesWithBlankValues();
623 var templateData = this.mappingEditorService.paramData; //template data array
624 var pdData = this.paramShareService.getSessionParamData(); //PD data array
625 var paramsContent = localStorage["paramsContent"];
627 if (paramsContent && paramsContent != undefined) {
629 var paramTabData = JSON.parse(paramsContent);
632 console.log("error is : " + error)
637 var resultParamObj = {};
638 let checkNamesOnlyCondition: boolean = true;
640 if (templateData && templateData != undefined) {
641 templateData.forEach(function (item) {
642 if (item.paramValue !== "" && item.paramValue != undefined && item.paramValue != null) {
643 checkNamesOnlyCondition = false;
648 templateData.forEach(function (item) {
649 resultParamObj[item.paramName] = item.paramValue;
651 if (paramTabData && paramTabData != undefined) {
652 templateData.forEach(function (item) {
653 for (var index in paramTabData) {
654 if (item.paramName === index) {
655 if (checkNamesOnlyCondition) {
656 resultParamObj[index] = paramTabData[index];
659 if (item.paramValue === "") {
660 resultParamObj[index] = paramTabData[index];
663 resultParamObj[index] = item.paramValue;
673 localStorage["paramsContent"] = JSON.stringify(resultParamObj);
674 templateData = Array.from(new Set(templateData.map((itemInArray) => itemInArray.paramName)))
676 //reformatting arr1 to match with PD
677 templateData.forEach(function (item) {
713 "ruleTypeValues": [null]
718 if (pdData && pdData != undefined) {
719 for (var i = 0; i < resultArr.length; i++) {
721 pdData.forEach(function (arr2item) {
722 if (resultArr[i].name === arr2item.name) {
725 "name": arr2item.name,
726 "type": arr2item.type,
727 "description": arr2item.description,
728 "required": arr2item.required,
729 "default": arr2item.default,
730 "source": arr2item.source,
731 "rule-type": arr2item["rule-type"],
732 "request-keys": arr2item["request-keys"],
733 "response-keys": arr2item["response-keys"],
734 "ruleTypeValues": arr2item.ruleTypeValues
736 resultArr.splice(i, 1, json)
744 this.paramShareService.setSessionParamData(resultArr);
745 this.mappingEditorService.paramData = [];
746 //navigate to PD page after sync
749 .navigate(['../../../vnfs/design/parameterDefinitions/create']);
752 //========================== End of syncTemplate() Method============================================
754 this.mergeStatus = this.mappingEditorService.autoAnnotateDataForParams();
755 if (this.mergeStatus) {
756 this.nService.success("Success", "Merge Successful");
759 this.nService.error("Error", "Merge Unsuccessful");
763 //========================== End of mergeParams() Method============================================
764 public handleAnnotation(modal) {
766 this.selectedWord = this.templateeditor.getEditor().session.getTextRange(this.templateeditor.getEditor().selectionRange);
767 if (this.selectedWord && this.selectedWord != undefined) modal.open();
769 //========================== End of handleAnnotations() Method============================================
770 public submitNameValues() {
772 this.checkNameEntered = true;
774 if (this.selectedWord) {
775 if (this.selectedWord.startsWith('${(')) {
776 var replaceWord: any = this.replaceWord = this.selectedWord.substring(3, this.selectedWord.indexOf(')=(')) + this.tempName;
777 this.templateeditor.getEditor().session.replace(this.templateeditor.getEditor().session.selection.getRange(), replaceWord);
780 let mappingKey = this.mappingEditorService.getKeysForValues(this.selectedWord);
781 var replaceWord: any = this.replaceWord = '${(' + this.selectedWord + ')=(' + this.tempName + ')}';
782 this.templateeditor.getEditor().session.replace(this.templateeditor.getEditor().session.selection.getRange(), replaceWord);
786 this.mappingEditorService.refreshEditor();
792 this.checkNameEntered = false;
796 //========================== End of submitNameValues() Method============================================