Change Content Item State

The Atom entry resource representing a retrieved content item always contains an app:control element containing information about the current state of the content item. For example:

<app:control>
  <app:draft>yes</app:draft>
  <vaext:state name="draft-published" 
               href="http://host-ip-address/webservice/escenic/content/state/draft-published/editor"/>
</app:control>

The important element here is the vaext:state element. It always has the following two attributes:

name

The name of the current state.

href

The URI of a resource containing information about the state transitions that may be performed by the current user. If you look at the example above, you will see that the last two parts of the URI are draft-published (the current state) and editor (the role of the user that submitted the request). If the user who retrieved this content item had journalist access rights, then the last part of this URI would be journalist.

In order to change the state of a content item therefore, a client application needs to:

  1. Retrieve the content item as described in Retrieve a Content Item.

  2. Retrieve the list of possible state transitions for the content item using the URI in the vaext:state element. See Example State Transitions Document for an example of what this resource looks like.

  3. Select the required new state from the list of possible transitions.

  4. Insert the new state into the vaext:state element of the retrieved content item. For example:

    <vaext:state name="draft-published" 
                 href="http://host-ip-address/webservice/escenic/content/state/draft-published/editor">
      draft-submitted
    </vaext:state
  5. PUT the modified content item back as described in Change a Content Item.

If content item staging is disabled, then:

  • The vaext:state element's href attribute will contain a slightly different URI containing the string legacy.

  • The returned resource will contain a different (smaller) set of possible state transitions.