+

Search Tips   |   Advanced Search

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.

  1. In MobileFirst Studio, create an application.

    1. In the Project Explorer tab, right-click the project name.

    2. Click New > MobileFirst Hybrid Application. The Hybrid Application window opens.

    3. Enter the appropriate information into the fields in this window and click Finish. A standard application structure is created.

  2. In MobileFirst Studio, create and deploy an adapter.

    1. In the Project Explorer tab, right-click the project name.

    2. Click New > MobileFirst Adapter. The New MobileFirst Adapter window opens.

    3. Select the appropriate adapter type, enter an adapter name, and select the JSON Data available offline check box.

    4. Optional: To change the suggested procedure names, type over them.

    5. Click Finish. A standard adapter structure is created.

    6. Deploy the adapter.

  3. Retrieve a JSON object with the adapter:

    1. Right-click the adapter name.

    2. Click Run As > Invoke MobileFirst Procedure. The Edit Configuration window opens.

    3. Select the procedure used for retrieving JSON data and click Run. The JSON object that is returned by the procedure is displayed.

  4. Create a local JSONstore:

    1. In MobileFirst Studio, click File > New > MobileFirst JSONStore and select the project and app names. The Create JSON Collection wizard starts.

    2. Follow the instructions in the wizard to start the adapter, name the collection, and specify the searchable fields.

    3. 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.

  5. 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