This chapter provides an overview on adding custom fields to Oracle Communications Billing Care account creation for capturing required service configuration information.
Users create new subscriber accounts by clicking New Account on the Billing Care home page. New accounts require creating new subscriber profiles, selecting offers, and configuring services and payments. Your offers may require additional fields for capturing custom service configuration attributes during account creation.
Use the Billing Care SDK to customize new account service configuration to capture such information. For example, use the SDK to add fields for capturing mailbox message limits to set when configuring a messaging service. The SDK includes a sample for adding fields to account creation in SDK_home/BillingCare_SDK/samples/AccountCreation_CustomizeServices where SDK_home is the Billing Care SDK installation directory.
Adding custom service configuration fields requires:
Billing Care renders account creation screens using view models that define graphical elements including service configuration fields. See "About View Models" for a description of view models. Adding additional fields for account creation requires:
Both view models must be included in your NetBeans IDE project in the myproject/web/custom/viewmodels/accountCreation/configure folder where myproject is the base directory of your Net Beans IDE project. See "Setting Up the Development Environment" for more information on setting up your project.
Billing Care uses NewAccountConfigureViewModel.js during account creation to identify configurable services. This file selects a registry key based on the service being configured and maps this registry key to a module (view, view model, and validator) configuration defined in the registry. Billing Care then renders the appropriate service configuration screen based on the mapped module during account creation.
Adding additional fields to capture during service configuration requires extending NewAccountConfigureViewModel.js with additional registry keys for custom services. This enables Billing Care to select the correct registry key defining the custom service configuration.
A sample CustomNewAccountConfigureViewModel.js file is provided in the SDK_home/BillingCare_SDK/samples/AccountCreation_CustomizeServices/web/custom/js/viewmodels/accountCreation/configure directory where SDK_home is the Billing Care SDK installation directory.
To extend NewAccountConfigureViewModel.js:
Create a CustomNewAccountConfigureViewModel.js file in myproject/web/custom/js/viewmodels/area/configure where myproject is the folder containing your NetBeans IDE project and area is the customization type.
Define new registry keys that map to Oracle Communications Billing and Revenue Management (BRM) service types. Example 13-1 shows an additional registry key definition for /service/email.
Example 13-1 Sample New Account Configure View Model
define(['knockout', 'underscore', 'viewmodels/accountCreation/configure/NewAccountConfigureViewModel'], function(ko, _, NewAccountConfigureViewModel) { function CustomNewAccountConfigureViewModel() { NewAccountConfigureViewModel.apply(this, arguments); var self = this; /** * Get registryKey for service type from the activePageKey. * @param {type} apKey * @returns {String} */ self.getRegistryKeyForServiceType = function(apKey){ var registryKey = null; if(apKey != null && apKey.indexOf("/service/telco") !== -1){ registryKey = "telcoServiceConfiguration"; }else if(apKey != null && apKey.indexOf("/service/email") !== -1){ registryKey = "emailServiceConfiguration"; } return registryKey; }; } CustomNewAccountConfigureViewModel.prototype = new NewAccountConfigureViewModel(); return CustomNewAccountConfigureViewModel; });
Save the file in your NetBeans IDE project.
Billing Care uses a service configuration view model to define what fields to capture during service configuration. The fields defined in the service configuration view model are bound in the HTML file used to render the service configuration screen. You must create a custom service configuration view model to capture additional fields during account creation for any custom services.
A sample CustomEmailServiceConfigurationViewModel.js file is provided in the SDK_home/BillingCare_SDK/samples/AccountCreation_CustomizeServices/web/custom/js/viewmodels/accountCreation/configure directory where SDK_home is the Billing Care SDK installation directory. This sample defines three mailbox attributes usable for a custom messaging service. Use this sample to create a custom service configuration view model for defining the fields required by your service.
To create a custom service configuration view model defining the additional fields you need to capture:
Create a CustomServiceConfigurationViewModel.js file in myproject/web/custom/js/viewmodels/area/configure where myproject is the folder containing your NetBeans IDE project and area is the customization type.
Define the new fields required for capture in this file.
Define the BRM service type using the @class property in the self.isValid function in this file. Table 13-1 contains the supported services.
Table 13-1 Supported @class Services
Service |
---|
com.oracle.communications.brm.cc.model.ServiceEmailType |
com.oracle.communications.brm.cc.model.ServiceBroadbandType |
com.oracle.communications.brm.cc.model.ServiceDataType |
com.oracle.communications.brm.cc.model.ServiceLdapType |
com.oracle.communications.brm.cc.model.ServiceMmsType |
com.oracle.communications.brm.cc.model.ServiceEmailType |
com.oracle.communications.brm.cc.model.ServiceProviderType |
com.oracle.communications.brm.cc.model.ServiceSpcontentType |
com.oracle.communications.brm.cc.model.ServiceInstantchatType |
com.oracle.communications.brm.cc.model.ServicePsmcontentproviderType |
com.oracle.communications.brm.cc.model.ServiceContentproviderType |
com.oracle.communications.brm.cc.model.ServiceConfchatType |
com.oracle.communications.brm.cc.model.ServiceProviderProdType |
com.oracle.communications.brm.cc.model.ServiceInternettvType |
com.oracle.communications.brm.cc.model.ServiceAdminClientType |
com.oracle.communications.brm.cc.model.ServiceCableType |
com.oracle.communications.brm.cc.model.ServiceVideochatType |
com.oracle.communications.brm.cc.model.ServiceCloudType |
com.oracle.communications.brm.cc.model.ServiceStreamType |
com.oracle.communications.brm.cc.model.ServiceTelephonyType |
com.oracle.communications.brm.cc.model.ServiceContentType |
com.oracle.communications.brm.cc.model.ServicePcmClientType |
com.oracle.communications.brm.cc.model.ServiceIpType |
com.oracle.communications.brm.cc.model.ServiceSsgType |
com.oracle.communications.brm.cc.model.ServiceFaxType |
om.oracle.communications.brm.cc.model.ServiceSettlementType |
com.oracle.communications.brm.cc.model.ServiceVpdnType |
com.oracle.communications.brm.cc.model.ServiceTelcoType |
com.oracle.communications.brm.cc.model.ServiceTelcoVoipType |
com.oracle.communications.brm.cc.model.ServiceTelcoGprsType |
com.oracle.communications.brm.cc.model.ServiceTelcoGsmType |
Save the file in your NetBeans IDE project.
Billing Care uses an HTML view file to render the service configuration screen during account creation. You must create a custom service view model HTML template to display any additional fields during service configuration. The template file contains the additional fields defined in the custom service configuration view model created in "Creating a Custom Service Configuration View Model".
A sample customEmailServiceConfigView.html file is provided in the SDK_home/BillingCare_SDK/samples/AccountCreation_CustomizeServices/web/custom/js/templates/accountCreation/configure directory where SDK_home is the Billing Care SDK installation directory. This sample defines how to render three mailbox attributes usable for a custom messaging service and the data binding values. Use this sample to create a custom service configuration HTML template for displaying the fields required by your service.
To create a custom service configuration HTML template for rendering the additional fields you need to capture:
Create a CustomServiceConfigView.html file in myproject/web/custom/js/templates/area/configure where myproject is the folder containing your NetBeans IDE project and area is the customization type.
Define the new fields in HTML required for rendering in this file.
Save the file in your NetBeans IDE project.
Billing Care uses a JavaScript-based validator for validating field entry in the service configuration screen during account creation. You must create a custom field validator for any additional fields you add in your HTML template to assure that entered values are properly formatted. The registry key entry that defines the custom module includes the validator JavaScript file.
A sample CustomEmailServiceFieldsValidatory.js file is provided in the SDK_home/BillingCare_SDK/samples/AccountCreation_CustomizeServices/web/custom/js/validations/accountCreation/configure directory where SDK_home is the Billing Care SDK installation directory. This sample defines the required format of each custom field and the error message that appears if the user enters an incorrect format. Use this sample to create a custom service fields validator for your service.
To create a custom service fields validator:
Create a CustomServiceFieldsValidator.js file in myproject/web/custom/js/validations/area/configure where myproject is the folder containing your NetBeans IDE project and area is the customization type.
Define the required field validations in this file.
Save the file in your NetBeans IDE project.
After creating the required custom view models, HTML template, and validator, create a custom account creation module entry in the customRegistry.js file to use when creating a new account. Billing Care uses the custom account creation module instead of the default entry during account creation and renders the service configuration screen containing your custom fields.
A sample customRegistry.js file is provided in the SDK_home/BillingCare_SDK/samples/AccountCreation_CustomizeServices/web/custom directory where SDK_home is the Billing Care SDK installation directory. This sample defines the custom account creation module containing the previously referenced sample view models, HTML template, and validator.
To create a custom account creation module entry in the customRegistry.js file:
Create a customRegistry.js file in myproject/web/custom/ where myproject is the folder containing your NetBeans IDE project.
Define the custom account creation module in this file. Example 13-2 shows a definition of the custom account creation module in the registry using the SDK samples.
Example 13-2 Sample Custom Account Creation Module Registry Entry
var CustomRegistry = { accountCreationConfigure: { viewmodel: '../custom/js/viewmodels/accountCreation/configure/CustomNewAccountConfigureViewModel', emailServiceConfiguration:{ view: 'text!../custom/templates/accountCreation/configure/customEmailServiceConfigView.html', viewmodel: '../custom/js/viewmodels/accountCreation/configure/CustomEmailServiceConfigurationViewModel', validator: '../custom/js/validations/accountCreation/configure/CustomEmailServiceFieldsValidator' } } } ;
Save the file in your NetBeans IDE project.
Package and deploy your customizations using one of the methods described in "Using an Exploded Archive during Customization" or "Packaging and Deploying Customizations".