Scope of document covers transformation rules for full and partial Object to XML and XML to Object transformation in compliance with “Server object (POJO|POCO) - HTML UI synchronization” document. XML is a source for data and operations definition.
FullXml has complete presentation of Object’s data up to
defined embedding level. If Object’s field’s value does not match,
it carries Update operation. I.e. values from XML will be populated in Object.
Request and response content stays same. Error info(if any) will be attached to
own field in response.
DiffXml is subset of full one which includes only one or several fields
to be updated. It could include additional info next to the field, like
validation error code/message or suggested values. It also used for operations
for object fields and array elements: List, Create, Update, Delete.
For sample object with structure
· A
o B
§ C
o FieldA
o Darr[3] (array of type D elements)
§ Darr[0]
§ Darr[1]
§ Darr[2]
· E
|
Request |
Obj. model |
Response |
Description |
|
|
Object/Field |
||||||
List |
<A> |
A |
<A> |
Return member names and values for simple objects. |
Get object A details. |
|
<A><B/></A> |
A.B |
<A><B><C/></B></A> |
|
Get A.B details |
||
|
<A><FieldA/></A> |
A.FieldA |
<A> |
|
Get A.FieldA value |
|
Create |
<A> |
A |
|
New A |
Same as in List, but subObject will be created if no exist |
|
<A><B/></A> |
|
|
A.B=new B |
|||
Update |
<A> |
A.FieldA=9 |
-||- |
Set A.FieldA to “ |
Reassign field value |
|
<A> |
Assigning to A.FieldA new value failed. Error info is attached |
Assign new value failed. |
||||
Delete |
<A deleted=”1”> |
deleteA; A=null; |
-||- |
|
Remove object |
|
|
<A> |
Delete A.B; |
-||- |
|
Remove subobject |
|
Array elements |
||||||
GetArr |
<A><Darr /></A> |
A.Darr |
<A><Darr > |
Get references to A.Darr elements. Reference: element root node with id in array. |
List of array elements ids |
|
GetArrEl |
<A><Darr > |
A.Darr[1] |
<A><Darr > |
Get a.Darr[1] (second element) content |
Single array element get. |
|
|
<A><Darr > |
|
|
Only elements with requested id will be retrieved |
Paging get |
|
Append |
<A><Darr><D/></Darr></A> |
A.Darr |
<A><Darr > |
No id in array element means “create one”. 4th element will be created and attached to array |
Increment array size |
|
Extract |
<A><Darr > |
|
-||- |
|
Remove element from array |
|
Reposition |
TBD |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-||- ::= response is s ::= response is same as request XML.
TBD: validation
Object load Xml -> Obj |
Edit Obj ->Xml+validation |
|
After object read body from XML DiffXml.Initialize(obj) subfields initialized obj.Init() (if method exist) obj.Validate() (if method exist) |
WriteObjBody obj.Validate() (if method exist) |
|
Exceptions are collected by DiffXml serializer |
Exceptions are collected by DiffXml serializer
and ebedded into XML as "errorcode" attributes. |
XOR | ||||||||
∀ X ≃ O | ||||||||
O:: | X? | !X && Validate | ||||||
simple | O = X | \ | ||||||
complex | ∀Of≃Xf | \ | ||||||
Heap | ∀Oi≃Xi | - | XOR | - | Init | Validate | ||
∅ | O=new |X| | / | Validate | |||||
XOR | ||||||||||||||
∀ X ≃ O | ||||||||||||||
O:: | X? | !X && Validate | ||||||||||||
simple | O = X | \ | ||||||||||||
complex | ∀Of≃Xf | <Of... | \ | XOR |
|
|||||||||
Heap | @length=xxx | ∀Oi≃Xi | <Oi id=xxx... | Init | @errorcode=initErr | Validate | @errorcode=validateErr | >value | ||||||
∅ | O=new |X| | / | |_ | Validate | @errorcode=validateErr | / | ||||||||
R:: <O... |
X | O | R | Init | Validate | |||
✓ | ✓ | ✓ | ✓ | ✓ | Full processing. Usual for Editor UI. | ||
✓ | ✓ |
Retrieve XML Save object into XML |
|||||
✓ | ✓ | ✓ |
Retrieve XML and validation results Viewer UI. |
||||
✓ | ✓ | Create object from XML | |||||