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) andeditor
(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 bejournalist
.
In order to change the state of a content item therefore, a client application needs to:
-
Retrieve the content item as described in Retrieve a Content Item.
-
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. -
Select the required new state from the list of possible transitions.
-
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
-
PUT
the modified content item back as described in Change a Content Item.
If content item staging is disabled, then:
-
The
vaext:state
element'shref
attribute will contain a slightly different URI containing the stringlegacy
. -
The returned resource will contain a different (smaller) set of possible state transitions.