georgeeapen
Hi All,
I am trying to create an example of DynaMetapush table.I read the docs of web client but couldn't get these info.
1]How can i define a key item for the table?
i tried the code var schema = ["key", "command", "secId"];
var table = new DynaMetapushTable("LS_activity", schema, "COMMAND");
But how can i include the rest of the normal fields.
2]In the data adapter(java) how do i call update function?
listener.update("LS_activity", data, false);
but the above code is giving the exception ---Missing mandatory parameter in command event.
3]Is the ADD/UPDATE automatically handled by the engine based on the key?
It would be really helpful if anyone could show me some code excerpts for the above questions.Is there any tutorials to get some info about defining DataAdaptor/MetaAdaptor and tables like Dynametapush etc..?.
Regards,
George Eapen
Dario Crivelli
Sorry for not answering to your three points directly. Please reformulate trailing questions after the following information.
The COMMAND mode, with the special meaning of the "key" and "command" fields, is supported by the web client library through the DynaMetapush tables and by the Server, but there is no facility on the Data Adapter side.
This means that your Data Adapter, upon a subscription to an item to be managed in COMMAND mode, is fully responsible of producing an update flow that is compliant with the COMMAND mode conventions.
Hence, each update must include a value for the "key" field and a value for the "command" field and the latter must be valued as "ADD", "UPDATE" or "DELETE" in a way consistent with the corresponding key lifecycle. Referring to your example, those values must be included in the "data" map.
In Lightstreamer distribution, we demonstrate COMMAND mode in the "Basic Portfolio Demo", while in the "Portfolio Demo" we show an advanced use of the COMMAND mode, related to the MultiDynaMetapush table.
Both demos get COMMAND mode data from the preinstalled "PORTFOLIO_ADAPTER" Data Adapter. The source code for this Adapter is reported under
DOCS-SDKs\sdk_adapter_java\examples\Portfolio_Adapters