[% pagetitle = 'XML skin' %] [% techinfo = '1' %] [% lefttoright = '1' %] [% PROCESS helpheader.html %]

Overview

This document describes the XML skin, that allows the Squeezebox Server to return XML instead of HTML. It is designed to enable the integration of the Squeezebox Server with third party automation tools, such as AMX/Crestron touchpanels, or other "home grown" solutions.

The XML skin only changes what is returned by the Server, and not its interface. Please refer to The Squeezebox Server Web Interface documentation.

Usage

Because it is of no interest to human beings, this skin is hidden from the skin list available in the Server preferences. To enable the skin, use URLs with this general form:

http://server:port/xml/page.xml?parameter=value&...

where server, port, page, and parameter must be replaced by appropriate values. For example, to browse the music library (in the following examples, the Squeezebox Server is running on a computer with the IP address of 10.0.1.201 using the default port 9000):

http://10.0.1.201:9000/xml/browse.xml

The following values are possible for page:

For example:

http://10.0.1.201:9000/xml/browsedb.xml?hierarchy=genre,title&level=0&start=0&itemsPerPage=2

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE browse SYSTEM "html/slimserver_xml.dtd">
<browse xmlns="http://www.slimdevices.com/slimserver/xml">
   <song_count>19418 songs</song_count>
   <artist_count>1678 artists</artist_count>
   <album_count>1593 albums</album_count>
   <browseby>BROWSE_BY_GENRE</browseby>
   <location>
      <locator>
         <locator_name>Browse Genres</locator_name>
         <locator_url><![CDATA[xml/browsedb.xml?hierarchy=genre%2Ctrack&level=0]]></locator_url>
      </locator>
   </location>
   <offsets>
      <from>0</from>
      <to>1</to>
      <last>112</last>
   </offsets>
   <browse_entry>
      <entry_type>genre</entry_type>
      <entry_name>Acid House</entry_name>
      <entry_id>90</entry_id>
      <browse_url><![CDATA[xml/browsedb.xml?hierarchy=genre%2Ctrack&level=1&genre=90]]></browse_url>
      <replace_url><![CDATA[status.xml?command=playlist&subcommand=loadtracks&genre=90]]></replace_url>
      <append_url><![CDATA[status.xml?command=playlist&subcommand=addtracks&genre=90]]></append_url>
      <dir>
         <dir_name>Acid House</dir_name>
         <dir_browse_url><![CDATA[xml/browsedb.xml?hierarchy=genre%2Ctrack&level=1&genre=90]]></dir_browse_url>
         <genre>Acid House</genre>
      </dir>
   </browse_entry>
   <browse_entry>
      <entry_type>genre</entry_type>
      <entry_name>Acid Punk</entry_name>
      <entry_id>89</entry_id>
      <browse_url><![CDATA[xml/browsedb.xml?hierarchy=genre%2Ctrack&level=1&genre=89]]></browse_url>
      <replace_url><![CDATA[status.xml?command=playlist&subcommand=loadtracks&genre=89]]></replace_url>
      <append_url><![CDATA[status.xml?command=playlist&subcommand=addtracks&genre=89]]></append_url>
      <dir>
         <dir_name>Acid Punk</dir_name>
         <dir_browse_url><![CDATA[xml/browsedb.xml?hierarchy=genre%2Ctrack&level=1&genre=89]]></dir_browse_url>
         <genre>Acid Punk</genre>
      </dir>
   </browse_entry>
</browse>

General parameters

The following parameters are applicable to all pages that return many items (potentially all pages except songinfo.xml):

The following parameter must be added to the page status.xml:

The include.html file

The include.html file provides a location to set parameters for every page.
If desired, [% params.itemsPerPage = number %] could be added instead of adding it to every URL.
If a single player is automated, [% params.player = player_id %] could be another option.

Be aware that this file is within the Server software release. Any changes will be overwritten by any upgrade to the Server software.

Pages parameters

An efficient client can be implemented without knowing much about parameters, as the XML includes special tags (ending in _url) containing "links". In our example above, in order to browse the tracks with a genre of "Acid House", one simply requests the URL indicated by the browse_url. Similar tags exists for most operations. The player parameter should be added to any URL targetting a specific player, such as replace_url above.

search.xml parameters

The following parameters must be provided:

hitlist.xml parameters

hitlist.xml takes no parameters. hitlist.xml does not currently respect the start or itemsPerPage parameters.

Other pages parameters

Please refer to The Squeezebox Server Web Interface documentation for parameters to the status.xml page. Discovering the parameters of the other pages is left as an exercise to the reader.

PS: Seriously, the only way for a client to discover the value of parameters to browsetree.xml, browsedb.xml and songinfo.xml is to use the XML interface to browse the library in the first place. Therefore, the links will have been calculated for you already in the _url tags!.

The DTD

The XML skin comes with a heavily commented DTD, indicated in DOCTYPE and that can be served by the Squeezebox Server. Please refer to it for more information on the various tags returned.

Limitations

The skin does not support:

  1. Moodlogic URLs (because I have no way to test and I am unsure how "automated" the Moodlogic software is)
  2. Configuring the server and player
[% PROCESS helpfooter.html %]