[ACR-47] Guideline for Service Adaptor.
authorGrzegorz Reszka <g.reszka@samsung.com>
Thu, 25 Jun 2015 10:07:35 +0000 (12:07 +0200)
committerGrzegorz Reszka <g.reszka@samsung.com>
Thu, 25 Jun 2015 11:47:30 +0000 (13:47 +0200)
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 <g.reszka@samsung.com>
org.tizen.guides/html/index.htm
org.tizen.guides/html/native/social/service_adaptor_n.htm [moved from org.tizen.guides/html/native/social/service_adaptor_client_n.html with 98% similarity]
org.tizen.guides/html/native/social/social_guide_n.htm
org.tizen.guides/html/web/tizen/social/service_adaptor_w.htm [new file with mode: 0644]
org.tizen.guides/html/web/tizen/social/social_guide_w.htm

index 74a70f2..1b5b07b 100644 (file)
@@ -92,6 +92,7 @@
                                                <li><a href="web/tizen/social/call_history_w.htm">Call History</a></li>
                                                <li><a href="web/tizen/social/contact_w.htm">Contact</a></li>
                                                <li><a href="web/tizen/social/data_sync_w.htm">Data Synchronization</a></li>
+                                               <li><a href="web/tizen/social/service_adaptor_w.htm">Service Adaptor</a></li>
                                        </ul>
                                </li>                           
                                <li><a href="web/tizen/localization/localization_w.htm">Localization</a></li>
@@ -59,7 +59,7 @@ But main of them are following:
     <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:
+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:
 
 <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>
index 657d5a4..5385b87 100644 (file)
 
   <p>The main social features are:</p>
   <ul>
-       <li><a href="phonenumber_util_n.htm">Phonenumber-utils</a> 
+       <li><a href="phonenumber_util_n.htm">Phonenumber-utils</a>
        <p>Allows you to parse and format phone numbers.</p></li>
   </ul>
-  
- <p>The following guides apply in <span style="color: red">mobile applications only</span>:</p> 
-  
+
+ <p>The following guides apply in <span style="color: red">mobile applications only</span>:</p>
+
   <ul>
-   <li><a href="account_manager_n.htm">Account Manager</a> 
+   <li><a href="account_manager_n.htm">Account Manager</a>
    <p>Allows you to work with accounts in your application by creating, managing and removing individual accounts.</p></li>
    <li><a href="calendar_n.htm">Calendar</a> <p>Allows you to work with personal scheduling data by managing calendars, events, and todos, and setting reminders and recurrence properties. You can also search for calendar book entries and receive calendar book change notifications.</p></li>
    <li><a href="contact_n.htm">Contacts</a> <p>Allows you to work with contact information in your application by retrieving and managing individual contact information, searching for contacts, and receiving address book change notifications. </p></li>
-  </ul>
+   <li><a href="service_adaptor_n.htm">Service Adaptor</a> <p>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.</p></li>
+</ul>
+
 <script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
 <script type="text/javascript" src="../../scripts/showhide.js"></script>
 </div></div></div>
@@ -72,4 +73,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
 </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
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 (file)
index 0000000..fc0ee20
--- /dev/null
@@ -0,0 +1,230 @@
+<!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>
index c687e5c..aef61e5 100644 (file)
@@ -54,6 +54,7 @@
    <li><a href="call_history_w.htm">Call History</a> <p>Allows you to search, manage, and monitor the call history of a device.</p></li>
    <li><a href="contact_w.htm">Contact</a> <p>Allows you to manage address books and contacts on a device.</p></li>
    <li><a href="data_sync_w.htm">Data Synchronization</a> <p>Allows you to synchronize device data, such as contacts and calendar events, with the OMA DS server.</p></li>
+   <li><a href="service_adaptor_w.htm">Service Adaptor</a> <p>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.</p></li>
   </ul>
 
 <script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
@@ -77,4 +78,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
 </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>