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
v1 module handlers, each v2 handler
shown below calls the indicated procedure in the
ACTION_ITEMS_DV_API_REST package:
GET/v2/actionitems→get_objectsGET/v2/actionitems/:id→get_objectPOST/v2/actionitems→insert_objectPUT/v2/actionitems/:id→update_objectDELETE/v2/actionitems/:id→delete_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.
ACTION_ITEMS_DV_API_RESTusesACTION_ITEMS_APIfor logicAPP_COMMON_RESTas a REST services helper
ACTION_ITEMS_DV_APIusesACTION_ITEMS_COMMONfor validationAPP_COMMONfor error handling
ACTION_ITEMS_COMMONalso usesAPP_COMMONfor error handling
ACTION_ITEMS_COMMONfor validationAPP_COMMONfor error handling
Figure 14-30 Layered Package Design for Sharing Business Logic with a Page
Parent topic: Simplifying REST APIs in Oracle 26ai


