| Update transaction changes
10 Update Transaction
The request format is specified to be multipart/form-data (see rfc 2388), with the following keys:
- Resource - The ResourceID of the Resource being modified.
- ClassName - the ClassName of the Class being modified
- Action - (formerly Validate) one of the following specified actions: Update | Autopop | Validate
- Type - the UpdateName of the Update being performed
- Record - See below
- WarningResponse - See below
- Object - See below
Record and WarningResponse both have a Content-Type (remember, each key is a separate MIME message part) of text/xml. The format of Record is -
<Record>
1*(<Field name="SystemName">NewValue</Field>)
</Record>
And the format of WarningResponse is
<WarningResponse>
1*(<Response number="warning-num">response</Response>)
</WarningResponse>
The WarningResponse value is optional (see RCP 031). If no response is entered for an optional response, an empty element <Response number="warning-num"/> may be used.
The Object key may only be specified for an Add or Modify Update on the Object resource (see RCP 040). This modified transaction eliminates the need for a specialized PostObject transaction, but the Object Resource is needed for this to work.
The response body format remains unchanged.
Alternate solution:
Instead of using multipart/form-data, we could specify a complete XML container format for the Update Transaction request. The Content-Type of the Post would then be XML, and the format would be roughly as follows:
<Update>
<Resource>resource-id</Resource>
<Class>class-name</Class>
<Action> Autopop | Validate | Update </Action>
<Type> UpdateName </Type>
<Record> 1* (<Field ... as above />) </Record>
<WarningResponse> ... contents as above ... </WarningResponse>
</Update>
This eliminates the need for multipart parsing for servers that do not support object upload, but makes two separate parse paths based on Content-Type submitted by the client. Image upload would have to use a multipart/form-data content-type with one part called Update with type text/xml and the above XML structure, and the other part being an Object name as specified above. |