Managing Resource Templates

Resource templates are a means of grouping URIs and associating them with a particular RESTful Service Module. Resource templates can have one or more resource handlers. Only one resource handler per HTTP method is permitted. For example, a resource template can have only one GET method, only one DELETE method and so on.

Topics:

Adding a Resource Template

To add a resource template to a RESTful Service Module:

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

    The RESTful Services home page appears.

  2. Click the RESTful Service for which you want to create a resource template.

  3. On the RESTful Service tree, click Create Template.

    The resource template settings appear on the right panel.

  4. 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 item Help for that option.

  5. Specify the following:

    • URI Template - Enter the URI template to identify your Uniform Resource Identifiers. A URI template is simple syntax for describing URIs, for example:

      example/{id}
      
    • Priority - Specify the template's evaluation order. Higher numbers are evaluated first.

    • Entity Tag - Specify how the ETag HTTP Header for the resource is generated. See item Help for further details.

    • Entity Tag Query - Specify the SQL SELECT statement that returns one column and one row that is to be used to generate a custom entity tag. This option is only visible when the user selects Query for the Entity Tag.

  6. Click Create.

Editing a Resource Template

To edit a resource template:

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

    The RESTful Services home page appears.

  2. Click the name of the module the resource template you want to edit belongs to.

    The RESTful Service Module page appears.

  3. On the RESTful Service tree, click the resource template you want to edit.

    The selected resource template is highlighted on the RESTful Service tree and the corresponding resource template settings appear on the right panel.

  4. Make the changes you want. See "Adding a Resource Template" for further details.

  5. Click Apply Changes.

Deleting a Resource Template

Deleting a resource template removes the template along with all resource handlers associated with this template.

To delete a resource template:

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

    The RESTful Services home page appears.

  2. Click the name of the module you want to update.

    The RESTful Service Module page appears.

  3. On the RESTful Service tree, click the resource template you want to delete.

    The resource template settings appear on the right panel.

  4. Click Delete.

  5. Click OK to confirm.

    The RESTful Service Module appears.