[VID-15] fixes for various issues 77/4877/1
authorjimmydot <jf2512@att.com>
Thu, 8 Jun 2017 15:54:45 +0000 (11:54 -0400)
committerjimmydot <jf2512@att.com>
Thu, 8 Jun 2017 15:54:45 +0000 (11:54 -0400)
Change-Id: I392a0427078d337a5d501a813dff73c1959481e2
Signed-off-by: jimmydot <jf2512@att.com>
vid-app-common/src/main/java/org/openecomp/vid/controller/VidController.java
vid-app-common/src/main/java/org/openecomp/vid/model/ModelConstants.java
vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java
vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java
vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js
vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js
vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js
vid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js
vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm

index e22448a..f7bf3a5 100755 (executable)
@@ -41,6 +41,7 @@ import javax.ws.rs.client.Client;
 import org.json.JSONObject;\r
 import org.json.JSONTokener;\r
 import org.openecomp.vid.exceptions.VidServiceUnavailableException;\r
+import org.openecomp.vid.model.ModelUtil;\r
 import org.openecomp.vid.model.ModelConstants;\r
 import org.openecomp.vid.model.Network;\r
 import org.openecomp.vid.model.ServiceModel;\r
@@ -191,12 +192,11 @@ public class VidController extends RestrictedBaseController {
         LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " start");\r
         boolean isNewFlow = false;\r
         \r
-        String asdcModelNamespace = VidProperties.getAsdcModelNamespace();\r
+        String asdcModelNamespaces[] = VidProperties.getAsdcModelNamespace();\r
+        String[] vnfTags = ModelUtil.getTags(asdcModelNamespaces, ModelConstants.VNF);\r
+        String[] networkTags = ModelUtil.getTags(asdcModelNamespaces, ModelConstants.NETWORK);\r
+        String[] vfModuleTags = ModelUtil.getTags(asdcModelNamespaces, ModelConstants.VF_MODULE);\r
         \r
