16 Customizing Purchase Deal and Assets Action Menu

Learn how to customize how you configure deals and display the Actions menu in Oracle Communications Billing Care.

Topics in this document:

About Customizing Purchase Deal Configuration and Assets Action Menu

You configure new or additional deals added to an account by clicking Configure in the Purchase Catalogue screen. Your deals may require additional fields for capturing custom configuration attributes during the purchase.

You can customize Billing Care to add custom fields for configuring the deal purchase and display the newly added custom fields in the assets action menu by using the Billing Care SDK.

For more information, see the following:

Customizing Purchase Deal Configuration

The Billing Care SDK includes the sample SDK in the SDK_home/samples/PurchaseDealAndAssetsActionMenuCustomization directory, where SDK_home is the directory where you installed the SDK. Extend the sample with additional fields if required by your business. Use this sample to assist you in customizing the deal purchase configuration in Billing Care.

To customize the purchase deal configuration:

  1. Extend the Billing Care data model by creating the custom data model JAR file (for example,customDataModel.jar) and add the JAR file to your Billing Care customization NetBeans IDE project. See "Extending the Data Model With the XSD and Java Class files" for more information.

  2. Create custom purchase configuration view models to override the default purchase configuration flow. See "Creating a Custom Purchase Deal Configuration View Model" for more information.

  3. Create a custom view model HTML template to display the fields in the Configure screen during deal purchase. See "Creating Custom Purchase Configure View Model HTML Templates" for more information.

  4. Deploy your custom payment type projects to your application server. See "Deploying Customizations" for more information.

Extending the Data Model With the XSD and Java Class files

To extend the data model with the XSD and Java class files:

  1. Create the customPurchaseBundle.xsd file by using the sample customPurchaseBundle.xsd file in the SDK_home/samples/PurchaseDealAndAssetsActionMenuCustomization/customSchema/ directory. The sample customPurchaseBundle.xsd file includes the following custom fields: productDescription and overridingAmount.

  2. Create the jaxb_bindings.xml file by using the sample jaxb_bindings.xml file in the SDK_home/samples/PurchaseDealAndAssetsActionMenuCustomization/customSchema/ directory.

  3. Generate a JAXB class from the schema by using XJC (XJC is available as part of Java):

    Note:

    It is assumed that the jaxb_bindings.xml and customPurchaseBundle.xsd files are available in the same directory in which the customPurchaseBundle XSD schema is stored.

    xjc path_of_XSD_file -p package_path -b bindings_file

    where:

    • path_of_XSD_file is the path to the customPurchaseBundle.xsd file.

    • package_path is the path to the Billing Care package.

    • bindings_file is the path to the jaxb_bindings.xml file.

    For example:

    xjc . -p com.oracle.communications.brm.cc.model -b jaxb_bindings.xml

    The customPurchaseBundle.java file is created in the directory in which the jaxb_bindings.xml and customPurchaseBundle.xsd files are stored.

  4. Create a Java class file by running the following command:

    javac java_file_Path -cp path to dataModel.jar

    where path to dataModel.jar is the path to the dataModel.jar available in Billing Care.

    For example:

    javac com\oracle\communications\brm\cc\model\* -cp ..\..\lib\dataModel.jar

    The CustomPurchaseBundle.class file is generated.

  5. Do one of the following:

    • If you already have a customized data model JAR file, add the CustomPurchaseBundle.class to that JAR file.

    • If the customized data model JAR is not available, create a customDataModel.jar by running the following command:

      jar -cf customDataModel.jar com\*
  6. Copy the customized data model jar file (for example,customDataModel.jar) to your Billing Care customization NetBeans IDE project myproject/web/lib directory where myproject is the project directory of your Billing Care customizations NetBeans IDE project.

Creating a Custom Purchase Deal Configuration View Model

Billing Care uses the PurchaseConfigurationViewModel and PurchaseViewModel to define the purchase configuration flow for the deal purchase. You must create these view models containing the override functions.

The PurchaseConfigurationViewModel contains the processBundlePurchasePayload() function, which captures the values entered in the custom fields in the Configure page and adds it to the accountModel as array. The PurchaseViewModel contains the purchaseBundle() function, which retrieves the data and calls the Custom REST Resource. The CustomAccountResource handles the custom REST call by accepting the customPurchaseBundle from the user interface.

See "About View Models" for more information about Billing Care view models.

The sample CustomPurchaseConfigurationViewModel.js and CustomPurchaseViewModel.js files are provided in the SDK_home/samples/PurchaseDealAndAssetsActionMenuCustomization/web/custom/viewmodels directory. These samples contain the necessary override functions to add custom fields for purchase deal configuration. Use these samples to create the custom purchase deal configuration view models.

