Skip to main content Skip to navigation

Marking a file as deleted

To mark a file as deleted (or, conversely, to restore a deleted file) we set the <sitebuilder:deleted> element. This allows us to perform Sitebuilder two-stage deletes, where a file can be deleted but not purged (the Atom Publishing Protocol DELETE method actually purges the file, see Purging a file).

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="" xmlns:sitebuilder="">

With this saved as deletepage.atom:

mat@augustus:~$ curl -i -X PUT --data-binary @deletepage.atom -H 'Content-Type: application/atom+xml' -u cuscav
Enter host password for user 'cuscav':

HTTP/1.1 200 OK
Date: Tue, 22 Mar 2011 11:52:16 GMT
Server: Penny
Content-Type: application/atom+xml;charset=ISO-8859-1
Content-Length: 1123
Vary: User-Agent

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="" xmlns:sitebuilder="">
  <title>Exam Results 2011</title>
  <link rel="collection" 
    href="" />
  <link rel="edit" 
    href="" />
  <link rel="alternate" 
    href="" />
    <name>Mathew Mannion</name>
  <sitebuilder:description>A changed ATOM description</sitebuilder:description>
  <sitebuilder:keywords>api tests, atom, file, changed</sitebuilder:keywords>

This is identical to the response for changing file properties. If we set <sitebuilder:deleted> to true, we can restore a deleted file.