XML repository descriptor file

From SpinetiX Support Wiki

Jump to: navigation, search

These instructions apply when the Pull Mode web server does not have WebDAV extension enabled.

Pull content from a web server without WebDAV

There is no standard method of listing the content of a repository using the HTTP protocol. For this reason, a custom XML file describing the content of your repository must be available to the HMP if you are using an HTTP server without WebDAV support with Pull Mode.

Note Note:
Starting with version 3.1.0, Elementi M and Elementi X automatically generate this file ("spx-listing.xml") within the project during publishing. See Publish Location page for more details about this feature.

To pull content from a standard HTTP server, follow these steps:

  1. Create a repository on your HTTP server.
  2. Upload your content to the HTTP server.
  3. Create the XML description of your repository.
    • The description may be static or generated in an automatic manner (for instance, using PHP as demonstrated in the Files pull XML sample).
  4. Use the URI of the XML description as the source for your publish process.

XML description of HTTP repository

The XML description of the HTTP repository uses the XML structure of the WebDAV protocol to answer a PROPFIND command (See section 12 of the WebDAV RFC)

projects

<projects xmlns="http://www.spinetix.com/namespace/1.0/spxproj">

This is the top level element; it must be in the spinetix project namespace (http://www.spinetix.com/namespace/1.0/spxproj ).

multistatus

<multistatus xmlns="DAV:">

This contains the complete description of the repository and must be in the "DAV:" namespace. There can be more than one multistatus entry in the XML file allowing to merge files from different sources into a single project. In this case, this element can include an optional attribute xml:base which links to the base of the repository. If this attribute is absent, the HMP assumes that the XML file is located in the root of your repository.

Example:

<multistatus xmlns="DAV:" xml:base="http://demo.spinetix.com/project/default/">

response

<response xmlns="DAV:">

Contains the description of a multimedia file or a directory. There should be a <response> element per file to be uploaded to the HMP. Note that if sub-folders are present in the project, the folder itself must also be specified in the list of resources.

The root of the repository MUST be present in the list of resources.

href

<href xmlns="DAV:">

URI of the multimedia file to be uploaded to the HMP. The URI is relative to the address of the repository.

propstats

<propstat xmlns="DAV:"> 
  <prop xmlns="DAV:">
     ...
  </prop>
</propstat>

Containers for the properties of the current file. Properties are not compulsory. Note that the <propstat> element might be omitted, but is supported for compatibility with the WebDAV protocol.

It is recommended to specify either the <getetag> or the <getlastmodified> properties which will be used by Pull mode to check for file modifications. If neither of those properties is present the files will be uploaded each time the publish action is performed.

getetag

<getetag xmlns="DAV:">

Specify the ETag of the file.

The ETag is an identifier that must be unique for each file. Two files with the same ETag and the same file name will be considered as identical. The HMP will use the ETag to check whether a file must be uploaded or not.

getlastmodified

<getlastmodified xmlns="DAV:">

Specify the date of the last modification of a file.

If the ETag is not present, the HMP will use the date of the last modification to check whether a file must be uploaded or not.

Example of XML description

This shows an example of an XML description of a server containing index.svg and spinetix.svg files, in a folder called media.

This example can be downloaded from http://demo.spinetix.com/project/default/publish.xml

<?xml version="1.0" encoding="UTF-8"?>
<projects xmlns="http://www.spinetix.com/namespace/1.0/spxproj">
 <multistatus xmlns="DAV:" xml:base="http://demo.spinetix.com/project/default/">
  <response>
   <href>/</href>
  </response>
  <response>
   <href>/index.svg</href>
   <propstat>
    <prop>
     <getetag>"3d06d7-7e0-f58a7c0"</getetag>
    </prop>
   </propstat>
  </response>
  <response>
   <href>/media/</href>
  </response>
  <response>
   <href>/media/spinetix.svg</href>
   <propstat>
    <prop>
     <getlastmodified>Wed, 23 Jul 2008 13:38:37 GMT</getlastmodified>
    </prop>
   </propstat>
  </response>
 </multistatus>
</projects>
This page was last modified on 5 December 2019, at 19:36.