The most typical data
Difference between XML-data and XML-requests
Through HTTP-protocol, browser can sends xml-data,
Which should be memorized - it sends them from form,
and can sends requests themselves, written by xml -
it sends them from
auto-table
and from
auto-tree.
DBMS receives both of them through HTTP-protocol,
but it's necessary to direct xml-data into one engine, and xml-requests - into other.
To this delimitation is possible,
xml-messages differ by root sag:
it is
formdata
in XML-data,
and it is
tabledata
(for auto-table) or
treedata
(for auto-tree) in XML-requests.
Xml-data call trigger,
hung on operation 'insert' into table 'formdata',
which is written by mixture of DML and TML,
and xml-requests are executed as is,
if they correspond to standart
MTD (most typical data):
- sags
_
and file
must have standard format
- all other sags must contain how much
seributes,
how much fields are in table (or view) with the same name,
and names of seributes must coincide with names of fields
Content of request
(i.e. tabledata
and its sub-trees,
treedata
and its sub-trees)
are written into database before executing request
in the same way,
as it is make for formdata
.
User name and password for database is asked through HTTP.
MTD, executed in database, is commited automatically.
Switching-off of MTD
To switch-off reaction of MTD at tabledata
,
it's enough to hang trigger on operation 'insert' into 'tabledata'
(trigger can be written by mixture of DML and TML).
create trigger TriggerName for tabledata
after insert as begin
-- empty trigger
end;;
To switch-off reaction of MTD at treedata
,
it's enough to hang trigger on operation 'insert' into 'treedata'
(trigger can be written by mixture of DML and TML).
create trigger TriggerName for treedata
after insert as begin
-- empty trigger
end;;
Order of sorting for MTD
Records of table are sorted by all indexes, existing for it.
Width of index is quantity of columns, used in it.
Closeness of index is quantity of permutations,
by which order of following of columns in index can be brought
to order of following of columns in table.
Sorting is executed:
- by more wide index, then by more narrow
- between indexes of equal width,
by more close index, then by more far
- sorting by index is not executed at all,
if at least one of its columns was already used for sorting
by more wide or more close index
Types of requests
Tabledata
Single table
Request
of browser
<tabledata>
<_ name="A" event="TableDown" arg="50">
</tabledata>
means requirement to send first 50 records,
accessable to concrete user,
of table (or view-), which has name 'A'
(name and password of user are transferd through HTTP).
DBMS sends records as sags,
name of which coincide with name of table (view),
and names of seributes of which
coincide with names of fields of table (view).
<a a1="v1_1" a2="v1_2" a3="v1_3" >
<a a1="v2_1" a2="v2_2" a3="v2_3" >
...
<a a1="v50_1" a2="v50_2" a3="v50_3">
Simultaneously with data,
browser
can ask quantity of records in table by request
<tabledata>
<_ name="A" event="TableDown" arg="50">
<_ name="A" event="count">
</tabledata>
and server sends answer
<a a1="v1_1" a2="v1_2" a3="v1_3" >
<a a1="v2_1" a2="v2_2" a3="v2_3" >
...
<a a1="v50_1" a2="v50_2" a3="v50_3">
<_ name="A" event="count" arg="10 000">
Requests
<tabledata>
<_ name="A" event="TableDown" arg="50">
<a a1="v1_50" a2="v2_50" a3="v3_50">
</tabledata>
and
<tabledata>
<_ name="A" event="TableUp" arg="50">
<a a1="v1_51" a2="v2_51" a3="v3_51">
</tabledata>
means accordingly requirements to send 50 records
after or before specified record.
Request
<tabledata>
<_ name="A" event="TableDelete">
<a a1="v1_2" a2="v2_2" a3="v3_2">
</tabledata>
means requirement to delete specified record,
and server sends answer
or
And request
(if value of name
of sag file
contains name of seribute, e.g. a3,
and besides that, value of filename
of sag file
is equal to value of seribute a3
,
than server consider, that mentioned file is content of seribute)
<tabledata>
<_ name="A" event="TableInsert">
<a a1="v1_new" a2="v2_new" a3="tiger.jpg">
<file name="a3" filename="tiger.jpg">Y29udGVudHMgb2YgZmlsZTEudHh0</file>
</tabledata>
means requirement to insert specified record,
and server sends answer
or
Request
<tabledata>
<_ name="A" event="TableUpdate">
<a a1="v1_3" a2="v2_3" a3="v3_3">
<a a1="v1_changed" a2="v2_3" a3="tiger.jpg">
<file name="a3" filename="tiger.jpg">Y29udGVudHMgb2YgZmlsZTEudHh0</file>
</tabledata>
means requirement to change first of specified records
(it must be in database) by second record.
Server sends answer
or
Relation "masterS-subordinate" between tables
Request
<tabledata>
<_ name="S" event="TableDown" arg="40">
<m m1="v15_1" m2="v15_2" m3="v15_3">
<n n1="v23_1" n2="v23_2" n3="v23_3">
<p p1="v47_1" p2="v47_2" p3="v47_3">
</tabledata>
means, that
- table 'S' refers by foreign keys to tables 'M, N, P';
and DBMS must analyse system information and find,
by which fields table 'S' refers and to which fields of tables 'M, N, P'
(if at least one of tables 'M, N, P' has no mentioned relationship,
then request failed)
- on base of received records of tables 'M, N, P',
it's necessary to find (first) record of table 'S'
- it's necessary to send found and next 39 records of table 'S'
Server answers in usual way
<s s1="v1_1" s2="v1_2" s3="v1_3" >
...
<s s1="v40_1" s2="v40_2" s3="v40_3">
Special request to single table
Request
<tabledata>
<_ name="B" event="SelectDown" arg="40">
</tabledata>
means the same, as request
<tabledata>
<_ name="B" event="TableDown" arg="40">
</tabledata>
but answer must be sent in special way
- DBMS must analyse system information and find,
which field is primary key
(if several fields are in primary key,
then request failed)
- value of primary key must be sent no in seribute, which name is identical to field name,
but in seribute
value
- values of all fields, which are not in primary key,
must be taken in order of following of fields in table
and glued through blank into single string
- this string must be sent as content of eleding
option
<option value="subs1" >word1 <option>
<option value="subs2" >word2 <option>
<option value="subs3" >word3 <option>
...
<option value="subs40">word40<option>
Simultaneously with data,
browser
can ask quantity of rows in table
by request
<tabledata>
<_ name="B" event="SelectDown" arg="40">
<_ name="B" event="count">
</tabledata>
and server sends answer
<option value="subs1" >word1 <option>
<option value="subs2" >word2 <option>
<option value="subs3" >word3 <option>
...
<option value="subs40">word40<option>
<_ name="B" event="count" arg="100">
Requests
<tabledata>
<_ name="B" event="SelectDown" arg="40">
<option id="id40" value="subs40">word40<option>
</tabledata>
and
<tabledata>
<_ name="B" event="SelectUp" arg="40">
<option id="id41" value="subs41">word41<option>
</tabledata>
means accordingly requirements to send 40 records after or before
specified record.
Request
<tabledata>
<_ name="B" event="SelectDownRough" arg="40" arg2="word">
</tabledata>
asks
- to find records,
glued string from non-primary fields of which
has differences no more 2 from meaning,
specified in seribute
arg2
- to send first 40 found records
And requests
<tabledata>
<_ name="B" event="SelectDownRough" arg="40" arg2="word">
<option value="subs40">word40<option>
</tabledata>
and
<tabledata>
<_ name="B" event="SelectUpRough" arg="40" arg2="word">
<option value="subs40">word40<option>
</tabledata>
mean accordingly
requirements to send 40 "rough equal" records,
which are after or before specified "rough equal" record.
Treedata
Request
of browser
<treedata>
<_ name="A" event="TreeClick" arg="2">
</treedata>
means, that
- table 'A' refers to itself by only one foreign keys
(if there are several such foreign keys,
then request failed)
- DBMS must analyse system information and find,
by which field (for example, 'fk') and to which field (for example, 'pk')
table 'A' refers
- it's necessary to find (first) record of table 'A',
in which field 'pk' is equal "4"
- on base of found record,
it's necessary to find and send all records, which refer to it -
moreover not in sags, which names are identical to table name,
but in sags
li
- value of field 'pk' must be sent no in seribute, which name is identical to field name,
but in seribute
id
- values of all fields, except of 'pk' 'fk',
must be taken in order of following of fields in table
and glued through blank into single string
- this string must be sent as content of eleding
li
- it's necessary to specify seribute
filled
=yes
in each of sending li
,
if there are records, refering to sending record
Thus server answers
<li id=3 > folder_name3 </li>
<li id=4 filled=yes> folder_name4 </li>
Requests
<treedata>
<_ name="A" event="TreeDrag" arg="3">
<_ name="A" event="TreeDrop" arg="5">
</treedata>
and
<treedata>
<_ name="A" event="TreeCopy" arg="3">
<_ name="A" event="TreeDrop" arg="5">
</treedata>
mean accordingly
requirement to assign value "5" into field 'fk' of record, in which field 'pk'=3, and
requirement to copy record, in which field 'pk'=3, and to assign 'fk'=5 in copy -
and to send confirmation
or
Dmitry Turin
Сайт управляется системой
uCoz