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