31 Searching for Accounts by Payment ID

Learn how to customize the Oracle Communications Billing Care account search screen to support searches by Payment ID.

Topics in this document:

About Account Searches in Billing Care

The Billing Care account search screen includes multiple fields on which searches can be performed. For example, you can search for accounts by entering account numbers, last names, or addresses in designated fields on the screen. The default account search screen does not, however, support searches by payment ID.

Adding a Payment ID Field to the Account Search Screen

To enable users to search for accounts by payment ID, you can add a Payment ID field to the account search screen.

To add a Payment ID field to the Billing Care account search screen:

  1. Specify the name of the custom account search template in the CustomConfigurations.xml file. See "Naming the Custom Account Search Template in the CustomConfigurations.xml File".

  2. Create the custom account search template containing the payment ID search criteria. See "Creating a Custom Account Search Template".

  3. Create a custom account search view model to override the default Billing Care account search behavior. See "Creating a Custom Account Search View Model".

  4. Create a custom search view model to display the related payment details when an account is opened from the results of a search based on payment ID. See "Creating a Custom Search View Model".

  5. Create a custom router view model to accept a query parameter and route to a custom router helper function when users search for an account by payment ID. See "Creating a Custom Router View Model".

  6. Create a custom router helper to add a function that displays the related payment details when an account is opened from the results of a search based on payment ID. See "Creating a Custom Router Helper".

  7. Create the account search view model HTML template to display the new Payment ID search field. See "Creating a Custom Account Search View Model HTML Template".

  8. Replace the default method for listing the most recently opened account in the account search screen. See "Replacing the Default Method for Showing Recently Opened Accounts".

  9. Create a customRegistry.js file configuring Billing Care to use the custom account search view model created in step 3. See "Configuring a Custom Module in the Registry".

  10. Create a customized_en.xlf file containing a localizable value for the new Payment ID search field in the Billing Care account search screen. See "Creating a customized_en.xlf File Entry for Payment ID Search Field".

  11. Configure Billing Care to get the appropriate payment item Portal object ID (POID) from BRM when users search for an account by payment ID. See "Getting Payment Item POIDs from BRM".

Naming the Custom Account Search Template in the CustomConfigurations.xml File

Before creating a custom search template to search for accounts by payment ID, you must specify the template's name in the custom Billing Care configuration file.

To name the custom account search template in the CustomConfigurations.xml file:

  1. If your system does not have a CustomConfigurations.xml file, create the file. See "Creating a Custom Configuration File".

  2. Open the CustomConfigurations.xml file in an editor.

    Note:

    By default, the CustomConfigurations.xml file is in the myproject/web/custom/configurations/ directory, where myproject is your NetBeans IDE Billing Care customizations project.

  3. In the file's search.options key, specify a name for your custom account search template.

    Example 31-1 shows the search.options key with My Custom Search specified as the search template name:

  4. Set the default search option using the defaultSearch attribute.

  5. Save the file in your NetBeans IDE project.

Example 31-1 CustomConfigurations.xml search.options Key with "My Custom Search" as Search Template Name

 [{"searchTemplateKey": "accountSearch", "searchTemplateName":"SEARCH_OPTION_ACCOUNTS", "defaultSearch": false},{"searchTemplateKey": "CustomAccountSearch", "searchTemplateName":"My Custom Search", "defaultSearch": true}]

Creating a Custom Account Search Template

The Billing Care account search screen uses a template that defines what search fields to display. To add the Payment ID field in the account search screen, you must create a custom account search template containing the Payment ID field in the filter element in your NetBeans IDE project.

For more information on customizing templates, see "Customizing Billing Care Templates".

When creating your custom account search template, use the reference accountSearch.xml template file located in the SDK_home/references directory.

To create an account search template with the Payment ID field:

  1. Create a custom account search template file for the account search screen by using the reference example in myproject/src/custom.

    Use a descriptive name for your file such as CustomAccountSearch.xml.

  2. Define the Payment ID criteria in the filter element.

    Example 31-2 shows the code to add for the Payment ID filter.

  3. Add a column in the CustomAccountSearch.xml file to store payment item POIDs, which are used to open the appropriate payment details overlay for accounts returned by searches based on payment IDs.

    Example 31-3 shows the code to add for the payment item POID column.

  4. Save the file in your NetBeans IDE project.

