Use the JavaScript API Generation wizard to generate API files for a
Hybrid App that uses an MBO as a data source.
Prerequisites
Whether you develop your Hybrid Apps using
third-party tools or manually, you can use the JavaScript API to access the
Mobile SDK
container
features:
- If your Hybrid App's data source is an MBO, you can use the
JavaScript API Generation wizard to generate a library of functions that use the
API,
and that your Hybrid App references.
- A project in your Sybase Unwired WorkSpace must contain the MBOs that
you want to use in your application.
- Create any UI-related resources (for example, HTML, CSS, and
JavaScript files) needed for functionality that the JavaScript API Generation
wizard does not provide.
- If your Hybrid App does not use MBOs, you cannot use the JavaScript
API Generation wizard, but you can still reference the JavaScript API in your
application code.
To understand the overall process and how the JavaScript API generates
code, read Generating JavaScript MBO Access API
in Developer Guide:
Hybrid Apps.
- In WorkSpace Navigator, right-click the project and choose
Generate Hybrid App API.
- Choose one or more MBOs to include in your application.
The
Dependencies
box shows relationships detected between the MBOs you select.
- Specify the location using one of these options:
- Generate into the
project
The files are generated in a project
subfolder, Generated Hybrid
App\APIs.
- Generate to an external
folder
Specify a folder anywhere in your file
system.
- Optionally, if your
Hybrid App is server initiated, click
Next to define a notification for the object query.
- In the Server-initiated Notification Configuration page, specify an object
query to configure, and its associated MBO.
- If the query has input parameters, click Add to define
one or more message transformation rules.
Each rule extracts a parameter value from a field in the notification. For
more information, see Notification Extraction
Rules
- Click Finish.
Next
The wizard copies core API files from your installation to the
generation folder you specify, and generates
WorkflowClient.xml and
HybridApp.js,
which has the JavaScript functions for accessing the MBO operations and object queries. You
can examine these files for detailed information about the API, and you can tailor them for
your application.
The wizard does not deploy the application. To help
you deploy it, Sybase Unwired Platform includes a packaging tool that automates much of the
work. See
Packaging Hybrid Apps
Using the Packaging Tool
in Developer Guide:
Hybrid Apps for information
about completing and deploying your application.