XML repository descriptor file
From SpinetiX Support Wiki
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.
To pull content from a standard HTTP server, follow these steps:
- Create a repository on your HTTP server.
- Upload your content to the HTTP server.
- 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).
- 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)
This is the top level element; it must be in the spinetix project namespace (http://www.spinetix.com/namespace/1.0/spxproj ).
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.
<multistatus xmlns="DAV:" xml:base="http://demo.spinetix.com/project/default/">
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.
URI of the multimedia file to be uploaded to the HMP. The URI is relative to the address of the repository.
<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.
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.
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>