Creating XSQL Servlet Clients for Business Components

You can create XML based clients for business components using XSQL servlet. XSQL servlet allows you to easily get data in and out of the database in XML format. The following procedure shows how to bind an XSQL client to a business components project you have already created, using the ViewObject Show tag to display the view object's data in XML format. You could also use the ViewObject Update tag to process inserts, updates, and deletes to a view object.

Note: To use XSQL pages with the Business Components XSQL action handlers, the XSQL Runtime and the JBO HTML libraries need to be in your project's classpath, in addition to any JBO libraries that are needed based on your intended connection mode. JDeveloper includes them in the classpath automatically.

To create an XSQL servlet client for business components:

  1. Create a new project in the workspace that contains the business components project by selecting the workspace in the Navigator and choosing File | New to open the New Gallery.
  2. In the Categories tree, expand General and select Projects.
  3. In the Items list, double-click Empty Project to open the New Project dialog.
  4. Complete the New Project dialog and click OK to add the empty project to your workspace
  5. Select the new project in the Navigator and choose File | New.
  6. In the Categories list, select General and select XML.
  7. In the Items list, double-click XSQL Page.

    This adds a skeleton XSQL file named untitled#.xsql to your project.

  8. In the Navigator, right-click the new XSQL file, and choose XML Editor to open the source file if it is not open.
  9. Place your cursor in the blank line after the <page xmlns:xsql="urn:oracle-xsql"> tag.
  10. Choose View | Component Palette to open the Palette if it is not displayed.
  11. Select XSQL tags from the dropdown list in the Palette if it is not displayed.
  12. Select the ViewObject Show tag from the Palette.

    The ViewObject Show tag shows the view object's data in XML format. The ViewObject Update processes inserts, updates, and deletes to a view object based on an optionally transformed XML document.

  13. In the View Object Selection dialog, select the appropriate view object, then click Next.
  14. Change or accept the default values for the attributes. Press F1 or click Help in the dialog to get help on the tag and its attributes. After entering attributes, click Next.
  15. Click Finish.

    Notice that the tag and attributes you entered appear in the XSQL page.

  16. Choose File | Save All to save all your work thus far.
  17. Right-click the XSQL file in the Navigator, and choose Run filename.xsql to view the raw XML data in your web browser.

You can format the XML data with a style sheet. The XML data also can be passed on to another application through a messaging service.

Note: Please refer to the section titled "Caveats while Querying View Objects with Circular ViewLink Accessors" in the ViewObject Show help topic if you get the XSQL error JBO-27122.


Creating a New Business Component Project
Creating XSQL Servlet Clients that Access the Database
Formatting XML Data with a Style Sheet