Skip to main content

Marking a page as deleted

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

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:sitebuilder="http://go.warwick.ac.uk/elab-schemas/atom">
  <sitebuilder:deleted>true</sitebuilder:deleted>
</entry>

With this saved as deletepage.atom:

mat@augustus:~$ curl -i -X PUT --data-binary @deletepage.atom -H 'Content-Type: application/atom+xml' -u cuscav
   "https://sitebuilder.warwick.ac.uk/sitebuilder2/edit/atom/atom.htm?page=/fac/sci/chemistry/mynewpage&type=single"
Enter host password for user 'cuscav':

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

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:sitebuilder="http://go.warwick.ac.uk/elab-schemas/atom">
  <title>Here is my edited page</title>
  <link rel="collection" 
    href="https://sitebuilder.warwick.ac.uk/sitebuilder2/edit/atom/atom.htm?page=/fac/sci/chemistry/mynewpage&type=list" />
  <link rel="edit" 
    href="https://sitebuilder.warwick.ac.uk/sitebuilder2/edit/atom/atom.htm?page=/fac/sci/chemistry/mynewpage&type=single" />
  <link rel="alternate" 
    href="http://www2.warwick.ac.uk/fac/sci/chemistry/mynewpage" />
  <id>urn:uuid:094d43ed2eb4e006012edd22205e7f97</id>
  <content type="html">
    &lt;h2&gt;Hello World!&lt;/h2&gt;
    &lt;p&gt;Here is my newly created page&lt;/p&gt;
    &lt;p&gt;This is an extra line in the modified content of the page.&lt;/p&gt;
  </content>
  <author>
    <name>Mathew Mannion</name>
  </author>
  <updated>2011-03-22T10:58:59Z</updated>
  <published>2011-03-22T10:58:59Z</published>
  <sitebuilder:page-name>mynewpage</sitebuilder:page-name>
  <sitebuilder:searchable>true</sitebuilder:searchable>
  <sitebuilder:visible>true</sitebuilder:visible>
  <sitebuilder:deleted>true</sitebuilder:deleted>
  <sitebuilder:span-rhs>false</sitebuilder:span-rhs>
  <sitebuilder:description>A test of the ATOM representation of a page</sitebuilder:description>
  <sitebuilder:keywords>api tests, atom, changed</sitebuilder:keywords>
</entry>  

This is identical to the response for editing the content of a page. If we set <sitebuilder:deleted> to true, we can restore a deleted page.