14.9.3 Configuring ORDS Handlers for 26ai API

Set up ORDS handlers to call an alternate API that uses 26ai JSON type and a duality view.

The v2 module has the same template and handlers as the v1 module. However, its handlers use 26ai JSON type and Duality Views to simplify the implementation. The diagram shows the module, its templates, and their handlers using the segment of the REST API URL they contribute. The v2 module has an /actionitems template with GET and POST handlers. Its /actionitems/:id template has GET, PUT, and DELETE handlers.

Figure 14-28 ORDS "v2" Module for Action Items API Using JSON Relational Duality View



Similar to the v1 module handlers, each v2 handler shown below calls the indicated procedure in the ACTION_ITEMS_DV_API_REST package:
  • GET /v2/actionitemsget_objects
  • GET /v2/actionitems/:idget_object
  • POST /v2/actionitemsinsert_object
  • PUT /v2/actionitems/:idupdate_object
  • DELETE /v2/actionitems/:iddelete_object

Figure 14-29 Each ORDS Handler Call an ACTION_ITEMS_API_REST Procedure



The ACTION_ITEMS_DV_API_REST accepts the CLOB JSON payload and constructs a JSON type to pass to the main ACTION_ITEMS_DV_API package. The diagram below shows the similar package layering the v1 module uses.

The figure illustrates a package dependency diagram showing:
  • ACTION_ITEMS_DV_API_REST uses
    • ACTION_ITEMS_API for logic
    • APP_COMMON_REST as a REST services helper
  • ACTION_ITEMS_DV_API uses
    • ACTION_ITEMS_COMMON for validation
    • APP_COMMON for error handling
  • ACTION_ITEMS_COMMON also uses APP_COMMON for error handling
In addition, the diagram shows that the Action Items edit page uses the same packages:
  • ACTION_ITEMS_COMMON for validation
  • APP_COMMON for error handling

Figure 14-30 Layered Package Design for Sharing Business Logic with a Page