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