From 8410d21847fedbc577155ec1c65dc4d34785c9bb Mon Sep 17 00:00:00 2001 From: Lukasz Bardeli Date: Thu, 14 Apr 2016 07:51:55 +0200 Subject: [PATCH] [DataControl] update API reference Change-Id: Id535641ae5c0351d3a369ff0016b592f82c5107f Signed-off-by: Lukasz Bardeli --- .../device_api/wearable/tizen/datacontrol.html | 76 +++++++++++++--------- 1 file changed, 47 insertions(+), 29 deletions(-) diff --git a/org.tizen.web.apireference/html/device_api/wearable/tizen/datacontrol.html b/org.tizen.web.apireference/html/device_api/wearable/tizen/datacontrol.html index 2355e94..9b8a655 100644 --- a/org.tizen.web.apireference/html/device_api/wearable/tizen/datacontrol.html +++ b/org.tizen.web.apireference/html/device_api/wearable/tizen/datacontrol.html @@ -7,7 +7,6 @@
-

DataControl API

This specification defines a DataControl API for applications. @@ -26,7 +25,8 @@ Please read the -
  • 1. Type Definitions
  • @@ -678,28 +686,38 @@ The string consists of one or more components, separated by a slash('/').

    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++)
              {
    -             console.log("column: " + result[i].columns[j] + ", value: " + result[i].values[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 {
    -     // Defines globalReqId before
    +     // globalSQLConsumer and globalReqId should be defined before.
          // Increases globalReqId for uniqueness
    -     var array = ["WORD", "WORD_DESC" ];
          globalReqId++;
    -     globalSQLConsumer.select(globalReqId, array, "WORD='tizen1'", getValueSuccessCB, errorcb);
    +     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);
    @@ -1201,7 +1219,7 @@ The string consists of one or more components, separated by a slash('/').
      This interface provides a SuccessCallback for SQLDataControlConsumer.insert().
               
        [Callback=FunctionOnly, NoInterfaceObject] interface DataControlInsertSuccessCallback {
    -        void onsuccess(unsigned long reqId, long insertRowId);
    +    void onsuccess(unsigned long reqId, long insertRowId);
         };

    Since: @@ -1405,7 +1423,7 @@ The string consists of one or more components, separated by a slash('/'). void select(unsigned long reqId, DOMString[] columns, DOMString where, DataControlSelectSuccessCallback successCallback, optional DataControlErrorCallback? errorCallback, - optional unsigned long? page, optional unsigned long? maxNumberPerPage) raises(WebAPIException); + optional unsigned long? page, optional unsigned long? maxNumberPerPage, optional DOMString? order) raises(WebAPIException); }; [NoInterfaceObject] interface MappedDataControlConsumer : DataControlConsumerObject { @@ -1435,7 +1453,7 @@ The string consists of one or more components, separated by a slash('/'). }; [Callback=FunctionOnly, NoInterfaceObject] interface DataControlInsertSuccessCallback { - void onsuccess(unsigned long reqId, long insertRowId); + void onsuccess(unsigned long reqId, long insertRowId); }; -- 2.7.4