documentation: adds required-binding entry
[src/app-framework-main.git] / doc / writing-config.xml.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4   <meta charset="utf-8">
5   <meta name="generator" content="pandoc">
6   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
7   <meta name="author" content="José Bollo">
8   <title>Writing the configuration file &quot;config.xml&quot;</title>
9   <style type="text/css">code{white-space: pre;}</style>
10   <style type="text/css">
11 div.sourceCode { overflow-x: auto; }
12 table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
13   margin: 0; padding: 0; vertical-align: baseline; border: none; }
14 table.sourceCode { width: 100%; line-height: 100%; }
15 td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
16 td.sourceCode { padding-left: 5px; }
17 code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
18 code > span.dt { color: #902000; } /* DataType */
19 code > span.dv { color: #40a070; } /* DecVal */
20 code > span.bn { color: #40a070; } /* BaseN */
21 code > span.fl { color: #40a070; } /* Float */
22 code > span.ch { color: #4070a0; } /* Char */
23 code > span.st { color: #4070a0; } /* String */
24 code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
25 code > span.ot { color: #007020; } /* Other */
26 code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
27 code > span.fu { color: #06287e; } /* Function */
28 code > span.er { color: #ff0000; font-weight: bold; } /* Error */
29 code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
30 code > span.cn { color: #880000; } /* Constant */
31 code > span.sc { color: #4070a0; } /* SpecialChar */
32 code > span.vs { color: #4070a0; } /* VerbatimString */
33 code > span.ss { color: #bb6688; } /* SpecialString */
34 code > span.im { } /* Import */
35 code > span.va { color: #19177c; } /* Variable */
36 code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
37 code > span.op { color: #666666; } /* Operator */
38 code > span.bu { } /* BuiltIn */
39 code > span.ex { } /* Extension */
40 code > span.pp { color: #bc7a00; } /* Preprocessor */
41 code > span.at { color: #7d9029; } /* Attribute */
42 code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
43 code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
44 code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
45 code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
46   </style>
47   <link rel="stylesheet" href="doc.css">
48   <!--[if lt IE 9]>
49     <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
50   <![endif]-->
51 </head>
52 <body>
53 <header>
54 <h1 class="title">Writing the configuration file &quot;config.xml&quot;</h1>
55 <h2 class="author">José Bollo</h2>
56 <h3 class="date">12 septembre 2016</h3>
57 </header>
58 <nav id="TOC">
59 <ul>
60 <li><a href="#writing-the-configuration-file-config.xml">Writing the configuration file &quot;config.xml&quot;</a><ul>
61 <li><a href="#about-config.xml">About &quot;config.xml&quot;</a></li>
62 <li><a href="#example-of-config.xml">Example of &quot;config.xml&quot;</a></li>
63 <li><a href="#standard-elements-of-config.xml">Standard elements of &quot;config.xml&quot;</a><ul>
64 <li><a href="#the-element-widget">The element widget</a></li>
65 <li><a href="#the-element-content">The element content</a></li>
66 <li><a href="#the-element-icon">The element icon</a></li>
67 </ul></li>
68 <li><a href="#known-widget-types-and-content">Known widget types and content</a></li>
69 <li><a href="#agl-features">AGL features</a><ul>
70 <li><a href="#feature-nameurnaglrequired-binding">feature name=&quot;urn:AGL:required-binding&quot;</a></li>
71 <li><a href="#feature-nameurnaglrequired-permissions">feature name=&quot;urn:AGL:required-permissions&quot;</a></li>
72 <li><a href="#feature-nameurnaglprovides-binding">feature name=&quot;urn:AGL:provides-binding&quot;</a></li>
73 <li><a href="#feature-nameurnagldefined-permissions">feature name=&quot;urn:AGL:defined-permissions&quot;</a></li>
74 </ul></li>
75 </ul></li>
76 </ul>
77 </nav>
78 <h1 id="writing-the-configuration-file-config.xml">Writing the configuration file &quot;config.xml&quot;</h1>
79 <h2 id="about-config.xml">About &quot;config.xml&quot;</h2>
80 <p>The file <strong>config.xml</strong> describes important data of the application to the framework:</p>
81 <ul>
82 <li>the unique identifier of the application</li>
83 <li>the name of the application</li>
84 <li>the type of the application</li>
85 <li>the icon of the application</li>
86 <li>the permissions linked to the application</li>
87 <li>the services and dependancies of the application</li>
88 </ul>
89 <p>The file MUST be at the root of the widget and MUST be case sensitively name <strong><em>config.xml</em></strong>.</p>
90 <p>The file <strong>config.xml</strong> is a XML file described by the document <a href="http://www.w3.org/TR/widgets" title="Packaged Web Apps">widgets</a>.</p>
91 <h2 id="example-of-config.xml">Example of &quot;config.xml&quot;</h2>
92 <p>Here is the example of the config file for the QML application SmartHome.</p>
93 <div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"><span class="kw">&lt;?xml</span> version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;<span class="kw">?&gt;</span>
94 <span class="kw">&lt;widget</span><span class="ot"> xmlns=</span><span class="st">&quot;http://www.w3.org/ns/widgets&quot;</span><span class="ot"> id=</span><span class="st">&quot;smarthome&quot;</span><span class="ot"> version=</span><span class="st">&quot;0.1&quot;</span><span class="kw">&gt;</span>
95   <span class="kw">&lt;name&gt;</span>SmartHome<span class="kw">&lt;/name&gt;</span>
96   <span class="kw">&lt;icon</span><span class="ot"> src=</span><span class="st">&quot;smarthome.png&quot;</span><span class="kw">/&gt;</span>
97   <span class="kw">&lt;content</span><span class="ot"> src=</span><span class="st">&quot;qml/smarthome/smarthome.qml&quot;</span><span class="ot"> type=</span><span class="st">&quot;text/vnd.qt.qml&quot;</span><span class="kw">/&gt;</span>
98   <span class="kw">&lt;description&gt;</span>
99     This is the Smarthome QML demo application.
100     It shows some user interfaces for controlling an automated house.
101     The user interface is completely done with QML.
102   <span class="kw">&lt;/description&gt;</span>
103   <span class="kw">&lt;author&gt;</span>Qt team<span class="kw">&lt;/author&gt;</span>
104   <span class="kw">&lt;license&gt;</span>GPL<span class="kw">&lt;/license&gt;</span>
105 <span class="kw">&lt;/widget&gt;</span></code></pre></div>
106 <h2 id="standard-elements-of-config.xml">Standard elements of &quot;config.xml&quot;</h2>
107 <h3 id="the-element-widget">The element widget</h3>
108 <h4 id="the-attribute-id-of-widget">the attribute id of widget</h4>
109 <p>The attribute <em>id</em> is mandatory (for version 2.x, blowfish) and must be unique.</p>
110 <p>Values for <em>id</em> are any non empty string containing only latin letters, arabic digits, and the three characters '.' (dot), '-' (dash) and '_' (underscore).</p>
111 <p>Authors can use a mnemonic id or can pick a unique id using command <strong>uuid</strong> or <strong>uuidgen</strong>.</p>
112 <h4 id="the-attribute-version-of-widget">the attribute version of widget</h4>
113 <p>The attribute <em>version</em> is mandatory (for version 2.x, blowfish).</p>
114 <p>Values for <em>id</em> are any non empty string containing only latin letters, arabic digits, and the three characters '.' (dot), '-' (dash) and '_' (underscore).</p>
115 <p>Version values are dot separated fields MAJOR.MINOR.REVISION.</p>
116 <h3 id="the-element-content">The element content</h3>
117 <p>The element <em>content</em> is mandatory (for version 2.x, blowfish) and must designate a file (subject to localisation) with its attribute <em>src</em>.</p>
118 <p>The content designed depends on its type. See below for the known types.</p>
119 <h3 id="the-element-icon">The element icon</h3>
120 <p>The element <em>icon</em> is mandatory (for version 2.x, blowfish) and must be unique. It must designate an image file with its attribute <em>src</em>.</p>
121 <h2 id="known-widget-types-and-content">Known widget types and content</h2>
122 <p>The configuration file <strong><em>/etc/afm/afm-launch.conf</em></strong> defines the types of widget known and how to launch it.</p>
123 <p>Known types for the type of content are (for version 2.x, blowfish):</p>
124 <ul>
125 <li><p><strong><em>text/html</em></strong>: HTML application, content.src designates the home page of the application</p></li>
126 <li><p><strong><em>application/x-executable</em></strong>: Native application, content.src designates the relative path of the binary</p></li>
127 <li><p><strong><em>application/vnd.agl.url</em></strong>: Internet url, content.src designates the url to be used</p></li>
128 <li><p><strong><em>application/vnd.agl.service</em></strong>: AGL service defined as a binder, content.src designates the directory of provided binders, http content, if any, must be put in the subdirectory <strong><em>htdocs</em></strong> of the widget</p></li>
129 <li><p><strong><em>application/vnd.agl.native</em></strong>: Native application with AGL service defined as a binder, content.src designates the relative path of the binary, bindings, if any must be put in the subdirectory <strong><em>lib</em></strong> of the widget, http content, if any, must be put in the subdirectory <strong><em>htdocs</em></strong> of the widget</p></li>
130 <li><p><strong><em>text/vnd.qt.qml</em></strong>, <strong><em>application/vnd.agl.qml</em></strong>: QML application, content.src designate the relative path of the QML root, imports must be put in the subdirectory <strong><em>imports</em></strong> of the widget</p></li>
131 <li><p><strong><em>application/vnd.agl.qml.hybrid</em></strong>: QML application with bindings, content.src designate the relative path of the QML root, bindings, if any must be put in the subdirectory <strong><em>lib</em></strong> of the widget, imports must be put in the subdirectory <strong><em>imports</em></strong> of the widget</p></li>
132 <li><p><strong><em>application/vnd.agl.html.hybrid</em></strong>: HTML application, content.src designates the home page of the application, bindings, if any must be put in the subdirectory <strong><em>lib</em></strong> of the widget, http content must be put in the subdirectory <strong><em>htdocs</em></strong> of the widget</p></li>
133 </ul>
134 <h2 id="agl-features">AGL features</h2>
135 <p>The AGL framework uses the feature tag for specifying security and binding requirement of the widget.</p>
136 <p>The current version of AGL (up to 2.0.1, blowfish) has no fully implemented features.</p>
137 <p>The features planned to be implemented are described below.</p>
138 <h3 id="feature-nameurnaglrequired-binding">feature name=&quot;urn:AGL:required-binding&quot;</h3>
139 <p>List of the bindings required by the widget.</p>
140 <p>Each required binding must be explicited using a <param> entry.</p>
141 <h4 id="param-namerequired-binding-name">param name=[required binding name]</h4>
142 <p>The value is either:</p>
143 <ul>
144 <li>required: the binding is mandatorily needed except if the feature isn't required (required=&quot;false&quot;) and in that case it is optional.</li>
145 <li>optional: the binding is optional</li>
146 </ul>
147 <h3 id="feature-nameurnaglrequired-permissions">feature name=&quot;urn:AGL:required-permissions&quot;</h3>
148 <p>List of the permissions required by the widget.</p>
149 <p>Each required permission must be explicited using a <param> entry.</p>
150 <h4 id="param-namerequired-permission-name">param name=[required permission name]</h4>
151 <p>The value is either:</p>
152 <ul>
153 <li>required: the permission is mandatorily needed except if the feature isn't required (required=&quot;false&quot;) and in that case it is optional.</li>
154 <li>optional: the permission is optional</li>
155 </ul>
156 <h3 id="feature-nameurnaglprovides-binding">feature name=&quot;urn:AGL:provides-binding&quot;</h3>
157 <p>Use this feature for each provided binding of the widget. The parameters are:</p>
158 <h4 id="param-namename">param name=&quot;name&quot;</h4>
159 <p>REQUIRED</p>
160 <p>The value is the string that must match the binding prefix. It must be unique.</p>
161 <h4 id="param-namesrc">param name=&quot;src&quot;</h4>
162 <p>REQUIRED</p>
163 <p>The value is the path of the shared library for the binding.</p>
164 <h4 id="param-nametype">param name=&quot;type&quot;</h4>
165 <p>REQUIRED</p>
166 <p>Currently it must be <strong><em>application/vnd.agl.binding.v1</em></strong>.</p>
167 <h4 id="param-namescope">param name=&quot;scope&quot;</h4>
168 <p>REQUIRED</p>
169 <p>The value indicate the availability of the binidng:</p>
170 <ul>
171 <li>private: used only by the widget</li>
172 <li>public: available to allowed clients as a remote service (requires permission+)</li>
173 <li>inline: available to allowed clients inside their binding (unsafe, requires permission+++)</li>
174 </ul>
175 <h4 id="param-nameneeded-binding">param name=&quot;needed-binding&quot;</h4>
176 <p>OPTIONAL</p>
177 <p>The value is a space separated list of binding's names that the binding needs.</p>
178 <h3 id="feature-nameurnagldefined-permissions">feature name=&quot;urn:AGL:defined-permissions&quot;</h3>
179 <p>Each required permission must be explicited using a <param> entry.</p>
180 <h4 id="param-namedefined-permission-name">param name=[defined permission name]</h4>
181 <p>The value is the level of the defined permission. Standard levels are:</p>
182 <ul>
183 <li>system</li>
184 <li>platform</li>
185 <li>partner</li>
186 <li>public</li>
187 </ul>
188 <p>This level defines the level of accreditation required to get the given permission. The accreditions are given by signatures of widgets.</p>
189 </body>
190 </html>