Example 31-2 Payment ID Filter

  <criteria name="paymentID">
      <label></label>
      <inputType>Text</inputType>
      <width>245</width>
      <placeHolder>PAYMENTID</placeHolder>
      <fieldKey>payment.transId</fieldKey>
      <storableClass>eventBillingPayment</storableClass>
      <visible>true</visible> 

Example 31-3 Payment Item POID Column

   <column name="eventId">
      <type>text</type>
      <fields>itemObj</fields>
   </column>
   <columnHeader name="eventId">
      <label>EVENT_ID_UC</label>
      <width>15%</width>
      <visible>true</visible>
      <sortable>false</sortable>
      <tooltip>EVENT_ID_UC</tooltip>
      <resizable>false</resizable>
      <alignment>left</alignment>
   </column>

Creating a Custom Account Search View Model

Billing Care uses an account search view model to define account search behavior.

Create a custom account search view model containing the Payment ID search filter by using the sample customAccountSearch.js file. This sample contains the override functions to add payment ID criteria to the custom account search template.

To create a custom account search view model:

  1. Copy the SDK_home/samples/AccountSearchCustomization/web/custom/js/viewmodels/search/customAccountSearch.js file to the myproject/web/custom/js/viewmodels/area/configure directory.

    where area is the customization type (for example, accountSearch for customizations done to account search view model files).

  2. Include the customAccountSearch.js file when you package your customizations shared library for deployment to your Billing Care domain.

    For more information, see "Packaging and Deploying Customizations".

Creating a Custom Search View Model

Billing Care uses a search view model to open an account from the results of an account search.

Create a custom search view model to support searches based on payment IDs by using the sample customSearchViewModel.js file in the Billing Care SDK. This sample contains code that displays the payment details overlay when an account is opened from the results of a search based on a payment ID.

To create a custom search view model:

  1. Copy the SDK_home/samples/AccountSearchCustomization/web/custom/js/viewmodels/customSearchViewModel.js file to the myproject/web/custom/js/viewmodels/area/configure directory.

  2. Include the customSearchViewModel.js file when you package your customizations shared library for deployment to your Billing Care domain.

    For more information, see "Packaging and Deploying Customizations".

Creating a Custom Router View Model

Billing Care uses a router view model to route patterns to a function.

Create a custom router view model to support searches based on payment IDs by using the sample customRouterViewModel.js file in the Billing Care SDK. This sample contains code that overrides the default open account router URL to accept a payment item POID as a query parameter when an account search is based on a payment ID.

To create a custom router view model:

  1. Copy the SDK_home/samples/AccountSearchCustomization/web/custom/js/viewmodels/customRouterViewModel.js file to the myproject/web/custom/js/viewmodels/area/configure directory.

  2. Include the customRouterViewModel.js file when you package your customizations shared library for deployment to your Billing Care domain.

    For more information, see "Packaging and Deploying Customizations".

Creating a Custom Router Helper

In Billing Care, a router helper routes the router view model request to a function that opens an account.

Create a custom router helper to support searches based on payment IDs by using the sample customRouterHelper.js file in the Billing Care SDK. This sample contains code that routes the router view model request to a function that displays the related payment details when an account is opened from the results of a search based on payment ID.

To create a custom router helper:

  1. Copy the SDK_home/samples/AccountSearchCustomization/web/custom/js/routers/customRouterHelper.js file to the myproject/web/custom/js/viewmodels/area/configure directory.

  2. Include the customRouterHelper.js file when you package your customizations shared library for deployment to your Billing Care domain.

    For more information, see "Packaging and Deploying Customizations".

Creating a Custom Account Search View Model HTML Template

Billing Care uses an HTML view file to render the account search screen during. You must create a custom account search view model HTML template to display the Payment ID search field.

A sample customAccountSearch.html file is provided in the SDK_home/samples/AccountSearchCustomization/web/custom/templates/search directory. Use this sample to create a custom account search HTML template for displaying the Payment ID search field and the required data binding.

To create a custom account search HTML template for rendering the Payment ID field:

  1. Create a customAccountSearch.html file in the myproject/web/custom/js/templates/area/configure directory.

  2. Define the Payment ID field in HTML required for rendering in this file.

  3. Save the file in your NetBeans IDE project.

Replacing the Default Method for Showing Recently Opened Accounts

When you open an account from the default search results and then return to the search screen, the recently opened account is listed at the bottom of the screen.

