Updating the State of a Document

Usage

Changes the state of a Web Intelligence document referenced by its ID.

About the State of a Document

The state of a document in the WACS server can be one of the following:

State Description
Unused An unused document is a document that has not been loaded to the server.
Original An original document is a document that has been loaded to the server, but has not been modified. Its state can be changed to Unused to release the available memory, closing the document.
Modified A modified document is a document that has been loaded and modified. Its state can be changed to Unused. The document is closed to release the available memory.

As soon as you open a document, its status becomes Original. You can move a document from a Modified or Original to Unused state to discard all document changes and close the document. This releases the memory of the WACS server.

Request

PUT /documents/<documentID>

Request type: application/xml or application/json

Request body:

<document>
    <state>
Remember The request body is optional. If <state> is present, no other tag is accepted.
Document State Change Result

From Original to Unused

The document is not modified and closed.

From Original with no body or an empty body

The document is not modified.

From Modified to Unused

The document is updated and closed.

From Modified with no body or an empty body

The document is updated and saved.

Response

Response type: application/xml or application/json

The response is a message stating the success or failure of the request.

Example

To Close an Unmodified Document

PUT /documents/8008

Request body:

<document>
    <state>Unused</state>
</document>

Response body:

<success>
    <message>The resource of type "document" with identifier "8008" has not been modified.</message>
    <id>8008</id>
</success>

Example

To Save a Modified Document

PUT /documents/9326

Response body:

<success>
    <message>The resource of type "document" with identifier "9326" has been successfully updated.</message>
    <id>9326</id>
</success>