From e4aa522b862f9155d3b9271c2e3cb9ba97baec43 Mon Sep 17 00:00:00 2001 From: sebdet Date: Tue, 19 Mar 2019 13:47:37 +0100 Subject: Remove useless UI code Remove svn/wsdl code + rename the js files Issue-ID: CLAMP-330 Change-Id: I88aa31b99247ae5700347ae04955e08d6d5a5dd4 Signed-off-by: sebdet --- .../META-INF/resources/designer/css/app.css | 12 - .../META-INF/resources/designer/index.html | 110 ++--- .../portfolios/PolicyWindow_properties.html | 1 - .../designer/scripts/ActivityModellingCtrl.js | 106 +---- .../resources/designer/scripts/ExportFileCtrl.js | 26 -- .../designer/scripts/ExportFileService.js | 79 ---- .../resources/designer/scripts/FileUploadCtrl.js | 155 ------- .../designer/scripts/FileUploadService.js | 87 ---- .../resources/designer/scripts/ImportSchemaCtrl.js | 296 ------------- .../designer/scripts/OperationalPolicyCtrl.js | 79 ++++ .../designer/scripts/OperationalPolicyService.js | 37 ++ .../designer/scripts/UpgradeSchemaCtrl.js | 479 --------------------- .../META-INF/resources/designer/scripts/app.js | 27 +- .../resources/designer/scripts/common_variables.js | 1 - .../designer/scripts/importSchemaService.js | 61 --- .../designer/scripts/propertyController.js | 10 +- .../designer/scripts/soapRequestService.js | 105 ----- 17 files changed, 187 insertions(+), 1484 deletions(-) delete mode 100644 src/main/resources/META-INF/resources/designer/scripts/ExportFileCtrl.js delete mode 100644 src/main/resources/META-INF/resources/designer/scripts/ExportFileService.js delete mode 100644 src/main/resources/META-INF/resources/designer/scripts/FileUploadCtrl.js delete mode 100644 src/main/resources/META-INF/resources/designer/scripts/FileUploadService.js delete mode 100644 src/main/resources/META-INF/resources/designer/scripts/ImportSchemaCtrl.js create mode 100644 src/main/resources/META-INF/resources/designer/scripts/OperationalPolicyCtrl.js create mode 100644 src/main/resources/META-INF/resources/designer/scripts/OperationalPolicyService.js delete mode 100644 src/main/resources/META-INF/resources/designer/scripts/UpgradeSchemaCtrl.js delete mode 100644 src/main/resources/META-INF/resources/designer/scripts/importSchemaService.js delete mode 100644 src/main/resources/META-INF/resources/designer/scripts/soapRequestService.js (limited to 'src/main') diff --git a/src/main/resources/META-INF/resources/designer/css/app.css b/src/main/resources/META-INF/resources/designer/css/app.css index 34842ef5d..d9d7fd1ca 100644 --- a/src/main/resources/META-INF/resources/designer/css/app.css +++ b/src/main/resources/META-INF/resources/designer/css/app.css @@ -126,18 +126,6 @@ svg:not(:root) { z-index:100000; /*a number that's more than the modal box*/ } /* '' */ -.upgrade-schema:before{ - content: url('../images/UpgradeSchema.png'); - position:relative; /*or absolute*/ - z-index:100000; /*a number that's more than the modal box*/ - opacity:0.5; - cursor: none; -} /* '' */ -.upgradeSchema:before{ - content: url('../images/UpgradeSchema.png'); - position:relative; /*or absolute*/ - z-index:100000; /*a number that's more than the modal box*/ -} /* '' */ .set-default-values:before{ content: url('../images/SetDefaultValues.png'); position:relative; /*or absolute*/ diff --git a/src/main/resources/META-INF/resources/designer/index.html b/src/main/resources/META-INF/resources/designer/index.html index ec13e2a02..62672d213 100644 --- a/src/main/resources/META-INF/resources/designer/index.html +++ b/src/main/resources/META-INF/resources/designer/index.html @@ -34,7 +34,7 @@ - + @@ -47,7 +47,7 @@ - + @@ -73,16 +73,16 @@
- - - - - + + + + +
@@ -95,8 +95,8 @@ - - + + @@ -124,62 +124,44 @@ - - - - + + + + - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html index 6255698d8..203b3cd56 100644 --- a/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html +++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html @@ -311,7 +311,6 @@ label { '; - var x = angular.element(elementHTML); - element.append(x); - $compile(x)(scope); - } - }); - } - } -}); -app -.directive( -'inputInfoUpgradeClassMember', -function($compile) { - return { - restrict : "C", - link : function(scope, element, attrs) { - var elementHTML = ''; - scope.currentElementName = scope.objectName; - scope.parentName = scope.ParentKey; - scope.parentElement = scope.parElement; - scope.heirarchyLevel = scope.heirLevel + 1; - if (scope.schemaElement.element.name != null) { - scope.elementKey = scope.parentName + '_' - + scope.schemaElement.element.name; - if (scope.schemaElement.repeatableHierarchicalPrefix != null) { - scope.elementKey = scope.elementKey - + scope.schemaElement.repeatableHierarchicalPrefix; - } - scope.tableStyle = 'table-level' + scope.heirarchyLevel + '-tree'; - scope.tdLabelStyle = 'td-level' + scope.heirarchyLevel - + '-label-tree'; - if (scope.schemaElement.type.complexType != null) { - scope.showUTMViewMsgHeader = false; - } else { - scope.showUTMViewMsgHeader = true; - } - elementHTML = elementHTML - + '
'; - elementHTML = elementHTML + ' '; - elementHTML = elementHTML + ''; - elementHTML = elementHTML - + ''; - elementHTML = elementHTML + ''; - elementHTML = elementHTML + '
'; - elementHTML = elementHTML - + ''; - elementHTML = elementHTML + '
'; - elementHTML = elementHTML - + ''; - elementHTML = elementHTML + '
'; - elementHTML = elementHTML - + ''; - elementHTML = elementHTML + '{{schemaElement.element.name}} '; - elementHTML = elementHTML + ''; - elementHTML = elementHTML + ''; - elementHTML = elementHTML + ''; - elementHTML = elementHTML + ''; - elementHTML = elementHTML + '
'; - elementHTML = elementHTML - + '
'; - elementHTML = elementHTML + '
'; - elementHTML = elementHTML + ''; - elementHTML = elementHTML + ''; - elementHTML = elementHTML + '
'; - var x = angular.element(elementHTML); - element.append(x); - $compile(x)(scope); - if (scope.schemaElement.type.complexType != null) { - var elementHTML2 = '
' - elementHTML2 = elementHTML2 - + '
' - elementHTML2 = elementHTML2 - + '
' - elementHTML2 = elementHTML2 - + '
' - elementHTML2 = elementHTML2 + '
' - elementHTML2 = elementHTML2 + '
' - elementHTML2 = elementHTML2 + '
'; - var x = angular.element(elementHTML2); - element.append(x); - $compile(x)(scope); - } - } - } - } -}); -app -.controller( -'UpgradeSchemaCtrl', -[ -'$scope', -'$rootScope', -'$uibModalInstance', -'dialogs', -function($scope, $rootScope, $uibModalInstance, dialogs) { - $rootScope.Currentmappedvalues = []; - $scope.utmSchemaExts = {}; - $scope.callFromMap = false; - $scope.oldMapValFlag = false; - $scope.complexMappedValuesOld = {}; - $scope.complexMappedValuesNew = {}; - var allCurrentElementKeyArray = []; - $scope.checkedValues = {}; - var checkedElementValueArray = []; - $scope.complexMapElements = function(elementKey, schemaElement, radioName) { - if (schemaElement.complexType != null - || (schemaElement.type != null && schemaElement.type.complexType != null)) { - if (radioName == "oldChk") - $scope.complexMappedValuesOld[elementKey] = schemaElement; - else if (radioName == "newChk") - $scope.complexMappedValuesNew[elementKey] = schemaElement; - } - if (elementKey != null) - allCurrentElementKeyArray.push(elementKey); - }; - $scope.mapElements = function() { - var oldVal = $('input[name=oldChk]:checked').val(); - var newVal = $('input[name=newChk]:checked').val(); - var oldId = $('input[name=oldChk]:checked').attr('id'); - var newId = $('input[name=newChk]:checked').attr('id'); - $scope.mappedvalues = {}; - $scope.checkedValues.oldVal = oldVal; - $scope.checkedValues.newVal = newVal; - checkedElementValueArray.push($scope.checkedValues); - $scope.oldMappedvaluesKeyArray = []; - $scope.newMappedvaluesKeyArray = []; - $scope.oldmappedvaluesArray = []; - $scope.newMappedvaluesArray = []; - if ($scope.complexMappedValuesOld[oldId] != null - && $scope.complexMappedValuesNew[newId] != null) { - $scope.matchType = ''; - $scope.matchType = $scope.compareElements( - $scope.complexMappedValuesOld[oldId], - $scope.complexMappedValuesNew[newId]); - if ($scope.matchType == "true") { - console - .log("Element Type Matches and eligible for upgrade schema"); - $scope.callFromMap = true; - for (var i = 0; i < $scope.complexMappedValuesOld[oldId].type.elements.length; i++) { - $scope.oldMapValFlag = true; - getElementkeys(oldId, - $scope.complexMappedValuesOld[oldId].type.elements[i]); - } - for (var j = 0; j < $scope.complexMappedValuesNew[newId].type.elements.length; j++) { - $scope.oldMapValFlag = false; - getElementkeys(newId, - $scope.complexMappedValuesNew[newId].type.elements[j]); - } - for (var k = 0; k < $scope.oldmappedvaluesArray.length; k++) { - $scope.mappedvalues = {}; - $scope.mappedvalues.oldvalue = $scope.oldmappedvaluesArray[k]; - $scope.mappedvalues.newvalue = $scope.newMappedvaluesArray[k]; - $scope.mappedvalues.oldidvalue = $scope.oldMappedvaluesKeyArray[k]; - $scope.mappedvalues.newidvalue = $scope.newMappedvaluesKeyArray[k]; - $rootScope.Currentmappedvalues.push($scope.mappedvalues); - } - } else if ($scope.matchType == "false") { - dialogs - .error( - 'Invalid Selection Error', - 'The mapping of the selected elements is invalid. Please select valid complex elements for Upgrade Schema'); - } - } else if (($scope.complexMappedValuesOld[oldId] == null && $scope.complexMappedValuesNew[newId] != null) - || ($scope.complexMappedValuesOld[oldId] != null && $scope.complexMappedValuesNew[newId] == null)) { - dialogs - .error( - 'Invalid Selection Error', - 'The mapping of the selected elements is invalid. Please select valid complex elements for Upgrade Schema'); - } else { - $scope.mappedvalues.oldvalue = oldVal; - $scope.mappedvalues.newvalue = newVal; - $scope.mappedvalues.oldidvalue = oldId; - $scope.mappedvalues.newidvalue = newId; - $rootScope.Currentmappedvalues.push($scope.mappedvalues); - } - $rootScope.checkRepeatable = false; - }; - // Utility Method to compare Object Structure of Complex Type Elements - // before upgrade schema - $scope.compareElements = function(oldElement, newElement) { - if (oldElement.type.complexType != null - && newElement.type.complexType != null) { - if (oldElement.type.elements.length == newElement.type.elements.length) { - for (var i = 0; i < oldElement.type.elements.length; i++) { - if (oldElement.type.elements[i].type.complexType != null - && newElement.type.elements[i].type.complexType != null) { - $scope.compareElements(oldElement.type.elements[i], - newElement.type.elements[i]); - } else if (oldElement.type.elements[i].type.complexType == null - && newElement.type.elements[i].type.complexType != null) { - $scope.matchType = "false"; - return $scope.matchType; - } - if ($scope.matchType == "false") - return $scope.matchType; - } - for (var i = 0; i < newElement.type.elements.length; i++) { - if (newElement.type.elements[i].type.complexType != null - && oldElement.type.elements[i].type.complexType != null) { - $scope.compareElements(newElement.type.elements[i], - oldElement.type.elements[i]); - } else if (newElement.type.elements[i].type.complexType == null - && oldElement.type.elements[i].type.complexType != null) { - $scope.matchType = "false"; - return $scope.matchType; - } - if ($scope.matchType == "false") - return $scope.matchType; - } - $scope.matchType = "true"; - return $scope.matchType; - } else - $scope.matchType = "false"; - return $scope.matchType; - } - }; - $scope.checkRepeatableElement = function(elementKey, key) { - if (elementKey != key) - $rootScope.checkRepeatable = true; - }; - $scope.upgradeSchema = function() { - // console.log("List Model Path Details before Upgrade Schema :: " + - // JSON.stringify(list_model_path_details[selected_model])); - $scope.callFromMap = false; - $rootScope.isHorR = true; - $rootScope.repeatableHeirarchicalElementMap = map_model_repeatable_heirarchical_elements[selected_model]; - // Checking Repeatable Hierarchical elements mapping and changing - // elementkey if repeatable hierarchical is mapped - for ( var key in $rootScope.repeatableHeirarchicalElementMap) { - for (var i = 0; i < allCurrentElementKeyArray.length; i++) { - if (allCurrentElementKeyArray[i].indexOf(key) > -1) - elementKeys.push(allCurrentElementKeyArray[i]); - } - for (var j = 0; j < checkedElementValueArray.length; j++) { - var currentCheckedMappedvalue = checkedElementValueArray[j]; - if (key.indexOf(currentCheckedMappedvalue.oldVal) > -1) { - var newObject = JSON - .stringify($rootScope.repeatableHeirarchicalElementMap); - var oldvalue = currentCheckedMappedvalue.oldVal; - var newvalue = currentCheckedMappedvalue.newVal; - var modObject = newObject.replace(oldvalue, newvalue); - $rootScope.repeatableHeirarchicalElementMap = angular - .fromJson(modObject); - } - } - } - $scope.oldSchemaLocation = $rootScope.wsdlInfo.schemaLocation; - $rootScope.wsdlInfo = $rootScope.updateWsdlInfo; - $rootScope.wsdlInfo.schemaUpgradedFlag = true; - $rootScope.wsdlInfo.oldSchemaLocation = $scope.oldSchemaLocation; - $rootScope.serviceInfo = $rootScope.updateServiceInfo; - $rootScope.schemaLocation = $rootScope.updateWsdlInfo.schemaLocation; - $rootScope.serviceInput = $rootScope.updateServiceInput; - $rootScope.serviceInputPartInfo = $rootScope.updateServiceInputPartInfo; - $rootScope.inputSchemaServiceInputPartInfo = []; - $rootScope.inputSchemaServiceOutputPartInfo = []; - $rootScope.inputSchemaServicefaultPartInfo = []; - angular.copy($rootScope.serviceInputPartInfo, - $rootScope.inputSchemaServiceInputPartInfo); - angular.copy($rootScope.serviceOutputPartInfo, - $rootScope.inputSchemaServiceOutputPartInfo); - angular.copy($rootScope.servicefaultPartInfo, - $rootScope.inputSchemaServicefaultPartInfo); - // Form all the element keys of the Upgraded Schema so that to know the - // attibutes removed - for (var i = 0; i < $rootScope.serviceInputPartInfo.length; i++) { - for (var j = 0; j < $rootScope.serviceInputPartInfo[i].schemaElements.length; j++) { - getElementkeys('ServiceInput', - $rootScope.serviceInputPartInfo[i].schemaElements[j]); - } - } - $rootScope.serviceOutput = $rootScope.updateServiceOutput; - $rootScope.serviceOutputPartInfo = $rootScope.updateServiceOutputPartInfo; - for (var i = 0; i < $rootScope.serviceOutputPartInfo.length; i++) { - for (var j = 0; j < $rootScope.serviceOutputPartInfo[i].schemaElements.length; j++) { - getElementkeys('ServiceOutput', - $rootScope.serviceOutputPartInfo[i].schemaElements[j]); - } - } - $rootScope.servicefault = $rootScope.updateServicefault; - $rootScope.servicefaultPartInfo = $rootScope.updateServicefaultPartInfo; - for (var i = 0; i < $rootScope.servicefaultPartInfo.length; i++) { - for (var j = 0; j < $rootScope.servicefaultPartInfo[i].schemaElements.length; j++) { - getElementkeys('ServiceFault', - $rootScope.servicefaultPartInfo[i].schemaElements[j]); - } - } - console.log("mapped values of current" - + JSON.stringify($rootScope.Currentmappedvalues)); - // For each model in the project - // a) For the mapped elements - // i) replace the old ids with new ids for the Schema Extensions - // ii) replace the old ids with new ids for the Path Details - // b) For the deleted attributes in the Upgraded schema - // i) Remove the ids from Schema Extensions - // ii) Remove the ids from Path Details - for (var modelIndex = 0; modelIndex < $rootScope.models.length; modelIndex++) { - var current_model = $rootScope.models[modelIndex]; - $scope.utmSchemaExts = list_model_schema_extensions[current_model].utmSchemaExtentionMap; - $scope.pathDetailsArray = list_model_path_details[current_model]; - for (var i = 0; i < $rootScope.Currentmappedvalues.length; i++) { - $scope.mappedvalues = $rootScope.Currentmappedvalues[i]; - if ($scope.utmSchemaExts != null) { - $scope.utmSchemaExts[$scope.mappedvalues.newidvalue] = $scope.utmSchemaExts[$scope.mappedvalues.oldidvalue]; - if ($scope.mappedvalues.newidvalue != $scope.mappedvalues.oldidvalue) - delete $scope.utmSchemaExts[$scope.mappedvalues.oldidvalue]; - } - if ($scope.pathDetailsArray != null - && $scope.pathDetailsArray.length > 0) { - for (var k = 0; k < $scope.pathDetailsArray.length; k++) { - $scope.pathDetails = $scope.pathDetailsArray[k]; - if ($scope.pathDetails != null) { - for (var j = 0; j < $scope.pathDetails.decisionIdentifiers.length; j++) { - if ($scope.pathDetails.decisionIdentifiers[j].elementValues[$scope.mappedvalues.oldidvalue] != null) - $scope.pathDetails.decisionIdentifiers[j].elementValues[$scope.mappedvalues.newidvalue] = $scope.pathDetails.decisionIdentifiers[j].elementValues[$scope.mappedvalues.oldidvalue]; - if ($scope.mappedvalues.newidvalue != $scope.mappedvalues.oldidvalue) - delete $scope.pathDetails.decisionIdentifiers[j].elementValues[$scope.mappedvalues.oldidvalue]; - } - } - } - } - } - $scope.schemenExts = angular.copy($scope.utmSchemaExts); - // If an attribute is removed from upgraded schema, remove that - // attribute related details from SchemaExtensions - Object.keys($scope.schemenExts).forEach(function(key) { - var key_isavailable = false; - for (var j = 0; j < elementKeys.length; j++) { - if (elementKeys[j] === key) { - key_isavailable = true; - } - } - if (!key_isavailable) { - // Implement this later. Commented this as this is wiping - // out all the Repeatable/Heirarchical values - // delete $scope.utmSchemaExts[key]; - } - }); - // If an attribute is removed from upgraded schema, remove that - // attribute related details from PathDetails - if ($scope.pathDetailsArray != null - && $scope.pathDetailsArray.length > 0) { - for (var k = 0; k < $scope.pathDetailsArray.length; k++) { - $scope.pathDetails = $scope.pathDetailsArray[k]; - for (var j = 0; j < $scope.pathDetails.decisionIdentifiers.length; j++) { - $scope.decisionElementValues = angular - .copy($scope.pathDetails.decisionIdentifiers[j].elementValues); - Object.keys($scope.decisionElementValues).forEach( - function(key) { - var key_isavailable = false; - for (var l = 0; l < elementKeys.length; l++) { - if (elementKeys[l] === key) { - key_isavailable = true; - } - } - if (!key_isavailable) { - // Implement this later. Commented this as this - // is wiping out all the Repeatable/Heirarchical - // values - // delete - // $scope.pathDetails.decisionIdentifiers[j].elementValues[key]; - } - }); - } - } - } - } - $uibModalInstance.close("closed"); - }; - $scope.close = function() { - $uibModalInstance.close("closed"); - }; - function getElementkeys(parentname, schemaelement) { - if (schemaelement.complexType != null) { - var parentkey = parentname + "_" + schemaelement.complexType.name; - for (var i = 0; i < schemaelement.elements.length; i++) { - getElementkeys(parentkey, schemaelement.elements[i]); - } - } - if (schemaelement.element != null && schemaelement.element.name != null) { - var elementKey = parentname + '_' + schemaelement.element.name; - if (!$scope.callFromMap) { - elementKeys.push(elementKey); - } else { - if ($scope.oldMapValFlag) { - $scope.oldmappedvaluesArray - .push(schemaelement.element.name); - $scope.oldMappedvaluesKeyArray.push(elementKey); - } else { - $scope.newMappedvaluesArray - .push(schemaelement.element.name); - $scope.newMappedvaluesKeyArray.push(elementKey); - } - } - } - if (schemaelement.type != null - && schemaelement.type.complexType != null) { - var parentkey = parentname + '_' + schemaelement.element.name; - for (var i = 0; i < schemaelement.type.elements.length; i++) { - getElementkeys(parentkey, schemaelement.type.elements[i]); - } - } - } -} ]); diff --git a/src/main/resources/META-INF/resources/designer/scripts/app.js b/src/main/resources/META-INF/resources/designer/scripts/app.js index 59a27bdfe..b0b34533a 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/app.js +++ b/src/main/resources/META-INF/resources/designer/scripts/app.js @@ -678,7 +678,7 @@ function($scope, $rootScope, $timeout, dialogs) { var dlg = dialogs.create( 'partials/portfolios/PolicyWindow_properties.html', - 'ImportSchemaCtrl', { + 'operationalPolicyCtrl', { closable : true, draggable : true }, { @@ -768,18 +768,7 @@ app.run([ '$route', function($route) { $route.reload(); } ]); -function TestCtrl($scope) { - $scope.msg = "Hello from a controller method."; - $scope.returnHello = function() { - - return $scope.msg; - } -} -function importshema() { - - angular.element(document.getElementById('navbar')).scope().importSchema(); -} function F5Window() { angular.element(document.getElementById('navbar')).scope().F5Window(); @@ -790,7 +779,7 @@ function GOCWindow() { } function ToscaModelWindow() { angular.element(document.getElementById('navbar')).scope().ToscaModelWindow(); -}; +} function PolicyWindow(PolicyWin) { angular.element(document.getElementById('navbar')).scope().PolicyWindow( @@ -806,23 +795,11 @@ function setdefaultvalue() { angular.element(document.getElementById('navbar')).scope() .setDefaultValue(); } -function upgradeSchemaVersion() { - - angular.element(document.getElementById('navbar')).scope() - .upgradeSchemaVersion(); -} function saveProject() { angular.element(document.getElementById('navbar')).scope().saveProject(); } -function modifySchema() { - angular.element(document.getElementById('navbar')).scope().modifySchema(); -} -function definePID() { - - angular.element(document.getElementById('navbar')).scope().definePID(); -} function defineServiceAcronym() { angular.element(document.getElementById('navbar')).scope() diff --git a/src/main/resources/META-INF/resources/designer/scripts/common_variables.js b/src/main/resources/META-INF/resources/designer/scripts/common_variables.js index 826e1870e..36070de59 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/common_variables.js +++ b/src/main/resources/META-INF/resources/designer/scripts/common_variables.js @@ -30,7 +30,6 @@ var list_model_test_sets={}; var list_model_path_details={}; var list_model_schema_extensions={}; var list_model_test_management_details={}; -var isImportSchema=false; var selected_decison_element=''; var selected_element_name = ''; var list_model_repeatable_heirarchical_elements={}; diff --git a/src/main/resources/META-INF/resources/designer/scripts/importSchemaService.js b/src/main/resources/META-INF/resources/designer/scripts/importSchemaService.js deleted file mode 100644 index c355d7523..000000000 --- a/src/main/resources/META-INF/resources/designer/scripts/importSchemaService.js +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP CLAMP - * ================================================================================ - * 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. - * 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. - * ============LICENSE_END============================================ - * =================================================================== - * - */ -app.service('svnservice', ['$http', '$q', function ($http, $q) { - console.log("//////svnservice"); - this.SVNToUrl = function(schemaLocation, userID, password,svnURL,svnUploadURL){ - console.log("SVNToUrl"); - - - var def = $q.defer(); - var sets = []; - - var svnRequest = {schemaLocation: schemaLocation, userID: userID, password: password,svnURL:svnURL}; - - - $http.post(svnUploadURL, svnRequest) - .success(function(data){ - console.log("success"); - pars = data; - def.resolve(data); - - }) - .error(function(data){ - console.log("error"); - def.reject("SVN Import not successful"); - }); - - return def.promise; - }; - - this.saveOpPolicyProperties = function(form) { - var modelName = getLoopName(); - var def = $q.defer(); - var svcUrl = "/restservices/clds/v2/loop/updateOperationalPolicies/" + modelName; - $http.post(svcUrl, form).success(function(data) { - def.resolve(data); - }).error(function(data) { - def.reject("Save Operational Policy not successful"); - }); - return def.promise; - }; -}]); \ No newline at end of file diff --git a/src/main/resources/META-INF/resources/designer/scripts/propertyController.js b/src/main/resources/META-INF/resources/designer/scripts/propertyController.js index 044b21eca..f1ab1e195 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/propertyController.js +++ b/src/main/resources/META-INF/resources/designer/scripts/propertyController.js @@ -21,20 +21,20 @@ * */ -function updateMsProperties(type, form) { +function updateMsProperties(type, newMsProperties) { var newMsProperties = cl_props["microServicePolicies"]; for (p in newMsProperties) { if (newMsProperties[p]["name"] == type) { - cl_props["microServicePolicies"][p] = form; + cl_props["microServicePolicies"][p] = newMsProperties; } } } -function updateGlobalProperties(form) { - cl_props["globalPropertiesJson"] = form; +function updateGlobalProperties(newGlobalProperties) { + cl_props["globalPropertiesJson"] = newGlobalProperties; } -function updateOpPolicyProperties(form) { +function updateOpPolicyProperties(newOpProperties) { cl_props["operationalPolicies"] = newOpProperties; } diff --git a/src/main/resources/META-INF/resources/designer/scripts/soapRequestService.js b/src/main/resources/META-INF/resources/designer/scripts/soapRequestService.js deleted file mode 100644 index 25a0b4788..000000000 --- a/src/main/resources/META-INF/resources/designer/scripts/soapRequestService.js +++ /dev/null @@ -1,105 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP CLAMP - * ================================================================================ - * 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. - * 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. - * ============LICENSE_END============================================ - * =================================================================== - * - */ - -app.service('soapRequestService', ['$http', '$q', function ($http, $q) { - console.log("////////////soapRequestService"); - this.changetimeoutMode = function(timeoutMode){ - console.log("changetimeoutMode"); - console.log("timeoutmode:"+timeoutMode); - if(timeoutMode == "Default") - return false; - else - return true; - }; - - - this.generateTst = function(tstInput, generateTSTUrl){ - console.log("generateTst"); - var def = $q.defer(); - - $http.post(generateTSTUrl, tstInput) - .success(function(data){ - console.log("success"); - def.resolve(data); - - }) - .error(function(data){ - console.log("error"); - def.reject("GenerateTST not successful"); - }); - - return def.promise; - }; - - - this.generateTSTMultiple = function(tstInputList, generateTSTUrl){ - console.log("generateTSTMultiple"); - var def = $q.defer(); - - $http.post(generateTSTUrl, tstInputList) - .success(function(data){ - console.log("success"); - def.resolve(data); - - }) - .error(function(data){ - console.log("error"); - def.reject("GenerateTST multiple not successful"); - }); - - return def.promise; - }; - - this.downloadTst = function(tstId, tstName,downloadTSTUrl){ - console.log("downloadTst"); - var def = $q.defer(); - - var downloadInput={}; - - downloadInput.tstId=tstId; - downloadInput.tstName=tstName; - - $http({ - url: downloadTSTUrl, method: "POST", data: downloadInput, - responseType: 'arraybuffer' }).success(function (data, status, headers, config) { - console.log("success"); - var results = []; - - - results.data = new Blob([data], {type: 'application/octet-stream'}); - console.log( results.data); - results.headers = headers(); - results.status = status; - results.config = config; - def.resolve(results); - console.log( "Result From UTM Server : " + results.data); - }) - .error(function(data){ - console.log("error"); - def.reject("DownloadTST not successful"); - }); - - return def.promise; - }; - -}]); -- cgit 1.2.3-korg