aboutsummaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController
diff options
context:
space:
mode:
Diffstat (limited to 'POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController')
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSControllerDictController.js84
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSDependencyDictController.js84
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSParamDictController.js95
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLPepOptionsDictController.js115
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLServiceDictController.js70
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLSiteDictController.js70
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLVarbindDictController.js70
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLVnfTypeDictController.js70
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLVsclActionDictController.js71
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/DecisionSettingsDictController.js71
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/DescriptiveSearchDictController.js116
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/EnforcerDictController.js60
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWActionListDictController.js71
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWAddressGroupDictController.js116
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWParentListDictController.js151
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWPortListDictController.js71
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWPrefixListDictController.js98
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWProtocolListDictController.js70
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWSecurityZoneDictController.js70
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWServiceGroupDictController.js118
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWServiceListDictController.js144
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWTagListDictController.js105
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWTagPickerListDictController.js151
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWTermListDictController.js328
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWZoneDictController.js70
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSConfigNameDictController.js71
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSDcaeUUIDDictController.js70
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSLocationDictController.js70
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSModelsDictController.js97
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/ModelAttributeDictController.js96
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSClosedLoopDictController.js70
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSGroupPolicyScopeDictController.js136
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSResourceDictController.js70
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSServiceDictController.js70
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSTypeDictController.js71
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/RiskTypeDictController.js70
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/SafePolicyWarningDictController.js103
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/actionPolicyDictController.js114
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/attributeDictController.js104
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/ecompNameEditorController.js70
40 files changed, 3821 insertions, 0 deletions
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSControllerDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSControllerDictController.js
new file mode 100644
index 000000000..6665255b3
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSControllerDictController.js
@@ -0,0 +1,84 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editBRMSControllerController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.brmsControllerDictionaryDatas==null)
+ $scope.label='Add New BRMS Controller'
+ else{
+ if(message.disabled){
+ $scope.label='View BRMS Controller'
+ }else{
+ $scope.label='Edit BRMS Controller'
+ }
+ $scope.disableCd=true;
+ }
+ $scope.editBRMSController = message.brmsControllerDictionaryDatas;
+ $scope.disabled = message.disabled;
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.saveBRMSController = function(brmsControllerDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(brmsControllerDictionaryData.controllerName)) {
+ Notification.error("Enter Valid Controller Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/brms_dictionary/save_BRMSControllerData";
+ if(brmsControllerDictionaryData && brmsControllerDictionaryData.controllerName){
+ if(brmsControllerDictionaryData.controller){
+ var postData={brmsControllerDictionaryData: brmsControllerDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.brmsControllerDictionaryDatas=data.brmsControllerDictionaryDatas;});
+ if($scope.brmsControllerDictionaryDatas == "Duplicate"){
+ Notification.error("BRMS Controller Dictionary exists with Same Controller Name.")
+ }else if($scope.brmsControllerDictionaryDatas == "Error"){
+ Notification.error("BRMS Controller is not in proper required format");
+ }else{
+ console.log($scope.brmsControllerDictionaryDatas);
+ $modalInstance.close({brmsControllerDictionaryDatas:$scope.brmsControllerDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }else{
+ Notification.error("Controller Field is Empty.");
+ }
+ }else{
+ Notification.error("BRMS Controller Name should be given.");
+ }
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSDependencyDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSDependencyDictController.js
new file mode 100644
index 000000000..7ccc29ec9
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSDependencyDictController.js
@@ -0,0 +1,84 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editBRMSDependencyController', function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.brmsDependencyDictionaryDatas==null)
+ $scope.label='Add New BRMS Dependency'
+ else{
+ if(message.disabled){
+ $scope.label='View BRMS Dependency'
+ }else{
+ $scope.label='Edit BRMS Dependency'
+ }
+ $scope.disableCd=true;
+ }
+ $scope.editBRMSDependency = message.brmsDependencyDictionaryDatas;
+ $scope.disabled = message.disabled;
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.saveBRMSDependency = function(brmsDependencyDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(brmsDependencyDictionaryData.dependencyName)) {
+ Notification.error("Enter Valid Dependency Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/brms_dictionary/save_BRMSDependencyData";
+ var postData={brmsDependencyDictionaryData: brmsDependencyDictionaryData, userid: userid};
+ if(brmsDependencyDictionaryData && brmsDependencyDictionaryData.dependencyName){
+ if(brmsDependencyDictionaryData.dependency){
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.brmsDependencyDictionaryDatas=data.brmsDependencyDictionaryDatas;});
+ if($scope.brmsDependencyDictionaryDatas == "Duplicate"){
+ Notification.error("BRMS Dependency Dictionary exists with Same Dependency Name.")
+ }else if($scope.brmsDependencyDictionaryDatas == "Error"){
+ Notification.error("BRMS Dependency is not in proper format Maven dependency Format");
+ }else{
+ console.log($scope.brmsDependencyDictionaryDatas);
+ $modalInstance.close({brmsDependencyDictionaryDatas:$scope.brmsDependencyDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }else{
+ Notification.error("Dependency Field is Empty.");
+ }
+ }else{
+ Notification.error("BRMS Dependency Name should be given.");
+ }
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSParamDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSParamDictController.js
new file mode 100644
index 000000000..4b1482992
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSParamDictController.js
@@ -0,0 +1,95 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editBRMSParamController' , function ($scope, $modalInstance, message, $http, UserInfoServiceDS2, Notification){
+ if(message.brmsParamDictionaryData==null)
+ $scope.label='Add BRMS Rule'
+ else{
+ $scope.label='Edit BRMS Rule'
+ $scope.disableCd=true;
+ }
+
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ var valid = true;
+ $scope.editBRMSParam = message.brmsParamDictionaryData;
+
+ $scope.uploadFile = function(files) {
+ var extn = files[0].name.substr(files[0].name.lastIndexOf('.')+1);
+ if(extn == 'drl'){
+ valid = true;
+ var fd = new FormData();
+ fd.append("file", files[0]);
+ $http.post("saveDictionary/brms_dictionary/set_BRMSParamData", fd, {
+ withCredentials: false,
+ headers: {'Content-Type': undefined },
+ transformRequest: angular.identity
+ }).success().error( );
+ }else{
+ Notification.error("BRMS Dictionary Upload file should ends with .drl extension");
+ valid = false;
+ }
+ };
+
+ $scope.MyFile = [];
+ $scope.saveBRMSParam = function(brmsParamDictionaryData) {
+ if(valid){
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(brmsParamDictionaryData.ruleName)) {
+ Notification.error("Enter Valid Rule Name without spaces or special characters");
+ }else{
+ var file = $scope.MyFile;
+ var uuu = "saveDictionary/brms_dictionary/save_BRMSParam";
+ var postData={brmsParamDictionaryData: brmsParamDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.brmsParamDictionaryDatas=data.brmsParamDictionaryDatas;});
+ if($scope.brmsParamDictionaryDatas == "Duplicate"){
+ Notification.error("BRMSParan Dictionary exists with Same Name.")
+ }else{
+ console.log($scope.brmsParamDictionaryDatas);
+ $modalInstance.close({brmsParamDictionaryDatas:$scope.brmsParamDictionaryDatas});
+ }
+ },
+ error : function(data){
+ Notification.error("Error while saving.");
+ }
+ });
+ }
+ }else{
+ Notification.error("Please check BRMS Rule Upload file format.");
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLPepOptionsDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLPepOptionsDictController.js
new file mode 100644
index 000000000..2d1d2d931
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLPepOptionsDictController.js
@@ -0,0 +1,115 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editPEPOptionsController', function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.pepOptionsDictionaryData==null)
+ $scope.label='Add PEP Options',
+ $scope.choices = [];
+ else{
+ $scope.label='Edit PEP Options'
+ $scope.disableCd=true;
+ $scope.choices = [];
+ var headers = message.pepOptionsDictionaryData.actions;
+ var SplitChars = ':#@';
+ if (headers.indexOf(SplitChars) >= 0) {
+ var splitHeader = headers.split(SplitChars);
+ var singleHeader = splitHeader;
+ var splitEqual = '=#@';
+ for(i = 0; i < singleHeader.length; i++){
+ if (singleHeader[i].indexOf(splitEqual) >= 0) {
+ var splitValue = singleHeader[i].split(splitEqual);
+ var key = splitValue[0];
+ var value = splitValue[1];
+ var newItemNo = $scope.choices.length+1;
+ $scope.choices.push({'id':'choice'+newItemNo, 'option': key , 'number' : value });
+ }
+ }
+ }else{
+ var splitEqual = '=#@';
+ if (headers.indexOf(splitEqual) >= 0) {
+ var splitValue = headers.split(splitEqual);
+ var key = splitValue[0];
+ var value = splitValue[1];
+ $scope.choices.push({'id':'choice'+1, 'option': key , 'number' : value });
+ }
+ }
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editPEPOptions = message.pepOptionsDictionaryData;
+
+ $scope.saveCLPepOptions = function(pepOptionsDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(pepOptionsDictionaryData.pepName)) {
+ Notification.error("Enter Valid PEP Name without spaces or special characters");
+ }else{
+ var finalData = extend(pepOptionsDictionaryData, $scope.actions[0]);
+ var uuu = "saveDictionary/cl_dictionary/save_pepOptions";
+ var postData={pepOptionsDictionaryData: finalData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.pepOptionsDictionaryDatas=data.pepOptionsDictionaryDatas;});
+ if($scope.pepOptionsDictionaryDatas == "Duplicate"){
+ Notification.error("PEP Options Dictionary exists with Same PEP Name.")
+ }else{
+ console.log($scope.pepOptionsDictionaryDatas);
+ $modalInstance.close({pepOptionsDictionaryDatas:$scope.pepOptionsDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+
+ function extend(obj, src) {
+ for (var key in src) {
+ if (src.hasOwnProperty(key)) obj[key] = src[key];
+ }
+ return obj;
+ }
+
+ $scope.actions = [{"attributes" : $scope.choices}];
+ $scope.addNewChoice = function() {
+ var newItemNo = $scope.choices.length+1;
+ $scope.choices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeChoice = function() {
+ var lastItem = $scope.choices.length-1;
+ $scope.choices.splice(lastItem);
+ };
+
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLServiceDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLServiceDictController.js
new file mode 100644
index 000000000..fda942be4
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLServiceDictController.js
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editCLServiceController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.closedLoopServiceDictionaryData==null)
+ $scope.label='Add Service Name'
+ else{
+ $scope.label='Edit Service Name'
+ $scope.disableCd=true;
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editCLService = message.closedLoopServiceDictionaryData;
+
+ $scope.saveCLServiceDict = function(closedLoopServiceDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(closedLoopServiceDictionaryData.serviceName)) {
+ Notification.error("Enter Valid ClosedLoop Service Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/cl_dictionary/save_service";
+ var postData={closedLoopServiceDictionaryData: closedLoopServiceDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.closedLoopServiceDictionaryDatas=data.closedLoopServiceDictionaryDatas;});
+ if($scope.closedLoopServiceDictionaryDatas == "Duplicate"){
+ Notification.error("ClosedLoop Service Dictionary exists with Same Service Name.")
+ }else{
+ console.log($scope.closedLoopServiceDictionaryDatas);
+ $modalInstance.close({closedLoopServiceDictionaryDatas:$scope.closedLoopServiceDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLSiteDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLSiteDictController.js
new file mode 100644
index 000000000..403f8652d
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLSiteDictController.js
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editCLSiteController', function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.closedLoopSiteDictionaryData==null)
+ $scope.label='Add Site Name'
+ else{
+ $scope.label='Edit Site Name'
+ $scope.disableCd=true;
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editCLSite = message.closedLoopSiteDictionaryData;
+
+ $scope.saveCLSite = function(closedLoopSiteDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(closedLoopSiteDictionaryData.siteName)) {
+ Notification.error("Enter Valid ClosedLoop Site Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/cl_dictionary/save_siteName";
+ var postData={closedLoopSiteDictionaryData: closedLoopSiteDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.closedLoopSiteDictionaryDatas=data.closedLoopSiteDictionaryDatas;});
+ if($scope.closedLoopSiteDictionaryDatas == "Duplicate"){
+ Notification.error("ClosedLoop Site Dictionary exists with Same Site Name.")
+ }else{
+ console.log($scope.closedLoopSiteDictionaryDatas);
+ $modalInstance.close({closedLoopSiteDictionaryDatas:$scope.closedLoopSiteDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLVarbindDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLVarbindDictController.js
new file mode 100644
index 000000000..f3d75ec52
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLVarbindDictController.js
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editCLVarbindController',function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.varbindDictionaryData==null)
+ $scope.label='Add Varbind '
+ else{
+ $scope.label='Edit Varbind'
+ $scope.disableCd=true;
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editCLVarbind = message.varbindDictionaryData;
+
+ $scope.saveCLVarbind = function(varbindDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(varbindDictionaryData.varbindName)) {
+ Notification.error("Enter Valid ClosedLoop Varbind Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/cl_dictionary/save_varbind";
+ var postData={varbindDictionaryData: varbindDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.varbindDictionaryDatas=data.varbindDictionaryDatas;});
+ if($scope.varbindDictionaryDatas == "Duplicate"){
+ Notification.error("ClosedLoop Varbind Dictionary exists with Same Varbind Name.")
+ }else{
+ console.log($scope.varbindDictionaryDatas);
+ $modalInstance.close({varbindDictionaryDatas:$scope.varbindDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLVnfTypeDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLVnfTypeDictController.js
new file mode 100644
index 000000000..73236445d
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLVnfTypeDictController.js
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editVnfTypeController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.vnfTypeDictionaryData==null)
+ $scope.label='Add VNF Type'
+ else{
+ $scope.label='Edit VNF Type'
+ $scope.disableCd=true;
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editVnfType = message.vnfTypeDictionaryData;
+
+ $scope.saveCLVnfType = function(vnfTypeDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(vnfTypeDictionaryData.vnftype)) {
+ Notification.error("Enter Valid VNF Type Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/cl_dictionary/save_vnfType";
+ var postData={vnfTypeDictionaryData: vnfTypeDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.vnfTypeDictionaryDatas=data.vnfTypeDictionaryDatas;});
+ if($scope.vnfTypeDictionaryDatas == "Duplicate"){
+ Notification.error("ClosedLoop VNFType Dictionary exists with Same VNFType Name.")
+ }else{
+ console.log($scope.vnfTypeDictionaryDatas);
+ $modalInstance.close({vnfTypeDictionaryDatas:$scope.vnfTypeDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLVsclActionDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLVsclActionDictController.js
new file mode 100644
index 000000000..ac597c85e
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/CLVsclActionDictController.js
@@ -0,0 +1,71 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editVsclActionController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.vsclActionDictionaryData==null)
+ $scope.label='Add VSCL Action'
+ else{
+ $scope.label='Edit VSCL Action'
+ $scope.disableCd=true;
+ }
+
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editvsclAction = message.vsclActionDictionaryData;
+
+ $scope.saveCLVSCLAction = function(vsclActionDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(vsclActionDictionaryData.vsclaction)) {
+ Notification.error("Enter Valid VSCL Action Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/cl_dictionary/save_vsclAction";
+ var postData={vsclActionDictionaryData: vsclActionDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.vsclActionDictionaryDatas=data.vsclActionDictionaryDatas;});
+ if($scope.vsclActionDictionaryDatas == "Duplicate"){
+ Notification.error("ClosedLoop VSCLAction Dictionary exists with Same VSCLAction Name.")
+ }else{
+ console.log($scope.vsclActionDictionaryDatas);
+ $modalInstance.close({vsclActionDictionaryDatas:$scope.vsclActionDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/DecisionSettingsDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/DecisionSettingsDictController.js
new file mode 100644
index 000000000..2dfc2c4c7
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/DecisionSettingsDictController.js
@@ -0,0 +1,71 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editSettingsDictController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.settingsDictionaryData==null)
+ $scope.label='Add Decision Settings'
+ else{
+ $scope.label='Edit Decision Settings'
+ $scope.disableCd=true;
+ }
+
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editSettingsDict = message.settingsDictionaryData;
+
+ $scope.saveDecisionSettings = function(settingsDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(settingsDictionaryData.xacmlId)) {
+ Notification.error("Enter Valid Settings Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/decision_dictionary/save_Settings";
+ var postData={settingsDictionaryData: settingsDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.settingsDictionaryDatas=data.settingsDictionaryDatas;});
+ if($scope.settingsDictionaryDatas == "Duplicate"){
+ Notification.error("Decision Dictionary exists with Same Settings Name.")
+ }else{
+ console.log($scope.settingsDictionaryDatas);
+ $modalInstance.close({settingsDictionaryDatas:$scope.settingsDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/DescriptiveSearchDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/DescriptiveSearchDictController.js
new file mode 100644
index 000000000..218ad24bc
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/DescriptiveSearchDictController.js
@@ -0,0 +1,116 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editDescriptiveScopeController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.descriptiveScopeDictionaryData==null)
+ $scope.label='Add Descriptive Scope',
+ $scope.choices = [];
+ else{
+ $scope.label='Edit Descriptive Scope'
+ $scope.disableCd=true;
+ $scope.choices = [];
+ var headers = message.descriptiveScopeDictionaryData.search;
+ var SplitChars = 'AND';
+ if (headers.indexOf(SplitChars) >= 0) {
+ var splitHeader = headers.split(SplitChars);
+ var singleHeader = splitHeader;
+ var splitEqual = ':';
+ for(i = 0; i < singleHeader.length; i++){
+ if (singleHeader[i].indexOf(splitEqual) >= 0) {
+ var splitValue = singleHeader[i].split(splitEqual);
+ var key = splitValue[0];
+ var value = splitValue[1];
+ var newItemNo = $scope.choices.length+1;
+ $scope.choices.push({'id':'choice'+newItemNo, 'option': key , 'number' : value });
+ }
+ }
+ }else{
+ var splitEqual = ':';
+ if (headers.indexOf(splitEqual) >= 0) {
+ var splitValue = headers.split(splitEqual);
+ var key = splitValue[0];
+ var value = splitValue[1];
+ $scope.choices.push({'id':'choice'+1, 'option': key , 'number' : value });
+ }
+ }
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editDescriptiveScope = message.descriptiveScopeDictionaryData;
+
+ $scope.saveDescriptiveScope = function(descriptiveScopeDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(descriptiveScopeDictionaryData.scopeName)) {
+ Notification.error("Enter Valid Descriptive Scope Name without spaces or special characters");
+ }else{
+ var finalData = extend(descriptiveScopeDictionaryData, $scope.actions[0]);
+ var uuu = "saveDictionary/descriptive_dictionary/save_descriptive";
+ var postData={descriptiveScopeDictionaryData: finalData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.descriptiveScopeDictionaryDatas=data.descriptiveScopeDictionaryDatas;});
+ if($scope.descriptiveScopeDictionaryDatas == "Duplicate"){
+ Notification.error("Descriptive Scope Dictionary exists with Same Scope Name.")
+ }else{
+ console.log($scope.descriptiveScopeDictionaryDatas);
+ $modalInstance.close({descriptiveScopeDictionaryDatas:$scope.descriptiveScopeDictionaryDatas});
+ }
+
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+
+ function extend(obj, src) {
+ for (var key in src) {
+ if (src.hasOwnProperty(key)) obj[key] = src[key];
+ }
+ return obj;
+ }
+
+ $scope.actions = [{"attributes" : $scope.choices}];
+ $scope.addNewChoice = function() {
+ var newItemNo = $scope.choices.length+1;
+ $scope.choices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeChoice = function() {
+ var lastItem = $scope.choices.length-1;
+ $scope.choices.splice(lastItem);
+ };
+
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/EnforcerDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/EnforcerDictController.js
new file mode 100644
index 000000000..6481a93c8
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/EnforcerDictController.js
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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=========================================================
+ */
+var editEnforcerTypeController = function ($scope, $modalInstance, message, UserInfoServiceDS2){
+ if(message.enforcerDictionaryData==null)
+ $scope.label='Add Enforcing Type'
+ else{
+ $scope.label='Edit Enforcing Type'
+ $scope.disableCd=true;
+ }
+ $scope.editEnforcerType = message.enforcerDictionaryData;
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.saveEnforcerType = function(enforcerDictionaryData) {
+ var uuu = "saveDictionary/enforcer_dictionary/save_enforcerType";
+ var postData={enforcerDictionaryData: enforcerDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.enforcerDictionaryDatas=data.enforcerDictionaryDatas;});
+ console.log($scope.enforcerDictionaryDatas);
+ $modalInstance.close({enforcerDictionaryDatas:$scope.enforcerDictionaryDatas});
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+} \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWActionListDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWActionListDictController.js
new file mode 100644
index 000000000..e52fd6d5e
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWActionListDictController.js
@@ -0,0 +1,71 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editFWActionListController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.actionListDictionaryData==null)
+ $scope.label='Add Action Name'
+ else{
+ $scope.label='Edit Action Name'
+ $scope.disableCd=true;
+ }
+
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editActionList = message.actionListDictionaryData;
+
+ $scope.saveFWActionList = function(actionListDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(actionListDictionaryData.actionName)) {
+ Notification.error("Enter Valid ActionList Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/fw_dictionary/save_ActionList";
+ var postData={actionListDictionaryData: actionListDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.actionListDictionaryDatas=data.actionListDictionaryDatas;});
+ if($scope.actionListDictionaryDatas == "Duplicate"){
+ Notification.error("FW ActionList Dictionary exists with Same ActionList Name.")
+ }else{
+ console.log($scope.actionListDictionaryDatas);
+ $modalInstance.close({actionListDictionaryDatas:$scope.actionListDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWAddressGroupDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWAddressGroupDictController.js
new file mode 100644
index 000000000..70c88bc23
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWAddressGroupDictController.js
@@ -0,0 +1,116 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editFWAddressGroupController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, PolicyAppService, Notification){
+ if(message.addressGroupDictionaryData==null)
+ $scope.label='Add Address Group',
+ $scope.apchoices = [];
+ else{
+ $scope.label='Edit Address Group'
+ $scope.disableCd=true;
+ $scope.apchoices = [];
+ var headers = message.addressGroupDictionaryData.prefixList;
+ var splitEqual = ',';
+ if(headers != null){
+ if (headers.indexOf(splitEqual) >= 0) {
+ var splitValue = headers.split(splitEqual);
+ for(i = 0; i < splitValue.length; i++){
+ var key = splitValue[i];
+ $scope.apchoices.push({'id':'choice'+i+1, 'option': key});
+ }
+ }else{
+ var key = headers;
+ $scope.apchoices.push({'id':'choice'+1, 'option': key});
+ }
+ }
+ }
+
+
+ PolicyAppService.getData('getDictionary/get_PrefixListDataByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.prefixListDictionaryDatas = JSON.parse($scope.data.prefixListDictionaryDatas);
+ console.log($scope.prefixListDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editAddressGroup = message.addressGroupDictionaryData;
+
+ $scope.saveFWAddressGroup = function(addressGroupDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(addressGroupDictionaryData.groupName)) {
+ Notification.error("Enter Valid Address Group Name without spaces or special characters");
+ }else{
+ var finalData = extend(addressGroupDictionaryData, $scope.attributeDatas[0]);
+ var uuu = "saveDictionary/fw_dictionary/save_addressGroup";
+ var postData={addressGroupDictionaryData: finalData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.addressGroupDictionaryDatas=data.addressGroupDictionaryDatas;});
+ if($scope.addressGroupDictionaryDatas == "Duplicate"){
+ Notification.error("FW AddressGroup Dictionary exists with Same Address group Name.")
+ }else{
+ console.log($scope.addressGroupDictionaryDatas);
+ $modalInstance.close({addressGroupDictionaryDatas:$scope.addressGroupDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+
+ function extend(obj, src) {
+ for (var key in src) {
+ if (src.hasOwnProperty(key)) obj[key] = src[key];
+ }
+ return obj;
+ }
+
+ $scope.attributeDatas = [{"attributes" : $scope.apchoices}];
+ $scope.addAPNewChoice = function() {
+ var newItemNo = $scope.apchoices.length+1;
+ $scope.apchoices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeAPChoice = function() {
+ var lastItem = $scope.apchoices.length-1;
+ $scope.apchoices.splice(lastItem);
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWParentListDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWParentListDictController.js
new file mode 100644
index 000000000..96fb57734
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWParentListDictController.js
@@ -0,0 +1,151 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editFWParentListController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, PolicyAppService, Notification){
+ if(message.fwDictListDictionaryData==null){
+ $scope.slchoices = [];
+ $scope.alchoices = [];
+ $scope.label='Add Parent List'
+ }else{
+ $scope.label='Edit Parent List'
+ $scope.disableCd=true;
+ $scope.slchoices = [];
+ $scope.alchoices = [];
+ var slList = message.fwDictListDictionaryData.serviceList;
+ var alList = message.fwDictListDictionaryData.addressList;
+ var splitEqual = ',';
+ if(slList != null){
+ if (slList.indexOf(splitEqual) >= 0) {
+ var splitValue = slList.split(splitEqual);
+ for(i = 0; i < splitValue.length; i++){
+ var key = splitValue[i];
+ $scope.slchoices.push({'id':'choice'+i+1, 'option': key});
+ }
+ }else{
+ var key = slList;
+ $scope.slchoices.push({'id':'choice'+1, 'option': key});
+ }
+ }
+ if(alList != null){
+ if (alList.indexOf(splitEqual) >= 0) {
+ var splitALValue = alList.split(splitEqual);
+ for(i = 0; i < splitALValue.length; i++){
+ var key = splitALValue[i];
+ $scope.alchoices.push({'id':'choice'+i+1, 'option': key});
+ }
+ }else{
+ var key = alList;
+ $scope.alchoices.push({'id':'choice'+1, 'option': key});
+ }
+ }
+ }
+
+ PolicyAppService.getData('getDictionary/get_ServiceListDictionaryDataByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.serviceListDictionaryDatas = JSON.parse($scope.data.serviceListDictionaryDatas);
+ console.log($scope.serviceListDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+ PolicyAppService.getData('getDictionary/get_AddressGroupDictionaryDataByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.addressGroupDictionaryDatas = JSON.parse($scope.data.addressGroupDictionaryDatas);
+ console.log($scope.addressGroupDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editParentList = message.fwDictListDictionaryData;
+
+ $scope.saveFWParentList = function(fwDictListDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(fwDictListDictionaryData.parentItemName)) {
+ Notification.error("Enter Valid Parent List Name without spaces or special characters");
+ }else{
+ var addSLData = extend(fwDictListDictionaryData, $scope.attributeDatas[0]);
+ var finalData = extend(addSLData, $scope.attributeALDatas[0]);
+ var uuu = "saveDictionary/fw_dictionary/save_FWDictionaryList";
+ var postData={fwDictListDictionaryData: finalData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.fwDictListDictionaryDatas=data.fwDictListDictionaryDatas;});
+ if($scope.fwDictListDictionaryDatas == "Duplicate"){
+ Notification.error("FW DictionaryList Dictionary exists with Same Name.")
+ }else{
+ console.log($scope.fwDictListDictionaryDatas);
+ $modalInstance.close({fwDictListDictionaryDatas:$scope.fwDictListDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+
+ function extend(obj, src) {
+ for (var key in src) {
+ if (src.hasOwnProperty(key)) obj[key] = src[key];
+ }
+ return obj;
+ }
+
+
+ $scope.attributeDatas = [{"attributes" : $scope.slchoices}];
+ $scope.addServiceGroupNewChoice = function() {
+ var newItemNo = $scope.slchoices.length+1;
+ $scope.slchoices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeServiceGroupChoice = function() {
+ var lastItem = $scope.slchoices.length-1;
+ $scope.slchoices.splice(lastItem);
+ };
+
+ $scope.attributeALDatas = [{"alAttributes" : $scope.alchoices}];
+ $scope.addAddressGroupNewChoice = function() {
+ var newItemNo = $scope.alchoices.length+1;
+ $scope.alchoices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeAddressGroupChoice = function() {
+ var lastItem = $scope.alchoices.length-1;
+ $scope.alchoices.splice(lastItem);
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWPortListDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWPortListDictController.js
new file mode 100644
index 000000000..aac43e8a9
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWPortListDictController.js
@@ -0,0 +1,71 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editFWPortListController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.portListDictionaryData==null)
+ $scope.label='Add Port Name'
+ else{
+ $scope.label='Edit Port Name'
+ $scope.disableCd=true;
+ }
+
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editPortList = message.portListDictionaryData;
+
+ $scope.saveFWPortList = function(portListDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(portListDictionaryData.portName)) {
+ Notification.error("Enter Valid Port Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/fw_dictionary/save_portName";
+ var postData={portListDictionaryData: portListDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.portListDictionaryDatas=data.portListDictionaryDatas;});
+ if($scope.portListDictionaryDatas == "Duplicate"){
+ Notification.error("FW PortList Dictionary exists with Same Port Name.")
+ }else{
+ console.log($scope.portListDictionaryDatas);
+ $modalInstance.close({portListDictionaryDatas:$scope.portListDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWPrefixListDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWPrefixListDictController.js
new file mode 100644
index 000000000..372837f39
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWPrefixListDictController.js
@@ -0,0 +1,98 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editFWPrefixListController' , function ($scope, $modalInstance, message, Notification, UserInfoServiceDS2, Notification){
+ $scope.validate = 'false';
+ if(message.prefixListDictionaryData==null)
+ $scope.label='Add PrefixList'
+ else{
+ $scope.label='Edit PrefixList'
+ $scope.disableCd=true;
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editPrefixList = message.prefixListDictionaryData;
+
+ $scope.saveFWPrefixList = function(prefixListDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(prefixListDictionaryData.prefixListName)) {
+ Notification.error("Enter Valid PrefixList Name without spaces or special characters");
+ }else{
+ if($scope.validate == 'true'){
+ var uuu = "saveDictionary/fw_dictionary/save_prefixList";
+ var postData={prefixListDictionaryData: prefixListDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.prefixListDictionaryDatas=data.prefixListDictionaryDatas;});
+ if($scope.prefixListDictionaryDatas == "Duplicate"){
+ Notification.error("FW PrefixList Dictionary exists with Same PrefixList Name.")
+ }else{
+ console.log($scope.prefixListDictionaryDatas);
+ $modalInstance.close({prefixListDictionaryDatas:$scope.prefixListDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }else{
+ Notification.error('Prefix List Validation is Not Successful');
+ }
+ }
+ };
+
+ $scope.validateFWPrefixList = function(prefixListDictionaryData) {
+ var uuu = "saveDictionary/fw_dictionary/validate_prefixList";
+ var postData={prefixListDictionaryData: prefixListDictionaryData};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.result=data.result;});
+ console.log($scope.result);
+ if($scope.result == 'error'){
+ Notification.error('IP not according to CIDR notation');
+ }else{
+ $scope.validate = 'true';
+ Notification.success('Validation Success');
+ }
+ }
+ });
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWProtocolListDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWProtocolListDictController.js
new file mode 100644
index 000000000..a87727380
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWProtocolListDictController.js
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editFWProtocolListController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.protocolListDictionaryData==null)
+ $scope.label='Add Protocol Name'
+ else{
+ $scope.label='Edit Protocol Name'
+ $scope.disableCd=true;
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editProtocolList = message.protocolListDictionaryData;
+
+ $scope.saveProtocolList = function(protocolListDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(protocolListDictionaryData.protocolName)) {
+ Notification.error("Enter Valid ProtocolList Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/fw_dictionary/save_protocolList";
+ var postData={protocolListDictionaryData: protocolListDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.protocolListDictionaryDatas=data.protocolListDictionaryDatas;});
+ if($scope.protocolListDictionaryDatas == "Duplicate"){
+ Notification.error("FW ProtocolList Dictionary exists with Same Protocol Name.")
+ }else{
+ console.log($scope.protocolListDictionaryDatas);
+ $modalInstance.close({protocolListDictionaryDatas:$scope.protocolListDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWSecurityZoneDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWSecurityZoneDictController.js
new file mode 100644
index 000000000..ecda8c27a
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWSecurityZoneDictController.js
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editfwSecurityZoneController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.securityZoneDictionaryData==null)
+ $scope.label='Add Security Zone'
+ else{
+ $scope.label='Edit Security Zone'
+ $scope.disableCd=true;
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editSecurityZone = message.securityZoneDictionaryData;
+
+ $scope.saveSecurityZone = function(securityZoneDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(securityZoneDictionaryData.zoneName)) {
+ Notification.error("Enter Valid Security Zone Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/fw_dictionary/save_securityZone";
+ var postData={securityZoneDictionaryData: securityZoneDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.securityZoneDictionaryDatas=data.securityZoneDictionaryDatas;});
+ if($scope.securityZoneDictionaryDatas == "Duplicate"){
+ Notification.error("FW SecurityZone Dictionary exists with Same Zone Name.")
+ }else{
+ console.log($scope.securityZoneDictionaryDatas);
+ $modalInstance.close({securityZoneDictionaryDatas:$scope.securityZoneDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWServiceGroupDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWServiceGroupDictController.js
new file mode 100644
index 000000000..1de45ecf6
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWServiceGroupDictController.js
@@ -0,0 +1,118 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editFWServiceGroupController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, PolicyAppService, Notification){
+ if(message.serviceGroupDictionaryData==null){
+ $scope.slchoices = [];
+ $scope.label='Add Service Group'
+ }else{
+ $scope.label='Edit Service Group'
+ $scope.disableCd=true;
+ $scope.slchoices = [];
+ var headers = message.serviceGroupDictionaryData.serviceList;
+ var splitEqual = ',';
+ if(headers != null){
+ if (headers.indexOf(splitEqual) >= 0) {
+ var splitValue = headers.split(splitEqual);
+ for(i = 0; i < splitValue.length; i++){
+ var key = splitValue[i];
+ $scope.slchoices.push({'id':'choice'+i+1, 'option': key});
+ }
+ }else{
+ var key = headers;
+ $scope.slchoices.push({'id':'choice'+1, 'option': key});
+ }
+ }
+ }
+
+
+ PolicyAppService.getData('getDictionary/get_ServiceListDictionaryDataByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.serviceListDictionaryDatas = JSON.parse($scope.data.serviceListDictionaryDatas);
+ console.log($scope.serviceListDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editServiceGroup = message.serviceGroupDictionaryData;
+
+ $scope.saveFWServiceGroup = function(serviceGroupDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(serviceGroupDictionaryData.groupName)) {
+ Notification.error("Enter Valid Service Group Name without spaces or special characters");
+ }else{
+ var finalData = extend(serviceGroupDictionaryData, $scope.attributeDatas[0]);
+ var uuu = "saveDictionary/fw_dictionary/save_serviceGroup";
+ var postData={serviceGroupDictionaryData: finalData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.serviceGroupDictionaryDatas=data.serviceGroupDictionaryDatas;});
+ if($scope.serviceGroupDictionaryDatas == "Duplicate"){
+ Notification.error("FW Service Group Dictionary exists with Same Group Name.")
+ }else{
+ console.log($scope.serviceGroupDictionaryDatas);
+ $modalInstance.close({serviceGroupDictionaryDatas:$scope.serviceGroupDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+
+ function extend(obj, src) {
+ for (var key in src) {
+ if (src.hasOwnProperty(key)) obj[key] = src[key];
+ }
+ return obj;
+ }
+
+
+
+ $scope.attributeDatas = [{"attributes" : $scope.slchoices}];
+ $scope.addServiceGroupNewChoice = function() {
+ var newItemNo = $scope.slchoices.length+1;
+ $scope.slchoices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeServiceGroupChoice = function() {
+ var lastItem = $scope.slchoices.length-1;
+ $scope.slchoices.splice(lastItem);
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWServiceListDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWServiceListDictController.js
new file mode 100644
index 000000000..458601bb9
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWServiceListDictController.js
@@ -0,0 +1,144 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editFWServiceListController' , function ($scope, $modalInstance, message, PolicyAppService, UserInfoServiceDS2, Notification){
+ $scope.protocolListDictionaryDatas =[];
+
+ $scope.tpchoices = [];
+ $scope.apchoices = [];
+ if(message.serviceListDictionaryData==null){
+ $scope.label='Add Service List'
+ }else{
+ $scope.label='Edit Service List'
+ $scope.disableCd=true;
+ var tcpheaders = message.serviceListDictionaryData.serviceTransProtocol;
+ var splitEqual = ',';
+ if(tcpheaders != null){
+ if (tcpheaders.indexOf(splitEqual) >= 0) {
+ var splitValue = tcpheaders.split(splitEqual);
+ for(i = 0; i < splitValue.length; i++){
+ var key = splitValue[i];
+ $scope.tpchoices.push({'id':'choice'+i+1, 'option': key});
+ }
+ }else{
+ var key = tcpheaders;
+ $scope.tpchoices.push({'id':'choice'+1, 'option': key});
+ }
+ }
+ var appheaders = message.serviceListDictionaryData.serviceAppProtocol;
+ var splitEqual1 = ',';
+ if(appheaders != null){
+ if (appheaders.indexOf(splitEqual1) >= 0) {
+ var splitValue1 = appheaders.split(splitEqual1);
+ for(i = 0; i < splitValue1.length; i++){
+ var key1 = splitValue1[i];
+ $scope.apchoices.push({'id':'choice'+i+1, 'option': key1});
+ }
+ }else{
+ var key1 = appheaders;
+ $scope.apchoices.push({'id':'choice'+1, 'option': key1});
+ }
+ }
+ }
+
+
+ PolicyAppService.getData('getDictionary/get_ProtocolListDataByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.protocolListDictionaryDatas = JSON.parse($scope.data.protocolListDictionaryDatas);
+ console.log($scope.protocolListDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editServiceList = message.serviceListDictionaryData;
+
+ $scope.saveFWServiceList = function(serviceListDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(serviceListDictionaryData.serviceName)) {
+ Notification.error("Enter Valid ServiceList Name without spaces or special characters");
+ }else{
+ var addtcpData = extend(serviceListDictionaryData, $scope.attributeTCPDatas[0]);
+ var finalData = extend(addtcpData, $scope.attributeAPPDatas[0]);
+ var uuu = "saveDictionary/fw_dictionary/save_serviceList";
+ var postData={serviceListDictionaryData: finalData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.serviceListDictionaryDatas=data.serviceListDictionaryDatas;});
+ if($scope.serviceListDictionaryDatas == "Duplicate"){
+ Notification.error("FW ServiceList Dictionary exists with Same ServiceList Name.")
+ }else{
+ console.log($scope.serviceListDictionaryDatas);
+ $modalInstance.close({serviceListDictionaryDatas:$scope.serviceListDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+
+ function extend(obj, src) {
+ for (var key in src) {
+ if (src.hasOwnProperty(key)) obj[key] = src[key];
+ }
+ return obj;
+ }
+
+ $scope.attributeTCPDatas = [{"transportProtocols" : $scope.tpchoices}];
+ $scope.addTPNewChoice = function() {
+ var newItemNo = $scope.tpchoices.length+1;
+ $scope.tpchoices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeTPChoice = function() {
+ var lastItem = $scope.tpchoices.length-1;
+ $scope.tpchoices.splice(lastItem);
+ };
+
+
+ $scope.attributeAPPDatas = [{"appProtocols" : $scope.apchoices}];
+ $scope.addAPNewChoice = function() {
+ var newItemNo = $scope.apchoices.length+1;
+ $scope.apchoices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeAPChoice = function() {
+ var lastItem = $scope.apchoices.length-1;
+ $scope.apchoices.splice(lastItem);
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWTagListDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWTagListDictController.js
new file mode 100644
index 000000000..0d65b8209
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWTagListDictController.js
@@ -0,0 +1,105 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editFWTagListController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+
+ if(message.fwTagDictionaryDatas==null)
+ $scope.label='Add Tag',
+ $scope.choices = [];
+ else{
+ $scope.label='Edit Tag'
+ $scope.disableCd=true;
+ $scope.choices = [];
+ var headers = message.fwTagDictionaryDatas.tagValues;
+ var SplitChars = ',';
+ if (headers.indexOf(SplitChars) >= 0) {
+ var splitHeader = headers.split(SplitChars);
+ var singleHeader = splitHeader;
+ for(i = 0; i < singleHeader.length; i++){
+ var splitValue = singleHeader[i];
+ var newItemNo = $scope.choices.length+1;
+ $scope.choices.push({'id':'choice'+newItemNo, 'tags': splitValue });
+ }
+ }else{
+ $scope.choices.push({'id':'choice'+1, 'tags': headers });
+ }
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editFWTag = message.fwTagDictionaryDatas;
+
+ $scope.saveFWTag = function(fwTagDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(fwTagDictionaryData.fwTagName)) {
+ Notification.error("Enter Valid Tag Name without spaces or special characters");
+ }else{
+ var finalData = extend(fwTagDictionaryData, $scope.attributeDatas[0]);
+ var uuu = "saveDictionary/fw_dictionary/save_fwTag";
+ var postData={fwTagDictionaryData: finalData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.fwTagDictionaryDatas=data.fwTagDictionaryDatas;});
+ if($scope.fwTagDictionaryDatas == "Duplicate"){
+ Notification.error("Tag Dictionary exists with Same Tag Name.")
+ }else{
+ console.log($scope.fwTagDictionaryDatas);
+ $modalInstance.close({fwTagDictionaryDatas:$scope.fwTagDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ function extend(obj, src) {
+ for (var key in src) {
+ if (src.hasOwnProperty(key)) obj[key] = src[key];
+ }
+ return obj;
+ }
+
+ $scope.attributeDatas = [{"tags" : $scope.choices}];
+ $scope.addNewChoice = function() {
+ var newItemNo = $scope.choices.length+1;
+ $scope.choices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeChoice = function() {
+ var lastItem = $scope.choices.length-1;
+ $scope.choices.splice(lastItem);
+ };
+
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWTagPickerListDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWTagPickerListDictController.js
new file mode 100644
index 000000000..534edd0bc
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWTagPickerListDictController.js
@@ -0,0 +1,151 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editFWTagPickerController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification, PolicyAppService){
+ if(message.fwTagPickerDictionaryData==null)
+ $scope.label='Add TagPicker',
+ $scope.choices = [];
+ else{
+ $scope.label='Edit TagPicker'
+ $scope.disableCd=true;
+ $scope.choices = [];
+ var headers = message.fwTagPickerDictionaryData.tagValues;
+ var SplitChars = '#';
+ if (headers.indexOf(SplitChars) >= 0) {
+ var splitHeader = headers.split(SplitChars);
+ var singleHeader = splitHeader;
+ var splitEqual = ':';
+ for(i = 0; i < singleHeader.length; i++){
+ if (singleHeader[i].indexOf(splitEqual) >= 0) {
+ var splitValue = singleHeader[i].split(splitEqual);
+ var key = splitValue[0];
+ var value = splitValue[1];
+ var newItemNo = $scope.choices.length+1;
+ $scope.choices.push({'id':'choice'+newItemNo, 'option': key , 'number' : value });
+ }
+ }
+ }else{
+ var splitEqual = ':';
+ if (headers.indexOf(splitEqual) >= 0) {
+ var splitValue = headers.split(splitEqual);
+ var key = splitValue[0];
+ var value = splitValue[1];
+ $scope.choices.push({'id':'choice'+1, 'option': key , 'number' : value });
+ }
+ }
+ }
+
+
+ PolicyAppService.getData('getDictionary/get_TagListData').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.fwTagDictionaryDatas = JSON.parse($scope.data.fwTagDictionaryDatas);
+ console.log($scope.fwTagDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+ PolicyAppService.getData('getDictionary/get_TagNameByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.fwTagDictionaryKeyDatas = JSON.parse($scope.data.fwTagDictionaryDatas);
+ console.log($scope.fwTagDictionaryKeyDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+
+ $scope.fwTagDictionaryDataValues = [];
+ $scope.getTagListValues = function(key){
+ for (var i = 0; i < $scope.fwTagDictionaryDatas.length; ++i) {
+ var obj = $scope.fwTagDictionaryDatas[i];
+ if (obj.fwTagName == key){
+ var splitValue = obj.tagValues.split(',');
+ for (var j = 0; j < splitValue.length; ++j) {
+ $scope.fwTagDictionaryDataValues.push(splitValue[j].split(',')[0]);
+ }
+ }
+ }
+ };
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editFWTagPicker = message.fwTagPickerDictionaryData;
+
+ $scope.saveFWTagPicker = function(fwTagPickerDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(fwTagPickerDictionaryData.tagPickerName)) {
+ Notification.error("Enter Valid TagPicker Name without spaces or special characters");
+ }else{
+ var finalData = extend(fwTagPickerDictionaryData, $scope.actions[0]);
+ var uuu = "saveDictionary/fw_dictionary/save_fwTagPicker";
+ var postData={fwTagPickerDictionaryData: finalData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.fwTagPickerDictionaryDatas=data.fwTagPickerDictionaryDatas;});
+ if($scope.fwTagPickerDictionaryDatas == "Duplicate"){
+ Notification.error("TagPicker Dictionary exists with TagPicker Name.")
+ }else{
+ console.log($scope.fwTagPickerDictionaryDatas);
+ $modalInstance.close({fwTagPickerDictionaryDatas:$scope.fwTagPickerDictionaryDatas});
+ }
+
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+
+ function extend(obj, src) {
+ for (var key in src) {
+ if (src.hasOwnProperty(key)) obj[key] = src[key];
+ }
+ return obj;
+ }
+
+ $scope.actions = [{"tags" : $scope.choices}];
+ $scope.addNewChoice = function() {
+ var newItemNo = $scope.choices.length+1;
+ $scope.choices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeChoice = function() {
+ var lastItem = $scope.choices.length-1;
+ $scope.choices.splice(lastItem);
+ };
+
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWTermListDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWTermListDictController.js
new file mode 100644
index 000000000..4c3ddb4ab
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWTermListDictController.js
@@ -0,0 +1,328 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editFWTermListController' , function ($scope, $modalInstance, message, PolicyAppService, UserInfoServiceDS2, Notification){
+ $scope.fromZonechoices = [];
+ $scope.toZonechoices = [];
+ $scope.sourceListchoices = [];
+ $scope.destinationListchoices = [];
+ $scope.sourceServicechoices = [];
+ $scope.destinationServicechoices = [];
+ $scope.actionListchoices = [];
+ if(message.termListDictionaryData==null){
+ $scope.label='Add Term List Name'
+ }else{
+ $scope.label='Edit Term List Name'
+ $scope.disableCd=true;
+ var fromZoneheaders = message.termListDictionaryData.fromZone;
+ var splitFromZone = ',';
+ if(fromZoneheaders != null){
+ if (fromZoneheaders.indexOf(splitFromZone) >= 0) {
+ var splitFromZoneValue = fromZoneheaders.split(splitFromZone);
+ for(i = 0; i < splitFromZoneValue.length; i++){
+ var key = splitFromZoneValue[i];
+ $scope.fromZonechoices.push({'id':'choice'+i+1, 'option': key});
+ }
+ }else{
+ var key = fromZoneheaders;
+ $scope.fromZonechoices.push({'id':'choice'+1, 'option': key});
+ }
+ }
+
+ var toZoneheaders = message.termListDictionaryData.toZone;
+ var splitToZone = ',';
+ if(toZoneheaders != null){
+ if (toZoneheaders.indexOf(splitToZone) >= 0) {
+ var splitToZoneValue = toZoneheaders.split(splitToZone);
+ for(i = 0; i < splitToZoneValue.length; i++){
+ var key = splitToZoneValue[i];
+ $scope.toZonechoices.push({'id':'choice'+i+1, 'option': key});
+ }
+ }else{
+ var key = toZoneheaders;
+ $scope.toZonechoices.push({'id':'choice'+1, 'option': key});
+ }
+ }
+
+ var srcIPheaders = message.termListDictionaryData.srcIPList;
+ var splitSrcIP = ',';
+ if(srcIPheaders != null){
+ if (srcIPheaders.indexOf(splitSrcIP) >= 0) {
+ var splitSrcIPValue = srcIPheaders.split(splitSrcIP);
+ for(i = 0; i < splitSrcIPValue.length; i++){
+ var key = splitSrcIPValue[i];
+ $scope.sourceListchoices.push({'id':'choice'+i+1, 'option': key});
+ }
+ }else{
+ var key = srcIPheaders;
+ $scope.sourceListchoices.push({'id':'choice'+1, 'option': key});
+ }
+ }
+
+ var desIPheaders = message.termListDictionaryData.destIPList;
+ var splitDesIP = ',';
+ if(desIPheaders != null){
+ if (desIPheaders.indexOf(splitDesIP) >= 0) {
+ var splitDestIPValue = desIPheaders.split(splitDesIP);
+ for(i = 0; i < splitDestIPValue.length; i++){
+ var key = splitDestIPValue[i];
+ $scope.destinationListchoices.push({'id':'choice'+i+1, 'option': key});
+ }
+ }else{
+ var key = desIPheaders;
+ $scope.destinationListchoices.push({'id':'choice'+1, 'option': key});
+ }
+ }
+
+ var srcServheaders = message.termListDictionaryData.srcPortList;
+ var splitSrcServ = ',';
+ if(srcServheaders != null){
+ if (srcServheaders.indexOf(splitSrcServ) >= 0) {
+ var splitSrcServValue = srcServheaders.split(splitSrcServ);
+ for(i = 0; i < splitSrcServValue.length; i++){
+ var key = splitSrcServValue[i];
+ $scope.sourceServicechoices.push({'id':'choice'+i+1, 'option': key});
+ }
+ }else{
+ var key = srcServheaders;
+ $scope.sourceServicechoices.push({'id':'choice'+1, 'option': key});
+ }
+ }
+
+ var desServheaders = message.termListDictionaryData.destPortList;
+ var splitdesSer = ',';
+ if(desServheaders != null){
+ if (desServheaders.indexOf(splitdesSer) >= 0) {
+ var splitDesSerValue = desServheaders.split(splitdesSer);
+ for(i = 0; i < splitDesSerValue.length; i++){
+ var key = splitDesSerValue[i];
+ $scope.destinationServicechoices.push({'id':'choice'+i+1, 'option': key});
+ }
+ }else{
+ var key = desServheaders;
+ $scope.destinationServicechoices.push({'id':'choice'+1, 'option': key});
+ }
+ }
+
+ var actionheaders = message.termListDictionaryData.action;
+ var splitAction = ',';
+ if(actionheaders != null){
+ if (actionheaders.indexOf(splitAction) >= 0) {
+ var splitActionValue = actionheaders.split(splitAction);
+ for(i = 0; i < splitActionValue.length; i++){
+ var key = splitActionValue[i];
+ $scope.actionListchoices.push({'id':'choice'+i+1, 'option': key});
+ }
+ }else{
+ var key = actionheaders;
+ $scope.actionListchoices.push({'id':'choice'+1, 'option': key});
+ }
+ }
+ }
+
+
+ PolicyAppService.getData('getDictionary/get_PrefixListDataByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.prefixListDictionaryDatas = JSON.parse($scope.data.prefixListDictionaryDatas);
+ console.log($scope.prefixListDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+ PolicyAppService.getData('getDictionary/get_ZoneDictionaryDataByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.zoneDictionaryDatas = JSON.parse($scope.data.zoneDictionaryDatas);
+ console.log($scope.zoneDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+ PolicyAppService.getData('getDictionary/get_AddressGroupDictionaryDataByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.addressGroupDictionaryDatas = JSON.parse($scope.data.addressGroupDictionaryDatas);
+ console.log($scope.addressGroupDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+ PolicyAppService.getData('getDictionary/get_ServiceListDictionaryDataByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.serviceListDictionaryDatas = JSON.parse($scope.data.serviceListDictionaryDatas);
+ console.log($scope.serviceListDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+ PolicyAppService.getData('getDictionary/get_ServiceGroupDictionaryDataByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.serviceGroupDictionaryDatas = JSON.parse($scope.data.serviceGroupDictionaryDatas);
+ console.log($scope.serviceGroupDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+ PolicyAppService.getData('getDictionary/get_ActionListDictionaryDataByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.actionListDictionaryDatas = JSON.parse($scope.data.actionListDictionaryDatas);
+ console.log($scope.actionListDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editTermList = message.termListDictionaryData;
+
+ $scope.saveTermName = function(termListDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(termListDictionaryData.termName)) {
+ Notification.error("Enter Valid Term Name without spaces or special characters");
+ }else{
+ var mergeFromZoneData = extend(termListDictionaryData, $scope.fromZoneDatas[0]);
+ var mergeToData = extend(mergeFromZoneData, $scope.toZoneDatas[0]);
+ var mergeSourceListData = extend(mergeToData, $scope.sourceListDatas[0]);
+ var mergeDListData = extend(mergeSourceListData, $scope.destinationListDatas[0]);
+ var mergeSServicesData = extend(mergeDListData, $scope.sourceServicesDatas[0]);
+ var mergeDServicesData = extend(mergeSServicesData, $scope.destinationServicesDatas[0]);
+ var finalData = extend(mergeDServicesData, $scope.actionListDatas[0]);
+ var uuu = "saveDictionary/fw_dictionary/save_termList";
+ var postData={termListDictionaryData: finalData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.termListDictionaryDatas=data.termListDictionaryDatas;});
+ if($scope.termListDictionaryDatas == "Duplicate"){
+ Notification.error("FW TermList Dictionary exists with Same Term Name.")
+ }else{
+ console.log($scope.termListDictionaryDatas);
+ $modalInstance.close({termListDictionaryDatas:$scope.termListDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+
+
+ function extend(obj, src) {
+ for (var key in src) {
+ if (src.hasOwnProperty(key)) obj[key] = src[key];
+ }
+ return obj;
+ }
+
+ $scope.fromZoneDatas = [{"fromZoneDatas" : $scope.fromZonechoices}];
+ $scope.addFromZoneNewChoice = function() {
+ var newItemNo = $scope.fromZonechoices.length+1;
+ $scope.fromZonechoices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeFromZoneChoice = function() {
+ var lastItem = $scope.fromZonechoices.length-1;
+ $scope.fromZonechoices.splice(lastItem);
+ };
+
+ $scope.toZoneDatas = [{"toZoneDatas" : $scope.toZonechoices}];
+ $scope.addToZoneNewChoice = function() {
+ var newItemNo = $scope.toZonechoices.length+1;
+ $scope.toZonechoices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeToZoneChoice = function() {
+ var lastItem = $scope.toZonechoices.length-1;
+ $scope.toZonechoices.splice(lastItem);
+ };
+
+ $scope.sourceListDatas = [{"sourceListDatas" : $scope.sourceListchoices}];
+ $scope.addSourceListNewChoice = function() {
+ var newItemNo = $scope.sourceListchoices.length+1;
+ $scope.sourceListchoices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeSourceListChoice = function() {
+ var lastItem = $scope.sourceListchoices.length-1;
+ $scope.sourceListchoices.splice(lastItem);
+ };
+
+ $scope.destinationListDatas = [{"destinationListDatas" : $scope.destinationListchoices}];
+ $scope.addDListNewChoice = function() {
+ var newItemNo = $scope.destinationListchoices.length+1;
+ $scope.destinationListchoices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeDlistChoice = function() {
+ var lastItem = $scope.destinationListchoices.length-1;
+ $scope.destinationListchoices.splice(lastItem);
+ };
+
+ $scope.sourceServicesDatas = [{"sourceServiceDatas" : $scope.sourceServicechoices}];
+ $scope.addSourceServiceNewChoice = function() {
+ var newItemNo = $scope.sourceServicechoices.length+1;
+ $scope.sourceServicechoices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeSourceServiceChoice = function() {
+ var lastItem = $scope.sourceServicechoices.length-1;
+ $scope.sourceServicechoices.splice(lastItem);
+ };
+
+ $scope.destinationServicesDatas = [{"destinationServiceDatas" : $scope.destinationServicechoices}];
+ $scope.addDServicesNewChoice = function() {
+ var newItemNo = $scope.destinationServicechoices.length+1;
+ $scope.destinationServicechoices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeDServicesChoice = function() {
+ var lastItem = $scope.destinationServicechoices.length-1;
+ $scope.destinationServicechoices.splice(lastItem);
+ };
+
+ $scope.actionListDatas = [{"actionListDatas" : $scope.actionListchoices}];
+ $scope.addActionListNewChoice = function() {
+ var newItemNo = $scope.actionListchoices.length+1;
+ $scope.actionListchoices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeActionListChoice = function() {
+ var lastItem = $scope.actionListchoices.length-1;
+ $scope.actionListchoices.splice(lastItem);
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWZoneDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWZoneDictController.js
new file mode 100644
index 000000000..e655e2c5b
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWZoneDictController.js
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editFWZoneController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.zoneDictionaryData==null)
+ $scope.label='Add Zone Name'
+ else{
+ $scope.label='Edit Zone Name'
+ $scope.disableCd=true;
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editZoneName = message.zoneDictionaryData;
+
+ $scope.saveZoneName = function(zoneDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(zoneDictionaryData.zoneName)) {
+ Notification.error("Enter Valid Zone Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/fw_dictionary/save_zoneName";
+ var postData={zoneDictionaryData: zoneDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.zoneDictionaryDatas=data.zoneDictionaryDatas;});
+ if($scope.zoneDictionaryDatas == "Duplicate"){
+ Notification.error("FW Zone Dictionary exists with Same Zone Name.")
+ }else{
+ console.log($scope.zoneDictionaryDatas);
+ $modalInstance.close({zoneDictionaryDatas:$scope.zoneDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSConfigNameDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSConfigNameDictController.js
new file mode 100644
index 000000000..b985beb7d
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSConfigNameDictController.js
@@ -0,0 +1,71 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editMSConfigController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.microServiceCongigNameDictionaryData==null)
+ $scope.label='Add Config Name'
+ else{
+ $scope.label='Edit Config Name'
+ $scope.disableCd=true;
+ }
+
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editMSConfig = message.microServiceCongigNameDictionaryData;
+
+ $scope.saveMSConfig = function(microServiceCongigNameDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(microServiceCongigNameDictionaryData.name)) {
+ Notification.error("Enter Valid Config Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/ms_dictionary/save_configName";
+ var postData={microServiceCongigNameDictionaryData: microServiceCongigNameDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.microServiceCongigNameDictionaryDatas=data.microServiceCongigNameDictionaryDatas;});
+ if($scope.microServiceCongigNameDictionaryDatas == "Duplicate"){
+ Notification.error("MS ConfigName Dictionary exists with Same Config Name.")
+ }else{
+ console.log($scope.microServiceCongigNameDictionaryDatas);
+ $modalInstance.close({microServiceCongigNameDictionaryDatas:$scope.microServiceCongigNameDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSDcaeUUIDDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSDcaeUUIDDictController.js
new file mode 100644
index 000000000..a67fad81d
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSDcaeUUIDDictController.js
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editDCAEuuidController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.dcaeUUIDDictionaryData==null)
+ $scope.label='Add Micro Service UUID'
+ else{
+ $scope.label='Edit Micro Service UUID'
+ $scope.disableCd=true;
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editDCAEuuid = message.dcaeUUIDDictionaryData;
+
+ $scope.saveDCAEUUID = function(dcaeUUIDDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(dcaeUUIDDictionaryData.name)) {
+ Notification.error("Enter Valid DCAEUUID Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/ms_dictionary/save_dcaeUUID";
+ var postData={dcaeUUIDDictionaryData: dcaeUUIDDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.dcaeUUIDDictionaryDatas=data.dcaeUUIDDictionaryDatas;});
+ if($scope.dcaeUUIDDictionaryDatas == "Duplicate"){
+ Notification.error("MS DCAEUUID Dictionary exists with Same DCAEUUID Name.")
+ }else{
+ console.log($scope.dcaeUUIDDictionaryDatas);
+ $modalInstance.close({dcaeUUIDDictionaryDatas:$scope.dcaeUUIDDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSLocationDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSLocationDictController.js
new file mode 100644
index 000000000..808eddd40
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSLocationDictController.js
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editMSLocationController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.microServiceLocationDictionaryData==null)
+ $scope.label='Add Micro Service Location'
+ else{
+ $scope.label='Edit Micro Service Location'
+ $scope.disableCd=true;
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editMSLocation = message.microServiceLocationDictionaryData;
+
+ $scope.saveMSLocation = function(microServiceLocationDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(microServiceLocationDictionaryData.name)) {
+ Notification.error("Enter Valid Micro Service Location Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/ms_dictionary/save_location";
+ var postData={microServiceLocationDictionaryData: microServiceLocationDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.microServiceLocationDictionaryDatas=data.microServiceLocationDictionaryDatas;});
+ if($scope.microServiceLocationDictionaryDatas == "Duplicate"){
+ Notification.error("MS Location Dictionary exists with Same Location Name.")
+ }else{
+ console.log($scope.microServiceLocationDictionaryDatas);
+ $modalInstance.close({microServiceLocationDictionaryDatas:$scope.microServiceLocationDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSModelsDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSModelsDictController.js
new file mode 100644
index 000000000..2e30523ad
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/MSModelsDictController.js
@@ -0,0 +1,97 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editMSModelController' , function ($scope, $modalInstance, message, $http, UserInfoServiceDS2, Notification){
+ if(message.microServiceModelsDictionaryData==null)
+ $scope.label='Add Micro Service Model'
+ else{
+ $scope.label='Edit Micro Service Model'
+ $scope.disableCd=true;
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ var valid = true;
+ $scope.editMSmodelName = message.microServiceModelsDictionaryData;
+
+ $scope.uploadFile = function(files) {
+ var extn = files[0].name.substr(files[0].name.lastIndexOf('.')+1);
+ if(extn == 'zip' || extn == 'xmi'){
+ valid = true;
+ var fd = new FormData();
+ fd.append("file", files[0]);
+ $http.post("ms_dictionary/set_MSModelData", fd, {
+ withCredentials: false,
+ headers: {'Content-Type': undefined },
+ transformRequest: angular.identity
+ }).success(function(data){
+ if(data.classListDatas == "EMPTY"){
+ Notification.error("No Micro Services Avaialble.")
+ }else{
+ $scope.classListDatas=data.classListDatas;
+ $scope.modalDatas = data.modelDatas;
+ console.log($scope.classListDatas);
+ }
+ }).error( );
+ }else{
+ Notification.error("Micro Service Model Upload file should ends with .zip or .xmi extension");
+ valid = false;
+ }
+
+ };
+
+ $scope.saveMSModel = function(microServiceModelsDictionaryData) {
+ if(valid){
+ var uuu = "saveDictionary/ms_dictionary/save_model";
+ var postData={microServiceModelsDictionaryData: microServiceModelsDictionaryData, userid: userid, classMap: $scope.modalDatas};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.microServiceModelsDictionaryDatas=data.microServiceModelsDictionaryDatas;});
+ if($scope.microServiceModelsDictionaryDatas == "Duplicate"){
+ Notification.error("MS Models Dictionary exists with Same Model Name.")
+ }else{
+ console.log($scope.microServiceModelsDictionaryDatas);
+ $modalInstance.close({microServiceModelsDictionaryDatas:$scope.microServiceModelsDictionaryDatas});
+ }
+ },
+ error : function(data){
+ Notification.error("Error while saving.");
+ }
+ });
+ }else{
+ Notification.error("Please check Micro Service Model Upload file format.");
+ }
+
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/ModelAttributeDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/ModelAttributeDictController.js
new file mode 100644
index 000000000..1eae88daa
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/ModelAttributeDictController.js
@@ -0,0 +1,96 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editModelAttributeController' , function ($scope, $modalInstance, message, PolicyAppService, UserInfoServiceDS2, Notification){
+ if(message.modelAttributeDictionaryData==null)
+ $scope.label='Add New Dictionary Entry'
+ else{
+ $scope.label='Edit Dictionary Entry'
+ $scope.disableCd=true;
+ }
+
+ PolicyAppService.getData('getDictionary/get_MicroServiceAttributeData').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.microServiceAttributeDictionaryDatas = JSON.parse($scope.data.microServiceAttributeDictionaryDatas);
+ console.log($scope.microServiceAttributeDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+ PolicyAppService.getData('getDictionary/get_MicroServiceModelsDataServiceVersion').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.microServiceModelsDictionaryDatas = JSON.parse($scope.data.microServiceModelsDictionaryDatas);
+ console.log($scope.microServiceModelsDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editModelAttribute = message.modelAttributeDictionaryData;
+ $scope.editModelAttribute1 = {microservice: []};
+ if($scope.edit){
+ if(message.modelAttributeDictionaryData.groupList != null){
+ var splitValue = message.modelAttributeDictionaryData.groupList.split(",");
+ console.log(splitValue);
+ }
+ }
+ $scope.saveModelAttribute = function(modelAttributeDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(modelAttributeDictionaryData.name)) {
+ Notification.error("Enter Valid Micro Service Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/ms_dictionary/save_modelAttribute";
+ var postData={modelAttributeDictionaryData: modelAttributeDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.microServiceAttributeDictionaryDatas=data.microServiceAttributeDictionaryDatas;});
+ if($scope.microServiceAttributeDictionaryDatas == "Duplicate"){
+ Notification.error("Model Attribute Dictionary exists with Same Attribute Name.")
+ }else{
+ console.log($scope.microServiceAttributeDictionaryDatas);
+ $modalInstance.close({microServiceAttributeDictionaryDatas:$scope.microServiceAttributeDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSClosedLoopDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSClosedLoopDictController.js
new file mode 100644
index 000000000..746eb44ed
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSClosedLoopDictController.js
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editPSClosedLoopController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.psClosedLoopDictionaryData==null)
+ $scope.label='Add New Policy Scope ClosedLoop'
+ else{
+ $scope.label='Edit Policy Scope ClosedLoop'
+ $scope.disableCd=true;
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editPSClosedLoop = message.psClosedLoopDictionaryData;
+
+ $scope.savePSClosedLoop = function(psClosedLoopDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(psClosedLoopDictionaryData.name)) {
+ Notification.error("Enter Valid Policy Scope Closed Loop Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/ps_dictionary/save_psClosedLoop";
+ var postData={psClosedLoopDictionaryData: psClosedLoopDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.psClosedLoopDictionaryDatas=data.psClosedLoopDictionaryDatas;});
+ if($scope.psClosedLoopDictionaryDatas == "Duplicate"){
+ Notification.error("ClosedLoop Dictionary exists with Same ClosedLoop Name.")
+ }else{
+ console.log($scope.psClosedLoopDictionaryDatas);
+ $modalInstance.close({psClosedLoopDictionaryDatas:$scope.psClosedLoopDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSGroupPolicyScopeDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSGroupPolicyScopeDictController.js
new file mode 100644
index 000000000..5ddf1489f
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSGroupPolicyScopeDictController.js
@@ -0,0 +1,136 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editPSGroupPolicyScopeController' , function ($scope, $modalInstance, message, PolicyAppService, UserInfoServiceDS2, Notification){
+ $scope.edit = false;
+ if(message.groupPolicyScopeListData==null)
+ $scope.label='Add New Group Policy Scope'
+ else{
+ $scope.label='Edit Group Policy Scope'
+ $scope.disableCd=true;
+ $scope.edit = true;
+ }
+
+ PolicyAppService.getData('getDictionary/get_PSServiceDataByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.psServiceDictionaryDatas = JSON.parse($scope.data.psServiceDictionaryDatas);
+ console.log($scope.psServiceDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+ PolicyAppService.getData('getDictionary/get_PSTypeDataByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.psTypeDictionaryDatas = JSON.parse($scope.data.psTypeDictionaryDatas);
+ console.log($scope.psTypeDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+ PolicyAppService.getData('getDictionary/get_PSResourceDataByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.psResourceDictionaryDatas = JSON.parse($scope.data.psResourceDictionaryDatas);
+ console.log($scope.psResourceDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+ PolicyAppService.getData('getDictionary/get_PSClosedLoopDataByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.psClosedLoopDictionaryDatas = JSON.parse($scope.data.psClosedLoopDictionaryDatas);
+ console.log($scope.psClosedLoopDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editPSGroupPolicyScope = message.groupPolicyScopeListData;
+ $scope.editPSGroupPolicyScope1 = {resource: [], type:[], service: [], closedloop: []};
+ if($scope.edit){
+ if(message.groupPolicyScopeListData.groupList != null){
+ var splitValue = message.groupPolicyScopeListData.groupList.split(",");
+ console.log(splitValue);
+ $scope.splittedGroupListValues = [];
+ var splitResource = splitValue[0].split("=");
+ $scope.editPSGroupPolicyScope1.resource.push(splitResource[1]);
+ var splitType = splitValue[1].split("=");
+ $scope.editPSGroupPolicyScope1.type.push(splitType[1]);
+ var splitService = splitValue[2].split("=");
+ $scope.editPSGroupPolicyScope1.service.push(splitService[1]);
+ var splitCloop = splitValue[3].split("=");
+ $scope.editPSGroupPolicyScope1.closedloop.push(splitCloop[1]);
+ }
+ }
+
+ $scope.savePSGroupPolicyScope = function(groupPolicyScopeListData, groupPolicyScopeListData1) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(groupPolicyScopeListData.groupName)) {
+ Notification.error("Enter Valid Policy Scope Group Name without spaces or special characters");
+ }else{
+ console.log(groupPolicyScopeListData1);
+ if(groupPolicyScopeListData1.resource[0] != undefined && groupPolicyScopeListData1.type[0] != undefined && groupPolicyScopeListData1.service[0] != undefined && groupPolicyScopeListData1.closedloop[0] != undefined){
+ var uuu = "saveDictionary/ps_dictionary/save_psGroupPolicyScope";
+ var postData={groupPolicyScopeListData: groupPolicyScopeListData,
+ groupPolicyScopeListData1: groupPolicyScopeListData1, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.groupPolicyScopeListDatas=data.groupPolicyScopeListDatas;});
+ if($scope.groupPolicyScopeListDatas == "Duplicate"){
+ Notification.error("GroupPolicyScope Dictionary exists with Same Group Name.")
+ }else if($scope.groupPolicyScopeListDatas == "DuplicateGroup"){
+ Notification.error("GroupPolicyScope Dictionary exists with Same Group List.")
+ }else{
+ console.log($scope.groupPolicyScopeListDatas);
+ $modalInstance.close({groupPolicyScopeListDatas:$scope.groupPolicyScopeListDatas});
+ }
+ },
+ error : function(data){
+ Notification.error("Error while saving.");
+ }
+ });
+ }else{
+ Notification.error("Please Select all the required fields to Save");
+ }
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSResourceDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSResourceDictController.js
new file mode 100644
index 000000000..d5afa347a
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSResourceDictController.js
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editPSResourceController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.psResourceDictionaryData==null)
+ $scope.label='Add New Resource'
+ else{
+ $scope.label='Edit Resource'
+ $scope.disableCd=true;
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editPSResource = message.psResourceDictionaryData;
+
+ $scope.savePSResource = function(psResourceDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(psResourceDictionaryData.name)) {
+ Notification.error("Enter Valid Resource Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/ps_dictionary/save_psResource";
+ var postData={psResourceDictionaryData: psResourceDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.psResourceDictionaryDatas=data.psResourceDictionaryDatas;});
+ if($scope.psResourceDictionaryDatas == "Duplicate"){
+ Notification.error("Resource Dictionary exists with Same Resource Name.")
+ }else{
+ console.log($scope.psResourceDictionaryDatas);
+ $modalInstance.close({psResourceDictionaryDatas:$scope.psResourceDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSServiceDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSServiceDictController.js
new file mode 100644
index 000000000..b3813656e
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSServiceDictController.js
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editPSServiceController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.psServiceDictionaryData==null)
+ $scope.label='Add New Service'
+ else{
+ $scope.label='Edit Service'
+ $scope.disableCd=true;
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editPSService = message.psServiceDictionaryData;
+
+ $scope.savePSService = function(psServiceDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(psServiceDictionaryData.name)) {
+ Notification.error("Enter Valid Service Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/ps_dictionary/save_psService";
+ var postData={psServiceDictionaryData: psServiceDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.psServiceDictionaryDatas=data.psServiceDictionaryDatas;});
+ if($scope.psServiceDictionaryDatas == "Duplicate"){
+ Notification.error("Service Dictionary exists with Same Service Name.")
+ }else{
+ console.log($scope.psServiceDictionaryDatas);
+ $modalInstance.close({psServiceDictionaryDatas:$scope.psServiceDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSTypeDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSTypeDictController.js
new file mode 100644
index 000000000..bb7ef00c3
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/PSTypeDictController.js
@@ -0,0 +1,71 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editPSTypeController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.psTypeDictionaryData==null)
+ $scope.label='Add New Type'
+ else{
+ $scope.label='Edit Type'
+ $scope.disableCd=true;
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editPSType = message.psTypeDictionaryData;
+
+ $scope.savePSType = function(psTypeDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(psTypeDictionaryData.name)) {
+ Notification.error("Enter Valid PS Type Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/ps_dictionary/save_psType";
+ var postData={psTypeDictionaryData: psTypeDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.psTypeDictionaryDatas=data.psTypeDictionaryDatas;});
+ console.log($scope.psTypeDictionaryDatas);
+ if($scope.psTypeDictionaryDatas == "Duplicate"){
+ Notification.error("Type Dictionary exists with Same Type Name.")
+ }else{
+ console.log($scope.psTypeDictionaryDatas);
+ $modalInstance.close({psTypeDictionaryDatas:$scope.psTypeDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/RiskTypeDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/RiskTypeDictController.js
new file mode 100644
index 000000000..b5fe5f38a
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/RiskTypeDictController.js
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editRiskTypeController', function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.riskTypeDictionaryData==null)
+ $scope.label='Add New Type'
+ else{
+ $scope.label='Edit Type'
+ $scope.disableCd=true;
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editRiskType = message.riskTypeDictionaryData;
+
+ $scope.saveRiskType = function(riskTypeDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(riskTypeDictionaryData.riskName)) {
+ Notification.error("Enter Valid Risk Type Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/sp_dictionary/save_riskType";
+ var postData={riskTypeDictionaryData: riskTypeDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.riskTypeDictionaryDatas=data.riskTypeDictionaryDatas;});
+ if($scope.riskTypeDictionaryDatas == "Duplicate"){
+ Notification.error("Risk type Dictionary exists with Same RiskType Name.")
+ }else{
+ console.log($scope.riskTypeDictionaryDatas);
+ $modalInstance.close({riskTypeDictionaryDatas:$scope.riskTypeDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/SafePolicyWarningDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/SafePolicyWarningDictController.js
new file mode 100644
index 000000000..9d9a500b3
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/SafePolicyWarningDictController.js
@@ -0,0 +1,103 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editSafePolicyWarningController' , function ($scope, $modalInstance, message, PolicyAppService, UserInfoServiceDS2, Notification){
+ $scope.edit = false;
+ if(message.safePolicyWarningData==null)
+ $scope.label='Add New Safe Policy Warning'
+ else{
+ $scope.label='Edit Safe Policy Warning'
+ $scope.disableCd=true;
+ $scope.edit = true;
+ }
+
+ PolicyAppService.getData('getDictionary/get_SafePolicyWarningDataByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.safePolicyWarningDatas = JSON.parse($scope.data.safePolicyWarningDatas);
+ console.log($scope.safePolicyWarningDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+ PolicyAppService.getData('getDictionary/get_RiskTypeDataByName').then(function (data) {
+ var j = data;
+ $scope.data = JSON.parse(j.data);
+ console.log($scope.data);
+ $scope.riskTypeDictionaryDatas = JSON.parse($scope.data.riskTypeDictionaryDatas);
+ console.log($scope.riskTypeDictionaryDatas);
+ }, function (error) {
+ console.log("failed");
+ });
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editSafePolicyWarning = message.safePolicyWarningData;
+ $scope.editSafePolicyWarning1 = {resource: [], type:[], service: [], closedloop: []};
+ if($scope.edit){
+ if(message.safePolicyWarningData.groupList != null){
+ var splitValue = message.safePolicyWarningData.groupList.split(",");
+ console.log(splitValue);
+ $scope.splittedGroupListValues = [];
+ var splitResource = splitValue[0].split("=");
+ $scope.editSafePolicyWarningScope1.riskType.push(splitResource[1]);
+ }
+ }
+
+ $scope.saveSafePolicyWarning = function(safePolicyWarningData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(safePolicyWarningData.name)) {
+ Notification.error("Enter Valid Safe Policy Warning Name without spaces or special characters");
+ }else{
+ console.log(safePolicyWarningData);
+ var uuu = "saveDictionary/sp_dictionary/save_safePolicyWarning";
+ var postData={safePolicyWarningData: safePolicyWarningData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.safePolicyWarningDatas=data.safePolicyWarningDatas;});
+ if($scope.safePolicyWarningDatas == "Duplicate"){
+ Notification.error("Safe Policy Dictionary exists with Same Name.")
+ }else{
+ console.log($scope.safePolicyWarningDatas);
+ $modalInstance.close({safePolicyWarningDatas:$scope.safePolicyWarningDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/actionPolicyDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/actionPolicyDictController.js
new file mode 100644
index 000000000..36bc73929
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/actionPolicyDictController.js
@@ -0,0 +1,114 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editActionPolicyDictController', function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.actionPolicyDictionaryData==null)
+ $scope.label='Add Action Dictionary',
+ $scope.choices = [];
+ else{
+ $scope.choices = [];
+ $scope.label='Edit Action Dictionary'
+ $scope.disableCd=true;
+ var headers = message.actionPolicyDictionaryData.header;
+ var SplitChars = ':';
+ if (headers.indexOf(SplitChars) >= 0) {
+ var splitHeader = headers.split(SplitChars);
+ var singleHeader = splitHeader;
+ var splitEqual = '=';
+ for(i = 0; i < singleHeader.length; i++){
+ if (singleHeader[i].indexOf(splitEqual) >= 0) {
+ var splitValue = singleHeader[i].split(splitEqual);
+ var key = splitValue[0];
+ var value = splitValue[1];
+ var newItemNo = $scope.choices.length+1;
+ $scope.choices.push({'id':'choice'+newItemNo, 'option': key , 'number' : value });
+ }
+ }
+ }else{
+ var splitEqual = '=';
+ if (headers.indexOf(splitEqual) >= 0) {
+ var splitValue = headers.split(splitEqual);
+ var key = splitValue[0];
+ var value = splitValue[1];
+ $scope.choices.push({'id':'choice'+1, 'option': key , 'number' : value });
+ }
+ }
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editActionDict = message.actionPolicyDictionaryData;
+ $scope.saveActionDict = function(actionPolicyDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(actionPolicyDictionaryData.attributeName)) {
+ Notification.error("Enter Valid Attribute Name without spaces or special characters");
+ }else{
+ var finalData = extend(actionPolicyDictionaryData, $scope.headerDatas[0]);
+ var uuu = "saveDictionary/action_dictionary/save_ActionDict";
+ var postData={actionPolicyDictionaryData: finalData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.actionPolicyDictionaryDatas=data.actionPolicyDictionaryDatas;});
+ if($scope.actionPolicyDictionaryDatas == "Duplicate"){
+ Notification.error("ActionPolicy Dictionary exists with Same Attribute Name.")
+ }else{
+ console.log($scope.actionPolicyDictionaryDatas);
+ $modalInstance.close({actionPolicyDictionaryDatas:$scope.actionPolicyDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+
+ function extend(obj, src) {
+ for (var key in src) {
+ if (src.hasOwnProperty(key)) obj[key] = src[key];
+ }
+ return obj;
+ }
+
+ $scope.headerDatas = [{"headers" : $scope.choices}];
+ $scope.addNewChoice = function() {
+ var newItemNo = $scope.choices.length+1;
+ $scope.choices.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeChoice = function() {
+ var lastItem = $scope.choices.length-1;
+ $scope.choices.splice(lastItem);
+ };
+
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/attributeDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/attributeDictController.js
new file mode 100644
index 000000000..51909162a
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/attributeDictController.js
@@ -0,0 +1,104 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editAttributeController' ,function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.attributeDictionaryData==null)
+ $scope.label='Add New Attribute',
+ $scope.attributes = [];
+ else{
+ $scope.attributes = [];
+ $scope.label='Edit Attribute'
+ $scope.disableCd=true;
+ var headers = message.attributeDictionaryData.attributeValue;
+ var splitEqual = ',';
+ if(headers != null){
+ if (headers.indexOf(splitEqual) >= 0) {
+ var splitValue = headers.split(splitEqual);
+ for(i = 0; i < splitValue.length; i++){
+ var key = splitValue[i];
+ $scope.attributes.push({'id':'choice'+i+1, 'attributeValues': key});
+ }
+ }else{
+ var key = headers;
+ $scope.attributes.push({'id':'choice'+1, 'attributeValues': key});
+ }
+ }
+ }
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.editAttributeName = message.attributeDictionaryData;
+
+ $scope.saveAttributeName = function(attributeDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(attributeDictionaryData.xacmlId)) {
+ Notification.error("Enter Valid Attribute Name without spaces or special characters");
+ }else{
+ var finalData = extend(attributeDictionaryData, $scope.attributeDatas[0]);
+ var uuu = "saveDictionary/attribute_dictionary/save_attribute";
+ var postData={attributeDictionaryData: attributeDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.attributeDictionaryDatas=data.attributeDictionaryDatas;});
+ if($scope.attributeDictionaryDatas == "Duplicate"){
+ Notification.error("Attribute Dictionary exists with Same Attribute Name.")
+ }else{
+ console.log($scope.attributeDictionaryDatas);
+ $modalInstance.close({attributeDictionaryDatas:$scope.attributeDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ function extend(obj, src) {
+ for (var key in src) {
+ if (src.hasOwnProperty(key)) obj[key] = src[key];
+ }
+ return obj;
+ }
+
+ $scope.attributeDatas = [{"userDataTypeValues" : $scope.attributes}];
+ $scope.addNewChoice = function() {
+ var newItemNo = $scope.attributes.length+1;
+ $scope.attributes.push({'id':'choice'+newItemNo});
+ };
+ $scope.removeChoice = function() {
+ var lastItem = $scope.attributes.length-1;
+ $scope.attributes.splice(lastItem);
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/ecompNameEditorController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/ecompNameEditorController.js
new file mode 100644
index 000000000..04c8d812a
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/ecompNameEditorController.js
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * 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.controller('editEcompNameController' , function ($scope, $modalInstance, message, UserInfoServiceDS2, Notification){
+ if(message.ecompNameDictionaryData==null)
+ $scope.label='Add New Ecomp Name'
+ else{
+ $scope.label='Edit Ecomp Name'
+ $scope.disableCd=true;
+ }
+ $scope.editEcompName = message.ecompNameDictionaryData;
+
+
+ /*getting user info from session*/
+ var userid = null;
+ UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
+ .then(function (response) {
+ userid = response.userid;
+ });
+
+ $scope.saveEcompName = function(ecompNameDictionaryData) {
+ var regex = new RegExp("^[a-zA-Z0-9_]*$");
+ if(!regex.test(ecompNameDictionaryData.ecompName)) {
+ Notification.error("Enter Valid Ecomp Name without spaces or special characters");
+ }else{
+ var uuu = "saveDictionary/ecomp_dictionary/save_ecompName";
+ var postData={ecompNameDictionaryData: ecompNameDictionaryData, userid: userid};
+ $.ajax({
+ type : 'POST',
+ url : uuu,
+ dataType: 'json',
+ contentType: 'application/json',
+ data: JSON.stringify(postData),
+ success : function(data){
+ $scope.$apply(function(){
+ $scope.ecompNameDictionaryDatas=data.ecompNameDictionaryDatas;});
+ if($scope.ecompNameDictionaryDatas == "Duplicate"){
+ Notification.error("EcompName Dictionary exists with Same Ecomp Name.")
+ }else{
+ console.log($scope.ecompNameDictionaryDatas);
+ $modalInstance.close({ecompNameDictionaryDatas:$scope.ecompNameDictionaryDatas});
+ }
+ },
+ error : function(data){
+ alert("Error while saving.");
+ }
+ });
+ }
+ };
+
+ $scope.close = function() {
+ $modalInstance.close();
+ };
+}); \ No newline at end of file