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
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/doxbook/xml/4.3/docbookx.dtd">
<section id="application-file-format" xreflabel="application manifest files">
<title>Application manifest file format</title>
<para>
Applications using libacounts-glib should supply a manifest: a simple XML file
describing the application and the services that it will use. An example is
shown below:
</para>
<example>
<title>Application manifest for a gallery application</title>
<programlisting><?xml version="1.0" encoding="UTF-8"?>
<application id="Gallery">
<description>Image gallery</description>
<desktop-entry>gallery</desktop-entry>
<translations>gallery</translations>
<services>
<service id="OtherService">
<description>Publish images on OtherService</description>
</service>
</services>
<service-types>
<service-type id="sharing">
<description>Share your images with your friends</description>
</service-type>
</service-types>
</application></programlisting>
</example>
<para>
The example application manifest describes an application called
<literal>Gallery</literal>, indicated by the
<sgmltag class="attribute" role="xml">id</sgmltag> attribute on the
<sgmltag class="element" role="xml">application</sgmltag> element. The
<sgmltag class="element" role="xml">description</sgmltag> is a string that
describes the application in general, and is also used for specific services
and service types. The
<sgmltag class="element" role="xml">desktop-entry</sgmltag> element is only
required if the basename of the desktop file is different than the basename of
the application manifest, where the basename is the filename excluding any file
extension. The <sgmltag class="element" role="xml">translations</sgmltag>
element is used to indicate the gettext translation domain for the
<sgmltag class="element" role="xml">name</sgmltag> and
<sgmltag class="element" role="xml">description</sgmltag> elements, to be used
by applications when showing those elements in a UI. The
<sgmltag class="element" role="xml">services</sgmltag> element contains
individual <sgmltag class="element" role="xml">service</sgmltag> elements, with
an <sgmltag class="attribute" role="xml">id</sgmltag> attribute that
corresponds to an installed service. Finally, a
<sgmltag class="element" role="xml">service-types</sgmltag> element contains
individual <sgmltag class="element" role="xml">service-type</sgmltag> elements,
which act in the same way as for services.
<note>
<para>
It is only useful to list services in the manifest if a separate description
is desired for each service, such as if some special features are
supported by the application, beyond those suggested by the general
description and the service type.
</para>
</note>
</para>
<section>
<title>Installation</title>
<para>
Application manifest filenames should end in
<filename class="extension">.application</filename> and be installed to
<filename class="directory">${prefix}/share/accounts/applications</filename>,
which normally expands to
<filename class="directory">/usr/share/accounts/applications</filename>. The
path can be queried with <command>pkg-config</command> by checking the
<varname>applicationfilesdir</varname> variable of the libaccounts-glib
pkg-config file, for example:
</para>
<informalexample>
<programlisting>pkg-config --variable=applicationfilesdir libaccounts-glib</programlisting>
</informalexample>
</section>
</section>
|