Reputation: 240
I'm following the document: 05_10_JSONStore_-_Synchronizing_client_and_server_databases.pdf
My adapter retrieves data from an SQL table.
It isn't clear if I need to call the WL.Client.invokeProcedure()
and where the success/failure callbacks are.
Upvotes: 1
Views: 1440
Reputation: 5111
I recommend reading the latest Getting Started Modules for JSONStore here. Specifically:
JSONStore - Common JSONStore Usage - See adapter Integration on page 26.
Download the source code here and take a look at the files under the adapter
folder, and the HTML+JS files that are part of the Hybrid Application.
Implementing adapter code is beyond the scope of the JSONStore module, but there are adapter specific modules: Adapter framework overview and SQL Adapters.
There is also documentation on IBM InfoCenter for all the methods: init, load, push and a section on adapter integration.
it isn't clear if i need to call or where the WL.Client.invokeProcedure() and the success/failure callback.
Going back to your question. You can manually call getPushRequired and then invokeProcedure to send changes to the adapter or you can use push and calling the adapter will be done for you. Similarly, you can call load to get data from the adapter, or manually call invokeProcedure and then add to put changes into JSONStore. If you manually call the add method, there's a flag {push: false}
that will tell JSONStore not to mark the document as "needs to be pushed to the server". If you intend to use the load or push method, you must link the adapter to a collection when you call the init method.
Upvotes: 3