17 Customizing Billing Care to Display Child Accounts

Learn how to 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 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.

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

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

/** 
* Custom hierarchy resource
*
*/
@Path("hierarchy")
public class CustomHierarchyResource {
    /**
     * sample rest API to retrieve child accounts 
     * refer to the documentation for more details.
     * @return String
     */
     private static CCLogger logger =
    CCLogger.getCCLogger(CustomHierarchyResource.class);
    @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");
        ChildrenAccount obj = new ChildrenAccount(id,"Dummy Account");
        return obj;
    }
}

Creating Custom View Models

Billing Care uses view model to define the display of the Organization Hierarchy screen. You must create the custom view model CustomOrganizationHierarchyViewModel 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 file is provided in the SDK_home/samples/DisplayChildAccountsInHierarchy/web/js/viewmodel directory. Use the samples to create the custom view models for displaying child accounts.

To create custom view models:

  1. Create the customOrganizationHierarchyViewModel.js file 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.

The view model customOrganizationHierarchyViewModel.js adds the required HTML from the JS side and applies binding to the same for Show All Children button.

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: {
        viewmodel: 'viewmodel/CustomOrganizationHierarchyViewModel',
        removeFromHierarchyOverlayView:
 'text!templates/organizationHierarchy/overlays/removeFromHierarchyOverlayView.html',
        removeFromHierarchyOverlayViewModel: 'overlayviewmodels/organizationHierarchy/RemoveFromHierarchyOverlayViewModel',
    }
};

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