From: Grzegorz Reszka Date: Thu, 25 Jun 2015 10:07:35 +0000 (+0200) Subject: [ACR-47] Guideline for Service Adaptor. X-Git-Tag: tizen_3.0/TD_SYNC/20161201~758 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2a6ec6e4e923e9494a48cf60e2402bb848520a54;p=sdk%2Fonline-doc.git [ACR-47] Guideline for Service Adaptor. Added links to Service Adaptor to: \online-doc\org.tizen.guides\html\index.html \online-doc\org.tizen.guides\html\native\social\social_guide_n.htm \online-doc\org.tizen.guides\html\web\tizen\social\social_guide_w.htm pages. Change-Id: I6b3c139dd664700f2af3b4c7830bd9ab5bae68fd Signed-off-by: Grzegorz Reszka --- diff --git a/org.tizen.guides/html/index.htm b/org.tizen.guides/html/index.htm index 74a70f2..1b5b07b 100644 --- a/org.tizen.guides/html/index.htm +++ b/org.tizen.guides/html/index.htm @@ -92,6 +92,7 @@
  • Call History
  • Contact
  • Data Synchronization
  • +
  • Service Adaptor
  • Localization
  • diff --git a/org.tizen.guides/html/native/social/service_adaptor_client_n.html b/org.tizen.guides/html/native/social/service_adaptor_n.htm similarity index 98% rename from org.tizen.guides/html/native/social/service_adaptor_client_n.html rename to org.tizen.guides/html/native/social/service_adaptor_n.htm index ba9b85a..96abe47 100644 --- a/org.tizen.guides/html/native/social/service_adaptor_client_n.html +++ b/org.tizen.guides/html/native/social/service_adaptor_n.htm @@ -59,7 +59,7 @@ But main of them are following:
  • Storage Adaptor
  • -Each adaptor is an agent between Service Adaptor Client and according plugins. There exist Auth and Storage Plugins for such services as: Amazon, Box, Dropbox, Gogledrive, Onedrive and Sugarsync. This structure illustrates following figure: +Each adaptor is an agent between Service Adaptor Client and according plugins. There exist Auth and Storage Plugins for such services as: Amazon, Box, Dropbox, Googledrive, Onedrive and Sugarsync. This structure illustrates following figure:

    Figure: Service Adaptor structure

    Service Adaptor structure

    diff --git a/org.tizen.guides/html/native/social/social_guide_n.htm b/org.tizen.guides/html/native/social/social_guide_n.htm index 657d5a4..5385b87 100644 --- a/org.tizen.guides/html/native/social/social_guide_n.htm +++ b/org.tizen.guides/html/native/social/social_guide_n.htm @@ -38,19 +38,20 @@

    The main social features are:

    - -

    The following guides apply in mobile applications only:

    - + +

    The following guides apply in mobile applications only:

    + - +
  • Service Adaptor

    Allows you to work with cloud storages/services as: Amazon, Box, Dropbox, Googledrive, Onedrive and Sugarsync by managing authentication, contacts information and handling file transfer to/from cloud.

  • + + @@ -72,4 +73,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - \ No newline at end of file + diff --git a/org.tizen.guides/html/web/tizen/social/service_adaptor_w.htm b/org.tizen.guides/html/web/tizen/social/service_adaptor_w.htm new file mode 100644 index 0000000..fc0ee20 --- /dev/null +++ b/org.tizen.guides/html/web/tizen/social/service_adaptor_w.htm @@ -0,0 +1,230 @@ + + + + + + + + + + + + + Service Adaptor + + + + + + +
    +

    Service Adaptor

    + +Service Adaptor is a set of several adaptors: + + +But main of them are following: + + +Each adaptor is an agent between Service Adaptor Client and according plugins. There exist Auth and Storage Plugins for such services as: Amazon, Box, Dropbox, Gogledrive, Onedrive and Sugarsync. This structure illustrates following figure: + +

    Figure: Service Adaptor structure

    +

    Service Adaptor structure

    + +

    The main feature of the Service Adaptor is connecting/disconnecting adaptors to Service Adaptor Client via D-Bus.

    + +

    There are two kinds of path type used in Service Adaptor: +

      +
    • "Logical path" - means path of "root file system".
      + It starts from root path(= '/') and you can use this path like linux, e.g. "/folder1/image1.jpg".

      +
    • +
    • "Physical path" - means specfic uri that be used for cloud server.
      + Some clouds use same with "Logical path", but some clouds use specfic key or url, e.g. "/" is "ZmNhMWY2MTZlY2M1NDg4OGJmZDY4O", "/folder1" is "2JI32UNJDWQEQWQWEADSSAD".
      +
    • +
    + +

    + +

    Auth Adaptor

    +

    This adaptor manages authentication plugins.

    +

    It allows to: +

      +
    • get Auth Plugin List
    • +
    • set Plugin
    • +
    • request Channel Auth, i.e. service name like "com.serviceadaptor.message", app id, service id (0: contact, 1: free message) and mobile station identification number (IMSI)
    • +
    +

    + +

    Storage Adaptor

    +

    This module handles files transfer to/from cloud.

    +

    It allows to: +

      +
    • download a server/thumbnail file and write it to local file
    • +
    • upload a local file to server path
    • +
    • request file status
    • +
    • cancel/pause/resume file transfer
    • +
    +

    + +

    Contact Adaptor

    +

    This adaptor manages contacts information in Contact Server, their profiles and service registration information.

    +

    It allows to: +

      +
    • reset contact information in Contact Server and upload native contact information of device to the server
    • +
    • synchronize native contact information of device with Contact Server according to [type] field of each contact
    • +
    • get profiles and service registration information of contacts
    • +
    • set and update device’s profile to server
    • +
    • upload/delete profile image meta to/from File Server and sets my profile image to Profile Server
    • +
    • set/get my profile’s privacy levelthe scope of people to be opened
    • +
    • set my presence ON/OFF information to Presence Server
    • +
    +

    + +

    Discovery Adaptor

    +

    It is a future development.

    + +

    Message Adaptor

    +

    This module manages chatting and messaging.

    +

    Its main functionality is requesting for: +

      +
    • Creating Chatroom, Inviting to (or Ending) Chat
    • +
    • All Unread Messages
    • +
    • Read or Unseal Message
    • +
    • Forward Online or Unread Message
    • +
    • Save Call Log
    • +
    • Chat ID based on phone number
    • +
    +

    + +

    Push Adaptor

    +

    It just receives push notifications from push service.

    + +

    Shop Adaptor

    +

    This module makes requests for: +

      +
    • List of Items
    • +
    • Item Information for Download
    • +
    • Download of Item
    • +
    • Item Panel URL
    • +
    +

    + +

    How to start plugin?

    +

    First we need to create service adaptor:

    +
    +int service_adaptor_create(service_adaptor_h *service_adaptor);
    +
    + +

    Than for valid service_adaptor handler we need to iterate to all installed plugins:

    +
    +int service_adaptor_foreach_plugin(service_adaptor_h service_adaptor,
    +                                   service_adaptor_plugin_cb callback,
    +                                   void *user_data);
    +
    + +

    Inside callback (which is invoked for each plugin) we get plugin_uri which is then passed to:

    +
    +int service_adaptor_create_plugin(service_adaptor_h service_adaptor,
    +                                  const char *plugin_uri,
    +                                  service_plugin_h *plugin);
    +
    + +

    And finally we have to request start initialization for service plugin:

    +
    +int service_plugin_start(service_plugin_h handle,
    +                         int service_flag);
    +
    + +Below example starts all installed Auth and Storage plugins appending each plugin_uri to the list object: +
    +bool _plugin_iterator_cb(char *plugin_uri, int service_mask, void *user_data);
    +
    +service_adaptor_h service_adaptor = NULL;
    +ret = service_adaptor_create(&service_adaptor);
    +
    +Evas_Object *list;
    +ret = service_adaptor_foreach_plugin(service_adaptor, _plugin_iterator_cb, (void *)list);
    +
    +bool _plugin_iterator_cb(char *plugin_uri, int service_mask, void *user_data)
    +{
    +    Evas_Object *list = (Evas_Object *)user_data;
    +
    +    if (!plugin_uri || !list)
    +        return false;
    +
    +    if ((service_mask & SERVICE_PLUGIN_SERVICE_AUTH) && (service_mask & SERVICE_PLUGIN_SERVICE_STORAGE))
    +    {
    +        elm_list_item_append(list, plugin_uri, NULL, NULL, _show_plugin_view, plugin_uri);
    +
    +        service_plugin_h plugin = NULL;
    +        service_adaptor_create_plugin(service_adaptor, plugin_uri, &plugin);
    +
    +        // This should be hidden using config file or User input, because it is security information
    +        service_plugin_add_property(plugin, SERVICE_PLUGIN_PROPERTY_APP_KEY, "enasvv4l8hdbmhn");
    +
    +        // This should be hidden using config file or User input, because it is security information
    +        service_plugin_add_property(plugin, SERVICE_PLUGIN_PROPERTY_APP_SECRET, "uqhl4pp8mo7hmgn");
    +        service_plugin_start(plugin, (SERVICE_PLUGIN_SERVICE_AUTH | SERVICE_PLUGIN_SERVICE_STORAGE));
    +    }
    +
    +    return true;
    +}
    +
    + + + +
    + +Go to top + + + + + + + diff --git a/org.tizen.guides/html/web/tizen/social/social_guide_w.htm b/org.tizen.guides/html/web/tizen/social/social_guide_w.htm index c687e5c..aef61e5 100644 --- a/org.tizen.guides/html/web/tizen/social/social_guide_w.htm +++ b/org.tizen.guides/html/web/tizen/social/social_guide_w.htm @@ -54,6 +54,7 @@
  • Call History

    Allows you to search, manage, and monitor the call history of a device.

  • Contact

    Allows you to manage address books and contacts on a device.

  • Data Synchronization

    Allows you to synchronize device data, such as contacts and calendar events, with the OMA DS server.

  • +
  • Service Adaptor

    Allows you to work with cloud storages/services as: Amazon, Box, Dropbox, Googledrive, Onedrive and Sugarsync by managing authentication, contacts information and handling file transfer to/from cloud.

  • @@ -77,4 +78,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - \ No newline at end of file +