removing unused db file
[policy/engine.git] / ecomp-sdk-app / src / main / webapp / app / policyApp / service / Dictionary / DictionaryService.js
1 /*-
2  * ============LICENSE_START=======================================================
3  * ECOMP Policy Engine
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 app.factory('DictionaryService', function ($http, $q) {
22         return {
23                 
24                 getActionPolicyDictionaryData : function(url){
25                         console.log("url on the service js: " + url);
26                         var url = url+'/ecomp/get_ActionPolicyDictData';
27                         return $http.get(url)
28                                 .then(function(response) {
29                                         if (typeof response.data === 'object') {
30                                                 return response.data;
31                                         } else {
32                                                 return $q.reject(response.data);
33                                         }
34
35                                 }, function(response) {
36                                         // something went wrong
37                                         return $q.reject(response.data);
38                                 });
39                 },
40
41                 getAttributeDictionaryData: function(url) {
42                         console.log("url on the service js: " + url);
43                         var url = url+'/ecomp/get_AttributeData';
44                         return $http.get(url)
45                                 .then(function(response) {
46                                         if (typeof response.data === 'object') {
47                                                 return response.data;
48                                         } else {
49                                                 return $q.reject(response.data);
50                                         }
51
52                                 }, function(response) {
53                                         // something went wrong
54                                         return $q.reject(response.data);
55                                 });
56                 },
57
58
59                 getEcompDictionaryData : function(url){
60                         console.log("url on the service js: " + url);
61                         var url = url+'/ecomp/get_EcompNameData';
62                         return $http.get(url)
63                                 .then(function(response) {
64                                         if (typeof response.data === 'object') {
65                                                 return response.data;
66                                         } else {
67                                                 return $q.reject(response.data);
68                                         }
69
70                                 }, function(response) {
71                                         // something went wrong
72                                         return $q.reject(response.data);
73                                 });
74                 },
75
76
77                 getBRMSParamDictionaryData : function(url){
78                         console.log("url on the service js: " + url);
79                         var url = url+'/ecomp/get_BRMSParamData';
80                         return $http.get(url)
81                                 .then(function(response) {
82                                         if (typeof response.data === 'object') {
83                                                 return response.data;
84                                         } else {
85                                                 return $q.reject(response.data);
86                                         }
87
88                                 }, function(response) {
89                                         // something went wrong
90                                         return $q.reject(response.data);
91                                 });
92                 },
93
94
95                 getDecisionSettingsDictionaryData : function(url){
96                         console.log("url on the service js: " + url);
97                         var url = url+'/ecomp/get_SettingsDictionaryData';
98                         return $http.get(url)
99                                 .then(function(response) {
100                                         if (typeof response.data === 'object') {
101                                                 return response.data;
102                                         } else {
103                                                 return $q.reject(response.data);
104                                         }
105
106                                 }, function(response) {
107                                         // something went wrong
108                                         return $q.reject(response.data);
109                                 });
110                 },
111
112
113                 getEnforcerDictionaryData : function(url){
114                         console.log("url on the service js: " + url);
115                         var url = url+'/ecomp/get_EnforcerTypeData';
116                         return $http.get(url)
117                                 .then(function(response) {
118                                         if (typeof response.data === 'object') {
119                                                 return response.data;
120                                         } else {
121                                                 return $q.reject(response.data);
122                                         }
123
124                                 }, function(response) {
125                                         // something went wrong
126                                         return $q.reject(response.data);
127                                 });
128                 },
129
130
131                 getDescriptiveDictionaryData : function(url){
132                         console.log("url on the service js: " + url);
133                         var url = url+'/ecomp/get_DescriptiveScope';
134                         return $http.get(url)
135                                 .then(function(response) {
136                                         if (typeof response.data === 'object') {
137                                                 return response.data;
138                                         } else {
139                                                 return $q.reject(response.data);
140                                         }
141
142                                 }, function(response) {
143                                         // something went wrong
144                                         return $q.reject(response.data);
145                                 });
146                 }
147         };
148 });