17 Customizing Billing Care to Display Child Accounts

You can customize Oracle Communications Billing Care to display child accounts in the Organization Hierarchy screen of the parent account.

Topics in this document:

About Displaying Child Accounts

By default, Billing Care does not display the list of child accounts from the parent account.

However, you can customize Billing Care to display the list of child accounts in the Organization Hierarchy screen of the parent account by using the Billing Care SDK. This lets you view the list of child accounts and also navigate to the child accounts from the parent account.

You can view the list of child accounts by clicking the Show Children link in the Organization Hierarchy screen of the parent account.

Customizing Billing Care to Display Child Accounts

This section provides a high level overview of the process on how to customize Billing Care to display the list of child accounts in the Organization Hierarchy screen.

To customize Billing Care to display child accounts:

  1. Create a java class to retrieve the child accounts from Oracle Communications Billing and Revenue Management (BRM) and display them from the Organization Hierarchy screen of the parent account. See "Customizing the Organization Hierarchy Screen" for more information.

  2. Create custom view models to define the display of the Organization Hierarchy screen. See "Creating Custom View Models" for more information.

  3. Create custom view model HTML templates to display the link to the child accounts in the Organization Hierarchy screen of the parent account. See "Creating Custom View Model HTML Templates" for more information.

  4. Create a customRegistry.js file configuring Billing Care to use the custom view models created in step 2. See "Configuring a Custom Module in the Registry" for more information.

  5. Add the data model JAR file to your NetBeans IDE project. See "Adding the Data Model JAR File" for more information.

  6. Deploy your customization to your Billing Care domain. See "Deploying Customizations" for more information.

Customizing the Organization Hierarchy Screen

Customize the Organization Hierarchy screen by creating a custom resource class containing the logic to retrieve and display all the child accounts for a parent account.

To customize the Organization Hierarchy screen:

  1. Create a CustomHierarchyResource.java file in myproject/projectname/src/java/com/rest/sdk, where myproject is the folder containing your NetBeans IDE project, using the sample shown in Example 17-1.

    You can extend the REST framework to call BRM opcodes (for example, PCM_OP_SEARCH) to retrieve the child account details from BRM by using account numbers. See "Extending and Creating Billing Care REST Resources" for more information about extending the REST framework.

  2. Save the file in your NetBeans IDE project.

  3. Copy the file to com.oracle.communications.brm.cc.ws package (myproject/src/com/oracle/communications/brm/cc/ws).

Example 17-1 Sample CustomHierarchyResource.java Class

/** * Sample REST Web Service with basic examples.
*
*/
@Path("hierarchy")
public class CustomHierarchyResource {
    /**
     * sample rest API
     * @return String
     */
    @Path("/children/{id}")
    @GET
    @Produces({"application/xml", "application/json"})
    public String getChildAccountsInHierarchy(@PathParam("id") String id) {
        logger.entering("CustomHierarchyResource", "getChildAccountsInHierarchy");
        try {
//method implementation to fetch child accounts goes here. Refer to documentation for more details.
            System.out.println("Custom Hierarchy Resource "+id);
        } catch (ApplicationException e) {
            ExceptionHelper.handleException(e);
        }
        logger.exiting("CustomHierarchyResource",
 "getChildAccountsInHierarchy");
        return id;
    }
}

Creating Custom View Models

Billing Care uses view model to define the display of the Organization Hierarchy screen. You must create the custom view models, CustomOrganizationHierarchyViewModel and ShowAllChildrenOverlayViewModel, containing overrides for the default Organization Hierarchy screen. See "About View Models" for more information about Billing Care view models.

The sample customOrganization HierarchyViewModel.js and showAllChildrenOverlayViewModel.js files are provided in the SDK_home/samples/web/custom/js/viewmodel directory. Use the samples to create the custom view models for displaying child accounts.

To create custom view models:

  1. Create the customOrganization HierarchyViewModel.js and showAllChildrenOverlayViewModel.js files in the myproject/web/custom/js/viewmodels/area/configure directory, where area is the customization type.

  2. Save the files in your NetBeans IDE project.

Creating Custom View Model HTML Templates

Billing Care uses the HTML view files to customize the Organization Hierarchy screen view. You must create view model HTML templates to display the Show Children link. The template files contain the additional fields defined in the customOrganizationHierarchyViewModel.js and showAllChildrenOverlayViewModel.js created in "Creating Custom View Models".

The sample customOrganizationHierarchyView.html and showAllChildrenOverlayView.html files are provided in the SDK_home/samples/web/custom/js/templates/ directory. Use these samples to create the HTML templates for customizing the Organization Hierarchy screen.

To create custom view model HTML templates:

  1. Create customOrganizationHierarchyView.html and showAllChildrenOverlayView.html files in the myproject/web/custom/js/templates/area/configure directory.

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

  3. Save the file in your NetBeans IDE project.

Configuring a Custom Module in the Registry

Create a custom organization hierarchy module entry in your customRegistry.js file for displaying child accounts from the parent account. Billing Care uses the custom module instead of the default entry and renders the Organization Hierarchy screen containing your custom fields. See "About the Registry File" for more information.

To create a custom module entry in the registry:

  1. Create a customRegistry.js file in myproject/web/custom/.

  2. Define the custom organization hierarchy module in this file. Example 17-2 shows a definition of the custom organization hierarchy module in the registry using the SDK samples.

  3. Save the file in your NetBeans IDE project.

Example 17-2 Sample Custom Organization Hierarchy Registry Entry

var CustomRegistry = {
    
    organizationHierarchy: {
        view: 'text!templates/customOrganizationHierarchyView.html',
        viewmodel: 'viewmodel/CustomOrganizationHierarchyViewModel',
        removeFromHierarchyOverlayView:
 'text!templates/organizationHierarchy/overlays/removeFromHierarchyOverlayView.html',
        removeFromHierarchyOverlayViewModel: 'overlayviewmodels/organizationHierarchy/RemoveFromHierarchyOverlayViewModel',
        showAllChildrenOverlayView:
 'text!templates/showAllChildrenOverlayView.html',
        showAllChildrenOverlayViewModel:
 'viewmodel/ShowAllChildrenOverlayViewModel'
    }};

Adding the Data Model JAR File

To add the data model JAR file to your NetBeans IDE project, copy the extensionDataModel.jar from SDK_home/libs to your Billing Care customization NetBeans IDE project (myproject/web/lib).

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