diff --git a/src/doc/specification/RecordType.rst b/src/doc/specification/RecordType.rst index cff3d0f91f9223395689c2dcea2ed8730ea621fb..266c538ddbe1ee892a7f0aa15fe1a4cad33ad469 100644 --- a/src/doc/specification/RecordType.rst +++ b/src/doc/specification/RecordType.rst @@ -4,14 +4,14 @@ RecordType Overview -------- -RecordTypes function as templates for [Records](Record), they provide -a description for a type of Record and define which -[Properties](Property) should be present. Properties come with an -_importance_ attribute which tells the user or client program how -strongly necessary the Property is. (As all other entities,) -RecordTypes can be inherited from other RecordTypes (or any +RecordTypes function as templates for :doc:`Records <Record>`, they +provide a description for a type of Record and define which +:doc:`Properties <AbstractProperty>` should be present. Properties +come with an `importance` attribute which tells the user or client +program how strongly necessary the Property is. (As all other +entities,) RecordTypes can be inherited from other RecordTypes (or any Entities). When RecordTypes inherit from other RecordTypes, the -_inheritance_ flag tells which properties shall be +`inheritance` flag tells which properties shall be Importance ~~~~~~~~~~ @@ -23,17 +23,17 @@ Properties can technically still be committed. :widths: 25 25 50 :width: 100% :header-rows: 1 - + * - Importance - Meaning - Consequence when omitted - * - `OBLIGATORY` + * - ``OBLIGATORY`` - Property must be present - *FIXME* Can be forced to be committed the server, but usually an error will be returned. - * - `RECOMMENDED` + * - ``RECOMMENDED`` - Property should be present (makes sense for most users) - *FIXME* Usually an error will be returned? - * - `SUGGESTED` (*FIXME* the default?) + * - ``SUGGESTED`` (*FIXME* the default?) - Property may be present (may make sense for some users) - *FIXME* No negative consequence? @@ -54,13 +54,13 @@ The _inheritance_ flag decides which [[Property|Properties]] are inherited from - Meaning * - _None_ (default) - Nothing is being inherited - * - `OBLIGATORY` - - *FIXME* Properteis of importance `OBLIGATORY` and above? - * - `SUGGESTED` - - *FIXME* Properteis of importance `SIGGESTED` and above, so the same effect as `ALL`? - * - `ALL` + * - ``OBLIGATORY`` + - *FIXME* Properteis of importance ``OBLIGATORY`` and above? + * - ``SUGGESTED`` + - *FIXME* Properteis of importance ``SIGGESTED`` and above, so the same effect as ``ALL``? + * - ``ALL`` - Copy everything from the parent. - * - `FIX` + * - ``FIX`` - *FIXME* in `tests/test_inheritance.py` of pyint_test this is used, what does it mean??? Examples @@ -74,53 +74,60 @@ Single-Get *Request:* - GET http://localhost:8122/mpidsserver/RecordType/1 +.. code-block:: + + GET http://localhost:8122/mpidsserver/RecordType/1 *Response:* - <?xml version="1.0" encoding="UTF-8"?> - <Response> - <RecordType id="1" name="Experiment" description="Description Experiment"> - <Property id="1" name="explanation" type="text" description="explains the thing" importance="obligatory" /> - <Property id="4" name="id" type="integer" description="identifier" exponent="0" importance="recommended" /> - <Property id="6" name="startDate" type="datetime" description="start" importance="obligatory" /> - <Property id="7" name="stopDate" type="datetime" description="stop" importance="recommended" /> - <Property id="12" name="file" type="file" description="file" importance="suggested" /> - </RecordType> - </Response> +.. code-block:: XML + + <?xml version="1.0" encoding="UTF-8"?> + <Response> + <RecordType id="1" name="Experiment" description="Description Experiment"> + <Property id="1" name="explanation" type="text" description="explains the thing" importance="obligatory" /> + <Property id="4" name="id" type="integer" description="identifier" exponent="0" importance="recommended" /> + <Property id="6" name="startDate" type="datetime" description="start" importance="obligatory" /> + <Property id="7" name="stopDate" type="datetime" description="stop" importance="recommended" /> + <Property id="12" name="file" type="file" description="file" importance="suggested" /> + </RecordType> + </Response> Multi-Get ^^^^^^^^^ *Request:* - GET http://localhost:8122/mpidsserver/RecordType/1&2&3 +.. code-block:: + + GET http://localhost:8122/mpidsserver/RecordType/1&2&3 *Response:* - <?xml version="1.0" encoding="UTF-8"?> - <?xml version="1.0" encoding="UTF-8"?> - <Response> - <RecordType id="1" name="Experiment" description="Description Experiment"> - <Property id="1" name="explanation" type="text" description="explains the thing" importance="obligatory" /> - <Property id="4" name="id" type="integer" description="identifier" exponent="0" importance="recommended" /> - <Property id="6" name="startDate" type="datetime" description="start" importance="obligatory" /> - <Property id="7" name="stopDate" type="datetime" description="stop" importance="recommended" /> - <Property id="12" name="file" type="file" description="file" importance="suggested" /> - </RecordType> - <RecordType id="2" name="Measurement" description="Description Measurement"> - <Property id="1" name="explanation" type="text" description="explains the thing" importance="obligatory" /> - <Property id="4" name="id" type="integer" description="identifier" exponent="0" importance="recommended" /> - <Property id="6" name="startDate" type="datetime" description="start" importance="obligatory" /> - <Property id="7" name="stopDate" type="datetime" description="stop" importance="recommended" /> - <Property id="12" name="file" type="file" description="file" importance="suggested" /> - </RecordType> - <RecordType id="3" name="Video" description="Description Video"> - <Property id="1" name="explanation" type="text" description="explains the thing" importance="recommended" /> - <Property id="6" name="startDate" type="datetime" description="start" importance="recommended" /> - <Property id="12" name="file" type="file" description="file" importance="obligatory" /> - </RecordType> - </Response> +.. code-block:: XML + + <?xml version="1.0" encoding="UTF-8"?> + <Response> + <RecordType id="1" name="Experiment" description="Description Experiment"> + <Property id="1" name="explanation" type="text" description="explains the thing" importance="obligatory" /> + <Property id="4" name="id" type="integer" description="identifier" exponent="0" importance="recommended" /> + <Property id="6" name="startDate" type="datetime" description="start" importance="obligatory" /> + <Property id="7" name="stopDate" type="datetime" description="stop" importance="recommended" /> + <Property id="12" name="file" type="file" description="file" importance="suggested" /> + </RecordType> + <RecordType id="2" name="Measurement" description="Description Measurement"> + <Property id="1" name="explanation" type="text" description="explains the thing" importance="obligatory" /> + <Property id="4" name="id" type="integer" description="identifier" exponent="0" importance="recommended" /> + <Property id="6" name="startDate" type="datetime" description="start" importance="obligatory" /> + <Property id="7" name="stopDate" type="datetime" description="stop" importance="recommended" /> + <Property id="12" name="file" type="file" description="file" importance="suggested" /> + </RecordType> + <RecordType id="3" name="Video" description="Description Video"> + <Property id="1" name="explanation" type="text" description="explains the thing" importance="recommended" /> + <Property id="6" name="startDate" type="datetime" description="start" importance="recommended" /> + <Property id="12" name="file" type="file" description="file" importance="obligatory" /> + </RecordType> + </Response> Get all @@ -128,13 +135,22 @@ Get all *Request:* - GET http://localhost:8122/mpidsserver/RecordType/ - GET http://localhost:8122/mpidsserver/RecordType +.. code-block:: + + GET http://localhost:8122/mpidsserver/RecordType/ + GET http://localhost:8122/mpidsserver/RecordType *Response:* - <?xml version="1.0" encoding="UTF-8"?> - <Response /> +.. note:: + + Outdated? + +.. code-block:: XML + + <?xml version="1.0" encoding="UTF-8"?> + <Response /> + [View Ticket #2](http://dev.bmp.ds.mpg.de/heartdb/ticket/2) @@ -143,73 +159,86 @@ POST Requests *Request is to be send to:* - POST http://localhost:8122/mpidsserver/RecordType/ - POST http://localhost:8122/mpidsserver/RecordType/ +.. code-block:: + + POST http://localhost:8122/mpidsserver/RecordType/ + POST http://localhost:8122/mpidsserver/RecordType/ Single-Post ^^^^^^^^^^^ *HTTP Body:* - <Post> - <RecordType name="TimmsRecordType11" > - <Property id="3" importance="recommended"/> - <Property id="4" importance="obligatory"/> - <Property name="age" /> - </RecordType> - </Post> +.. code-block:: XML + + <Post> + <RecordType name="TimmsRecordType11" > + <Property id="3" importance="recommended"/> + <Property id="4" importance="obligatory"/> + <Property name="age" /> + </RecordType> + </Post> *Response:* - <?xml version="1.0" encoding="UTF-8"?> - <Response> - <RecordType id="40" name="TimmsRecordType11"> - <Property id="3" name="name" type="text" description="Name" importance="recommended" /> - <Property id="4" name="id" type="integer" description="identifier" importance="suggested" /> - </RecordType> - </Response> +.. code-block:: XML + + <?xml version="1.0" encoding="UTF-8"?> + <Response> + <RecordType id="40" name="TimmsRecordType11"> + <Property id="3" name="name" type="text" description="Name" importance="recommended" /> + <Property id="4" name="id" type="integer" description="identifier" importance="suggested" /> + </RecordType> + </Response> Multi-Post ^^^^^^^^^^ *HTTP Body:* - <Post> - <RecordType name="TimmsRecordType11" > - <Property id="3" importance="recommended"/> - <Property id="4" importance="obligatory"/> - <Property name="age" /> - </RecordType> - <RecordType name="TimmsRecordType12" > - <Property id="6" importance="recommended"/> - <Property id="7" importance="obligatory"/> - <Property id="15" /> - </RecordType> - </Post> +.. code-block:: XML + + <Post> + <RecordType name="TimmsRecordType11" > + <Property id="3" importance="recommended"/> + <Property id="4" importance="obligatory"/> + <Property name="age" /> + </RecordType> + <RecordType name="TimmsRecordType12" > + <Property id="6" importance="recommended"/> + <Property id="7" importance="obligatory"/> + <Property id="15" /> + </RecordType> + </Post> *Response:* - <?xml version="1.0" encoding="UTF-8"?> - <Response> - <RecordType id="40" name="TimmsRecordType11" description="null"> - <Property id="3" name="name" type="text" description="Name" importance="recommended" /> - <Property id="4" name="id" type="integer" description="identifier" importance="suggested" /> - <Property id="3" name="name" type="text" description="Name" importance="recommended" /> - <Property id="4" name="id" type="integer" description="identifier" exponent="0" importance="suggested" /> - </RecordType> - <RecordType id="41" name="TimmsRecordType12"> - <Property id="6" name="startDate" type="datetime" description="start" importance="recommended" /> - <Property id="7" name="stopDate" type="datetime" description="stop" importance="suggested" /> - <Property id="15" name="TimmsIntProperty" type="integer" unit="kg" description="This is TimmsIntProperty" importance="suggested" /> - </RecordType> - </Response> - -= DELETE RecordTypes = - -HTTP-DELETE-requests are to be send to `http://${host}:${port}/mpidsserver/RecordType/...`. Default port is 8123. +.. code-block:: XML + + <?xml version="1.0" encoding="UTF-8"?> + <Response> + <RecordType id="40" name="TimmsRecordType11" description="null"> + <Property id="3" name="name" type="text" description="Name" importance="recommended" /> + <Property id="4" name="id" type="integer" description="identifier" importance="suggested" /> + <Property id="3" name="name" type="text" description="Name" importance="recommended" /> + <Property id="4" name="id" type="integer" description="identifier" exponent="0" importance="suggested" /> + </RecordType> + <RecordType id="41" name="TimmsRecordType12"> + <Property id="6" name="startDate" type="datetime" description="start" importance="recommended" /> + <Property id="7" name="stopDate" type="datetime" description="stop" importance="suggested" /> + <Property id="15" name="TimmsIntProperty" type="integer" unit="kg" description="This is TimmsIntProperty" importance="suggested" /> + </RecordType> + </Response> + +DELETE RecordTypes +~~~~~~~~~~~~~~~~~~ + +HTTP-DELETE-requests are to be send to ``http://${host}:${port}/mpidsserver/RecordType/...``. Default port is 8123. *Example* -{{{ -DELETE http://${host}:${port}/mpidsserver/RecordType/1&2&3&4 -}}} + +.. code-block:: + + DELETE http://${host}:${port}/mpidsserver/RecordType/1&2&3&4 +