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 var DetailsService = function ($log, DataService, ComponentService, COMPONENT,
\r
24 FIELD, UtilityService) {
\r
28 var getSummaryList = function () {
\r
29 var model = DataService.getModelInfo(COMPONENT.SERVICE);
\r
30 switch (_this.componentId) {
\r
31 case COMPONENT.NETWORK:
\r
32 case COMPONENT.SERVICE:
\r
34 case COMPONENT.VF_MODULE:
\r
35 case COMPONENT.VOLUME_GROUP:
\r
37 name: FIELD.NAME.SUBSCRIBER_NAME,
\r
38 value: DataService.getSubscriberName()
\r
40 name: FIELD.NAME.SERVICE_INSTANCE_ID,
\r
41 value: DataService.getServiceInstanceId()
\r
43 name: FIELD.NAME.SERVICE_TYPE,
\r
44 value: DataService.getServiceType()
\r
46 name: FIELD.NAME.MODEL_NAME,
\r
47 value: model.modelName
\r
49 name: FIELD.NAME.MODEL_VERSION,
\r
50 value: model.modelVersion
\r
55 var getDetailsList = function () {
\r
56 switch (_this.componentId) {
\r
57 case COMPONENT.NETWORK:
\r
58 case COMPONENT.SERVICE:
\r
60 case COMPONENT.VF_MODULE:
\r
61 case COMPONENT.VOLUME_GROUP:
\r
62 var model = DataService.getModelInfo(_this.componentId);
\r
63 var metaData = ComponentService.getDisplayNames(ComponentService
\r
64 .getInventoryParameterList(_this.componentId, DataService
\r
65 .getInventoryItem(), false));
\r
66 if (model && !UtilityService.isObjectEmpty(model.modelName) && !UtilityService.isObjectEmpty(model.modelVersion)) {
\r
67 metaData = metaData.concat([
\r
69 id: FIELD.NAME.MODEL_NAME,
\r
70 name: FIELD.NAME.MODEL_NAME,
\r
71 value: model.modelName
\r
73 id: FIELD.NAME.MODEL_VERSION,
\r
74 name: FIELD.NAME.MODEL_VERSION,
\r
75 value: model.modelVersion
\r
83 var getMsoFilterString = function () {
\r
85 var instanceId = "";
\r
87 switch (_this.componentId) {
\r
88 case COMPONENT.NETWORK:
\r
89 instanceId = DataService.getNetworkInstanceId();
\r
91 case COMPONENT.SERVICE:
\r
92 instanceId = DataService.getServiceInstanceId();
\r
95 instanceId = DataService.getVnfInstanceId();
\r
97 case COMPONENT.VF_MODULE:
\r
98 instanceId = DataService.getVfModuleInstanceId();
\r
100 case COMPONENT.VOLUME_GROUP:
\r
101 instanceId = DataService.getVolumeGroupInstanceId();
\r
104 return "filter=" + _this.componentId + "InstanceId:EQUALS:"
\r
109 initializeComponent: function (componentId) {
\r
110 _this.componentId = ComponentService.initialize(componentId);
\r
112 getComponentDisplayName: ComponentService.getComponentDisplayName,
\r
113 getSummaryList: getSummaryList,
\r
114 getDetailsList: getDetailsList,
\r
115 getMsoFilterString: getMsoFilterString
\r
119 appDS2.factory("DetailsService", ["$log", "DataService", "ComponentService",
\r
120 "COMPONENT", "FIELD", "UtilityService", DetailsService]);
\r