To create the purchase deal configuration view models with the override functions:

  1. Create a CustomPurchaseConfigurationViewModel.js file in myproject/web/custom/viewModels directory, where myproject is the folder containing your NetBeans IDE project.

  2. Create a CustomPurchaseViewModel.js file in myproject/web/custom/viewModels directory.

  3. Save the files in your NetBeans IDE project.

Creating Custom Purchase Configure View Model HTML Templates

Billing Care uses an HTML view file to render the Configure screen in the purchase flow. You must create a custom purchase configuration view model HTML template to display any additional fields during new or additional deals purchase configuration. The template file contains the additional fields defined in the custom purchase configuration view model created in "Creating a Custom Purchase Deal Configuration View Model".

A sample purchaseConfigureAdditionalFieldsView.html file is provided in the SDK_home/samples/PurchaseDealAndAssetsActionMenuCustomization directory. This sample defines how to render additional attributes for the purchase configuration. Use this sample to create a custom purchase configuration HTML template for displaying the additional fields required for the deal purchase configuration.

To create a purchase configuration HTML template for rendering the additional fields you need to capture:

  1. Create a purchaseConfigureAdditionalFieldsView.html file in myproject/web/custom/templates directory.

  2. Define the new fields in HTML required for rendering in this file.

  3. Save the file in your NetBeans IDE project.

Customizing Assets Action Menu

The Billing Care SDK includes a sample custom assets action menu in the SDK_home/samples/PurchaseDealAndAssetsActionMenuCustomization directory. Use this sample to assist you in customizing the assets action menu to display the newly added custom fields for purchasing deals in Billing Care.

To customize the assets action menu:

  1. Create a custom asset view model to override the default assets action menu view. See "Creating a Custom Asset View Model" for more information.

  2. Create custom view model HTML templates for customizing the assets action menu. See "Creating Custom Asset View Model HTML Templates" for more information.

  3. Deploy your custom payment type projects to your application server. See "Deploying Customizations" for more information.

Creating a Custom Asset View Model

Billing Care uses AssetViewModel to define the assets action menu. You must create a custom asset view model containing the override editProductParams() function. The editProductParams() function renders links for each product in the assets card to edit the product details.

See "About View Models" for more information about Billing Care view models.

The sample CustomAssetViewModel.js is provided in the SDK_home/samples/PurchaseDealAndAssetsActionMenuCustomization/web/custom/viewmodels directory. This sample contains the necessary overrides for the default assets action menu. Use this sample to create the custom view models for retrieving and displaying the custom fields in the assets action menu.

To create the asset view model with the override functions:

  1. Create a CustomAssetViewModel.js file in myproject/web/custom/viewModels directory, where myproject is the folder containing your NetBeans IDE project.

  2. Save the file in your NetBeans IDE project.

Creating Custom Asset View Model HTML Templates

Billing Care uses an HTML view file to customize the assets action menu. You must create a custom asset view model HTML template to display any custom fields that you added for the deal purchase configuration. The template file contains the additional fields defined in the custom asset view model created in "Creating a Custom Asset View Model".

The sample editProductParametersView.html and customAssetsActionMenuOptions.html files are provided in the SDK_home/samples/PurchaseDealAndAssetsActionMenuCustomization directory. The editProductParametersView.html file defines how to render the additional attributes when the custom Change Product Parameters entry is selected from the assets action menu. The customAssetsActionMenuOptions.html file defines the assets action menu options to be displayed. Use these samples to create the custom asset view HTML templates for customizing the assets action menu.

In the sample customAssetsActionMenuOptions.html file, the custom menu entry to be displayed is added in the <!-- Custom Menu Entry for Assets Action Menu SDK : START --> section. In the sample editProductParametersView.html file, the product parameters for the custom menu are listed in the "<!-- Dialog Contents for the Product Parameters : Added for Assets Actions Menu SDK : START -->" section.

To create an asset view HTML template:

  1. Create a editProductParametersView.html file in myproject/web/custom/templates directory.

  2. Define the new fields in HTML required for rendering in this file.

  3. Save the file in your NetBeans IDE project.

  4. Create a customAssetsActionMenuOptions.html file in myproject/web/custom/templates directory.

  5. Define the new fields in HTML required for rendering in this file.

  6. Save the file in your NetBeans IDE project.

Deploying Customizations

Package and deploy your customizations using one of the methods described in "Using an Exploded Archive during Customization" or "Packaging and Deploying Customizations".