2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
23 appDS2.requires.push('ngRoute');
\r
24 appDS2.requires.push('ui.tree');
\r
26 appDS2.config(function($routeProvider) {
\r
28 .when("/subviewedit", {
\r
29 templateUrl : "app/vid/scripts/view-models/aaiSubViewEdit.htm",
\r
30 controller : "aaiSubscriberSearchController"
\r
33 .when("/subdetails", {
\r
34 templateUrl : "app/vid/scripts/view-models/aaiSubDetails.htm",
\r
35 controller : "aaiSubscriberController"
\r
39 templateUrl : "app/vid/scripts/view-models/aaiGetSubs.htm",
\r
40 controller : "aaiSubscriberSearchController"
\r
44 appDS2.config(function(treeConfig) {
\r
45 treeConfig.defaultCollapsed = true; // collapse nodes by default
\r
48 appDS2.factory("user",function(){
\r
52 appDS2.controller("aaiSubscriberSearchController", [ "$scope", "$timeout", "$log", "UtilityService", "user", "PropertyService", "COMPONENT", "FIELD",
\r
53 function($scope, $timeout, $log, UtilityService, user, PropertyService, COMPONENT, FIELD) {
\r
55 $scope.baseUrl = "";
\r
56 $scope.responseTimeoutMsec = 10000;
\r
57 $scope.msoMaxPollingIntervalMsec = 1000;
\r
58 $scope.msoMaxPolls = 7;
\r
60 $scope.init = function(properties) {
\r
61 var msecs = PropertyService.retrieveMsoMaxPollingIntervalMsec();
\r
62 PropertyService.setMsoMaxPollingIntervalMsec(msecs);
\r
64 var polls = PropertyService.retrieveMsoMaxPolls();
\r
65 PropertyService.setMsoMaxPolls(polls);
\r
67 PropertyService.setServerResponseTimeoutMsec(10000);
\r
69 // These two properties only added for testing
\r
70 properties.msoDefaultBaseUrl = $scope.baseUrl;
\r
71 properties.responseTimeoutMsec = $scope.responseTimeoutMsec;
\r
73 UtilityService.setProperties(properties);
\r
76 $scope.autoGetSubs = function() {
\r
78 * Optionally comment in / out one of these method calls (or add a similar
\r
79 * entry) to auto-invoke an entry when the test screen is redrawn.
\r
81 $timeout(function() {
\r
82 $scope.getSubscribers();
\r
83 // $scope.deleteServiceInstance();
\r
84 // $scope.generateInvalidUrl405();
\r
88 $scope.autoGetSubDetails = function() {
\r
90 * Optionally comment in / out one of these method calls (or add a similar
\r
91 * entry) to auto-invoke an entry when the test screen is redrawn.
\r
93 $timeout(function() {
\r
94 $scope.getSubDetails();
\r
95 // $scope.deleteServiceInstance();
\r
96 // $scope.generateInvalidUrl405();
\r
100 $scope.autoPopulateViewEdit = function() {
\r
102 * Optionally comment in / out one of these method calls (or add a similar
\r
103 * entry) to auto-invoke an entry when the test screen is redrawn.
\r
105 $timeout(function() {
\r
106 $scope.getComponentList();
\r
107 // $scope.deleteServiceInstance();
\r
108 // $scope.generateInvalidUrl405();
\r
112 $scope.refreshSubs = function() {
\r
114 * Optionally comment in / out one of these method calls (or add a similar
\r
115 * entry) to auto-invoke an entry when the test screen is redrawn.
\r
117 $timeout(function() {
\r
118 $scope.refreshSubscribers();
\r
119 // $scope.deleteServiceInstance();
\r
120 // $scope.generateInvalidUrl405();
\r
124 $scope.autoStartQueryTest = function() {
\r
126 * Optionally comment in / out one of these method calls (or add a similar
\r
127 * entry) to auto-invoke an entry when the test screen is redrawn.
\r
129 $timeout(function() {
\r
130 // $scope.queryServiceInstance();
\r
134 $scope.queryServiceInstance = function() {
\r
136 * Example of method call needed to query a service instance.
\r
138 $scope.$broadcast(COMPONENT.QUERY_SERVICE_INSTANCE, {
\r
139 serviceInstanceId: COMPONENT.SERVICE_INSTANCE_ID_1
\r
143 $scope.getSubscribers = function() {
\r
145 * Example of method call needed to commit an instance creation request.
\r
147 $scope.$broadcast(COMPONENT.GET_SUBS, {
\r
148 url : FIELD.ID.AAI_GET_SUBSCRIBERS,
\r
149 requestDetails : createServiceRequestDetails
\r
153 $scope.getSubDetails = function() {
\r
155 * Example of method call needed to commit an instance creation request.
\r
157 $scope.$broadcast(COMPONENT.GET_SUB_DETAILS, {
\r
158 url : FIELD.ID.AAI_SUB_DETAILS,
\r
159 requestDetails : createServiceRequestDetails
\r
163 $scope.getComponentList = function() {
\r
165 * Example of method call needed to commit an instance creation request.
\r
167 $scope.$broadcast(COMPONENT.GET_COMPONENT_LIST, {
\r
168 url : FIELD.ID.AAI_SUB_VIEWEDIT,
\r
169 requestDetails : createServiceRequestDetails
\r
174 $scope.refreshSubscribers = function() {
\r
176 * Example of method call needed to commit an instance creation request.
\r
178 $scope.$broadcast(COMPONENT.GET_SUBS, {
\r
179 url : FIELD.ID.AAI_REFRESH_SUBSCRIBERS,
\r
180 requestDetails : createServiceRequestDetails
\r
184 $scope.deleteServiceInstance = function() {
\r
186 * Example of method call needed to commit an instance deletion request.
\r
188 $scope.$broadcast(COMPONENT.MSO_DELETE_REQ, {
\r
189 url : COMPONENT.MSO_DELETE_SVC_INSTANCE_PATH + COMPONENT.SERVICE_INSTANCE_ID_1,
\r
190 requestDetails : deleteServiceRequestDetails
\r
194 $scope.createNetworkInstance = function() {
\r
195 $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {
\r
196 url : COMPONENT.MSO_CREATE_NW_INSTANCE,
\r
197 requestDetails : createNetworkRequestDetails
\r
201 $scope.deleteNetworkInstance = function() {
\r
202 $scope.$broadcast(COMPONENT.MSO_DELETE_REQ, {
\r
203 url : COMPONENT.MSO_CREATE_NW_INSTANCE_PATH + COMPONENT.SERVICE_INSTANCE_ID_1 + COMPONENT.FORWARD_SLASH + COMPONENT.NETWORKS + COMPONENT.FORWARD_SLASH + COMPONENT.DELETE_INSTANCE_ID_1,
\r
204 requestDetails : deleteNetworkRequestDetails
\r
208 $scope.generateError = function(testName) {
\r
209 // Clone example request object
\r
210 var request = JSON.parse(JSON.stringify(createServiceRequestDetails));
\r
211 request.modelInfo.modelName = testName;
\r
212 $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {
\r
213 url : COMPONENT.MSO_CREATE_SVC_INSTANCE,
\r
214 requestDetails : request
\r
218 $scope.generateInvalidUrl404 = function() {
\r
219 var properties = UtilityService.getProperties(properties);
\r
220 properties.msoDefaultBaseUrl = COMPONENT.INVALID_STRING;
\r
221 UtilityService.setProperties(properties);
\r
222 $scope.$broadcast(COMPONENT.REFRESH_PROPERTIES);
\r
224 $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {
\r
225 url : COMPONENT.MSO_CREATE_SVC_INSTANCE,
\r
226 requestDetails : createServiceRequestDetails
\r
229 properties.msoDefaultBaseUrl = $scope.baseUrl;
\r
230 UtilityService.setProperties(properties);
\r
231 $scope.$broadcast(COMPONENT.REFRESH_PROPERTIES);
\r
234 $scope.generateInvalidUrl405 = function() {
\r
235 $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {
\r
236 url : COMPONENT.INVALID_STRING_MSO_CREATE_SVC_INSTANCE,
\r
237 requestDetails : createServiceRequestDetails
\r
242 $scope.getSubscriberDet = function(selectedCustomer){
\r
243 window.location.href = COMPONENT.SUBDETAILS_SELECTEDSUBSCRIBER + selectedCustomer;
\r