<div class="separator"></div>
<a title="Tizen Avengers - WebApi Guidelines" class="brand" href="#" style="background-image:url(images/tizen-logo_32h.png)"></a>
<div class="separator"></div>
- <ul id="sections"><li class="l2"><a href="#revision-history">Revision History</a></li><li class="l2"><a href="#overview">Overview</a></li><li class="l2"><a href="#guideline">Guideline</a><ul><li class="l3"><a href="#guideline/languages">Languages</a></li><li class="l3"><a href="#guideline/coding-style">Coding style</a></li><li class="l3"><a href="#guideline/api-guide">API guide</a></li><li class="l3"><a href="#guideline/unit-test-criteria">Unit test criteria</a></li><li class="l3"><a href="#guideline/source-code">Source code</a></li><li class="l3"><a href="#guideline/license-and-boilerplate">License and Boilerplate</a></li></ul></li><li class="l2"><a href="#plugin-structure">Plugin Structure</a><ul><li class="l3"><a href="#plugin-structure/conventions">Conventions</a></li><li class="l3"><a href="#plugin-structure/structure">Structure</a></li><li class="l3"><a href="#plugin-structure/spec-file">Spec file</a></li><li class="l3"><a href="#plugin-structure/gyp-file">GYP file</a></li><li class="l3"><a href="#plugin-structure/implementation-files">Implementation files</a></li><li class="l3"><a href="#plugin-structure/plugin-flow">Plugin flow</a></li></ul></li><li class="l2"><a href="#widl">WIDL</a><ul><li class="l3"><a href="#widl/conventions">Conventions</a></li><li class="l3"><a href="#widl/architecture">Architecture</a></li><li class="l3"><a href="#widl/example">Example</a></li></ul></li><li class="l2"><a href="#tools">Tools</a><ul><li class="l3"><a href="#tools/generate-stub-code">Generate stub code</a></li><li class="l3"><a href="#tools/using-multiple-javascript-files">Using multiple JavaScript files</a></li></ul></li><li class="l2"><a href="#implementation-javascript">Implementation - JavaScript</a><ul><li class="l3"><a href="#implementation-javascript/interface-creation">Interface creation</a></li><li class="l3"><a href="#implementation-javascript/creating-manager-entity">Creating Manager entity</a></li><li class="l3"><a href="#implementation-javascript/properties-definition">Properties definition</a></li><li class="l3"><a href="#implementation-javascript/methods-definition">Methods definition</a></li><li class="l3"><a href="#implementation-javascript/exporting-interface">Exporting interface</a></li><li class="l3"><a href="#implementation-javascript/utils">Utils</a></li><li class="l3"><a href="#implementation-javascript/exceptions">Exceptions</a></li><li class="l3"><a href="#implementation-javascript/synchronous-methods">Synchronous methods</a></li><li class="l3"><a href="#implementation-javascript/asynchronous-methods">Asynchronous methods</a></li><li class="l3"><a href="#implementation-javascript/listeners">Listeners</a></li></ul></li><li class="l2"><a href="#implementation-c">Implementation - C++</a><ul><li class="l3"><a href="#implementation-c/lifecycle-and-plugin-state">Lifecycle and plugin state</a></li><li class="l3"><a href="#implementation-c/privileges">Privileges</a></li><li class="l3"><a href="#implementation-c/namespace-and-entry-points">Namespace and entry points</a></li><li class="l3"><a href="#implementation-c/plugin-structure">Plugin structure</a></li><li class="l3"><a href="#implementation-c/asynchronous-calls">Asynchronous calls</a></li><li class="l3"><a href="#implementation-c/listeners">Listeners</a></li><li class="l3"><a href="#implementation-c/logger">Logger</a></li><li class="l3"><a href="#implementation-c/error-handling">Error handling</a></li></ul></li><li class="l2"><a href="#devel-package">Devel package</a><ul><li class="l3"><a href="#devel-package/package-structure">Package structure</a></li><li class="l3"><a href="#devel-package/creating-custom-web-device-plugins-module">Creating custom web device plugins module</a></li></ul></li></ul>
+ <ul id="sections"><li class="l2"><a href="#revision-history">Revision History</a></li><li class="l2"><a href="#overview">Overview</a></li><li class="l2"><a href="#guideline">Guideline</a><ul><li class="l3"><a href="#guideline/languages">Languages</a></li><li class="l3"><a href="#guideline/coding-style">Coding style</a></li><li class="l3"><a href="#guideline/api-guide">API guide</a></li><li class="l3"><a href="#guideline/unit-test-criteria">Unit test criteria</a></li><li class="l3"><a href="#guideline/source-code">Source code</a></li><li class="l3"><a href="#guideline/license-and-boilerplate">License and Boilerplate</a></li></ul></li><li class="l2"><a href="#plugin-structure">Plugin Structure</a><ul><li class="l3"><a href="#plugin-structure/conventions">Conventions</a></li><li class="l3"><a href="#plugin-structure/structure">Structure</a></li><li class="l3"><a href="#plugin-structure/spec-file">Spec file</a></li><li class="l3"><a href="#plugin-structure/manifest-file">Manifest file</a></li><li class="l3"><a href="#plugin-structure/gyp-file">GYP file</a></li><li class="l3"><a href="#plugin-structure/implementation-files">Implementation files</a></li><li class="l3"><a href="#plugin-structure/plugin-flow">Plugin flow</a></li></ul></li><li class="l2"><a href="#widl">WIDL</a><ul><li class="l3"><a href="#widl/conventions">Conventions</a></li><li class="l3"><a href="#widl/architecture">Architecture</a></li><li class="l3"><a href="#widl/example">Example</a></li></ul></li><li class="l2"><a href="#tools">Tools</a><ul><li class="l3"><a href="#tools/generate-stub-code">Generate stub code</a></li><li class="l3"><a href="#tools/using-multiple-javascript-files">Using multiple JavaScript files</a></li></ul></li><li class="l2"><a href="#implementation-javascript">Implementation - JavaScript</a><ul><li class="l3"><a href="#implementation-javascript/interface-creation">Interface creation</a></li><li class="l3"><a href="#implementation-javascript/creating-manager-entity">Creating Manager entity</a></li><li class="l3"><a href="#implementation-javascript/properties-definition">Properties definition</a></li><li class="l3"><a href="#implementation-javascript/methods-definition">Methods definition</a></li><li class="l3"><a href="#implementation-javascript/exporting-interface">Exporting interface</a></li><li class="l3"><a href="#implementation-javascript/utils">Utils</a></li><li class="l3"><a href="#implementation-javascript/exceptions">Exceptions</a></li><li class="l3"><a href="#implementation-javascript/synchronous-methods">Synchronous methods</a></li><li class="l3"><a href="#implementation-javascript/asynchronous-methods">Asynchronous methods</a></li><li class="l3"><a href="#implementation-javascript/listeners">Listeners</a></li></ul></li><li class="l2"><a href="#implementation-c">Implementation - C++</a><ul><li class="l3"><a href="#implementation-c/lifecycle-and-plugin-state">Lifecycle and plugin state</a></li><li class="l3"><a href="#implementation-c/privileges">Privileges</a></li><li class="l3"><a href="#implementation-c/namespace-and-entry-points">Namespace and entry points</a></li><li class="l3"><a href="#implementation-c/plugin-structure">Plugin structure</a></li><li class="l3"><a href="#implementation-c/asynchronous-calls">Asynchronous calls</a></li><li class="l3"><a href="#implementation-c/listeners">Listeners</a></li><li class="l3"><a href="#implementation-c/logger">Logger</a></li><li class="l3"><a href="#implementation-c/error-handling">Error handling</a></li></ul></li><li class="l2"><a href="#devel-package">Devel package</a><ul><li class="l3"><a href="#devel-package/package-structure">Package structure</a></li><li class="l3"><a href="#devel-package/creating-custom-web-device-plugins-module">Creating custom web device plugins module</a></li></ul></li></ul>
<div class="separator"></div>
<div class="extra generated">
Generated by <a href="https://github.com/DimitarChristoff/doctor" target="_blank" title="generate documentation from markdown">Doctor, MD</a>
<td>0.1.0</td>
<td>2015-05-15</td>
<td>Initial Draft</td>
-<td>Wojciech Kosowicz<br><a href="mailto:w.kosowicz@samsung.com">w.kosowicz@samsung.com</a></td>
+<td>Wojciech Kosowicz<br><a href="mailto:w.kosowicz@samsung.com">w.kosowicz@samsung.com</a></td>
</tr>
<tr>
<td>0.2.0</td>
<td>2015-05-22</td>
<td>Extended version</td>
-<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">p.kaczmarek3@samsung.com</a></td>
+<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">p.kaczmarek3@samsung.com</a></td>
</tr>
<tr>
<td>0.2.1</td>
<td>2015-06-01</td>
<td>Proofreading</td>
-<td>Rafal Galka<br><a href="mailto:r.galka@samsung.com">r.galka@samsung.com</a></td>
+<td>Rafal Galka<br><a href="mailto:r.galka@samsung.com">r.galka@samsung.com</a></td>
</tr>
<tr>
<td>0.3.0</td>
<td>2015-06-08</td>
<td>Supplemented C++ implementation guide</td>
-<td>Rafal Galka<br><a href="mailto:r.galka@samsung.com">r.galka@samsung.com</a></td>
+<td>Rafal Galka<br><a href="mailto:r.galka@samsung.com">r.galka@samsung.com</a></td>
</tr>
<tr>
<td>0.4.0</td>
<td>2015-06-16</td>
<td>Guideline</td>
-<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">p.kaczmarek3@samsung.com</a></td>
+<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">p.kaczmarek3@samsung.com</a></td>
</tr>
<tr>
<td>0.5.0</td>
<td>2015-06-18</td>
<td>Devel package</td>
-<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">p.kaczmarek3@samsung.com</a></td>
+<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">p.kaczmarek3@samsung.com</a></td>
</tr>
<tr>
<td>0.5.1</td>
<td>2015-06-24</td>
<td>Add info about WAPIOven.py</td>
-<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">p.kaczmarek3@samsung.com</a></td>
+<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">p.kaczmarek3@samsung.com</a></td>
</tr>
<tr>
<td>0.6.0</td>
<td>2016-10-28</td>
<td>update devel package for tizen 3.0</td>
-<td>Annie Park<br><a href="mailto:hj.na.park@samsung.com">hj.na.park@samsung.com</a></td>
+<td>Annie Park<br><a href="mailto:hj.na.park@samsung.com">hj.na.park@samsung.com</a></td>
</tr>
</tbody>
</table>
</ul>
<h3 id="plugin-structure/spec-file">Spec file</h3>
<p>Spec file (<code>webapi-plugins.spec</code>) kept inside <code>packaging/</code> directory
-is build specification file used by rpm packaging system where variables are defined.
+is build specification file used by RPM packaging system where variables are defined.
Those variables can be used to include or exclude particular modules from
build for each profile (mobile, TV, wearable).</p>
+<h3 id="plugin-structure/manifest-file">Manifest file</h3>
+<p>Each RPM package must have a manifest file where developers can specify the access control domain
+in which their application should be running and potentially additional security policies for the
+application. It is necessary to build the project. The manifest file (<code>webapi-plugins.manifest</code>)
+is located in the root directory of the project.</p>
<h3 id="plugin-structure/gyp-file">GYP file</h3>
<p>Each plugin has its own gyp file that contains information specific for it.
Plugin configuration file (gyp) is the equivalent of CMake.
<p>All plugins instances are created by runtime on application launch.
It's important to not initialize any database/service connections and platform
handlers in instance constructor. All resources should be "lazy" initialized
-just before first use, to keep starting time as short as possible.
+just before first use, to keep starting time as short as possible. At the beginning
+the initializer loads only basic information from plugins.json. This file is being
+generated during plugins build process, its body depends on defined modules.
Initialized resources can be referenced to instance and kept for further usage.
Instance destructor is called on application termination and should release all
used resources to prevent memory leaks.</p>
identifier should be passed again and additional check if object still exists
should be made.</p>
<h3 id="implementation-c/privileges">Privileges</h3>
-<p>Some of the API methods require privilege access. In Tizen 3.0 checking if application has privilege
-to call method has been moved to C++ layer. It's the first step which should be checked.</p>
+<p>Some of the API methods require privilege access. The privilege engine used in the project is Cynara.
+In Tizen 3.0 checking if application has privilege to call method has been moved to C++ layer. It's the
+first step which should be checked.</p>
<p>Below can be found example of using Privilege in Alarm API:</p>
<pre class="prettyprint linenums"><code class="lang-cpp">const std::string kPrivilegeAlarm = "http://tizen.org/privilege/alarm.get";
|-----------pylib
|-------------gyp
|---------------generator
+|---------slimit
+|-----------ply
+|-----------tests
+|-----------visitors
|---lib
|-----pkgconfig
</code></pre>
All plugins instances are created by runtime on application launch.
It's important to not initialize any database/service connections and platform
handlers in instance constructor. All resources should be "lazy" initialized
-just before first use, to keep starting time as short as possible.
+just before first use, to keep starting time as short as possible. At the beginning
+the initializer loads only basic information from plugins.json. This file is being
+generated during plugins build process, its body depends on defined modules.
Initialized resources can be referenced to instance and kept for further usage.
Instance destructor is called on application termination and should release all
used resources to prevent memory leaks.
### Privileges
-Some of the API methods require privilege access. In Tizen 3.0 checking if application has privilege
-to call method has been moved to C++ layer. It's the first step which should be checked.
+Some of the API methods require privilege access. The privilege engine used in the project is Cynara.
+In Tizen 3.0 checking if application has privilege to call method has been moved to C++ layer. It's the
+first step which should be checked.
Below can be found example of using Privilege in Alarm API: