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
|
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "AppStream.ent">
%BOOK_ENTITIES;
]>
<section id="sect-AppStream-Misc-URIHandler">
<title>URI Handler</title>
<section id="spec-asuri-introduction">
<title>Introduction</title>
<para>
In order to allow installation of AppStream components from websites, software-centers implementing AppStream
may choose to also support the <literal>appstream:</literal> URIs.
</para>
<para>
This allows upstream projects to trigger an installation of their application from their homepage on any supporting
distribution.
It also is helpful for web-based software-centers.
</para>
</section>
<section id="spec-asuri-schema">
<title>URI schema</title>
<para>
Software centers handling <literal>appstream:</literal> URIs should provide a handler for the <literal>x-scheme-handler/appstream</literal>
mimetype.
An AppStream URI follows the schema <code>appstream:%{component-id}</code>.
</para>
<para>
If a component is known by multiple alternative IDs, more component IDs may be defined in a comma-separated list in the query component
of the URI using the <code>alt</code> key. This may be necessary if an application has switched its ID, but the same URI may be called on systems
which still only know the old ID.
Software centers must try to find the initial ID first and, failing to find it in their catalog, may try the alternative IDs in order of appearance
in the query.
</para>
<para>
Example HTML code:
</para>
<programlisting language="HTML"><![CDATA[<a href="appstream:org.kde.discover.desktop">Install KDE Discover</a>
<a href="appstream:org.gnome.Software.desktop">Install GNOME-Software</a>
<a href="appstream:org.freedesktop.appstream.cli">Install AppStreamCLI</a>
<a href="appstream:org.example.foo?alt=com.github.darthvader.foo,net.launchpad.vader.foo">Install Foo</a>]]></programlisting>
</section>
<section id="spec-asuri-button">
<title>AppStream Buttons</title>
<para>
If you want to allow users to open your software in their local software center from your website, you might want to use
one of the easily recognizable AppStream buttons for your <code>appstream:</code> link.
</para>
<mediaobject>
<imageobject>
<imagedata fileref="appstream-button1.svg" />
</imageobject>
<caption>
<para>
<ulink url="https://github.com/ximion/appstream/blob/master/docs/images/src/svg/appstream-button1.svg">SVG</ulink>
</para>
</caption>
</mediaobject>
<mediaobject>
<imageobject>
<imagedata fileref="appstream-button2.svg" />
</imageobject>
<caption>
<para>
<ulink url="https://github.com/ximion/appstream/blob/master/docs/images/src/svg/appstream-button2.svg">SVG</ulink>
</para>
</caption>
</mediaobject>
</section>
</section>
|