--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+ <meta http-equiv="X-UA-Compatible" content="IE=9" />
+ <link rel="stylesheet" type="text/css" href="../../../css/styles.css" />
+ <link rel="stylesheet" type="text/css" href="../../../css/snippet.css" />
+ <script type="text/javascript" src="../../../scripts/snippet.js"></script>
+ <script type="text/javascript" src="../../../scripts/jquery.util.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/common.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/core.js" charset="utf-8"></script>
+ <script type="text/javascript" src="../../../scripts/search.js" charset="utf-8"></script>
+ <title>Service Adaptor</title>
+</head>
+
+<body onload="prettyPrint()" style="overflow: auto;">
+
+<div id="toc-navigation">
+ <div id="profile">
+ <!--<p><img alt="Mobile native" src="../../images/mn_icon.png"/> <img alt="Wearable native" src="../../images/wn_icon.png"/></p>-->
+ <p><img alt="Mobile Web" src="../../../images/mw_icon_optional.png"/></p>
+ </div>
+
+ <div id="toc_border"><div id="toc">
+ <p class="toc-title">Content</p>
+ <ul class="toc">
+ <li><a href="#auth">Auth Adaptor</a></li>
+ <li><a href="#storage">Storage Adaptor</a></li>
+ <li><a href="#contact">Contact Adaptor</a></li>
+ <li><a href="#discovery">Discovery Adaptor</a></li>
+ <li><a href="#message">Message Adaptor</a></li>
+ <li><a href="#push">Push Adaptor</a></li>
+ <li><a href="#shop">Shop Adaptor</a></li>
+ <li><a href="#start_plugin">How to start plugin?</a></li>
+ </ul>
+ <p class="toc-title">Related Info</p>
+ <ul class="toc">
+ <li><a href="../../../../org.tizen.tutorials/html/native/social/service_adaptor_client_tutorial_n.htm">Service Adaptor Tutorial</a></li>
+ <li><a href="../../../../org.tizen.native.mobile.apireference/XX.html">Service Adaptor API for Mobile Native</a></li>
+ <li><a href="../../../../org.tizen.native.wearable.apireference/XX.html">Service Adaptor API for Wearable Native</a></li>
+ </ul>
+ </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+<h1>Service Adaptor</h1>
+
+Service Adaptor is a set of several adaptors:
+<ul>
+ <li><a href="#contact">Contact Adaptor</a></li>
+ <li><a href="#discovery">Discovery Adaptor</a></li>
+ <li><a href="#message">Message Adaptor</a></li>
+ <li><a href="#push">Push Adaptor</a></li>
+ <li><a href="#shop">Shop Adaptor</a></li>
+</ul>
+
+But main of them are following:
+<ul>
+ <li><a href="#auth">Auth Adaptor</a></li>
+ <li><a href="#storage">Storage Adaptor</a></li>
+</ul>
+
+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:
+
+<p class="figure">Figure: Service Adaptor structure</p>
+<p style="text-align:center;"><img alt="Service Adaptor structure" src="../../../images/service_adaptor_structure.jpg"></p>
+
+<p>The main feature of the Service Adaptor is connecting/disconnecting adaptors to Service Adaptor Client via D-Bus.</p>
+
+<p>There are two kinds of path type used in Service Adaptor:
+ <ul>
+ <li><b>"Logical path"</b> - means path of "root file system".<br>
+ It starts from root path(= '/') and you can use this path like linux, e.g. "/folder1/image1.jpg".<br><br>
+ </li>
+ <li><b>"Physical path"</b> - means specfic uri that be used for cloud server.<br>
+ Some clouds use same with "Logical path", but some clouds use specfic key or url, e.g. "/" is "ZmNhMWY2MTZlY2M1NDg4OGJmZDY4O", "/folder1" is "2JI32UNJDWQEQWQWEADSSAD".<br>
+ </li>
+ </ul>
+
+</p>
+
+<h2 id="auth" name="auth">Auth Adaptor</h2>
+<p>This adaptor manages authentication plugins.</p>
+<p>It allows to:
+ <ul>
+ <li>get Auth Plugin List</li>
+ <li>set Plugin</li>
+ <li>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)</li>
+ </ul>
+</p>
+
+<h2 id="storage" name="storage">Storage Adaptor</h2>
+<p>This module handles files transfer to/from cloud.</p>
+<p>It allows to:
+ <ul>
+ <li>download a server/thumbnail file and write it to local file</li>
+ <li>upload a local file to server path</li>
+ <li>request file status</li>
+ <li>cancel/pause/resume file transfer</li>
+ </ul>
+</p>
+
+<h2 id="contact" name="contact">Contact Adaptor</h2>
+<p>This adaptor manages contacts information in Contact Server, their profiles and service registration information. </p>
+<p>It allows to:
+ <ul>
+ <li>reset contact information in Contact Server and upload native contact information of device to the server</li>
+ <li>synchronize native contact information of device with Contact Server according to [type] field of each contact</li>
+ <li>get profiles and service registration information of contacts</li>
+ <li>set and update device’s profile to server</li>
+ <li>upload/delete profile image meta to/from File Server and sets my profile image to Profile Server</li>
+ <li>set/get my profile’s privacy levelthe scope of people to be opened</li>
+ <li>set my presence ON/OFF information to Presence Server</li>
+ </ul>
+</p>
+
+<h2 id="discovery" name="discovery">Discovery Adaptor</h2>
+<p>It is a future development.</p>
+
+<h2 id="message" name="message">Message Adaptor</h2>
+<p>This module manages chatting and messaging.</p>
+<p>Its main functionality is requesting for:
+ <ul>
+ <li>Creating Chatroom, Inviting to (or Ending) Chat</li>
+ <li>All Unread Messages</li>
+ <li>Read or Unseal Message</li>
+ <li>Forward Online or Unread Message</li>
+ <li>Save Call Log</li>
+ <li>Chat ID based on phone number</li>
+ </ul>
+</p>
+
+<h2 id="push" name="push">Push Adaptor</h2>
+<p>It just receives push notifications from push service.</p>
+
+<h2 id="shop" name="shop">Shop Adaptor</h2>
+<p>This module makes requests for:
+ <ul>
+ <li>List of Items</li>
+ <li>Item Information for Download</li>
+ <li>Download of Item</li>
+ <li>Item Panel URL</li>
+ </ul>
+</p>
+
+<h2 id="start_plugin" name="start_plugin">How to start plugin?</h2>
+<p>First we need to create service adaptor:</p>
+<pre class="prettyprint">
+int service_adaptor_create(service_adaptor_h *service_adaptor);
+</pre>
+
+<p>Than for valid service_adaptor handler we need to iterate to all installed plugins:</p>
+<pre class="prettyprint">
+int service_adaptor_foreach_plugin(service_adaptor_h service_adaptor,
+ service_adaptor_plugin_cb callback,
+ void *user_data);
+</pre>
+
+<p>Inside callback (which is invoked for each plugin) we get plugin_uri which is then passed to:</p>
+<pre class="prettyprint">
+int service_adaptor_create_plugin(service_adaptor_h service_adaptor,
+ const char *plugin_uri,
+ service_plugin_h *plugin);
+</pre>
+
+<p>And finally we have to request start initialization for service plugin:</p>
+<pre class="prettyprint">
+int service_plugin_start(service_plugin_h handle,
+ int service_flag);
+</pre>
+
+Below example starts all installed Auth and Storage plugins appending each plugin_uri to the list object:
+<pre class="prettyprint">
+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;
+}
+</pre>
+
+<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="../../../scripts/showhide.js"></script>
+</div></div></div>
+
+<a class="top sms" href="#"><img src="../../../images/btn_top.gif" alt="Go to top" /></a>
+
+<div id="footer">
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>
+</div>
+
+<script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+</body>
+</html>