From c75ece4864b5575be3b4675d1b6ed6d0acaca831 Mon Sep 17 00:00:00 2001 From: Grzegorz Reszka Date: Tue, 30 Jun 2015 12:54:21 +0200 Subject: [PATCH] [ACR-47] Guideline for Service Adaptor. Removed Service Adaptor from WEB part of documentation. Change-Id: I5b1197fc9d483e375c0604e3c9e64f7a05479f63 Signed-off-by: Grzegorz Reszka --- .../html/web/tizen/social/service_adaptor_w.htm | 183 --------------------- .../html/web/tizen/social/social_guide_w.htm | 3 +- 2 files changed, 1 insertion(+), 185 deletions(-) delete mode 100644 org.tizen.guides/html/web/tizen/social/service_adaptor_w.htm 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 deleted file mode 100644 index 1439943..0000000 --- a/org.tizen.guides/html/web/tizen/social/service_adaptor_w.htm +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - - - - - - Service Adaptor - - - - -
-
- -

Mobile Web

-
- -
-

Content

- -

Related Info

- -
-
- -
-

Service Adaptor

- -

You can manage adaptors, which function as agents between the Service Adaptor Client and the related plugins, to take advantage of various services. For example, the Auth and Storage adaptors allow you to access the Auth and Service Plugins to use services, such as Amazon, Box, Dropbox, Gogledrive, Onedrive, and Sugarsync.

- -

Figure: Service adaptor structure

-

Service adaptor structure

- -

The main feature of the Service Adaptor API is to connect adaptors to and disconnect them from the Service Adaptor Client though D-Bus. The Service adaptor uses 2 path types:

-
    -
  • Logical path -

    The path of the root file system. It starts from the root path ("/"), and you can use the path like in Linux (for example, "/folder1/image1.jpg").

    -
  • -
  • Physical path -

    A specific URI used for the cloud server. Some clouds use a logical path, but others use a specific key or URL (for example, "/" is "ZmNhMWY2MTZlY2M1NDg4OGJmZDY4O" and "/folder1" is "2JI32UNJDWQEQWQWEADSSAD").

    -
  • -
- -

Available Adaptors

- -

The following adaptors are provided:

- -
    -
  • Auth adaptor -

    This adaptor manages authentication plugins. It allows you to:

    -
      -
    • Get the Auth Plugin list.
    • -
    • Set the Plugin.
    • -
    • Request the Channel Auth, such as the service name ("com.serviceadaptor.message"), app ID, service ID (0: contact, 1: free message), and mobile station identification number (IMSI).
    • -
    -
  • -
  • Storage adaptor -

    This adaptor handles files transfers to and from a cloud. It allows you to:

    -
      -
    • Download a server or thumbnail file and write it to a local file.
    • -
    • Upload a local file to a server path.
    • -
    • Request the file status.
    • -
    • Cancel, pause, and resume a file transfer.
    • -
    -
  • -
  • Contact adaptor -

    This adaptor manages contact information in the Contact server, including the contact profiles and service registration information. It allows you to:

    -
      -
    • Reset contact information in the Contact server and upload native contact information of the device to the server.
    • -
    • Synchronize native contact information of the device with the Contact server according to the [type] field of each contact.
    • -
    • Get contact profiles and service registration information.
    • -
    • Set and update device profile in the server.
    • -
    • Upload and delete profile image meta in the File server and set the my profile image to the Profile server.
    • -
    • Set and get my profile privacy level
    • -
    • Set my presence ON/OFF information to the Presence server.
    • -
    -
  • -
  • Discovery adaptor -

    This adaptor is a future development. Not in use yet.

  • -
  • Message adaptor -

    This adaptor manages chatting and messaging. It allows you to:

    -
      -
    • Create a chatroom, and invite people to (or end) a chat.
    • -
    • Get all unread messages.
    • -
    • Read or unseal a message.
    • -
    • Forward online or unread messages.
    • -
    • Save the call log.
    • -
    • Get the chat ID based on the phone number.
    • -
    -
  • -
  • Push adaptor -

    This adaptor receives push notifications from a push service.

  • -
  • Shop adaptor -

    This adaptor allows you to:

    -
      -
    • Get a list of items.
    • -
    • Get item information for download.
    • -
    • Download an item.
    • -
    • Get the item panel URL.
    • -
    -
  • -
- - -

Starting a Plugin

- -

To start a plugin, use the following process:

- -
  1. Create a Service adaptor with the service_adaptor_create() function.
  2. -
  3. With a valid Service adaptor handler, iterate through all installed plugins with the service_adaptor_foreach_plugin() function.
  4. -
  5. Inside the callback (invoked for each plugin), get the plugin_uri value, which is passed to the service_adaptor_create_plugin() function.
  6. -
  7. Request a start initialization for the service plugin with the service_plugin_start() function.
- -

The following 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);
-
-      // Hide this using config file or user input, because it is security information
-      service_plugin_add_property(plugin, SERVICE_PLUGIN_PROPERTY_APP_KEY, "enasvv4l8hdbmhn");
-      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 4fcd87c..228604e 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,7 +54,6 @@
  • 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.

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