-        String vnfTag = asdcModelNamespace + ModelConstants.VNF;\r
-       String networkTag = asdcModelNamespace + ModelConstants.NETWORK;\r
-       String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE;\r
-       \r
                try {\r
                        final ServiceModel serviceModel = new ServiceModel();\r
                        final Map<String, VNF> vnfs = new HashMap<String, VNF> ();\r
@@ -214,7 +214,8 @@ public class VidController extends RestrictedBaseController {
                                final NodeTemplate nodeTemplate = component.getValue();\r
                                final String type = nodeTemplate.getType();\r
                                \r
-                               if (type.startsWith(vnfTag)) {\r
+                               // is it a VNF?\r
+                               if ( ModelUtil.isType (type, vnfTags) ) {\r
                     LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " found node template type: " + type);\r
 \r
                                        final UUID vnfUuid = UUID.fromString(nodeTemplate.getMetadata().getUUID());\r
@@ -234,8 +235,9 @@ public class VidController extends RestrictedBaseController {
                                                isNewFlow = true;\r
                                        }\r
                                }\r
-                               // Networks\r
-                               if (type.startsWith(networkTag)) {\r
+                               \r
+                               // is it a Network?\r
+                               if ( ModelUtil.isType (type, networkTags) ) {\r
                                        LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " found node template type: " + type);\r
                                        final UUID networkUuid = UUID.fromString(nodeTemplate.getMetadata().getUUID());\r
                                        final Network network = new Network();\r
@@ -291,9 +293,8 @@ public class VidController extends RestrictedBaseController {
                                        // VF Module Customization UUID: We may have the complete set of all VF Modules for all VNFs under service and VF Modules under each VNF.\r
                                        // Keep using the VF Modules under VNFs but we need to get the customization uuid from the service level and put them\r
                                        // under each VF module at the VNF level\r
+                                       if ( ModelUtil.isType (type, vfModuleTags) ) {\r
                                        \r
-                                       if (type.startsWith(vfModuleTag)) {\r
-                                               \r
                                                VfModule vfMod = VfModule.extractVfModule(modelCustomizationName, group);\r
                                                \r
                                                // Add the vf module customization uuid from the service model\r
@@ -323,6 +324,10 @@ public class VidController extends RestrictedBaseController {
                        LOG.error("Failed to retrieve service definitions from SDC", e);\r
                        throw new VidServiceUnavailableException("Failed to retrieve service definitions from SDC", e);\r
                }\r
+               catch (Exception e) {\r
+                       LOG.error("Failed to retrieve service definitions from SDC", e);\r
+                       throw new VidServiceUnavailableException("Failed to retrieve service definitions from SDC", e);\r
+               }\r
        }\r
 \r
        public ServiceModel getCustomizedServices(ToscaModel asdcServiceToscaModel, ServiceModel serviceModel) {\r
index f4e4270..af5f0db 100755 (executable)
@@ -31,7 +31,7 @@ public class ModelConstants {
        public static final String ASDC_SVC_API_PATH = "sdc.svc.api.path";\r
        public static final String ASDC_RESOURCE_API_PATH = "sdc.resource.api.path";\r
        \r
-       public static final String DEFAULT_ASDC_MODEL_NAMESPACE = "org.onap.";\r
+       public static final String DEFAULT_ASDC_MODEL_NAMESPACE = "org.openecomp.";\r
        public static final String DEFAULT_ASDC_SVC_API_PATH = "sdc/v1/catalog/services";\r
        public static final String DEFAULT_ASDC_RESOURCE_API_PATH = "sdc/v1/catalog/resources";\r
        \r
index 140e9ed..98e6531 100755 (executable)
@@ -182,16 +182,15 @@ public class ServiceModel {
                \r
                final Map<String, VfModule> vfModules = new HashMap<String, VfModule> ();\r
                final Map<String, VolumeGroup> volumeGroups = new HashMap<String, VolumeGroup> ();\r
-               \r
-               String asdcModelNamespace = VidProperties.getAsdcModelNamespace();\r
-       String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE;\r
-       \r
+       String asdcModelNamespaces[] = VidProperties.getAsdcModelNamespace();\r
+        String[] vfModuleTags = ModelUtil.getTags(asdcModelNamespaces, ModelConstants.VF_MODULE);\r
+    \r
                for (Entry<String, Group> component : serviceToscaModel.gettopology_template().getGroups().entrySet()) {\r
                        final Group group = component.getValue();\r
                        final String type = group.getType();\r
                        final String customizationName = component.getKey();\r
                        \r
-                       if (type.startsWith(vfModuleTag)) {\r
+                       if ( ModelUtil.isType (type, vfModuleTags) ) {\r
                                VfModule vfMod = VfModule.extractVfModule(customizationName, group);\r
                                vfModules.put(customizationName, vfMod);\r
                                if ( vfMod.isVolumeGroupAllowed() ) {\r
index 141b9b2..38062df 100755 (executable)
@@ -53,21 +53,27 @@ public class VidProperties extends SystemProperties {
         * \r
         * @return the property value or a default value\r
         */\r
-       public static String getAsdcModelNamespace() {\r
+       public static String[] getAsdcModelNamespace() {\r
                String methodName = "getAsdcModelNamespace ";\r
-               String asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;\r
+               String[] asdcModelNamespaces = null;\r
+               String value = null;\r
            try {\r
-               asdcModelNamespace = SystemProperties.getProperty(ModelConstants.ASDC_MODEL_NAMESPACE);\r
-               if ( asdcModelNamespace == null || asdcModelNamespace.isEmpty()) {\r
-                       asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;\r
+               value = SystemProperties.getProperty(ModelConstants.ASDC_MODEL_NAMESPACE);\r
+               if ( value == null || value.isEmpty()) {\r
+                       asdcModelNamespaces = new String[1];\r
+                       asdcModelNamespaces[0] = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;\r
                    }\r
+               else {\r
+                       asdcModelNamespaces = value.split(",");\r
+               }\r
            }\r
            catch ( Exception e ) {\r
                LOG.error (EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + "unable to find the value, using the default "\r
                                + ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE);\r
-               asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;\r
+               asdcModelNamespaces = new String[1];\r
+               asdcModelNamespaces[0] = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;\r
            }\r
-           return (asdcModelNamespace);\r
+           return (asdcModelNamespaces);\r
        }\r
        /**\r
         * Gets the specified property value. If the property is not defined, returns a default value.\r
@@ -90,4 +96,5 @@ public class VidProperties extends SystemProperties {
            }\r
            return (propValue);\r
        }\r
+       \r
 }\r
index d2db094..cc5b680 100755 (executable)
@@ -50,7 +50,7 @@ appDS2.constant("COMPONENT", (function() {
        TENANT_ID : "tenantID",
        TENANT_NAME : "tenantName",
        TRUE : "true",
-       \r
+       
        VF_MODULE : "vfModule",
        VNF : "vnf",
        VNF_CODE : "vnfCode",
index 291549d..23ff56b 100755 (executable)
@@ -127,9 +127,8 @@ appDS2.factory("FIELD", [ "PARAMETER", function(PARAMETER) {
     };\r
 \r
     var KEY = {\r
-       LCP_REGION_TEXT : "LEGACYREGION"\r
     };\r
-\r
+   \r
     /*\r
      * NAME values are displayed on GUI pages.\r
      */\r
@@ -279,6 +278,7 @@ appDS2.factory("FIELD", [ "PARAMETER", function(PARAMETER) {
                SELECT : "Please select a subscriber or enter a service instance", \r
                SERVICE_INST_DNE : "That service instance does not exist.  Please try again.",\r
                SYSTEM_FAILURE : "System failure",\r
+               INVALID_DATA_FORMAT : 'Invalid data format.Please check your file content whether it is not in json or not.',\r
                \r
     }\r
 \r
index 00c1414..496c06f 100755 (executable)
@@ -41,7 +41,7 @@ appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER"
        $scope.defaultBaseUrl = "";\r
        $scope.responseTimeoutMsec = 60000;\r
 \r
-       $scope.serviceTypes=[ FIELD.PROMPT.SELECT_SERVICE ];\r
+       $scope.serviceTypes=[ FIELD.PROMPT.SELECT_SERVICE];\r
        $scope.defaultSubscriberName=[ FIELD.PROMPT.SELECT_SUB ];\r
 \r
        var callbackFunction = function(response) {\r
@@ -142,6 +142,7 @@ appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER"
                    for(var i=0; i<$scope.custSubList.length;i++){\r
                                                if($scope.createSubscriberName === $scope.custSubList[i].subscriberName){\r
                                                        globalCustomerId = $scope.custSubList[i].globalCustomerId;\r
+                                                       globalCustId = globalCustomerId;\r
                                                }\r
                                        };\r
                        \r
@@ -182,6 +183,7 @@ appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER"
                        \r
                        };\r
                        \r
+                       var globalCustId;// This value will be assigned only on create new service instance screen-macro\r
                        $scope.createType = "a la carte";\r
                $scope.deployService = function(service,hideServiceFields) {\r
                        hideServiceFields = hideServiceFields|| false;\r
@@ -208,6 +210,11 @@ appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER"
                                                "createSubscriberName":serviceModel.service.createSubscriberName\r
                                        });\r
                                        DataService.setHideServiceFields(hideServiceFields);\r
+                                       if(hideServiceFields){\r
+                                               DataService.setServiceType($scope.serviceTypeName);\r
+                                               DataService.setGlobalCustomerId(globalCustId);\r
+                                       }\r
+\r
                                        DataService.setALaCarte (true);\r
                                        $scope.createType = "a la carte";\r
                                        var broadcastType = "createComponent";\r
@@ -227,6 +234,7 @@ appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER"
                                                        "modelName": serviceModel.service.name,\r
                                                        "description": serviceModel.service.description,\r
                                                        "category":serviceModel.service.category,\r
+                                                       "serviceEcompNaming": serviceModel.service.serviceEcompNaming,\r
                                                        "inputs": serviceModel.service.inputs,\r
                                                        "displayInputs": convertedAsdcModel.completeDisplayInputs,\r
                                                        "serviceTypeName":serviceModel.service.serviceTypeName,\r
index eb17091..b400cc6 100755 (executable)
@@ -107,91 +107,210 @@ var creationDialogController = function( COMPONENT, FIELD, PARAMETER, $scope, $h
                        showError(FIELD.ERROR.MISSING_DATA, requiredFields);\r
                        return;\r
                }\r
-       \r
+               \r
+               var isUploadAvailable = false;\r
+               var uploadIndex =0;\r
                var paramList = $scope.userProvidedControl.getList();\r
-               var instanceName = "";\r
-\r
-               if ( DataService.getALaCarte() ) {\r
-                       if ( paramList != null ) {\r
-                               for (var i = 0; i < paramList.length; i++) {\r
-                                       if (paramList[i].id === FIELD.ID.INSTANCE_NAME) {\r
-                                               instanceName = paramList[i].value;\r
-                                               break;\r
+               \r
+               for (var i = 0; i < paramList.length; i++) {\r
+                       if (paramList[i].id === FIELD.ID.SUPPLEMENTORY_DATA_FILE) {\r
+                               isUploadAvailable = true;\r
+                               uploadIndex=i;\r
+                               break;\r
+                       }\r
+               }\r
+               \r
+               if(isUploadAvailable){\r
+                       var errorMsg = "";\r
+                       var fileInput = document.getElementById(FIELD.ID.SUPPLEMENTORY_DATA_FILE);\r
+                       var file = fileInput.files[0];\r
+                       var reader = new FileReader();\r
+                       reader.onload = function(e) {\r
+                               try{\r
+                                       paramList[uploadIndex].value = JSON.parse(reader.result);\r
+                                       FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value'] = JSON.stringify(paramList[uploadIndex].value);\r
+                                       $scope.userProvidedControl.updateList([ FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE ]);\r
+                                       \r
+                                       var instanceName = "";\r
+\r
+                                       if ( DataService.getALaCarte() ) {\r
+                                               if ( paramList != null ) {\r
+                                                       for (var i = 0; i < paramList.length; i++) {\r
+                                                               if (paramList[i].id === FIELD.ID.INSTANCE_NAME) {\r
+                                                                       instanceName = paramList[i].value;\r
+                                                                       break;\r
+                                                               }\r
+                                                       }\r
+                                               }\r
+                                               var isValid = validateInstanceName (instanceName);\r
+                                               if ( isValid ) {\r
+                                                       $scope.isErrorVisible = false;\r
+                                               } else {\r
+                                                       showError(FIELD.ERROR.INVALID_INSTANCE_NAME + instanceName, \r
+                                                                       FIELD.ERROR.INSTANCE_NAME_VALIDATE);\r
+                                                       return;\r
+                                               }\r
                                        }\r
-                               }\r
+                                       var arbitraryParametersList = DataService.getArbitraryParameters();\r
+                                       var p = null;\r
+                                       if (UtilityService.hasContents (arbitraryParametersList)) {\r
+                                               for (var i = 0; i < arbitraryParametersList.length; i++) {\r
+                                                       p = arbitraryParametersList[i];\r
+                                                       if (p.type === PARAMETER.MAP) {\r
+                                                               //validate a map: { <entry_key_1>: <entry_value_1>, ... , <entry_key_n>: <entry_value_n> }\r
+                                                               // need to find the value in paramList\r
+                                                               for (var j = 0; j < paramList.length; j++) {\r
+                                                                       if (paramList[j].id === p.id) {\r
+                                                                               p.value = paramList[j].value;\r
+                                                                               var isValid = validateMap (p.value);\r
+                                                                               if ( isValid ) {\r
+                                                                                       $scope.isErrorVisible = false;\r
+                                                                                       break;\r
+                                                                               } \r
+                                                                               else {\r
+                                                                                       showError(FIELD.ERROR.INVALID_MAP + p.id, \r
+                                                                                                       FIELD.ERROR.MAP_VALIDATE);\r
+                                                                                       return;\r
+                                                                               }       \r
+                                                                       }\r
+                                                               }\r
+                                                       } else if (p.type === PARAMETER.LIST) {\r
+                                                               //validate a list: { value or a list of comma separated values }\r
+                                                               // need to find the value in paramList\r
+                                                               for (var j = 0; j < paramList.length; j++) {\r
+                                                                       if (paramList[j].id === p.id) {\r
+                                                                               p.value = paramList[j].value;\r
+                                                                               var isValid = validateList (p.value);\r
+                                                                               if ( isValid ) {\r
+                                                                                       $scope.isErrorVisible = false;\r
+                                                                                       break;\r
+                                                                               } \r
+                                                                               else {\r
+                                                                                       showError(FIELD.ERROR.INVALID_LIST + p.id, \r
+                                                                                                       FIELD.ERROR.LIST_VALIDATE);\r
+                                                                                       return;\r
+                                                                               }       \r
+                                                                       }\r
+                                                               }\r
+                                                       }\r
+                                               }\r
+                                       }\r
+                                       var requestDetails = CreationService\r
+                                                       .getMsoRequestDetails($scope.userProvidedControl.getList());\r
+\r
+                                       $scope.isDialogVisible = false;\r
+\r
+                                       $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {\r
+                                               url : CreationService.getMsoUrl(),\r
+                                               requestDetails : requestDetails,\r
+                                               componentId: componentId,\r
+                                               callbackFunction : function(response) {\r
+                                                       if (response.isSuccessful) {\r
+                                                               $scope.popup.isVisible = false;\r
+                                                               runCallback(response);\r
+                                                       } else {\r
+                                                               $scope.isDialogVisible = false;\r
+                                                               $scope.popup.isVisible = false;\r
+                                                       }\r
+                                               }\r
+                                       });\r
+                                       \r
+                               }catch(e){\r
+                               errorMsg = errorMsg+ FIELD.ERROR.INVALID_DATA_FORMAT;\r
                        }\r
-                       var isValid = validateInstanceName (instanceName);\r
-                       if ( isValid ) {\r
-                               $scope.isErrorVisible = false;\r
-                       } else {\r
-                               showError(FIELD.ERROR.INVALID_INSTANCE_NAME + instanceName, \r
-                                               FIELD.ERROR.INSTANCE_NAME_VALIDATE);\r
+                       if (errorMsg !== "") {\r
+                               showError(FIELD.ERROR.SYSTEM_FAILURE, errorMsg);\r
                                return;\r
                        }\r
-               }\r
-               var arbitraryParametersList = DataService.getArbitraryParameters();\r
-               var p = null;\r
-               if (UtilityService.hasContents (arbitraryParametersList)) {\r
-                       for (var i = 0; i < arbitraryParametersList.length; i++) {\r
-                               p = arbitraryParametersList[i];\r
-                               if (p.type === PARAMETER.MAP) {\r
-                                       //validate a map: { <entry_key_1>: <entry_value_1>, ... , <entry_key_n>: <entry_value_n> }\r
-                                       // need to find the value in paramList\r
-                                       for (var j = 0; j < paramList.length; j++) {\r
-                                               if (paramList[j].id === p.id) {\r
-                                                       p.value = paramList[j].value;\r
-                                                       var isValid = validateMap (p.value);\r
-                                                       if ( isValid ) {\r
-                                                               $scope.isErrorVisible = false;\r
-                                                               break;\r
-                                                       } \r
-                                                       else {\r
-                                                               showError(FIELD.ERROR.INVALID_MAP + p.id, \r
-                                                                               FIELD.ERROR.MAP_VALIDATE);\r
-                                                               return;\r
-                                                       }       \r
+                       }\r
+                       reader.readAsText(file);\r
+               }else{\r
+       \r
+                       var paramList = $scope.userProvidedControl.getList();\r
+                       var instanceName = "";\r
+\r
+                       if ( DataService.getALaCarte() ) {\r
+                               if ( paramList != null ) {\r
+                                       for (var i = 0; i < paramList.length; i++) {\r
+                                               if (paramList[i].id === FIELD.ID.INSTANCE_NAME) {\r
+                                                       instanceName = paramList[i].value;\r
+                                                       break;\r
                                                }\r
                                        }\r
-                               } else if (p.type === PARAMETER.LIST) {\r
-                                       //validate a list: { value or a list of comma separated values }\r
-                                       // need to find the value in paramList\r
-                                       for (var j = 0; j < paramList.length; j++) {\r
-                                               if (paramList[j].id === p.id) {\r
-                                                       p.value = paramList[j].value;\r
-                                                       var isValid = validateList (p.value);\r
-                                                       if ( isValid ) {\r
-                                                               $scope.isErrorVisible = false;\r
-                                                               break;\r
-                                                       } \r
-                                                       else {\r
-                                                               showError(FIELD.ERROR.INVALID_LIST + p.id, \r
-                                                                               FIELD.ERROR.LIST_VALIDATE);\r
-                                                               return;\r
-                                                       }       \r
+                               }\r
+                               var isValid = validateInstanceName (instanceName);\r
+                               if ( isValid ) {\r
+                                       $scope.isErrorVisible = false;\r
+                               } else {\r
+                                       showError(FIELD.ERROR.INVALID_INSTANCE_NAME + instanceName, \r
+                                                       FIELD.ERROR.INSTANCE_NAME_VALIDATE);\r
+                                       return;\r
+                               }\r
+                       }\r
+                       var arbitraryParametersList = DataService.getArbitraryParameters();\r
+                       var p = null;\r
+                       if (UtilityService.hasContents (arbitraryParametersList)) {\r
+                               for (var i = 0; i < arbitraryParametersList.length; i++) {\r
+                                       p = arbitraryParametersList[i];\r
+                                       if (p.type === PARAMETER.MAP) {\r
+                                               //validate a map: { <entry_key_1>: <entry_value_1>, ... , <entry_key_n>: <entry_value_n> }\r
+                                               // need to find the value in paramList\r
+                                               for (var j = 0; j < paramList.length; j++) {\r
+                                                       if (paramList[j].id === p.id) {\r
+                                                               p.value = paramList[j].value;\r
+                                                               var isValid = validateMap (p.value);\r
+                                                               if ( isValid ) {\r
+                                                                       $scope.isErrorVisible = false;\r
+                                                                       break;\r
+                                                               } \r
+                                                               else {\r
+                                                                       showError(FIELD.ERROR.INVALID_MAP + p.id, \r
+                                                                                       FIELD.ERROR.MAP_VALIDATE);\r
+                                                                       return;\r
+                                                               }       \r
+                                                       }\r
+                                               }\r
+                                       } else if (p.type === PARAMETER.LIST) {\r
+                                               //validate a list: { value or a list of comma separated values }\r
+                                               // need to find the value in paramList\r
+                                               for (var j = 0; j < paramList.length; j++) {\r
+                                                       if (paramList[j].id === p.id) {\r
+                                                               p.value = paramList[j].value;\r
+                                                               var isValid = validateList (p.value);\r
+                                                               if ( isValid ) {\r
+                                                                       $scope.isErrorVisible = false;\r
+                                                                       break;\r
+                                                               } \r
+                                                               else {\r
+                                                                       showError(FIELD.ERROR.INVALID_LIST + p.id, \r
+                                                                                       FIELD.ERROR.LIST_VALIDATE);\r
+                                                                       return;\r
+                                                               }       \r
+                                                       }\r
                                                }\r
                                        }\r
                                }\r
                        }\r
-               }\r
-               var requestDetails = CreationService\r
-                               .getMsoRequestDetails($scope.userProvidedControl.getList());\r
+                       var requestDetails = CreationService\r
+                                       .getMsoRequestDetails($scope.userProvidedControl.getList());\r
 \r
-               $scope.isDialogVisible = false;\r
+                       $scope.isDialogVisible = false;\r
 \r
-               $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {\r
-                       url : CreationService.getMsoUrl(),\r
-                       requestDetails : requestDetails,\r
-                       componentId: componentId,\r
-                       callbackFunction : function(response) {\r
-                               if (response.isSuccessful) {\r
-                                       $scope.popup.isVisible = false;\r
-                                       runCallback(response);\r
-                               } else {\r
-                                       $scope.isDialogVisible = false;\r
-                                       $scope.popup.isVisible = false;\r
+                       $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {\r
+                               url : CreationService.getMsoUrl(),\r
+                               requestDetails : requestDetails,\r
+                               componentId: componentId,\r
+                               callbackFunction : function(response) {\r
+                                       if (response.isSuccessful) {\r
+                                               $scope.popup.isVisible = false;\r
+                                               runCallback(response);\r
+                                       } else {\r
+                                               $scope.isDialogVisible = false;\r
+                                               $scope.popup.isVisible = false;\r
+                                       }\r
                                }\r
-                       }\r
-               });\r
+                       });\r
+               }\r
        }\r
 \r
        $scope.cancel = function() {\r
index 2849812..11e61b3 100755 (executable)
@@ -187,32 +187,42 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
        };\r
 \r
        var getUserProvidedList = function() {\r
-               parameterList = [];\r
+               var parameterList = [];\r
                var isUserProvidedNaming = false;\r
                if ( (DataService.getModelInfo(_this.componentId).serviceEcompNaming != null) \r
                                && (DataService.getModelInfo(_this.componentId).serviceEcompNaming === "false") ) {\r
                        isUserProvidedNaming = true;\r
                }\r
-               var parameterList;\r
-               var hsf = DataService.getHideServiceFields() || false;\r
-               if (_this.componentId === COMPONENT.SERVICE && !hsf) {  \r
+               \r
+               var isInTop = DataService.getHideServiceFields() || false;\r
+               if (_this.componentId === COMPONENT.SERVICE) {  \r
                        if ( DataService.getALaCarte() ) {\r
                                parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];\r
-                               parameterList = parameterList.concat([ getSubscribersParameter(),\r
-                                   FIELD.PARAMETER.SERVICE_TYPE_DISABLED ]);\r
+                               if(!isInTop){\r
+                                       parameterList = parameterList.concat([ getSubscribersParameter(),\r
+                                               FIELD.PARAMETER.SERVICE_TYPE_DISABLED ]);\r
+                               }\r
                        }\r
                        else {\r
                                // macro\r
-                               if (isUserProvidedNaming) {\r
-                                       parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];\r
-                                       \r
+                               \r
+                               if(!isInTop){\r
+                                       if (isUserProvidedNaming) {\r
+                                               parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];\r
+                                               \r
+                                       }\r
+                                       parameterList = parameterList.concat([ getSubscribersParameter() ]);\r
+                                       parameterList = parameterList.concat([ getServiceId(),\r
+                                               FIELD.PARAMETER.SERVICE_TYPE,\r
+                                               FIELD.PARAMETER.LCP_REGION,\r
+                                               FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,\r
+                                               FIELD.PARAMETER.TENANT_DISABLED ]);\r
+                               }else{\r
+                                       parameterList = parameterList.concat([ getServiceId(),\r
+                                               FIELD.PARAMETER.LCP_REGION,\r
+                                               FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,\r
+                                               FIELD.PARAMETER.TENANT_DISABLED ]);\r
                                }\r
-                               parameterList = parameterList.concat([ getSubscribersParameter() ]);\r
-                               parameterList = parameterList.concat([ getServiceId(),\r
-                                       FIELD.PARAMETER.SERVICE_TYPE,\r
-                                       FIELD.PARAMETER.LCP_REGION,\r
-                                       FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,\r
-                                       FIELD.PARAMETER.TENANT_DISABLED ]);\r
                        }\r
                }\r
                else {\r
@@ -312,6 +322,9 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
                                                isRequired : inputs[key][PARAMETER.REQUIRED],\r
                                                description : inputs[key][PARAMETER.DESCRIPTION]\r
                                };\r
+                               if ( DataService.getALaCarte() ) {\r
+                                       parameter.name = ComponentService.getFieldDisplayName(inputs[key][PARAMETER.DISPLAY_NAME]);\r
+                               }\r
                                switch (inputs[key][PARAMETER.TYPE]) {\r
                                        case PARAMETER.INTEGER:\r
                                                parameter.type = PARAMETER.NUMBER;\r
@@ -539,8 +552,13 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
                                globalSubscriberId : DataService.getGlobalCustomerId(),\r
                                subscriberName : DataService.getSubscriberName()\r
                        };\r
+                       var isInTop = DataService.getHideServiceFields() || false;\r
+                       if(isInTop){\r
+                               requestDetails.requestParameters.subscriptionServiceType = DataService.getModelInfo(_this.componentId)["serviceTypeName"];\r
+                       }else{\r
                        requestDetails.requestParameters.subscriptionServiceType = getValueFromList(\r
                                        FIELD.ID.SERVICE_TYPE, parameterList);\r
+                       }\r
                        requestDetails.requestParameters.aLaCarte = DataService.getALaCarte();\r
                        if ( !DataService.getALaCarte() ) {\r
                                requestDetails.requestInfo.productFamilyId = getValueFromList(\r
@@ -876,7 +894,13 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
        };\r
        var updateUserParameterList = function(updatedId, parameterListControl) {\r
                console.log ("updateUserParameterList() updatedId=" + updatedId);\r
-               if (updatedId === FIELD.ID.SDN_C_PRELOAD) {\r
+               if (updatedId === FIELD.ID.PRODUCT_FAMILY && DataService.getHideServiceFields()) {\r
+                       var cloudRegionTenantList = new Array();\r
+                       AaiService.getLcpCloudRegionTenantList(DataService.getGlobalCustomerId(), DataService.getServiceType(), function(cloudRegionTenantList) {\r
+                               DataService.setCloudRegionTenantList(cloudRegionTenantList);\r
+                               parameterListControl.updateList([ getLcpRegion() ]);\r
+                       });\r
+               }else if (updatedId === FIELD.ID.SDN_C_PRELOAD) {\r
                        var list = parameterListControl.getList(updatedId);\r
                        if($('input[parameter-id="'+updatedId+'"]').is(':checked')){\r
                                FIELD.PARAMETER.SDN_C_PRELOAD_CHECKED.value=true;\r
@@ -903,25 +927,9 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
                        var fileExt  = arr[arr.length-1];\r
                        if(fileExt!='' && fileExt.toLowerCase()!='json'){\r
                                 $('input[parameter-id="'+updatedId+'"]').val('');\r
-                               showError("Invalid file format.", 'Please select *.json format file.');\r
+                               alert("Invalid file format. Please select *.json format file.");\r
                                return false;\r
                        }\r
-                       var fileJsonData={};\r
-                       var fileInput = document.getElementById(updatedId);\r
-                       var file = fileInput.files[0];\r
-                       var reader = new FileReader();\r
-                       reader.onload = function(e) {\r
-                               try{\r
-                                       fileJsonData = JSON.parse(reader.result);\r
-                                       FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value']=(JSON.stringify(fileJsonData)).toString();\r
-                                       parameterListControl\r
-                                       .updateList([ FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE ]);\r
-                               }catch(e){\r
-                                       alert('Invalid json format.');\r
-                                       showError("Invalid data format.", 'Please check your file content it is not in json format.');\r
-                               }\r
-                       }\r
-                       reader.readAsText(file);\r
                } else  if (updatedId === FIELD.ID.LCP_REGION) {\r
                        var list = parameterListControl.getList(updatedId);\r
                        if (list[0].selectedIndex >= 0) {\r
index 11dc1c3..ff79d70 100755 (executable)
@@ -1,64 +1,43 @@
-<!--
-  ============LICENSE_START=======================================================
-  VID
-  ================================================================================
-  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-  ================================================================================
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-  
-       http://www.apache.org/licenses/LICENSE-2.0
-  
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  ============LICENSE_END=========================================================
-  -->
-
-<div ng-controller="creationDialogController">
-
-       <div ng-show="isDialogVisible">
-               <div class="titleLine">
-                       <img src="app/vid/images/spinner.gif"
-                               ngx-visible="{{isSpinnerVisible}}"></img>
-                       <h3>Create {{componentName}} -- {{createType}}</h3>
-               </div>
-
-               <div class="error" ng-show="isErrorVisible">
-                       <img src="app/vid/images/error.png"></img>{{error}}
-               </div>
-
-               <div ngx-visible="{{isDataVisible}}">
-                       <parameter-block control="summaryControl"></parameter-block>
-                       <h4>
-                               User Provided Data (<img class="requiredIndicator"
-                                       src="app/vid/images/asterisk.png" height='10' width='10'></img> indicates required field)
-                       </h4>
-                       <parameter-block control="userProvidedControl"
-                               callback="userParameterChanged(id);" editable></parameter-block>
+<div ng-controller="creationDialogController">\r
 \r
-                       <div class="prompt">
-                               <p>
-                                       Enter Data and <span>Confirm</span> to<br />Create <span>{{componentName}}</span>
-                               </p>
-                               <p>
-                                       <span>Cancel</span> to Return to Previous Page.<br />Data entered
-                                       will be lost
-                               </p>
-                       </div>
-
-               </div>
-               <div class="buttonRow">
-                       <button ngx-enabled="{{isConfirmEnabled}}" att-button size="small"
-                               ng-click="confirm();">Confirm</button>
-                       <button type="button" ng-click="cancel();" att-button
-                               btn-type="primary" size="small">Cancel</button>
-               </div>
-       </div>
-
-       <div ng-include="'app/vid/scripts/view-models/msoCommit.htm'"></div>
-
-</div>
+       <div ng-show="isDialogVisible">\r
+               <div class="titleLine">\r
+                       <img src="app/vid/images/spinner.gif"\r
+                               ngx-visible="{{isSpinnerVisible}}"></img>\r
+                       <h3>Create {{componentName}} -- {{createType}}</h3>\r
+               </div>\r
+\r
+               <div class="error" ng-show="isErrorVisible">\r
+                       <img src="app/vid/images/error.png"></img>{{error}}\r
+               </div>\r
+\r
+               <div ngx-visible="{{isDataVisible}}">\r
+                       <parameter-block control="summaryControl"></parameter-block>\r
+                       <h4>\r
+                               User Provided Data (<img class="requiredIndicator"\r
+                                       src="app/vid/images/asterisk.png" height='10' width='10'></img> indicates required field)\r
+                       </h4>\r
+                       <parameter-block control="userProvidedControl"\r
+                               callback="userParameterChanged(id);" editable></parameter-block>\r
+                       <div class="prompt">\r
+                               <p>\r
+                                       Enter Data and <span>Confirm</span> to<br />Create <span>{{componentName}}</span>\r
+                               </p>\r
+                               <p>\r
+                                       <span>Cancel</span> to Return to Previous Page.<br />Data entered\r
+                                       will be lost\r
+                               </p>\r
+                       </div>\r
+\r
+               </div>\r
+               <div class="buttonRow">\r
+                       <button ngx-enabled="{{isConfirmEnabled}}" att-button size="small"\r
+                               ng-click="confirm();">Confirm</button>\r
+                       <button type="button" ng-click="cancel();" att-button\r
+                               btn-type="primary" size="small">Cancel</button>\r
+               </div>\r
+       </div>\r
+\r
+       <div ng-include="'app/vid/scripts/view-models/msoCommit.htm'"></div>\r
+\r
+</div>\r