7.8 Managing Resource Handlers

A resource handler is a query or an anonymous PL/SQL block responsible for handling a particular HTTP method.

Multiple resource handlers can be defined for a resource template, however only one resource handler can be defined for a HTTP method.

Parameters to a resource handler can be manually defined to bind HTTP headers to the resource handler, or to cast a URI template parameter to a specific data type. Parameters declared in the URI template are implicitly passed to the resource handler. For example, a resource handler might need to know the value of the HTTP Accept-Language header in order to localize the generated representation.

7.8.1 Adding a Resource Handler

Learn how to add a resource handler to a resource template.

To add a resource handler to a resource template:

  1. On the Workspace home page, click SQL Workshop and then RESTful Services.

    The RESTful Services home page appears.

  2. Click ORDS Based RESTful Services.

    The ORDS RESTful services page appears.

  3. Click the ORDS RESTful Service template you want to add the resource template to.

    The ORDS Template Definition page appears.

  4. Under Resource Handlers on the right pane, click Create Handler.

    The ORDS Handler Definition page appears.

  5. Fill in the appropriate fields and select the appropriate options. Mandatory fields are marked with a red asterisk (*). To learn more about a specific option, see the field-level help.
  6. Under Resource Handler, specify the following:
    • Method - Specify the HTTP method to be used for the resource handler. See field-level help.

    • Source Type - Identify the strategy type used to generate the resource. See field-level help.

    • Format - Select the format to utilize for the result set.

    • Pagination Size - Identify the size of the pagination window. For database queries, this is the number of rows to return.

  7. Under Source, enter the SQL query or PL/SQL block responsible for handling the selected HTTP method.
  8. Click Create Handler.

7.8.2 Editing a Resource Handler

Learn how to edit a resource handler.

To edit a resource handler:

  1. On the Workspace home page, click SQL Workshop and then RESTful Services.

    The RESTful Services home page appears.

  2. Click ORDS Based RESTful Services.

    The ORDS RESTful services page appears.

  3. Click the ORDS RESTful Service Handler you want to edit.

    The ORDS Handler Definition page appears.

  4. Make the changes you want.
  5. Click Apply Changes.

7.8.3 Deleting a Resource Handler

Learn how to delete a resource handler.

To delete a resource handler:

  1. On the Workspace home page, click SQL Workshop and then RESTful Services.

    The RESTful Services home page appears.

  2. Click ORDS Based RESTful Services.

    The ORDS RESTful services page appears.

  3. Click the ORDS RESTful Service Handler you want to delete.

    The ORDS Handler Definition page appears.

  4. Make the changes you want.
  5. Click Delete.
  6. Click OK to confirm.
  7. Click Apply Changes.