2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
23 var DetailsService = function($log, DataService, ComponentService, COMPONENT,
24 FIELD, UtilityService) {
28 var getSummaryList = function() {
29 switch (_this.componentId) {
30 case COMPONENT.NETWORK:
31 case COMPONENT.SERVICE:
33 case COMPONENT.VF_MODULE:
34 case COMPONENT.VOLUME_GROUP:
36 name : FIELD.NAME.SUBSCRIBER_NAME,
37 value : DataService.getSubscriberName()
39 name : FIELD.NAME.SERVICE_INSTANCE_ID,
40 value : DataService.getServiceInstanceId()
42 name : FIELD.NAME.SERVICE_TYPE,
43 value : DataService.getServiceType()
48 var getDetailsList = function() {
49 switch (_this.componentId) {
50 case COMPONENT.NETWORK:
51 case COMPONENT.SERVICE:
53 case COMPONENT.VF_MODULE:
54 case COMPONENT.VOLUME_GROUP:
55 return ComponentService.getDisplayNames(ComponentService
56 .getInventoryParameterList(_this.componentId, DataService
57 .getInventoryItem()));
61 var getMsoFilterString = function() {
65 switch (_this.componentId) {
66 case COMPONENT.NETWORK:
67 instanceId = DataService.getNetworkInstanceId();
69 case COMPONENT.SERVICE:
70 instanceId = DataService.getServiceInstanceId();
73 instanceId = DataService.getVnfInstanceId();
75 case COMPONENT.VF_MODULE:
76 instanceId = DataService.getVfModuleInstanceId();
78 case COMPONENT.VOLUME_GROUP:
79 instanceId = DataService.getVolumeGroupInstanceId();
82 return "filter=" + _this.componentId + "InstanceId:EQUALS:"
87 initializeComponent : function(componentId) {
88 _this.componentId = ComponentService.initialize(componentId);
90 getComponentDisplayName : ComponentService.getComponentDisplayName,
91 getSummaryList : getSummaryList,
92 getDetailsList : getDetailsList,
93 getMsoFilterString : getMsoFilterString
97 app.factory("DetailsService", [ "$log", "DataService", "ComponentService",
98 "COMPONENT", "FIELD", "UtilityService", DetailsService ]);