From 6c7dcba5be04a502a2d5de7e7c5f14eedf9eaa2a Mon Sep 17 00:00:00 2001 From: jimmydot Date: Tue, 30 May 2017 16:06:51 -0400 Subject: [VID-12] Delivery of remaining features for v1.1 Change-Id: I50305ba25aaa34ee1ca7640237f31ab824655a34 Signed-off-by: jimmydot --- .../openecomp/vid/asdc/beans/tosca/ToscaMeta.java | 26 +- .../openecomp/vid/asdc/rest/RestfulAsdcClient.java | 27 +- .../openecomp/vid/controller/AaiController.java | 5 +- .../vid/controller/VidHomeController.java | 79 ------ .../vid/scripts/constants/componentConstants.js | 295 +++++++++++---------- .../app/vid/scripts/constants/fieldConstants.js | 55 +++- .../vid/scripts/constants/parameterConstants.js | 5 +- .../app/vid/scripts/constants/vidConfiguration.js | 6 + .../scripts/controller/InstantiationController.js | 4 +- .../scripts/controller/ServiceModelController.js | 6 +- .../scripts/controller/aaiSubscriberController.js | 114 ++++++-- .../scripts/controller/creationDialogController.js | 78 +++++- .../app/vid/scripts/controller/subscriberSearch.js | 2 +- .../scripts/directives/parameterBlockDirective.js | 33 ++- .../webapp/app/vid/scripts/services/aaiService.js | 29 +- .../app/vid/scripts/services/creationService.js | 176 ++++++++---- .../webapp/app/vid/scripts/services/dataService.js | 42 +++ .../app/vid/scripts/services/utilityService.js | 12 +- .../view-models/createInstanceServiceModels.htm | 39 +-- .../app/vid/scripts/view-models/creationDialog.htm | 126 ++++----- .../app/vid/scripts/view-models/serviceModels.htm | 2 + 21 files changed, 741 insertions(+), 420 deletions(-) delete mode 100755 vid-app-common/src/main/java/org/openecomp/vid/controller/VidHomeController.java (limited to 'vid-app-common/src') diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMeta.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMeta.java index 66938372e..a5295c476 100755 --- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMeta.java +++ b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMeta.java @@ -1,9 +1,9 @@ /*- - * ============LICENSE_START======================================================= - * VID - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ + * ============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 @@ -14,7 +14,7 @@ * 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. + * limitations under the License. * ============LICENSE_END========================================================= */ @@ -104,12 +104,14 @@ public class ToscaMeta { try { while ((line = br.readLine()) != null) { - final String[] entry = line.split(":"); - - if (entry.length != 2) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (more than 1 colon found on a single line"); - if (!entry[1].startsWith(" ")) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (: not immediately followed by ' ')"); - - metadata.put(entry[0], entry[1].substring(1)); + if ( line.length() > 0 ) { + final String[] entry = line.split(":"); + + if (entry.length != 2) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (more than 1 colon found on a single line"); + if (!entry[1].startsWith(" ")) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (: not immediately followed by ' ')"); + + metadata.put(entry[0], entry[1].substring(1)); + } } } catch (IOException e) { metadata.clear(); diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/rest/RestfulAsdcClient.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/rest/RestfulAsdcClient.java index 26d45cc7e..9f7c3a57d 100755 --- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/rest/RestfulAsdcClient.java +++ b/vid-app-common/src/main/java/org/openecomp/vid/asdc/rest/RestfulAsdcClient.java @@ -22,16 +22,19 @@ package org.openecomp.vid.asdc.rest; import java.io.IOException; import java.io.InputStream; +import java.io.FileInputStream; +import java.io.File; import java.net.URI; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; +import java.text.DateFormat; +import java.text.SimpleDateFormat; import java.util.Collection; import java.util.Collections; import java.util.Map; import java.util.Map.Entry; import java.util.UUID; -import java.util.logging.Logger; import java.util.zip.ZipFile; import javax.ws.rs.NotFoundException; @@ -44,6 +47,7 @@ import javax.ws.rs.core.GenericType; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedHashMap; +import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.openecomp.vid.asdc.AsdcCatalogException; import org.openecomp.vid.asdc.AsdcClient; import org.openecomp.vid.asdc.beans.Artifact; @@ -64,8 +68,11 @@ import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; */ public class RestfulAsdcClient implements AsdcClient { - /** The Constant LOGGER. */ - private static final Logger LOGGER = Logger.getLogger(RestfulAsdcClient.class.getName()); + /** The Constant LOG. */ + private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(RestfulAsdcClient.class); + + /** The Constant dateFormat. */ + final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS"); /** The client. */ private final Client client; @@ -422,7 +429,6 @@ public class RestfulAsdcClient implements AsdcClient { */ private ToscaCsar getToscaModel(InputStream csarInputStream) throws AsdcCatalogException { final Path csarFile; - try { csarFile = Files.createTempFile("csar", ".zip"); Files.copy(csarInputStream, csarFile, StandardCopyOption.REPLACE_EXISTING); @@ -444,10 +450,17 @@ public class RestfulAsdcClient implements AsdcClient { final ToscaCsar.Builder csarBuilder = new ToscaCsar.Builder(parentModel); for (Map> imports : parentModel.getImports()) { + LOG.debug("imports = " + imports.toString()); for (Entry> entry : imports.entrySet()) { - final InputStream toscaChildEntryYamlStream = csar.getInputStream(csar.getEntry("Definitions/" + entry.getValue().get("file"))); - final ToscaModel childModel = yaml.loadAs(toscaChildEntryYamlStream, ToscaModel.class); - csarBuilder.addVnf(childModel); + if ( entry.getValue() != null) { + String fname = entry.getValue().get("file"); + if ( ( fname != null ) && (fname.startsWith("service") || fname.startsWith("resource")) ) { + LOG.debug("fname = " + fname); + final InputStream toscaChildEntryYamlStream = csar.getInputStream(csar.getEntry("Definitions/" + fname )); + final ToscaModel childModel = yaml.loadAs(toscaChildEntryYamlStream, ToscaModel.class); + csarBuilder.addVnf(childModel); + } + } } } diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/AaiController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/AaiController.java index 7cb25c264..92b752859 100755 --- a/vid-app-common/src/main/java/org/openecomp/vid/controller/AaiController.java +++ b/vid-app-common/src/main/java/org/openecomp/vid/controller/AaiController.java @@ -126,7 +126,10 @@ public class AaiController extends RestrictedBaseController{ User user = (User) session.getAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME)); if (user != null) { - userId = user.getHrid(); + //userId = user.getHrid(); + userId = user.getLoginId(); + if (userId == null) + userId = user.getOrgUserId(); } } diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/VidHomeController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/VidHomeController.java deleted file mode 100755 index cfb915b03..000000000 --- a/vid-app-common/src/main/java/org/openecomp/vid/controller/VidHomeController.java +++ /dev/null @@ -1,79 +0,0 @@ -/*- - * ============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========================================================= - */ - -package org.openecomp.vid.controller; - - -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; - - -import org.springframework.beans.factory.annotation.Autowired; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.servlet.ModelAndView; - -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; - - -/** - * The Class VidHomeController. - */ -@RestController -public class VidHomeController extends RestrictedBaseController{ - - /** The view name. */ - String viewName; - - - /** The servlet context. */ - private @Autowired ServletContext servletContext; - - /** - * Welcome. - * - * @param request the request - * @return the model and view - */ - @RequestMapping(value = {"/vidhome" }, method = RequestMethod.GET) - public ModelAndView welcome(HttpServletRequest request) { - - return new ModelAndView(getViewName()); - } - - /* (non-Javadoc) - * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#getViewName() - */ - public String getViewName() { - return viewName; - } - - /* (non-Javadoc) - * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#setViewName(java.lang.String) - */ - public void setViewName(String viewName) { - this.viewName = viewName; - } - - - -} diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js index 855f99087..d2db094b0 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js @@ -1,148 +1,149 @@ -/*- - * ============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========================================================= - */ - -"use strict"; - -appDS2.constant("COMPONENT", (function() { - return { - A_LA_CARTE : "a la carte", - CLOUD_REGION_ID : "cloudRegionID", - COMPONENT_STATUS : "ComponentStatus", - CREATE_COMPONENT : "createComponent", - DELETE_COMPONENT : "deleteComponent", - ENTITY : "entity", - GET_COMPONENT_LIST : "getComponentList", - GET_SUBS : "getSubs", - GET_SUB_DETAILS : "getSubDetails", - GLOBAL_CUSTOMER_ID : "globalCustomerId", - MACRO : "Macro", - MODEL_VERSION_1 : "1", - MSO_CREATE_REQ : "createInstance", - MSO_DELETE_REQ : "deleteInstance", - NAME : "name", - NETWORK : "network", - NETWORKS : "networks", - - QUERY_SERVICE_INSTANCE : "queryServiceInstance", - REFRESH_PROPERTIES : "refreshProperties", - SERVICE : "service", - SERVICE_TYPE : "serviceType", - SHOW_COMPONENT_DETAILS : "showComponentDetails", - STATUS : "status", - SUBSCRIBER_NAME : "subscriberName", - TENANT_ID : "tenantID", - TENANT_NAME : "tenantName", - TRUE : "true", +/*- + * ============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========================================================= + */ + +"use strict"; + +appDS2.constant("COMPONENT", (function() { + return { + A_LA_CARTE : "a la carte", + CLOUD_REGION_ID : "cloudRegionID", + COMPONENT_STATUS : "ComponentStatus", + CREATE_COMPONENT : "createComponent", + DELETE_COMPONENT : "deleteComponent", + ENTITY : "entity", + GET_COMPONENT_LIST : "getComponentList", + GET_SUBS : "getSubs", + GET_SUB_DETAILS : "getSubDetails", + GLOBAL_CUSTOMER_ID : "globalCustomerId", + MACRO : "Macro", + MODEL_VERSION_1 : "1", + MSO_CREATE_REQ : "createInstance", + MSO_DELETE_REQ : "deleteInstance", + NAME : "name", + NETWORK : "network", + NETWORKS : "networks", + + QUERY_SERVICE_INSTANCE : "queryServiceInstance", + REFRESH_PROPERTIES : "refreshProperties", + SERVICE : "service", + SERVICE_TYPE : "serviceType", + SHOW_COMPONENT_DETAILS : "showComponentDetails", + STATUS : "status", + SUBSCRIBER_NAME : "subscriberName", + TENANT_ID : "tenantID", + TENANT_NAME : "tenantName", + TRUE : "true", - VF_MODULE : "vfModule", - VNF : "vnf", - VNF_CODE : "vnfCode", - VNF_FUNCTION : "vnfFunction", - VNF_ROLE : "vnfRole", - VNF_TYPE : "vnfType", - VOLUME_GROUP : "volumeGroup", - - - // IDs - CIDR_MASK_1 : "255.255.255.000", - //COMPONENT_LIST_NAMED_QUERY_ID : "ed0a0f5b-cf79-4784-88b2-911cd726cd3d", - CUSTOMER_ID_1 : "icore9883749", - DELETE_INSTANCE_ID_1 : "ff305d54-75b4-ff1b-fff1-eb6b9e5460ff", - GATEWAY_ADDRESS_1 : "10.10.125.1", - GLOBAL_SUBSCRIBER_ID_1 : "C12345", - INSTANCE_ID_1 : "ff305d54-75b4-431b-adb2-eb6b9e5ff000", - INSTANCE_ID_2 : "ff305d54-75b4-ff1b-adb2-eb6b9e5460ff", - INSTANCE_ID_3 : "ff305d54-75b4-ff1b-bdb2-eb6b9e5460ff", - MODEL_ID_1 : "sn5256d1-5a33-55df-13ab-12abad84e764", - MODEL_ID_2 : "ff5256d1-5a33-55df-aaaa-12abad84e7ff", - MODEL_ID_3 : "ff3514e3-5a33-55df-13ab-12abad84e7ff", - MODEL_ID_4 : "ff5256d1-5a33-55df-13ab-12abad84e7ff", - MODEL_ID_5 : "ff5256d1-5a33-55df-13ab-22abad84e7ff", - MODEL_NAME_VERSION_ID_1 : "ab6478e4-ea33-3346-ac12-ab121484a333", - MODEL_NAME_VERSION_ID_2 : "fe6478e4-ea33-3346-aaaa-ab121484a3fe", - MODEL_NAME_VERSION_ID_3 : "fe6985cd-ea33-3346-ac12-ab121484a3fe", - MODEL_NAME_VERSION_ID_4 : "fe6478e4-ea33-3346-ac12-ab121484a3fe", - MODEL_NAME_VERSION_ID_5 : "fe6478e4-ea33-3346-bc12-ab121484a3fe", - SERVICE_INSTANCE_ID_1 : "bc305d54-75b4-431b-adb2-eb6b9e546014", - SUBSCRIBER_NAME_GED12 : "General Electric Division 12", - VNF_INSTANCE_ID : "VNF_INSTANCE_ID_12345", - VPN_ID_1 : "1a2b3c4d5e6f", - - // PATHS - ASSIGN : "?r=", - AAI_GET_SERVICE_INSTANCE_PATH : "aai_get_service_instance/", - AAI_GET_SERVICES : "aai_get_services", - AAI_GET_TENANTS : "aai_get_tenants/", - AAI_SUB_DETAILS_PATH : "aai_sub_details/", - AAI_SUB_VIEWEDIT_PATH : "aai_sub_viewedit", - ASDC_GETMODEL_PATH : "asdc/getModel/", - CREATE_INSTANCE_PATH : "/models/services/createInstance", - FORWARD_SLASH : "/", - GET_SYSTEM_PROP_VNF_PROV_STATUS_PATH : "get_system_prop_vnf_prov_status", - GET_USER_ID : "getuserID", - INSTANTIATE_ROOT_PATH : "#/instantiate?subscriberId=", - INSTANTIATE_PATH : "/instantiate", - INVALID_STRING : "/INVALID_STRING/", - INVALID_STRING_MSO_CREATE_SVC_INSTANCE : "INVALID_STRING_mso_create_svc_instance", - MSO_CREATE_NW_INSTANCE : "mso_create_nw_instance", - MSO_CREATE_NW_INSTANCE_PATH : "mso_create_nw_instance/", - MSO_CREATE_SVC_INSTANCE : "mso_create_svc_instance", - MSO_DELETE_SVC_INSTANCE_PATH : "mso_delete_svc_instance/", - SELECTED_SERVICE_SUB_PATH : "#/instances/subdetails?selectedServiceSubscription=", - SELECTED_SUB_PATH : "#/instances/subdetails?selectedSubscriber=", - SELECTEDSERVICEINSTANCE_SUB_PATH : "&selectedServiceInstance=", - SELECTEDSUBSCRIBER_SUB_PATH : "&selectedSubscriber=", - SERVICE_TYPE_LIST_PATH : "#/instances/serviceTypes?serviceTypeList=", - SERVICE_MODLES_INSTANCES_SUBSCRIBERS_PATH : 'serviceModels.htm#/instances/subscribers', - SERVICES_DIST_STATUS_PATH : "rest/models/services?distributionStatus=", - SERVICES_PATH : "rest/models/services/", - SERVICETYPE_SUB_PATH : "&serviceType=", - SERVICEINSTANCEID_SUB_PATH : "&serviceInstanceId=", - SERVICEMODELS_INSTANCES_SERVICES_PATH : "serviceModels.htm#/instances/services", - SERVICEMODELS_MODELS_SERVICES_PATH : "serviceModels.htm#/models/services", - SUBDETAILS_SELECTEDSUBSCRIBER : "#subdetails?selectedSubscriber=", - SUBSCRIBERNAME_SUB_PATH : "&subscriberName=", - WELCOME_PATH : "welcome.htm", - - //Template Urls - AAI_GET_SUBS_URL : "app/vid/scripts/view-models/aaiGetSubs.htm", - AAI_GET_SUBSCRIBER_URL : "app/vid/scripts/view-models/aaiGetSubscriberList.htm", - AAI_SERVICE_TYPES_URL : "app/vid/scripts/view-models/aaiServiceTypes.htm", - AAI_SUB_DETAILS_URL : "app/vid/scripts/view-models/aaiSubDetails.htm", - CREATE_INSTANCE_SERVICE_MODELS_URL : "app/vid/scripts/view-models/createInstanceServiceModels.htm", - INSTANTIATE_URL : "app/vid/scripts/view-models/instantiate.htm", - SERVICE_MODELS : "app/vid/scripts/view-models/serviceModels.htm", - - - - FULL_NAME_MAP : { - "model-invariant-id" : "Model ID", - "model-version-id" : "Model Version ID" - }, - PARTIAL_NAME_MAP : { - "id" : "ID", - "uuid" : "UUID", - "vfmodule" : "VF Module", - "vnf" : "VNF", - "volumegroup" : "Volume Group" - } - - }; -})()) + VF_MODULE : "vfModule", + VNF : "vnf", + VNF_CODE : "vnfCode", + VNF_FUNCTION : "vnfFunction", + VNF_ROLE : "vnfRole", + VNF_TYPE : "vnfType", + VOLUME_GROUP : "volumeGroup", + + + // IDs + CIDR_MASK_1 : "255.255.255.000", + //COMPONENT_LIST_NAMED_QUERY_ID : "ed0a0f5b-cf79-4784-88b2-911cd726cd3d", + CUSTOMER_ID_1 : "icore9883749", + DELETE_INSTANCE_ID_1 : "ff305d54-75b4-ff1b-fff1-eb6b9e5460ff", + GATEWAY_ADDRESS_1 : "10.10.125.1", + GLOBAL_SUBSCRIBER_ID_1 : "C12345", + INSTANCE_ID_1 : "ff305d54-75b4-431b-adb2-eb6b9e5ff000", + INSTANCE_ID_2 : "ff305d54-75b4-ff1b-adb2-eb6b9e5460ff", + INSTANCE_ID_3 : "ff305d54-75b4-ff1b-bdb2-eb6b9e5460ff", + MODEL_ID_1 : "sn5256d1-5a33-55df-13ab-12abad84e764", + MODEL_ID_2 : "ff5256d1-5a33-55df-aaaa-12abad84e7ff", + MODEL_ID_3 : "ff3514e3-5a33-55df-13ab-12abad84e7ff", + MODEL_ID_4 : "ff5256d1-5a33-55df-13ab-12abad84e7ff", + MODEL_ID_5 : "ff5256d1-5a33-55df-13ab-22abad84e7ff", + MODEL_NAME_VERSION_ID_1 : "ab6478e4-ea33-3346-ac12-ab121484a333", + MODEL_NAME_VERSION_ID_2 : "fe6478e4-ea33-3346-aaaa-ab121484a3fe", + MODEL_NAME_VERSION_ID_3 : "fe6985cd-ea33-3346-ac12-ab121484a3fe", + MODEL_NAME_VERSION_ID_4 : "fe6478e4-ea33-3346-ac12-ab121484a3fe", + MODEL_NAME_VERSION_ID_5 : "fe6478e4-ea33-3346-bc12-ab121484a3fe", + SERVICE_INSTANCE_ID_1 : "bc305d54-75b4-431b-adb2-eb6b9e546014", + SUBSCRIBER_NAME_GED12 : "General Electric Division 12", + VNF_INSTANCE_ID : "VNF_INSTANCE_ID_12345", + VPN_ID_1 : "1a2b3c4d5e6f", + + // PATHS + ASSIGN : "?r=", + AAI_GET_SERVICE_INSTANCE_PATH : "aai_get_service_instance/", + AAI_GET_SERVICES : "aai_get_services", + AAI_GET_SERVICES_BY_TYPE : "aai_get_models_by_service_type", + AAI_GET_TENANTS : "aai_get_tenants/", + AAI_SUB_DETAILS_PATH : "aai_sub_details/", + AAI_SUB_VIEWEDIT_PATH : "aai_sub_viewedit", + ASDC_GETMODEL_PATH : "asdc/getModel/", + CREATE_INSTANCE_PATH : "/models/services/createInstance", + FORWARD_SLASH : "/", + GET_SYSTEM_PROP_VNF_PROV_STATUS_PATH : "get_system_prop_vnf_prov_status", + GET_USER_ID : "getuserID", + INSTANTIATE_ROOT_PATH : "#/instantiate?subscriberId=", + INSTANTIATE_PATH : "/instantiate", + INVALID_STRING : "/INVALID_STRING/", + INVALID_STRING_MSO_CREATE_SVC_INSTANCE : "INVALID_STRING_mso_create_svc_instance", + MSO_CREATE_NW_INSTANCE : "mso_create_nw_instance", + MSO_CREATE_NW_INSTANCE_PATH : "mso_create_nw_instance/", + MSO_CREATE_SVC_INSTANCE : "mso_create_svc_instance", + MSO_DELETE_SVC_INSTANCE_PATH : "mso_delete_svc_instance/", + SELECTED_SERVICE_SUB_PATH : "#/instances/subdetails?selectedServiceSubscription=", + SELECTED_SUB_PATH : "#/instances/subdetails?selectedSubscriber=", + SELECTEDSERVICEINSTANCE_SUB_PATH : "&selectedServiceInstance=", + SELECTEDSUBSCRIBER_SUB_PATH : "&selectedSubscriber=", + SERVICE_TYPE_LIST_PATH : "#/instances/serviceTypes?serviceTypeList=", + SERVICE_MODLES_INSTANCES_SUBSCRIBERS_PATH : 'serviceModels.htm#/instances/subscribers', + SERVICES_DIST_STATUS_PATH : "rest/models/services?distributionStatus=", + SERVICES_PATH : "rest/models/services/", + SERVICETYPE_SUB_PATH : "&serviceType=", + SERVICEINSTANCEID_SUB_PATH : "&serviceInstanceId=", + SERVICEMODELS_INSTANCES_SERVICES_PATH : "serviceModels.htm#/instances/services", + SERVICEMODELS_MODELS_SERVICES_PATH : "serviceModels.htm#/models/services", + SUBDETAILS_SELECTEDSUBSCRIBER : "#subdetails?selectedSubscriber=", + SUBSCRIBERNAME_SUB_PATH : "&subscriberName=", + WELCOME_PATH : "welcome.htm", + + //Template Urls + AAI_GET_SUBS_URL : "app/vid/scripts/view-models/aaiGetSubs.htm", + AAI_GET_SUBSCRIBER_URL : "app/vid/scripts/view-models/aaiGetSubscriberList.htm", + AAI_SERVICE_TYPES_URL : "app/vid/scripts/view-models/aaiServiceTypes.htm", + AAI_SUB_DETAILS_URL : "app/vid/scripts/view-models/aaiSubDetails.htm", + CREATE_INSTANCE_SERVICE_MODELS_URL : "app/vid/scripts/view-models/createInstanceServiceModels.htm", + INSTANTIATE_URL : "app/vid/scripts/view-models/instantiate.htm", + SERVICE_MODELS : "app/vid/scripts/view-models/serviceModels.htm", + + + + FULL_NAME_MAP : { + "model-invariant-id" : "Model ID", + "model-version-id" : "Model Version ID" + }, + PARTIAL_NAME_MAP : { + "id" : "ID", + "uuid" : "UUID", + "vfmodule" : "VF Module", + "vnf" : "VNF", + "volumegroup" : "Volume Group" + } + + }; +})()) diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js index 6dbcbc2f8..291549d67 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js @@ -103,7 +103,7 @@ appDS2.factory("FIELD", [ "PARAMETER", function(PARAMETER) { SERVICE_INSTANCE_NAME : "service-instance-name", SERVICE_SUBSCRIPTION : "service-subscription", SERVICE_SUBSCRIPTIONS : "service-subscriptions", - SERVICE_TYPE : "service-type", + SERVICETYPE : "service-type", STATUS_MESSAGE : "statusMessage", SUBNAME : "subscriber-name", TIMESTAMP : "timestamp", @@ -121,6 +121,9 @@ appDS2.factory("FIELD", [ "PARAMETER", function(PARAMETER) { VOLUME_GROUP : "volume-group", VOLUME_GROUP_ID : "volume-group-id", VOLUME_GROUP_NAME : "volume-group-name", + SDN_C_PRELOAD : "sdncPreload", + UPLOAD_SUPPLEMENTORY_DATA_FILE : "uploadSupplementoryDataFile", + SUPPLEMENTORY_DATA_FILE : "supplementoryDataFile" }; var KEY = { @@ -144,7 +147,7 @@ appDS2.factory("FIELD", [ "PARAMETER", function(PARAMETER) { MODEL_VNF_TYPE: "NF Type", MODEL_VNF_ROLE: "NF Role", MODEL_VNF_FUNCTION: "NF Function", - MODEL_VNF_CODE: "NF Code", + MODEL_VNF_CODE: "NF Naming Code", MODEL_CUSTOMIZATION_NAME: "Resource Name", PRODUCT_FAMILY : "Product Family", RESOURCE_DESCRIPTION : "Resource Description", @@ -161,6 +164,9 @@ appDS2.factory("FIELD", [ "PARAMETER", function(PARAMETER) { SERVICE_VERSION : "Service Version", SUBSCRIBER_NAME : "Subscriber Name", SUPPRESS_ROLLBACK : "Suppress Rollback on Failure", + SDN_C_PRELOAD : "SDN-C Pre-Load", + UPLOAD_SUPPLEMENTORY_DATA_FILE : "Upload Supplementory Data file", + SUPPLEMENTORY_DATA_FILE : "Supplementory Data file (JSON format)", TENANT : "Tenant", USER_SERVICE_INSTANCE_NAME : "User Service Instance Name", VF_MODULE_DESCRIPTION : "VF Module Description", @@ -260,6 +266,10 @@ appDS2.factory("FIELD", [ "PARAMETER", function(PARAMETER) { FETCHING_SERVICE_INSTANCE_DATA : "Failed to fetch service instance data from A&AI: Response Code: ", INVALID_INSTANCE_NAME : "Invalid instance name: ", INSTANCE_NAME_VALIDATE : "The instance name must contain only alphanumeric or \"_-.\" characters, and must start with an alphabetic character", + INVALID_LIST : "Invalid list parameter: ", + INVALID_MAP : "Invalid map parameter: ", + LIST_VALIDATE : "A list parameter value must have the following syntax: '[,\.\.\.,]'", + MAP_VALIDATE : "A map parameter value must have the following syntax: '{ : , \.\.\., : }'", MAX_POLLS_EXCEEDED : "Maximum number of poll attempts exceeded", MISSING_DATA : "Missing data", MODEL_VERSION_ID_MISSING : "Error: model-version-id is not populated in A&AI", @@ -341,6 +351,47 @@ appDS2.factory("FIELD", [ "PARAMETER", function(PARAMETER) { type : PARAMETER.BOOLEAN, value : false }, + SDN_C_PRELOAD_CHECKED : { + name : NAME.SDN_C_PRELOAD, + id : ID.SDN_C_PRELOAD, + type : PARAMETER.CHECKBOX, + value : true, + isVisible:true, + isRequired:false + }, + SDN_C_PRELOAD_UNCHECKED : { + name : NAME.SDN_C_PRELOAD, + id : ID.SDN_C_PRELOAD, + type : PARAMETER.CHECKBOX, + value : false, + isVisible:true, + isRequired:false + }, + UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED : { + name : NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE, + id : ID.UPLOAD_SUPPLEMENTORY_DATA_FILE, + type : PARAMETER.CHECKBOX, + value : true, + isVisible:true, + isRequired:false + }, + UPLOAD_SUPPLEMENTORY_DATA_FILE_UNCHECKED : { + name : NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE, + id : ID.UPLOAD_SUPPLEMENTORY_DATA_FILE, + type : PARAMETER.CHECKBOX, + value : false, + isVisible:true, + isRequired:false + }, + SUPPLEMENTORY_DATA_FILE : { + name : NAME.SUPPLEMENTORY_DATA_FILE, + id : ID.SUPPLEMENTORY_DATA_FILE, + type : PARAMETER.FILE, + isRequired : false, + isVisible : true, + fileData:'' + }, + SUBSCRIBER_NAME : { name : NAME.SUBSCRIBER_NAME, id : ID.SUBSCRIBER_NAME, diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/parameterConstants.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/parameterConstants.js index 4e3ad29d1..693186af4 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/parameterConstants.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/parameterConstants.js @@ -46,7 +46,10 @@ appDS2.constant("PARAMETER", (function() { GREATER_THAN: "greater_than", LESS_THAN: "less_than", GREATER_OR_EQUAL: "greater_or_equal", - LESS_OR_EQUAL: "less_or_equal" + LESS_OR_EQUAL: "less_or_equal", + DISPLAY_NAME: "displayName", + CHECKBOX:'checkbox', + FILE:'file' }; })()) diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js index 8fdfd3fcb..f56066164 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js @@ -26,6 +26,11 @@ appDS2.constant("VIDCONFIGURATION", (function() { * Set to false, to disable the check. */ var VNF_STATUS_CHECK_ENABLED = false; + /* + * UPLOAD_SUPPLEMENTARY_STATUS_CHECK_ENABLED: Determines the Property to Govern Presence of Upload Supplementary File on Volume Group Screen. + * Set to false, to disable the check. + */ + var UPLOAD_SUPPLEMENTARY_STATUS_CHECK_ENABLED = false; /* * List of valid VNF status combinations */ @@ -93,6 +98,7 @@ appDS2.constant("VIDCONFIGURATION", (function() { MSO_POLLING_INTERVAL_MSECS : MSO_POLLING_INTERVAL_MSECS, VNF_STATUS_CHECK_ENABLED : VNF_STATUS_CHECK_ENABLED, VNF_VALID_STATUS_LIST : vnfValidStatusList, + UPLOAD_SUPPLEMENTARY_STATUS_CHECK_ENABLED : UPLOAD_SUPPLEMENTARY_STATUS_CHECK_ENABLED, MACRO_SERVICES : MACRO_SERVICES, COMPONENT_LIST_NAMED_QUERY_ID : COMPONENT_LIST_NAMED_QUERY_ID }; diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js index f928f4ec1..dcbf3e6ef 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js @@ -236,7 +236,7 @@ }); DataService.setSubscriberName(serviceObject[FIELD.ID.SUBSCRIBER_NAME]); - DataService.setServiceType(serviceObject[FIELD.ID.SERVICE_TYPE]); + DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]); DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]); DataService.setGlobalCustomerId(serviceObject[COMPONENT.GLOBAL_CUSTOMER_ID]); @@ -366,6 +366,7 @@ var vnfModelVersion = null; var vnfModelCustomizationUuid = null; var vnfModel = null; + var vnfModelVersionId = null; vnfModelInvariantUuid = vnf.object[FIELD.ID.MODEL_INVAR_ID]; vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID]; @@ -435,6 +436,7 @@ var vnfModelVersion = null; var vnfModelCustomizationUuid = null; var vnfModel = null; + var vnfModelVersionId = null; vnfModelInvariantUuid = vnf.object[FIELD.ID.MODEL_INVAR_ID]; vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID]; diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js index 5d382e9e9..dd2cf73f4 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js @@ -139,7 +139,7 @@ for (var i = 0; i < response.control.length; i++) { if (response.control[i].id == COMPONENT.SUBSCRIBER_NAME) { subscriberId = response.control[i].value; - } else if (response.control[i].id == "service-type") { + } else if (response.control[i].id == FIELD.ID.SERVICE_TYPE) { serviceType = response.control[i].value; } } @@ -182,8 +182,8 @@ if (subVal[FIELD.ID.SERVICE_SUBSCRIPTIONS] != null) { angular.forEach(subVal[FIELD.ID.SERVICE_SUBSCRIPTIONS][FIELD.ID.SERVICE_SUBSCRIPTION], function(serviceSubscription, key) { $scope.serviceInstanceId = []; - if (serviceSubscription[FIELD.ID.SERVICE_TYPE] != null) { - $scope.serviceType = serviceSubscription[FIELD.ID.SERVICE_TYPE]; + if (serviceSubscription[FIELD.ID.SERVICETYPE] != null) { + $scope.serviceType = serviceSubscription[FIELD.ID.SERVICETYPE]; } else { $scope.serviceType = FIELD.STATUS.NO_SERVICE_SUBSCRIPTION_FOUND; } diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js index 5caa3298f..00c141483 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js @@ -152,20 +152,12 @@ appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER" pathQuery = COMPONENT.SERVICES_PATH +globalCustomerId+"/"+$scope.serviceTypeName; } - AaiService.getServiceModels(globalCustomerId,$scope.serviceTypeName,function(response) { // success - console.log("service models : "+response.data); - DataService.setServiceIdList(response); - }, function(response) { // failure - $scope.showError(FIELD.ERROR.AAI); - $scope.errorMsg = FIELD.ERROR.FETCHING_SERVICES+ response.status; - $scope.errorDetails = response.data; - }); - - /*$http.get('/aai_get_services/'+globalCustomerId+''+$scope.serviceTypeName) - .then(function successCallback(response) { + var namedQueryId='6e806bc2-8f9b-4534-bb68-be91267ff6c8'; + AaiService.getServiceModelsByServiceType(namedQueryId,globalCustomerId,$scope.serviceTypeName,function(response) { // success $scope.services = []; - if (angular.isArray(response.data)) { - $scope.services = response.data; + if (angular.isArray(response.data['inventory-response-item'])) { + $scope.services = response.data['inventory-response-item'][0]['inventory-response-items']['inventory-response-item']; + $scope.serviceType = response.data['inventory-response-item'][0]['service-subscription']['service-type']; $scope.viewPerPage=10; $scope.totalPage=$scope.services.length/$scope.viewPerPage; $scope.sortBy="name"; @@ -177,15 +169,100 @@ appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER" $scope.isSpinnerVisible = false; $scope.isProgressVisible = false; } else { - $scope.status = "Failed to get service models from SDC."; + $scope.status = "Failed to get service models from ASDC."; $scope.error = true; $scope.isSpinnerVisible = false; } - }, function errorCallback(response) { - console.log("Error: " + response); - }); */ - + DataService.setServiceIdList(response); + }, function(response) { // failure + $scope.showError(FIELD.ERROR.AAI); + $scope.errorMsg = FIELD.ERROR.FETCHING_SERVICES+ response.status; + $scope.errorDetails = response.data; + }); + + }; + $scope.createType = "a la carte"; + $scope.deployService = function(service,hideServiceFields) { + hideServiceFields = hideServiceFields|| false; + var temp = service; + service.uuid = service['service-instance']['model-version-id']; + + console.log("Instantiating ASDC service " + service.uuid); + + $http.get('rest/models/services/' + service.uuid) + .then(function successCallback(getServiceResponse) { + getServiceResponse.data['service'].serviceTypeName =$scope.serviceTypeName ; + getServiceResponse.data['service'].createSubscriberName =$scope.createSubscriberName ; + var serviceModel = getServiceResponse.data; + DataService.setServiceName(serviceModel.service.name); + + DataService.setModelInfo(COMPONENT.SERVICE, { + "modelInvariantId": serviceModel.service.invariantUuid, + "modelVersion": serviceModel.service.version, + "modelNameVersionId": serviceModel.service.uuid, + "modelName": serviceModel.service.name, + "description": serviceModel.service.description, + "category":serviceModel.service.category, + "serviceTypeName":serviceModel.service.serviceTypeName, + "createSubscriberName":serviceModel.service.createSubscriberName + }); + DataService.setHideServiceFields(hideServiceFields); + DataService.setALaCarte (true); + $scope.createType = "a la carte"; + var broadcastType = "createComponent"; + + if (UtilityService.arrayContains (VIDCONFIGURATION.MACRO_SERVICES, serviceModel.service.invariantUuid )) { + DataService.setALaCarte (false); + $scope.createType = "Macro"; + var convertedAsdcModel = UtilityService.convertModel(serviceModel); + + //console.log ("display inputs "); + //console.log (JSON.stringify ( convertedAsdcModel.completeDisplayInputs)); + + DataService.setModelInfo(COMPONENT.SERVICE, { + "modelInvariantId": serviceModel.service.invariantUuid, + "modelVersion": serviceModel.service.version, + "modelNameVersionId": serviceModel.service.uuid, + "modelName": serviceModel.service.name, + "description": serviceModel.service.description, + "category":serviceModel.service.category, + "inputs": serviceModel.service.inputs, + "displayInputs": convertedAsdcModel.completeDisplayInputs, + "serviceTypeName":serviceModel.service.serviceTypeName, + "createSubscriberName":serviceModel.service.createSubscriberName + }); + }; + + $scope.$broadcast(broadcastType, { + componentId : COMPONENT.SERVICE, + callbackFunction : function(response) { + if (response.isSuccessful) { + vidService.setModel(serviceModel); + + var subscriberId = "Not Found"; + var serviceType = "Not Found"; + + var serviceInstanceId = response.instanceId; + + for (var i = 0; i < response.control.length; i++) { + if (response.control[i].id == "subscriberName") { + subscriberId = response.control[i].value; + } else if (response.control[i].id == "serviceType") { + serviceType = response.control[i].value; + } + } + + + $scope.refreshSubs(subscriberId,serviceType,serviceInstanceId); + + } + } + }); + + }, function errorCallback(response) { + console.log("Error: " + response); + }); }; $scope.cancelCreateSIType = function(){ @@ -207,6 +284,7 @@ appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER" } $scope.refreshSubs = function() { + $scope.init(); $scope.fetchSubs(FIELD.PROMPT.REFRESH_SUB_LIST); $scope.fetchServices(); }; diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js index 6a1c14c5b..eb170915a 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js @@ -20,8 +20,8 @@ "use strict"; -var creationDialogController = function( COMPONENT, FIELD, $scope, $http, $timeout, $log, - CreationService, UtilityService, DataService) { +var creationDialogController = function( COMPONENT, FIELD, PARAMETER, $scope, $http, $timeout, $log, + CreationService, UtilityService, DataService,VIDCONFIGURATION) { $scope.isDialogVisible = false; $scope.summaryControl = {}; @@ -73,8 +73,29 @@ var creationDialogController = function( COMPONENT, FIELD, $scope, $http, $timeo return false; } return true; - } - + }; + var validateMap = function(mname) { + var patt1 = /^{(\s*\w+\s*:\s*\w+\s*)(\s*,\s*\w+\s*:\s*\w+\s*)*}$/im; + if ( mname == null ){ + return true; + } + if ( !mname.match(patt1) ) { + return false; + } + return true; + }; + + var validateList = function(lname) { + var patt1 = /^\[(\s*\w+\s*)(\s*,\s*\w+\s*)*\]$/i; + if ( lname == null ){ + return true; + } + if ( !lname.match(patt1) ) { + return false; + } + return true; + }; + $scope.userParameterChanged = function(id) { CreationService.updateUserParameterList(id, $scope.userProvidedControl); } @@ -108,7 +129,50 @@ var creationDialogController = function( COMPONENT, FIELD, $scope, $http, $timeo return; } } - + var arbitraryParametersList = DataService.getArbitraryParameters(); + var p = null; + if (UtilityService.hasContents (arbitraryParametersList)) { + for (var i = 0; i < arbitraryParametersList.length; i++) { + p = arbitraryParametersList[i]; + if (p.type === PARAMETER.MAP) { + //validate a map: { : , ... , : } + // need to find the value in paramList + for (var j = 0; j < paramList.length; j++) { + if (paramList[j].id === p.id) { + p.value = paramList[j].value; + var isValid = validateMap (p.value); + if ( isValid ) { + $scope.isErrorVisible = false; + break; + } + else { + showError(FIELD.ERROR.INVALID_MAP + p.id, + FIELD.ERROR.MAP_VALIDATE); + return; + } + } + } + } else if (p.type === PARAMETER.LIST) { + //validate a list: { value or a list of comma separated values } + // need to find the value in paramList + for (var j = 0; j < paramList.length; j++) { + if (paramList[j].id === p.id) { + p.value = paramList[j].value; + var isValid = validateList (p.value); + if ( isValid ) { + $scope.isErrorVisible = false; + break; + } + else { + showError(FIELD.ERROR.INVALID_LIST + p.id, + FIELD.ERROR.LIST_VALIDATE); + return; + } + } + } + } + } + } var requestDetails = CreationService .getMsoRequestDetails($scope.userProvidedControl.getList()); @@ -158,6 +222,6 @@ var creationDialogController = function( COMPONENT, FIELD, $scope, $http, $timeo } -appDS2.controller("creationDialogController", [ "COMPONENT", "FIELD", "$scope", "$http", - "$timeout", "$log", "CreationService", "UtilityService", "DataService", +appDS2.controller("creationDialogController", [ "COMPONENT", "FIELD", "PARAMETER", "$scope", "$http", + "$timeout", "$log", "CreationService", "UtilityService", "DataService","VIDCONFIGURATION", creationDialogController ]); diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/subscriberSearch.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/subscriberSearch.js index afd7abad4..2cf689e75 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/subscriberSearch.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/subscriberSearch.js @@ -238,7 +238,7 @@ appDS2.controller("aaiSubscriberSearchController", [ "$scope", "$timeout", "$log }); } - + $scope.getSubscriberDet = function(selectedCustomer){ window.location.href = COMPONENT.SUBDETAILS_SELECTEDSUBSCRIBER + selectedCustomer; }; diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js b/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js index 811a51ecc..b6a360f46 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js @@ -49,7 +49,7 @@ var parameterBlockDirective = function($log, PARAMETER, UtilityService) { var checkboxInputStyle = "height: 18px; width: 18px; padding: 2px 5px;"; var selectStyle = "height: 25px; padding: 2px; text-align: center;"; var requiredLabelStyle = "width: 25px; padding: 5px 10px 10px 5px;"; - var textInputPrompt = "Enter data"; + var getParameterHtml = function(parameter, editable) { var style = valueStyle; @@ -60,7 +60,11 @@ var parameterBlockDirective = function($log, PARAMETER, UtilityService) { if (UtilityService.hasContents(parameter.description)) { attributeString += " title=' " + parameter.description + " '"; } - var html = "" + var rowstyle=''; + if(parameter.type == 'file' && !parameter.isVisiblity){ + rowstyle = ' style="display:none;"'; + } + var html = "" + getNameHtml(parameter) + ""; if (editable === undefined) { if (UtilityService.hasContents(parameter.value)) { @@ -102,6 +106,8 @@ var parameterBlockDirective = function($log, PARAMETER, UtilityService) { }; var getValueHtml = function(parameter) { + + var textInputPrompt = "Enter data"; var attributeString = " parameter-id='" + parameter.id + "'"; var additionalStyle = ""; if (parameter.isEnabled === false) { @@ -136,6 +142,14 @@ var parameterBlockDirective = function($log, PARAMETER, UtilityService) { name = parameter.id; } attributeString += " parameter-name='" + name + "'"; + + if ( parameter.type === PARAMETER.MAP ) { + textInputPrompt = "{: ,\.\.\.,: }"; + } + + if ( parameter.type === PARAMETER.LIST ) { + textInputPrompt = "[,\.\.\.,]"; + } switch (parameter.type) { case PARAMETER.BOOLEAN: @@ -151,6 +165,18 @@ var parameterBlockDirective = function($log, PARAMETER, UtilityService) { + ""; } break; + case PARAMETER.CHECKBOX: + if (parameter.value) { + return ""; + }else{ + return ""; + } + break; + case PARAMETER.FILE: + return ""; + break; case PARAMETER.NUMBER: var value=parameter.value; var parameterSpec = "= 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 ]); diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/createInstanceServiceModels.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/createInstanceServiceModels.htm index a78b95eed..4d02ae806 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/createInstanceServiceModels.htm +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/createInstanceServiceModels.htm @@ -78,30 +78,31 @@ Action - UUID - Invariant UUID - Name - Version - Category - Distribution Status - Last Updated By - Tosca Model + Service Name + Service Description + Service Type + Service UUID + Service Invariant UUID + Service Version + Action - - - - - - - - - - - + + + + + + + + + + +
+
+
+ @@ -65,6 +66,7 @@ +
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm index 0ac74a9a5..11dc1c39d 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm @@ -1,64 +1,64 @@ - + + +
+ +
+
+ +

Create {{componentName}} -- {{createType}}

+
+ +
+ {{error}} +
+ +
+ +

+ User Provided Data ( indicates required field) +

+ -
- -
-
- -

Create {{componentName}} -- {{createType}}

-
- -
- {{error}} -
- -
- -

- User Provided Data ( indicates required field) -

- - -
-

- Enter Data and Confirm to
Create {{componentName}} -

-

- Cancel to Return to Previous Page.
Data entered - will be lost -

-
- -
-
- - -
-
- -
- -
+
+

+ Enter Data and Confirm to
Create {{componentName}} +

+

+ Cancel to Return to Previous Page.
Data entered + will be lost +

+
+ +
+
+ + +
+
+ +
+ +
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceModels.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceModels.htm index c0a8ee54e..00b8972fe 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceModels.htm +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceModels.htm @@ -52,6 +52,7 @@
Distribution Status Last Updated By Tosca ModelAction
-- cgit 1.2.3-korg