From 5b74cd6f2b5cdd82273759aa7d72150dfff58a2c Mon Sep 17 00:00:00 2001 From: José Bollo Date: Mon, 12 Sep 2016 14:08:33 +0200 Subject: add documentation & ideas about config.xml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also enforce the strings for 'id' and 'version' to be not empty in config.xml Change-Id: I510b62891885033e0b750fac5f5de5e0fd25d75d Signed-off-by: José Bollo --- doc/widgets.html | 62 ++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 22 deletions(-) (limited to 'doc/widgets.html') diff --git a/doc/widgets.html b/doc/widgets.html index 5a22e4b..8c27577 100644 --- a/doc/widgets.html +++ b/doc/widgets.html @@ -8,29 +8,47 @@ The widgets - +
@@ -68,7 +86,7 @@ code > span.er { color: #ff0000; font-weight: bold; }

The configuration file config.xml

This is one of the important file of the widget. It fully describes the widget.

Here is the example of the config file for the QML application SmartHome.

-
<?xml version="1.0" encoding="UTF-8"?>
+
<?xml version="1.0" encoding="UTF-8"?>
 <widget xmlns="http://www.w3.org/ns/widgets" id="smarthome" version="0.1">
   <name>SmartHome</name>
   <icon src="smarthome.png"/>
@@ -77,7 +95,7 @@ code > span.er { color: #ff0000; font-weight: bold; }
 automated house. The user interface is completely done with QML.</description>
   <author>Qt team</author>
   <license>GPL</license>
-</widget>
+</widget>

The most important items are:

  • <widget id="......">: gives the id of the widget. It must be unique.

  • @@ -97,22 +115,22 @@ automated house. The user interface is completely done with QML.For all these commands, a tiny help is available with options -h or --help.

    There is no tool for unpacking a widget. For doing such operation, you can use the command unzip.

    To list the files of a widget:

    -
    $ unzip -l WIDGET
    +
    $ unzip -l WIDGET

    To extract a widget in some directory:

    -
    $ unzip WIDGET -d DIRECTORY
    +
    $ unzip WIDGET -d DIRECTORY

    Note that DIRECTORY will be created if needed.

    Signing a widget

    To sign a widget, you need a private key and its certificate.

    The tool wgtpkg-sign creates or replace a signature file in the directory of the widget BEFORE its packaging.

    There are two types of signature files: author and distributor.

    Example 1: add an author signature

    -
    $ wgtpkg-sign -a -k me.key.pem -c me.cert.pem DIRECTORY
    +
    $ wgtpkg-sign -a -k me.key.pem -c me.cert.pem DIRECTORY

    Example 2: add a distributor signature

    -
    $ wgtpkg-sign -k authority.key.pem -c authority.cert.pem DIRECTORY
    +
    $ wgtpkg-sign -k authority.key.pem -c authority.cert.pem DIRECTORY

    Packing a widget

    This operation can be done using the command zip but we provide the tool wgtpkg-pack that may add checking.

    Example:

    -
    $ wgtpkg-pack DIRECTORY -o file.wgt
    +
    $ wgtpkg-pack DIRECTORY -o file.wgt

    Getting data about a widget file

    The command wgtpkg-info opens a widget file, reads its config.xml file and displays its content in a human readable way.

    Writing a widget

    -- cgit