To continue listing the most recently opened account after customizing the account search template, replace the RecentRecordsModel.js file in your NetBeans IDE Billing Care customizations project with the sample customRecentRecordsModel.js file. This sample contains an updated method that supports the recently opened account feature in the custom account search flow.

To replace the default method for showing recently opened accounts:

  1. Copy the SDK_home/samples/AccountSearchCustomization/web/custom/js/viewmodels/customRecentRecordsModel.js file to the myproject/web/custom/js/viewmodels/area/configure directory.

  2. Include the customRecentRecordsModel.js file when you package your customizations shared library for deployment to your Billing Care domain.

    For more information, see "Packaging and Deploying Customizations".

Configuring a Custom Module in the Registry

After creating the required custom account search view model, create a custom module entry in the customRegistry.js file to use when searching for accounts. Billing Care uses the custom account search module instead of the default entry when rendering the account search screen.

A sample registry.js file is provided in the SDK_home/references directory, where SDK_home is the directory in which you installed the Billing Care SDK. Use this sample to create the customRegistry.js file containing your custom account search module.

To create a custom account search module entry in a customRegistry.js file:

  1. Create a customRegistry.js file in myproject/web/custom by copying the reference registry file.

  2. Define the custom account search module referencing the custom view model and HTML template previously created.

    Example 31-4 shows a definition of the custom account creation module in the registry.

  3. Save the file in your NetBeans IDE project.

Example 31-4 Sample Custom Account Search Module Registry Entry

var CustomRegistry = {
  customAccountSearch: {
    view : 'text!../custom/templates/search/customAccountSearch.html',
    viewmodel: '../custom/js/viewmodels/search/customAccountSearch'
  }
   search: { 
    viewmodel: '../custom/js/viewmodels/customSearchViewModel'
  }
   router: { 
    viewmodel: '../custom/js/viewmodels/customRouterViewModel'
  }
   recentRecords: { 
    recentRecordsModel: '../../../custom/js/viewmodels/customRecentRecordsModel'
  }
};

Creating a customized_en.xlf File Entry for Payment ID Search Field

You must provide a localized English entry for the Payment ID search field in the customized_en.xlf file to provide a translatable text string in Billing Care.

For more information on the customized_en.xlf file and how to add a new entry, see "Customizing Billing Care Labels".

Example 31-5 shows a sample entry for the Payment ID field to add in the customized_en.xlf file.

Example 31-5 Sample Payment ID XLF Entry

<trans-unit id="PAYMENT_ID_UC" translate="yes">
        <source>Payment ID</source>
             <target>Payment ID</target>
                   <note from="dev">
                        Comments for file
                   </note>
</trans-unit>

Getting Payment Item POIDs from BRM

When users search for an account by payment ID, Billing Care must get the payment item POID so that it can display the appropriate payment details when the account is opened.

To configure Billing Care to get payment item POIDs from BRM:

  1. Add a customModule.properties file containing the following entry to the myproject/web/WEB-INF/classes/custom directory:

    billingcare.rest.template.module = rest.CustomPCMTemplateModule

    This entry instructs Billing Care to load the CustomPCMTemplateModule class instead of the default PCMTemplateModule class.

    The SDK_home/samples/AccountSearchCustomization/src/java/custom/customModule.properties sample file contains this entry, where SDK_home is the directory in which you installed the Billing Care SDK.

    For more information about the custom module properties file, see "About the customModule.properties File".

  2. Create a custom PCMTemplateModule Java class named CustomPCMTemplateModule and override its getRecordsForTemplate() method to return the TemplateMyCustomAccountSearchWorker Java class instead of the default TemplateAccountSearchWorker Java class.

    For a sample of the required override code, see the SDK_home/samples/AccountSearchCustomization/src/java/rest/CustomPCMTemplateModule.java sample class.

    Note:

    Save the custom class in the rest folder containing the sample class.

    For more information, see "Customizing Billing Care Templates".

  3. Create a custom template worker Java class named TemplateMyCustomAccountSearchWorker that gets the corresponding payment item POID from BRM when users search for accounts by payment ID.

    For a sample of the required override code, see the SDK_home/samples/AccountSearchCustomization/src/java/rest/TemplateMyCustomAccountSearchWorker.java sample class.

    Note:

    Save the custom class in the rest folder containing the sample class.

    For more information, see "Customizing Billing Care Templates".

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".