datacontrol api this specification defines a datacontrol api for applications the datacontrol functionality provides a way to access specific data that is exported by other applications please read the data control guide to know how to share own application data with other applications since 2 4 summary of interfaces and methods interface method interface method datacontrolmanagerobject datacontrolmanager datacontrolconsumerobject getdatacontrolconsumer domstring providerid, domstring dataid, datatype type datacontrolconsumerobject long addchangelistener datacontrolchangecallback datachangecallback, optional errorcallback? errorcallback void removechangelistener long watchid sqldatacontrolconsumer void insert unsigned long reqid, rowdata insertiondata, optional datacontrolinsertsuccesscallback? successcallback, optional datacontrolerrorcallback? errorcallback void update unsigned long reqid, rowdata updatedata, domstring where, optional datacontrolsuccesscallback? successcallback, optional datacontrolerrorcallback? errorcallback void remove unsigned long reqid, domstring where, optional datacontrolsuccesscallback? successcallback, optional datacontrolerrorcallback? errorcallback void select unsigned long reqid, domstring[] columns, domstring where, datacontrolselectsuccesscallback successcallback, optional datacontrolerrorcallback? errorcallback, optional unsigned long? page, optional unsigned long? maxnumberperpage, optional domstring? order mappeddatacontrolconsumer void addvalue unsigned long reqid, domstring key, domstring value, optional datacontrolsuccesscallback? successcallback, optional datacontrolerrorcallback? errorcallback void removevalue unsigned long reqid, domstring key, domstring value, datacontrolsuccesscallback successcallback, optional datacontrolerrorcallback? errorcallback void getvalue unsigned long reqid, domstring key, datacontrolgetvaluesuccesscallback successcallback, optional datacontrolerrorcallback? errorcallback void updatevalue unsigned long reqid, domstring key, domstring oldvalue, domstring newvalue, datacontrolsuccesscallback successcallback, optional datacontrolerrorcallback? errorcallback datacontrolsuccesscallback void onsuccess unsigned long reqid datacontrolerrorcallback void onerror unsigned long reqid, webapierror error datacontrolinsertsuccesscallback void onsuccess unsigned long reqid, long insertrowid datacontrolselectsuccesscallback void onsuccess rowdata[] rows, unsigned long reqid datacontrolgetvaluesuccesscallback void onsuccess domstring[] values, unsigned long reqid datacontrolchangecallback void onsuccess eventtype type, rowdata data rowdata 1 type definitions 1 1 datatype data types enum datatype { "map", "sql"}; since 2 4 1 2 eventtype specifies the data change event types the possible values are enum eventtype { "sql_update", "sql_insert", "sql_delete", "map_set", "map_add", "map_remove"}; since 4 0 sql_update - sql update event sql_insert - sql insert event sql_delete - sql delete event map_set - map update event map_add - map add event map_remove - map remove event 2 interfaces 2 1 datacontrolmanagerobject defines what is instantiated in the tizen object [nointerfaceobject] interface datacontrolmanagerobject { readonly attribute datacontrolmanager datacontrol; }; tizen implements datacontrolmanagerobject; since 2 4 the tizen datacontrol object allows access to the datacontrol api 2 2 datacontrolmanager this interface provides access to the datacontrolmanager object [nointerfaceobject] interface datacontrolmanager { datacontrolconsumerobject getdatacontrolconsumer domstring providerid, domstring dataid, datatype type raises webapiexception ; }; since 2 4 methods getdatacontrolconsumer gets datacontrolconsumerobject with a given datatype datacontrolconsumerobject getdatacontrolconsumer domstring providerid, domstring dataid, datatype type ; since 2 4 privilege level public privilege http //tizen org/privilege/datacontrol consumer parameters providerid a provider id to use, which should be shared between the datacontrol provider and datacontrol consumer dataid a string for identifying specific data type the datatype to use return value datacontrolconsumerobject the local datacontrolconsumerobject exceptions webapiexception with error type typemismatcherror, if the parameter type is not compatible with the expected type for that parameter with error type securityerror, if the application does not have the privilege to call this method with error type unknownerror, if any other error occurs code example //the data provider, a native application, should be pre-installed and launched //the same provider id should be defined for the use of this api between a native application provider and a web application consumer //in this example, the dictionarydatacontrolprovider native sample application is used as a data control provider //gets sql type datacontrolconsumerobject try { var globalsqlconsumer = tizen datacontrol getdatacontrolconsumer "http //tizen org/datacontrol/provider/dictionarydatacontrolprovider", "dictionary", "sql" ; } catch err { console log err name +" " + err message ; } // gets map type datacontrolconsumerobject try { globalmappedconsumer = tizen datacontrol getdatacontrolconsumer "http //tizen org/datacontrol/provider/dictionarydatacontrolprovider", "dictionary", "map" ; } catch err { console log err name +" " + err message ; } 2 3 datacontrolconsumerobject this interface provides common attributes for other derived datacontrolconsumerobject [nointerfaceobject] interface datacontrolconsumerobject { readonly attribute datatype type; readonly attribute domstring providerid; readonly attribute domstring dataid; long addchangelistener datacontrolchangecallback datachangecallback, optional errorcallback? errorcallback raises webapiexception ; void removechangelistener long watchid raises webapiexception ; }; since 2 4 attributes attributes readonly datatype type an attribute to store the datatype since 2 4 readonly domstring providerid an attribute to hold a provider identifier of the application with whom it shares the datacontrol this attribute should be known to users who want to interact with the application since 2 4 readonly domstring dataid the dataid identifies specific data, usually a database table to process insert, delete, update the string consists of one or more components, separated by a slash '/' since 2 4 methods addchangelistener adds a listener to receive notifications about provider data changes long addchangelistener datacontrolchangecallback datachangecallback, optional errorcallback? errorcallback ; since 4 0 the errorcallback method is launched with these error types ioerror - if a db operation has failed privilege level public privilege http //tizen org/privilege/datasharing privilege http //tizen org/privilege/appmanager launch remark to monitor datacontrol provider data changes, it is not enough to implement a listener in the datacontrol consumer you also need to implement the data change sending functionality in the datacontrol provider the data sending implementation determines the actual change data returned to the datacontrol consumer for more information on the datacontrol provider implementation, see monitoring data changes parameters datachangecallback callback method to be invoked when received data changed notification from provider application errorcallback [optional] [nullable] callback method to be invoked if provider changes cannot be watched return value long an identifier used to clear the watch subscription exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type securityerror, if the application does not have the privilege to call this method with error type servicenotavailableerror, if the application could not connect with the provider code example var watcherid = 0; function datachangesuccesscallback eventtype, rowdata { console log "operation " + eventtype + " was performed" ; console log "data changed " ; for var i = 0; i < rowdata columns length; i++ { console log "column " + rowdata columns[i] + " value " + rowdata values[i] ; } } function errorcallback error { console log "the following error occurred " + error name ; } try { var rowdata = { columns ["word", "word_desc"] , values ["'tizen1'", "'tizen2'"] }; watcherid = globalsqlconsumer addchangelistener datachangesuccesscallback, errorcallback ; console log "change listener has been added with watchid = " + watcherid ; /* define globalreqid before */ /* increases globalreqid for uniqueness */ globalreqid++; globalsqlconsumer insert globalreqid, rowdata ; } catch err { console log err name + " " + err message ; } output example change listener has been added with watchid = 1 operation sql_insert was performed data changed column word value 'tizen1' column word_desc value 'tizen2' removechangelistener removes data change listener void removechangelistener long watchid ; since 4 0 if the watchid argument is valid and corresponds to a subscription already in place, the watch process must immediately stop and no further callbacks must be invoked if the watchid argument is not valid or does not correspond to a valid subscription, the method should return without any further action privilege level public privilege http //tizen org/privilege/datasharing privilege http //tizen org/privilege/appmanager launch parameters watchid subscription identifier exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type ioerror, if a db operation has failed code example var watcherid = 0; function datachangesuccesscallback type, rowdata { console log "operation " + type + " was performed" ; console log "data changed " ; for var i = 0; i < rowdata columns length; i++ { console log "column " + rowdata columns[i] + " value " + rowdata values[i] ; } } try { var rowdata = { columns ["word", "word_desc"] , values ["'tizen1'", "'tizen2'"] }; watcherid = globalsqlconsumer addchangelistener datachangesuccesscallback ; console log "change listener has been added with watchid = " + watcherid ; /* remove addchangelistener */ globalsqlconsumer removechangelistener watcherid ; console log "removechangelistener was invoked" ; /* define globalreqid before */ /* increases globalreqid for uniqueness */ globalreqid++; globalsqlconsumer insert globalreqid, rowdata ; } catch err { console log err name +" " + err message ; } output example change listener has been added with watchid = 1 removechangelistener was invoked 2 4 sqldatacontrolconsumer this interface defines sql data type operators [nointerfaceobject] interface sqldatacontrolconsumer datacontrolconsumerobject { void insert unsigned long reqid, rowdata insertiondata, optional datacontrolinsertsuccesscallback? successcallback, optional datacontrolerrorcallback? errorcallback raises webapiexception ; void update unsigned long reqid, rowdata updatedata, domstring where, optional datacontrolsuccesscallback? successcallback, optional datacontrolerrorcallback? errorcallback raises webapiexception ; void remove unsigned long reqid, domstring where, optional datacontrolsuccesscallback? successcallback, optional datacontrolerrorcallback? errorcallback raises webapiexception ; void select unsigned long reqid, domstring[] columns, domstring where, datacontrolselectsuccesscallback successcallback, optional datacontrolerrorcallback? errorcallback, optional unsigned long? page, optional unsigned long? maxnumberperpage, optional domstring? order raises webapiexception ; }; since 2 4 methods insert inserts new rows into a table owned by an sql-type data control provider void insert unsigned long reqid, rowdata insertiondata, optional datacontrolinsertsuccesscallback? successcallback, optional datacontrolerrorcallback? errorcallback ; since 2 4 privilege level public privilege http //tizen org/privilege/datacontrol consumer parameters reqid a unique identifier for the current operation so a developer should increase the reqid value to ensure it is unique for each method insertiondata the data on columns and values to insert successcallback [optional] [nullable] the method to invoke when the asynchronous call completes successfully errorcallback [optional] [nullable] the method to invoke when an error occurs exceptions webapiexception with error type typemismatcherror, if the parameter type is not compatible with the expected type for that parameter with error type ioerror, if a db operation has failed with error type securityerror, if the application does not have the privilege to call this method with error type unknownerror, if any other error occurs code example function successcb id, insertrowid { console log "ok reqid " + id ; } function errorcb id, error { console log "error id " + id + ", error msg " + error message ; } try { var rowdata = { columns ["word", "word_desc"] , values ["'tizen1'", "'tizen2'"] }; // defines globalreqid before // increases globalreqid for uniqueness globalreqid++; globalsqlconsumer insert globalreqid, rowdata, successcb, errorcb ; } catch err { console log err name +" " + err message ; } update updates values of a table owned by an sql-type data control provider void update unsigned long reqid, rowdata updatedata, domstring where, optional datacontrolsuccesscallback? successcallback, optional datacontrolerrorcallback? errorcallback ; since 2 4 privilege level public privilege http //tizen org/privilege/datacontrol consumer parameters reqid a unique identifier for the current operation so a developer should increase the reqid value to ensure it is unique for each method updatedata the data on columns and values to update where a filter to select desired rows to update it is an sql where clause excluding the where itself such as column1 = 'stringvalue' and column2 = numericvalue successcallback [optional] [nullable] the method to invoke when the asynchronous call completes successfully errorcallback [optional] [nullable] the method to invoke when an error occurs exceptions webapiexception with error type typemismatcherror, if the parameter type is not compatible with the expected type for that parameter with error type ioerror, if a db operation has failed with error type securityerror, if the application does not have the privilege to call this method with error type unknownerror, if any other error occurs code example function successcb id { console log "ok reqid " + id ; } function errorcb id, error { console log "error id " + id + ", error msg " + error message ; } try { var rowdata = { columns ["word", "word_desc"] , values ["'tizen1'", "'web apps platform!'"] }; // defines globalreqid before // increases globalreqid for uniqueness globalreqid++; globalsqlconsumer update globalreqid, rowdata, "word='tizen1'", successcb, errorcb ; } catch err { console log err name +" " + err message ; } remove delete rows from a table that is owned by an sql-type data control provider void remove unsigned long reqid, domstring where, optional datacontrolsuccesscallback? successcallback, optional datacontrolerrorcallback? errorcallback ; since 2 4 privilege level public privilege http //tizen org/privilege/datacontrol consumer parameters reqid a unique identifier for the current operation so a developer should increase the reqid value to ensure it is unique for each method where a filter to select desired rows to remove it is an sql where clause excluding the where itself such as column1 = 'stringvalue' and column2 = numericvalue successcallback [optional] [nullable] the method to invoke when the asynchronous call completes successfully errorcallback [optional] [nullable] the method to invoke when an error occurs exceptions webapiexception with error type typemismatcherror, if the parameter type is not compatible with the expected type for that parameter with error type ioerror, if a db operation has failed with error type securityerror, if the application does not have the privilege to call this method with error type unknownerror, if any other error occurs code example function successcb id { console log "ok reqid " + id ; } function errorcb id, error { console log "error id " + id + ", error msg " + error message ; } try { // defines globalreqid before // increases globalreqid for uniqueness globalreqid++; globalsqlconsumer remove globalreqid, "word='tizen1'", successcb, errorcb ; } catch err { console log err name +" " + err message ; } select selects the specified columns to be queried the result set of the specified columns is retrieved from a table owned by an sql-type data control provider void select unsigned long reqid, domstring[] columns, domstring where, datacontrolselectsuccesscallback successcallback, optional datacontrolerrorcallback? errorcallback, optional unsigned long? page, optional unsigned long? maxnumberperpage, optional domstring? order ; since 2 4 if either of the page or maxnumberperpage parameters are set to null or are not set, only the first 20 rows are included in the result set privilege level public privilege http //tizen org/privilege/datacontrol consumer remark order is supported since tizen 3 0 parameters reqid a unique identifier for the current operation so a developer should increase the reqid value to ensure it is unique for each method columns the columns to select where a filter to select desired rows it is an sql where clause excluding the where itself such as column1 = 'stringvalue' and column2 = numericvalue successcallback the method to invoke when the asynchronous call completes successfully errorcallback [optional] [nullable] the method to invoke when an error occurs page [optional] [nullable] the page number of the result set it starts from 1 if the number is out of page, datacontrolselectsuccesscallback is invoked with no result data maxnumberperpage [optional] [nullable] the maximum number of rows on a page the maximum allowed value is equal to 1024 order [optional] [nullable] the sorting order of the selected rows it is an sql order by clause excluding the order by itself such as column1, column2 asc if it is set to null, the order in which the rows are returned is undefined exceptions webapiexception with error type typemismatcherror, if the parameter type is not compatible with the expected type for that parameter with error type ioerror, if a db operation has failed with error type securityerror, if the application does not have the privilege to call this method with error type unknownerror, if any other error occurs code example function getvaluesuccesscb result, id { console log "getvaluesuccesscb result length " + result length ; var length = result length; for var i = 0; i < length; i++ { var rowdata = "| "; var j = 0; for j = 0; j < result[i] columns length; j++ { rowdata += "column " + result[i] columns[j] + ", value " + result[i] values[j] + " | "; } console log rowdata ; } } function errorcb id, error { console log "error id " + id + ", error msg " + error message ; } try { // globalsqlconsumer and globalreqid should be defined before // increases globalreqid for uniqueness globalreqid++; var columns = ["word", "word_desc" ]; var whereclause = "1"; console log "----- calling for ascending order -----" ; globalsqlconsumer select globalreqid, columns, whereclause, getvaluesuccesscb, errorcb, null, null, "word_desc asc" ; settimeout function { console log "----- calling descending order -----" ; globalsqlconsumer select globalreqid, columns, whereclause, getvaluesuccesscb, errorcb, null, null, "word_desc desc" ; }, 1000 ; } catch err { console log err name +" " + err message ; } 2 5 mappeddatacontrolconsumer this interface defines map data type operators [nointerfaceobject] interface mappeddatacontrolconsumer datacontrolconsumerobject { void addvalue unsigned long reqid, domstring key, domstring value, optional datacontrolsuccesscallback? successcallback, optional datacontrolerrorcallback? errorcallback raises webapiexception ; void removevalue unsigned long reqid, domstring key, domstring value, datacontrolsuccesscallback successcallback, optional datacontrolerrorcallback? errorcallback raises webapiexception ; void getvalue unsigned long reqid, domstring key, datacontrolgetvaluesuccesscallback successcallback, optional datacontrolerrorcallback? errorcallback raises webapiexception ; void updatevalue unsigned long reqid, domstring key, domstring oldvalue, domstring newvalue, datacontrolsuccesscallback successcallback, optional datacontrolerrorcallback? errorcallback raises webapiexception ; }; since 2 4 methods addvalue adds the value associated with the specified key to a key-values map owned by a map-type data control provider void addvalue unsigned long reqid, domstring key, domstring value, optional datacontrolsuccesscallback? successcallback, optional datacontrolerrorcallback? errorcallback ; since 2 4 privilege level public privilege http //tizen org/privilege/datacontrol consumer parameters reqid a unique identifier for the current operation so a developer should increase the reqid value to ensure it is unique for each method key the key to search mapped data value the value to add into a values array mapped by the key successcallback [optional] [nullable] the method to invoke when the asynchronous call completes successfully errorcallback [optional] [nullable] the method to invoke when an error occurs exceptions webapiexception with error type typemismatcherror, if the parameter type is not compatible with the expected type for that parameter with error type ioerror, if a db operation has failed with error type securityerror, if the application does not have the privilege to call this method with error type unknownerror, if any other error occurs code example function successcb id { console log "ok reqid " + id ; } function errorcb id, error { console log "error id " + id + ", error msg " + error message ; } try { // defines globalreqid before // increases globalreqid for uniqueness globalreqid++; globalmappedconsumer addvalue globalreqid, "tizen", "foo", successcb, errorcb ; } catch err { console log err name +" " + err message ; } removevalue removes the value associated with the specified key from a key-values map owned by a map-type data control provider void removevalue unsigned long reqid, domstring key, domstring value, datacontrolsuccesscallback successcallback, optional datacontrolerrorcallback? errorcallback ; since 2 4 privilege level public privilege http //tizen org/privilege/datacontrol consumer parameters reqid a unique identifier for the current operation so a developer should increase the reqid value to ensure it is unique for each method key the key to search mapped data value the value to remove from a values array mapped by the key successcallback the method to invoke when the asynchronous call completes successfully errorcallback [optional] [nullable] the method to invoke when an error occurs exceptions webapiexception with error type typemismatcherror, if the parameter type is not compatible with the expected type for that parameter with error type ioerror, if a db operation has failed with error type notfounderror, if the key cannot be found with error type securityerror, if the application does not have the privilege to call this method with error type unknownerror, if any other error occurs code example function successcb id { console log "ok reqid " + id ; } function errorcb id, error { console log "error id " + id + ", error msg " + error message ; } try { // defines globalreqid before // increases globalreqid for uniqueness globalreqid++; globalmappedconsumer removevalue globalreqid, "tizen", "foo", successcb, errorcb ; } catch err { console log err name +" " + err message ; } getvalue gets the value associated with the specified key, from a key-values map owned by a map-type data control provider void getvalue unsigned long reqid, domstring key, datacontrolgetvaluesuccesscallback successcallback, optional datacontrolerrorcallback? errorcallback ; since 2 4 privilege level public privilege http //tizen org/privilege/datacontrol consumer parameters reqid a unique identifier for the current operation so a developer should increase the reqid value to ensure it is unique for each method key the key to search mapped data successcallback the method to invoke when the asynchronous call completes successfully errorcallback [optional] [nullable] the method to invoke when an error occurs exceptions webapiexception with error type typemismatcherror, if the parameter type is not compatible with the expected type for that parameter with error type ioerror, if a db operation has failed with error type notfounderror, if the key cannot be found with error type securityerror, if the application does not have the privilege to call this method with error type unknownerror, if any other error occurs code example function getvaluesuccesscb result, id { console log result length + " " + result[0] ; } function errorcb id, error { console log "error id " + id + ", error msg " + error message ; } try { // defines globalreqid before // increases globalreqid for uniqueness globalreqid++; globalmappedconsumer getvalue globalreqid, "tizen", getvaluesuccesscb, errorcb ; } catch err { console log err name +" " + err message ; } updatevalue sets the value associated with the specified key to a new value void updatevalue unsigned long reqid, domstring key, domstring oldvalue, domstring newvalue, datacontrolsuccesscallback successcallback, optional datacontrolerrorcallback? errorcallback ; since 2 4 privilege level public privilege http //tizen org/privilege/datacontrol consumer parameters reqid a unique identifier for the current operation so a developer should increase the reqid value to ensure it is unique for each method key the key to search mapped data oldvalue the value to update in a values array mapped by the key newvalue the new value to replace in a values array mapped by the key successcallback the method to invoke when the asynchronous call completes successfully errorcallback [optional] [nullable] the method to invoke when an error occurs exceptions webapiexception with error type typemismatcherror, if the parameter type is not compatible with the expected type for that parameter with error type ioerror, if a db operation has failed with error type notfounderror, if the key cannot be found with error type securityerror, if the application does not have the privilege to call this method with error type unknownerror, if any other error occurs code example function successcb id { console log "ok reqid " + id ; } function errorcb id, error { console log "error id " + id + ", error msg " + error message ; } try { // defines globalreqid before // increases globalreqid for uniqueness globalreqid++; globalmappedconsumer updatevalue globalreqid, "tizen", "foo", "bar", successcb, errorcb ; } catch err { console log err name +" " + err message ; } 2 6 datacontrolsuccesscallback this interface provides a successcallback for datacontrolconsumerobject [callback=functiononly, nointerfaceobject] interface datacontrolsuccesscallback { void onsuccess unsigned long reqid ; }; since 2 4 methods onsuccess called on success void onsuccess unsigned long reqid ; since 2 4 parameters reqid a unique identifier of the successful operation 2 7 datacontrolerrorcallback this interface provides an errorcallback for datacontrolconsumerobject [callback=functiononly, nointerfaceobject] interface datacontrolerrorcallback { void onerror unsigned long reqid, webapierror error ; }; since 2 4 methods onerror called on error void onerror unsigned long reqid, webapierror error ; since 2 4 parameters reqid a unique identifier of the failed operation error an error message 2 8 datacontrolinsertsuccesscallback this interface provides a successcallback for sqldatacontrolconsumer insert [callback=functiononly, nointerfaceobject] interface datacontrolinsertsuccesscallback { void onsuccess unsigned long reqid, long insertrowid ; }; since 2 4 methods onsuccess called on success void onsuccess unsigned long reqid, long insertrowid ; since 2 4 parameters reqid a unique identifier for the current operation so it is recommended to increase the reqid value every time to guarantee uniqueness insertrowid the inserted row id set by the data control provider if the specified providerresult is true, else -1 2 9 datacontrolselectsuccesscallback this interface provides a successcallback for sqldatacontrolconsumer select [callback=functiononly, nointerfaceobject] interface datacontrolselectsuccesscallback { void onsuccess rowdata[] rows, unsigned long reqid ; }; since 2 4 methods onsuccess called on success void onsuccess rowdata[] rows, unsigned long reqid ; since 2 4 parameters rows rows of sql selection results from another application the array operation of rows would be different from general javascript array behavior depending on platform implementation for example, array isarray rows returns false reqid a unique identifier for the current operation so it is recommended to increase the reqid value every time to guarantee uniqueness 2 10 datacontrolgetvaluesuccesscallback this interface provides a successcallback for mapdatacontrolconsumer getvalue [callback=functiononly, nointerfaceobject] interface datacontrolgetvaluesuccesscallback { void onsuccess domstring[] values, unsigned long reqid ; }; since 2 4 methods onsuccess called on success void onsuccess domstring[] values, unsigned long reqid ; since 2 4 parameters values a list of values assigned to the requested key reqid a unique identifier of the successful operation 2 11 datacontrolchangecallback this interface provides a datacontrolchangecallback for addchangelistener method [callback=functiononly, nointerfaceobject] interface datacontrolchangecallback { void onsuccess eventtype type, rowdata data ; }; since 4 0 methods onsuccess called when the data is modified void onsuccess [eventtype] #eventtype type, [rowdata] #rowdata data ; since 4 0 parameters type a type of performed operation data object with information of columns and values of changed data actual data to be returned depends on data returned by data control provider application please refer to native documentation 2 11 rowdata the dictionary represents rowdata holding 1 row of sql selection results from another application dictionary rowdata { domstring[] columns; domstring[] values; }; since 2 4 dictionary members domstring[] columns an attribute to hold column names to select, update, and insert since 2 4 domstring[] values an attribute to hold values of columns to select, update, and insert since 2 4 3 full webidl module datacontrol { enum datatype { "map", "sql"}; enum eventtype { "sql_update", "sql_insert", "sql_delete", "map_set", "map_add", "map_remove"}; [nointerfaceobject] interface datacontrolmanagerobject { readonly attribute datacontrolmanager datacontrol; }; tizen implements datacontrolmanagerobject; [nointerfaceobject] interface datacontrolmanager { datacontrolconsumerobject getdatacontrolconsumer domstring providerid, domstring dataid, datatype type raises webapiexception ; }; [nointerfaceobject] interface datacontrolconsumerobject { readonly attribute datatype type; readonly attribute domstring providerid; readonly attribute domstring dataid; long addchangelistener datacontrolchangecallback datachangecallback, optional errorcallback? errorcallback raises webapiexception ; void removechangelistener long watchid raises webapiexception ; }; [nointerfaceobject] interface sqldatacontrolconsumer datacontrolconsumerobject { void insert unsigned long reqid, rowdata insertiondata, optional datacontrolinsertsuccesscallback? successcallback, optional datacontrolerrorcallback? errorcallback raises webapiexception ; void update unsigned long reqid, rowdata updatedata, domstring where, optional datacontrolsuccesscallback? successcallback, optional datacontrolerrorcallback? errorcallback raises webapiexception ; void remove unsigned long reqid, domstring where, optional datacontrolsuccesscallback? successcallback, optional datacontrolerrorcallback? errorcallback raises webapiexception ; void select unsigned long reqid, domstring[] columns, domstring where, datacontrolselectsuccesscallback successcallback, optional datacontrolerrorcallback? errorcallback, optional unsigned long? page, optional unsigned long? maxnumberperpage, optional domstring? order raises webapiexception ; }; [nointerfaceobject] interface mappeddatacontrolconsumer datacontrolconsumerobject { void addvalue unsigned long reqid, domstring key, domstring value, optional datacontrolsuccesscallback? successcallback, optional datacontrolerrorcallback? errorcallback raises webapiexception ; void removevalue unsigned long reqid, domstring key, domstring value, datacontrolsuccesscallback successcallback, optional datacontrolerrorcallback? errorcallback raises webapiexception ; void getvalue unsigned long reqid, domstring key, datacontrolgetvaluesuccesscallback successcallback, optional datacontrolerrorcallback? errorcallback raises webapiexception ; void updatevalue unsigned long reqid, domstring key, domstring oldvalue, domstring newvalue, datacontrolsuccesscallback successcallback, optional datacontrolerrorcallback? errorcallback raises webapiexception ; }; [callback=functiononly, nointerfaceobject] interface datacontrolsuccesscallback { void onsuccess unsigned long reqid ; }; [callback=functiononly, nointerfaceobject] interface datacontrolerrorcallback { void onerror unsigned long reqid, webapierror error ; }; [callback=functiononly, nointerfaceobject] interface datacontrolinsertsuccesscallback { void onsuccess unsigned long reqid, long insertrowid ; }; [callback=functiononly, nointerfaceobject] interface datacontrolselectsuccesscallback { void onsuccess rowdata[] rows, unsigned long reqid ; }; [callback=functiononly, nointerfaceobject] interface datacontrolgetvaluesuccesscallback { void onsuccess domstring[] values, unsigned long reqid ; }; [callback=functiononly, nointerfaceobject] interface datacontrolchangecallback { void onsuccess eventtype type, rowdata data ; }; dictionary rowdata { domstring[] columns; domstring[] values; }; };