JSONStore wizard (JavaScript only)
The MobileFirst JSONStore wizard can help you create a template JavaScript file based on search fields that are selected from the backend that you provide. Using the wizard is optional.
- In MobileFirst Studio, create an application.
- In the Project Explorer tab, right-click the project name.
- Click New > MobileFirst Hybrid Application. The Hybrid Application window opens.
- Enter the appropriate information into the fields in this window and click Finish. A standard application structure is created.
- In MobileFirst Studio, create and deploy an adapter.
- In the Project Explorer tab, right-click the project name.
- Click New > MobileFirst Adapter. The New MobileFirst Adapter window opens.
- Select the appropriate adapter type, enter an adapter name, and select the JSON Data available offline check box.
- Optional: To change the suggested procedure names, type over them.
- Click Finish. A standard adapter structure is created.
- Deploy the adapter.
- Retrieve a JSON object with the adapter:
- Right-click the adapter name.
- Click Run As > Invoke MobileFirst Procedure. The Edit Configuration window opens.
- Select the procedure used for retrieving JSON data and click Run. The JSON object that is returned by the procedure is displayed.
- Create a local JSONstore:
- In MobileFirst Studio, click File > New > MobileFirst JSONStore and select the project and app names. The Create JSON Collection wizard starts.
- Follow the instructions in the wizard to start the adapter, name the collection, and specify the searchable fields.
- Optional: To encrypt collections for an application, select the Encrypt collections check box in the wizard. The wizard creates a JavaScript file named collection_nameCollection.js in the application's common/js directory, where collection_name is the name you specified in the wizard.
- Review the collection_nameCollection.js file and include its content manually in the application's .js file.
The input data for the JSONStore wizard must be encoded with UTF-8. Other data encoding is not supported.
Parent topic: JSONStore advanced topics