aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/webapp/app/vid/scripts/services
diff options
context:
space:
mode:
authorjimmydot <jf2512@att.com>2017-05-30 16:06:51 -0400
committerjimmydot <jf2512@att.com>2017-05-30 16:06:51 -0400
commit6c7dcba5be04a502a2d5de7e7c5f14eedf9eaa2a (patch)
tree85f583353ede474b859e46707f15cb4326ea863a /vid-app-common/src/main/webapp/app/vid/scripts/services
parentef3524df38879e4f070a018beb3de494cf276fee (diff)
[VID-12] Delivery of remaining features for v1.1
Change-Id: I50305ba25aaa34ee1ca7640237f31ab824655a34 Signed-off-by: jimmydot <jf2512@att.com>
Diffstat (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/services')
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js29
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js176
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js42
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js12
4 files changed, 202 insertions, 57 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js
index 8132e3a33..ee99547b6 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js
@@ -82,8 +82,8 @@ var AaiService = function($http, $log, PropertyService, UtilityService, COMPONEN
angular.forEach(subscriber[FIELD.ID.SERVICE_SUBSCRIPTIONS][FIELD.ID.SERVICE_SUBSCRIPTION], function(serviceSubscription, key) {
var serviceInstanceId = [];
var serviceType = "";
- if (serviceSubscription[FIELD.ID.SERVICE_TYPE] != null) {
- serviceType = serviceSubscription[FIELD.ID.SERVICE_TYPE];
+ if (serviceSubscription[FIELD.ID.SERVICETYPE] != null) {
+ serviceType = serviceSubscription[FIELD.ID.SERVICETYPE];
} else {
serviceType = FIELD.PROMPT.NO_SERVICE_SUB;
}
@@ -115,7 +115,8 @@ var AaiService = function($http, $log, PropertyService, UtilityService, COMPONEN
serviceType : serviceType,
serviceInstanceId : subVal.serviceInstanceId,
aaiModelInvariantId : subVal.aaiModelInvariantId,
- aaiModelVersionId : subVal.aaiModelVersionId,
+ aaiModelVersionId
+ : subVal.aaiModelVersionId,
serviceInstanceName : subVal.serviceInstanceName
});
});
@@ -198,7 +199,7 @@ var AaiService = function($http, $log, PropertyService, UtilityService, COMPONEN
var serviceSubscriptions = response.data[FIELD.ID.SERVICE_SUBSCRIPTIONS][FIELD.ID.SERVICE_SUBSCRIPTION];
for (var i = 0; i < serviceSubscriptions.length; i++) {
- serviceTypes.push(serviceSubscriptions[i][FIELD.ID.SERVICE_TYPE]);
+ serviceTypes.push(serviceSubscriptions[i][FIELD.ID.SERVICETYPE]);
}
successCallbackFunction(serviceTypes);
} else {
@@ -331,7 +332,25 @@ var AaiService = function($http, $log, PropertyService, UtilityService, COMPONEN
}
})["catch"]
(UtilityService.runHttpErrorHandler);
-}
+},
+getServiceModelsByServiceType : function(namedQueryId,globalCustomerId,serviceType,successCallbackFunction) {
+ $log
+ .debug("AaiService:getServiceModelsByServiceType");
+ var url = COMPONENT.AAI_GET_SERVICES_BY_TYPE+COMPONENT.FORWARD_SLASH+namedQueryId+COMPONENT.FORWARD_SLASH+globalCustomerId+COMPONENT.FORWARD_SLASH +serviceType+COMPONENT.ASSIGN + Math.random();
+
+ $http.get(url,
+ {
+ timeout : PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function(response) {
+ if (response.data) {
+ successCallbackFunction(response);
+ } else {
+ successCallbackFunction([]);
+ }
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ }
}
}
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
index f6838af09..284981292 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
@@ -29,7 +29,7 @@
*
*/
-var CreationService = function($log, AaiService, AsdcService, DataService,
+var CreationService = function($log, AaiService, AsdcService, DataService,VIDCONFIGURATION,
ComponentService, COMPONENT, FIELD, PARAMETER, UtilityService) {
var _this = this;
@@ -77,7 +77,11 @@ var CreationService = function($log, AaiService, AsdcService, DataService,
/*
* Common fields displayed at the top of all create instance screens.
*/
- addToList(FIELD.NAME.SERVICE_NAME, DataService.getServiceName());
+ if(DataService.getModelInfo(_this.componentId)["serviceTypeName"]==null
+ || DataService.getModelInfo(_this.componentId)["serviceTypeName"]==undefined
+ || DataService.getModelInfo(_this.componentId)["serviceTypeName"]==''){
+ addToList(FIELD.NAME.SERVICE_NAME, DataService.getServiceName());
+ }
switch (_this.componentId) {
case COMPONENT.SERVICE:
@@ -98,6 +102,15 @@ var CreationService = function($log, AaiService, AsdcService, DataService,
}
}
}
+ if(DataService.getModelInfo(_this.componentId)["createSubscriberName"]!=null && DataService.getModelInfo(_this.componentId)["createSubscriberName"]!=''){
+ addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
+ .getModelInfo(_this.componentId)["createSubscriberName"]);
+ }
+ if(DataService.getModelInfo(_this.componentId)["serviceTypeName"]!=null && DataService.getModelInfo(_this.componentId)["serviceTypeName"]!=''){
+ addToList(FIELD.NAME.SERVICE_TYPE, DataService
+ .getModelInfo(_this.componentId)["serviceTypeName"]);
+ addToList(FIELD.NAME.SERVICE_NAME, DataService.getServiceName());
+ }
addToList(FIELD.NAME.SERVICE_INVARIANT_UUID, DataService
.getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
addToList(FIELD.NAME.SERVICE_VERSION, DataService
@@ -115,7 +128,7 @@ var CreationService = function($log, AaiService, AsdcService, DataService,
addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
.getServiceInstanceName());
addToList(FIELD.NAME.MODEL_NAME, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
.getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
addToList(FIELD.NAME.MODEL_VERSION, DataService
@@ -131,7 +144,7 @@ var CreationService = function($log, AaiService, AsdcService, DataService,
addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
.getServiceInstanceName());
addToList(FIELD.NAME.MODEL_NAME, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
.getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
addToList(FIELD.NAME.MODEL_VERSION, DataService
@@ -158,7 +171,7 @@ var CreationService = function($log, AaiService, AsdcService, DataService,
addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
.getServiceInstanceName());
addToList(FIELD.NAME.MODEL_NAME, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
.getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
addToList(FIELD.NAME.MODEL_VERSION, DataService
@@ -181,7 +194,8 @@ var CreationService = function($log, AaiService, AsdcService, DataService,
isUserProvidedNaming = true;
}
var parameterList;
- if (_this.componentId === COMPONENT.SERVICE) {
+ var hsf = DataService.getHideServiceFields() || false;
+ if (_this.componentId === COMPONENT.SERVICE && !hsf) {
if ( DataService.getALaCarte() ) {
parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
parameterList = parameterList.concat([ getSubscribersParameter(),
@@ -193,11 +207,11 @@ var CreationService = function($log, AaiService, AsdcService, DataService,
parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
}
- parameterList = parameterList.concat([ getSubscribersParameter(),
- FIELD.PARAMETER.SERVICE_TYPE_DISABLED ]);
+ parameterList = parameterList.concat([ getSubscribersParameter() ]);
parameterList = parameterList.concat([ getServiceId(),
FIELD.PARAMETER.SERVICE_TYPE,
FIELD.PARAMETER.LCP_REGION,
+ FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
FIELD.PARAMETER.TENANT_DISABLED ]);
}
}
@@ -237,8 +251,49 @@ var CreationService = function($log, AaiService, AsdcService, DataService,
FIELD.PARAMETER.TENANT_DISABLED ]);
}
}
-
parameterList.push(FIELD.PARAMETER.SUPPRESS_ROLLBACK);
+ if(_this.componentId === COMPONENT.VF_MODULE ){
+ parameterList.push({name: "SDN-C Pre-Load",
+ id: "sdncPreload",
+ type: "checkbox",
+ isEnabled: true,
+ isRequired: false
+ }
+ );
+ parameterList.push({name: "Upload Supplementory Data file",
+ id: "uploadSupplementoryDataFile",
+ type: "checkbox",
+ isEnabled: true,
+ isRequired: false
+ }
+ );
+
+ parameterList.push({name: "Supplemetory file (JSON format)",
+ id: "supplementoryDataFile",
+ type: "file",
+ isRequired: false,
+ isVisiblity: false
+ }
+ );
+ }
+
+ if( VIDCONFIGURATION.UPLOAD_SUPPLEMENTARY_STATUS_CHECK_ENABLED && _this.componentId === COMPONENT.VOLUME_GROUP){
+ parameterList.push({name: "Upload Supplementory Data file",
+ id: "uploadSupplementoryDataFile",
+ type: "checkbox",
+ isEnabled: true,
+ isRequired: false
+ }
+ );
+
+ parameterList.push({name: "Supplemetory file (JSON format)",
+ id: "supplementoryDataFile",
+ type: "file",
+ isRequired: false,
+ isVisiblity: false
+ }
+ );
+ }
addArbitraryParameters(parameterList);
@@ -267,6 +322,7 @@ var CreationService = function($log, AaiService, AsdcService, DataService,
case PARAMETER.RANGE:
break;
case PARAMETER.LIST:
+ parameter.type = PARAMETER.LIST;
break;
case PARAMETER.MAP:
parameter.type = PARAMETER.MAP;
@@ -284,6 +340,7 @@ var CreationService = function($log, AaiService, AsdcService, DataService,
parameterList.push(parameter);
}
}
+ DataService.setArbitraryParameters (parameterList);
}
};
@@ -432,6 +489,9 @@ var CreationService = function($log, AaiService, AsdcService, DataService,
var getMsoRequestDetails = function(parameterList) {
console.log("getMsoRequestDetails invoked, parameterList="); console.log(JSON.stringify(parameterList,null,4));
+ //console.log("getMsoRequestDetails invoked, DataService.getArbitraryParameters()=");
+ //console.log(JSON.stringify(DataService.getArbitraryParameters(),null,4));
+
var modelInfo = DataService.getModelInfo(_this.componentId);
var requestorloggedInId = DataService.getLoggedInUserId();
if (requestorloggedInId == null)
@@ -733,53 +793,27 @@ var CreationService = function($log, AaiService, AsdcService, DataService,
var getServiceId = function() {
var serviceIdList = DataService.getServiceIdList();
- var serviceTypeList = DataService.getSubscriptionServiceTypeList();
+ //var serviceTypeList = DataService.getSubscriptionServiceTypeList();
var parameter = FIELD.PARAMETER.PRODUCT_FAMILY;
parameter.optionList = new Array();
-
- if (serviceTypeList == null) {
- getSubscriptionServiceTypeList();
- serviceTypeList = DataService.getSubscriptionServiceTypeList();
- }
- var went = 0;
- if ( UtilityService.hasContents (serviceIdList) ) {
+ if ( UtilityService.hasContents(serviceIdList) ) {
+ // load them all
for (var i = 0; i < serviceIdList.length; i++) {
- var go = 0;
- var name = serviceIdList[i].id;
-
- if (UtilityService.hasContents(serviceTypeList) ) {
- console.log("STL: " + serviceTypeList);
- for (var k = 0; k < serviceTypeList.length; k++) {
- if (angular.equals(name,serviceTypeList[k])) {
- go = 1;
- went = 1;
- }
- }
- } else {
- go = 1;
- went = 1;
- }
- if (go == 1) {
- parameter.optionList.push({
- id : serviceIdList[i].id,
- name : serviceIdList[i].description
- });
- }
- } // load them all, ours wasn't in the list
- if (went == 0) {
- for (var i = 0; i < serviceIdList.length; i++) {
- parameter.optionList.push({
- id : serviceIdList[i].id,
- name : serviceIdList[i].description
- });
- }
+ parameter.optionList.push({
+ id : serviceIdList[i].id,
+ name : serviceIdList[i].description
+ });
}
}
+
return parameter;
};
var getLcpRegion = function() {
var cloudRegionTenantList = DataService.getCloudRegionTenantList();
+ console.log ( "cloudRegionTenantList=");
+ console.log ( JSON.stringify (cloudRegionTenantList, null, 4 ));
+
var parameter = FIELD.PARAMETER.LCP_REGION;
if ( UtilityService.hasContents (cloudRegionTenantList) ) {
parameter.optionList = new Array();
@@ -842,7 +876,53 @@ var CreationService = function($log, AaiService, AsdcService, DataService,
};
var updateUserParameterList = function(updatedId, parameterListControl) {
console.log ("updateUserParameterList() updatedId=" + updatedId);
- if (updatedId === FIELD.ID.LCP_REGION) {
+ if (updatedId === FIELD.ID.SDN_C_PRELOAD) {
+ var list = parameterListControl.getList(updatedId);
+ if($('input[parameter-id="'+updatedId+'"]').is(':checked')){
+ FIELD.PARAMETER.SDN_C_PRELOAD_CHECKED.value=true;
+ parameterListControl
+ .updateList([ FIELD.PARAMETER.SDN_C_PRELOAD_CHECKED ]);
+ }else{
+ parameterListControl
+ .updateList([ FIELD.PARAMETER.SDN_C_PRELOAD_UNCHECKED ]);
+ }
+ }else if (updatedId === FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE) {
+ if($('input[parameter-id="'+updatedId+'"]').is(':checked')){
+ $('input[parameter-id="'+FIELD.ID.SUPPLEMENTORY_DATA_FILE+'"]').closest('tr').show();
+ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED.value=true;
+ parameterListControl
+ .updateList([ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED ]);
+ }else{
+ $('input[parameter-id="'+FIELD.ID.SUPPLEMENTORY_DATA_FILE+'"]').closest('tr').hide();
+ parameterListControl
+ .updateList([ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_UNCHECKED ]);
+ }
+ } else if (updatedId === FIELD.ID.SUPPLEMENTORY_DATA_FILE) {
+ var filePath = $('input[parameter-id="'+updatedId+'"]').val();
+ var arr =filePath.split('.');
+ var fileExt = arr[arr.length-1];
+ if(fileExt!='' && fileExt.toLowerCase()!='json'){
+ $('input[parameter-id="'+updatedId+'"]').val('');
+ showError("Invalid file format.", 'Please select *.json format file.');
+ return false;
+ }
+ var fileJsonData={};
+ var fileInput = document.getElementById(updatedId);
+ var file = fileInput.files[0];
+ var reader = new FileReader();
+ reader.onload = function(e) {
+ try{
+ fileJsonData = JSON.parse(reader.result);
+ FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value']=(JSON.stringify(fileJsonData)).toString();
+ parameterListControl
+ .updateList([ FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE ]);
+ }catch(e){
+ alert('Invalid json format.');
+ showError("Invalid data format.", 'Please check your file content it is not in json format.');
+ }
+ }
+ reader.readAsText(file);
+ } else if (updatedId === FIELD.ID.LCP_REGION) {
var list = parameterListControl.getList(updatedId);
if (list[0].selectedIndex >= 0) {
parameterListControl
@@ -920,5 +1000,5 @@ var CreationService = function($log, AaiService, AsdcService, DataService,
}
appDS2.factory("CreationService", [ "$log", "AaiService", "AsdcService",
- "DataService", "ComponentService", "COMPONENT", "FIELD", "PARAMETER",
+ "DataService","VIDCONFIGURATION", "ComponentService", "COMPONENT", "FIELD", "PARAMETER",
"UtilityService", CreationService ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
index 7d913fafb..bb5adad38 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
@@ -124,6 +124,36 @@ var DataService = function($log, DataService) {
setServiceUuid : function(serviceUuid) {
_this.serviceUuid = serviceUuid;
},
+ getServiceTypeName : function() {
+ return _this.serviceTypeName;
+ },
+ setServiceTypeName : function(serviceTypeName) {
+ _this.serviceTypeName = serviceTypeName;
+ },
+ getCreateSubscriberName : function() {
+ return _this.createSubscriberName;
+ },
+ setCreateSubscriberName : function(createSubscriberName) {
+ _this.createSubscriberName = createSubscriberName;
+ },
+ getSdncPreload : function() {
+ return _this.sdncPreload;
+ },
+ setSdncPreload : function(sdncPreload) {
+ _this.sdncPreload = sdncPreload;
+ },
+ getUploadSupplementoryDataFile : function() {
+ return _this.uploadSupplementoryDataFile;
+ },
+ setUploadSupplementoryDataFile : function(uploadSupplementoryDataFile) {
+ _this.uploadSupplementoryDataFile = uploadSupplementoryDataFile;
+ },
+ getSupplementoryDataFile : function() {
+ return _this.supplementoryDataFile;
+ },
+ setSupplementoryDataFile : function(supplementoryDataFile) {
+ _this.supplementoryDataFile = supplementoryDataFile;
+ },
getSubscriberId : function() {
return _this.subscriberId;
},
@@ -236,6 +266,18 @@ var DataService = function($log, DataService) {
},
setUpdatedVNFProvStatus : function(r) {
_this.updatedvnfProvStatus = r;
+ },
+ setArbitraryParameters : function (pList) {
+ _this.arbitraryParameters = pList;
+ },
+ getArbitraryParameters : function () {
+ return _this.arbitraryParameters;
+ },
+ setHideServiceFields:function(b){
+ _this.hideServiceFields=b;
+ },
+ getHideServiceFields:function(){
+ return _this.hideServiceFields;
}
}
}
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js
index 133326943..4e4d12302 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js
@@ -63,7 +63,7 @@
* string for some known conditions.
*/
-var UtilityService = function($log, DataService) {
+var UtilityService = function($log, DataService, PARAMETER) {
var _this = this;
var convertModel = function (serviceModel) {
@@ -153,6 +153,7 @@ var UtilityService = function($log, DataService) {
if (serviceModel.service != null && serviceModel.service.inputs != null &&
serviceModel.service.inputs[cmdObj.inputName] != null ) {
networkModelDisplayInputs[cmdObj.inputName] = (serviceModel.service.inputs[cmdObj.inputName]);
+ networkModelDisplayInputs[cmdObj.inputName][PARAMETER.DISPLAY_NAME] = cmdObj.displayName;
}
}
@@ -219,6 +220,7 @@ var UtilityService = function($log, DataService) {
if (serviceModel.service != null && serviceModel.service.inputs != null &&
serviceModel.service.inputs[cmdObj.inputName] != null ) {
vnfModelDisplayInputs[cmdObj.inputName] = (serviceModel.service.inputs[cmdObj.inputName]);
+ vnfModelDisplayInputs[cmdObj.inputName][PARAMETER.DISPLAY_NAME] = cmdObj.displayName;
}
}
@@ -243,8 +245,8 @@ var UtilityService = function($log, DataService) {
if (hasContents (vnfModel.properties.nf_function) ) {
vnf_function = vnfModel.properties.nf_function;
}
- if (hasContents (vnfModel.properties.nf_code) ) {
- vnf_code = vnfModel.properties.nf_code;
+ if (hasContents (vnfModel.properties.nf_naming_code) ) {
+ vnf_code = vnfModel.properties.nf_naming_code;
}
}
convertedAsdcModel.vnfs[vnfCustomizationUuid]["nfType"] = vnf_type;
@@ -344,6 +346,7 @@ var UtilityService = function($log, DataService) {
if (serviceModel.service != null && serviceModel.service.inputs != null &&
serviceModel.service.inputs[cmdObj.inputName] != null ) {
networkModelDisplayInputs[cmdObj.inputName] = (serviceModel.service.inputs[cmdObj.inputName]);
+ networkModelDisplayInputs[cmdObj.inputName][PARAMETER.DISPLAY_NAME] = cmdObj.displayName;
}
}
@@ -404,6 +407,7 @@ var UtilityService = function($log, DataService) {
if (serviceModel.service != null && serviceModel.service.inputs != null &&
serviceModel.service.inputs[cmdObj.inputName] != null ) {
vnfModelDisplayInputs[cmdObj.inputName] = (serviceModel.service.inputs[cmdObj.inputName]);
+ vnfModelDisplayInputs[cmdObj.inputName][PARAMETER.DISPLAY_NAME] = cmdObj.displayName;
}
}
@@ -637,4 +641,4 @@ var UtilityService = function($log, DataService) {
}
//app.factory("UtilityService", UtilityService);
-appDS2.factory("UtilityService", [ "$log", "DataService", UtilityService ]);
+appDS2.factory("UtilityService", [ "$log", "DataService", "PARAMETER", UtilityService ]);