The JSON compact format purpose is to retrieve the master data using a lightweight structure. It follows the key-value design to display data in the simplest way and without any technical information. To activate the compact format, the compact
suffixed REST category, like data-compact
or form-data-compact
, must be used in URL.
The request body is represented by a JSON Object
whose content varies according to the operation and the category.
Dataset node
Specifies the target values of terminal nodes under the specified node. This request is used for the dataset node update operation.
{ "nodeName1": true, "nodeName2": 2, "nodeName3": "Hello" }
To ensure a JSON symmetric structure between the HTTP request and the HTTP response, enumeration node request format is like the following:
{ "enumerationNode": { "key": "a key value" } }
Record
Specifies the target record content by setting the value of each field. For missing fields, the behavior depends on the request parameter byDelta
. This structure is used for table record insert, record update or selector's select operation when local enumeration dependency field values are declared.
{ "gender": { "key": "M" }, "lastName": "Chopin", "lastName-en": "Chopin", "firstName": "Fryderyk", "firstName-en": "Frédéric", "birthDate": "1810-03-01", "deathDate": "1849-10-17", "jobs": [ { "key": "CM" }, { "key": "PI" } ], "infos": [ "https://en.wikipedia.org/wiki/Chopin" ] }
Record fields
Specifies the target values of fields under the record terminal node by setting the value of each field. For missing fields, the behavior depends on the request parameter byDelta
. This structure is only used for table record updates.
{ "jobs": [ { "key": "CM" }, { "key": "PI" } ] }
Record table
Defines the content of one or more records by indicating the value of each field. For missing fields, the behavior depends on the parameter of the request byDelta
. This structure is used upon insert or update records in the table.
[ { "gender": { "key": "M" }, "lastName": "Saint-Saëns", "firstName": "Camille", "birthDate": "1835-10-09", ... }, { "gender": { "key": "M" }, "lastName": "Debussy", "firstName": "Claude", "birthDate": "1862-10-22", ... } ]
Record table to delete
Defines one or more records. This structure is used upon deleting several records from the same table.
[ { "details": "http://.../root/table/1" }, { "details": "http://.../root/table/2" }, { "primaryKey": "./oid=3" }, { "foreignKey": "4" }, ... ]
Field
Specifies the target field content. This request is used upon field update.
The request has the same structure as defined in node value.
Open or close user interface
Specifies whether the user interface is open or close and the unavailability message.
{ "toolStatus": { "key": true, // or false "label": "Open" }, "toolStatusCloseMessage": "Access is temporarily forbidden for maintenance." }
Only writable fields can be mentioned in the request, this excludes the following cases:
Association node,
Selection node,
Value function,
JavaBean field that does not have a setter,
Unwritable permission on node for the authenticated user.
The response body is represented by a JSON Object
whose content depends on the operation and the category.
Dataset node
Contains the list of terminal nodes under the specified node.
{ "nodeName1": true, "nodeName2": 2, "nodeName3": "Hello" }
Table
JSON Object
containing the following properties:
rows
corresponding to JSON Array
of selected records. Each record is represented by a JSON Object
. If no record is selected, then the JSON Array
is empty.
(Optional) pagination
containing pagination data.
{ "rows": [ { "id": 1, "firstName": "Claude", "lastName": "Levi-Strauss" }, { "id": 2, "firstName": "Sigmoud", "lastName": "Freud" }, { "id": 3, "firstName": "Alfred", "lastName": "Dreyfus" } ], "pagination": { "firstPage": null, "previousPage": null, "nextPage": "http://.../root/individu?pageRecordFilter=./id=9&pageSize=9&pageAction=next", "lastPage": "http://.../root/individu?pageSize=9&pageAction=last" } }
Record
JSON Object
containing the record content.
{ "pk": "pk1", "name": "Name1", "name-fr": "Name1", "parent": null }
Fields
The compact json format does not support the association and selection nodes.
For other kinds of nodes, they contain the current node value.
Retrieve the user interface state
Contains the user interface status and the unavailability message.
{ "toolStatus": { "key": true, // or false "label": "Open" }, "toolStatusCloseMessage": "Access is temporarily forbidden for maintenance." }
Nodes, records and fields property and value may be hidden depending on their resolved permissions (see permissions) .
This section is always included and contains master data without any additional fields.
The node value contains only the data or the label and the details link in case of enumeration. It is available for all nodes except association and selection.
Corresponds to a key-value JSON entry which describes the node content.
XML Schema | JSON format | Examples |
---|---|---|
Group
|
Contains a property per sub-node. | Example for a simple-occurrence group. { "road": "11 rue scribe", "zipcode": "75009", "country": "France" } |
List
|
Contains an array of all field occurrences represented by a JSON Each JSON | Example for a multi-occurrence field of [ 0, 1, 2, 3, 4 ] Example for a multi-occurrence group. [ { "road": "11 rue scribe", "zipcode": "75009", "country": "France" }, { "road": "711 Atlantic Ave", "zipcode": "MA 02111", "country": "United States" } ] |
Enumeration
|
Contains | Example for a foreign key. { "key":"1", "details":"http://.../Bdataspace/dataset/root/nationality/FRA", "label":"Française" } |