Delete a Section

Deleting a section is not as straightforward as deleting a content item or person. There may be content items that depend on its existence. Any content items that have this section as their home section must either be:

  • Moved to a new home section, or

  • Deleted together with the section

When a selection is deleted it is actually removed from the database - the operation is irreversible. Moreover, any content items that you delete along with it are also physically deleted. So deleting content items indirectly in this way is a much more significant operation than deleting them directly - an ordinary content item delete operation just changes the content item's state to deleted.

To start a delete operation, send an HTTP DELETE request to the same URI that would be used to retrieve it (see Retrieve a Section). For example:

curl --include -u user:password -X DELETE \
> http://host-ip-address/webservice/escenic/section/20
HTTP/1.1 303 See Other
Server: Apache-Coyote/1.1
Date: Tue, 20 Mar 2012 09:12:00 GMT
Location: http://host-ip-address/webservice/escenic/section/20/delete

The usual response to this request is 303 See Other, and includes a Location header as shown above. You must then:

  1. GET the resource referenced in the Location header:

    curl -u user:password http://host-ip-address/webservice/escenic/section/20/delete

    The resource will be an Atom entry containing an empty VDF payload document something like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <entry xmlns="">
      <content type="application/vnd.vizrt.payload+xml">
        <vdf:payload xmlns:vdf=""
  2. GET the VDF model document referenced by the VDF payload:

    curl -u user:password http://host-ip-address/webservice/escenic/model/com.escenic.section.delete.20

    This provides the information you need to be able to add correctly formatted information to the payload document:

    <?xml version="1.0" encoding="UTF-8"?>
    <vdf:model xmlns:vdf="">
        <vdf:fielddef name="com.escenic.section.delete.title"
                         label="Delete section"
        <vdf:fielddef name="com.escenic.section.delete.replacement"
                         label="&lt;html&gt;The section with name &quot;Section Name&quot; contains 892 content item(s). You can&lt;br/&gt;choose a new home section for your content item(s) or allow the content item(s)&lt;br/&gt;to be deleted&lt;/html&gt;"
          <vdf:choice scope="limit">
            <vdf:collection src="escenic/section" select="title"/>
        <vdf:fielddef name="com.escenic.section.delete.confirmation"
                         label="Do you really want to delete this section?"
  3. Add information to the empty VDF payload document that complies with the schema in the model document. The VDF model specifies that the payload can contain three fields:

    • com.escenic.section.delete.title: This field is defined as read-only (contenteditable="false") so there is no point specifing a value for it.

    • com.escenic.section.delete.replacement: If you return the URL of another section in this field, then any content items belonging to the deleted section will be moved to it. If you leave the field empty or unspecified, then the content items will be deleted along with the section.

    • com.escenic.section.delete.confirmation : You must return true in this field to confirm deletion of the section. If you return false or specify nothing then the delete operation is canceled.

    This example will complete the section deletion and move all the orphaned content items to a new section:

    <?xml version="1.0" encoding="UTF-8"?>
    <entry xmlns="">
      <content type="application/vnd.vizrt.payload+xml">
        <vdf:payload xmlns:vdf=""
          <vdf:field name="com.escenic.section.delete.replacement">
            <vdf:origin href="http://host-ip-address/webservice/escenic/section/15"/>
          <vdf:field name="com.escenic.section.delete.confirmation">
  4. PUT the resource back to the same location. If you saved the Atom entry in a file called my-delete-section.xml, for example, then you could use the following curl command:

    curl --include -u user:password -X PUT -H "Content-Type: application/atom+xml" \
    > http://host-ip-address/webservice/escenic/section/20/delete --upload-file my-delete-section.xml
    HTTP/1.1 100 Continue
    HTTP/1.1 204 No Content
    Server: Apache-Coyote/1.1
    Date: Tue, 19 Feb 2013 05:50:26 GMT