The system permits to save and load "layouts". Layouts are not required if you simply want to query for data. A layout stores:
- The fields to retrieve with a query
- A name of the preset
- The default rows per page
- Other front end specific properties
The methods permit to:
- Current user default layout. For example, a user may want to always render a specific set of fields with specific column widths.
- System presets. Some lists propose predefined and commonly used layouts.
- User presets. As user can save a list of layouts with name.
URL
The following URLs permit to get, add, modify or delete layouts. All actions are private to the current user.
(GET) ./list/layouts
(GET) ./list/layouts/default
(PUT) ./list/layouts/userpresets
(PUT) ./list/layouts/default
MANAGE LAYOUTS
The following API methods are available:
URL | Description |
---|---|
(GET) list/layouts | Gets a list of all layouts. This is an object with properties:
|
(PUT) list/layouts/userpresets | Sets a list of user layouts. Include the JSON array in the HTTP BODY. To clear all presets, set an empty array.
|
(GET) list/layouts/default | Gets the user's default layout.
|
(PUT) list/layouts/default | Sets the user's default layout. Include the query object in the HTTP BODY. If the body is empty, the system restores the user default to the system default.
|
PRESET OBJECT
A preset object has these properties:
origin | Describes who created the layout:
| string |
name | The name of the layout. | string |
query | The query string. Not null. An empty string means that no filter will be applied. See Query language | string |
EXAMPLES
Calling /list/queries may return:
{ { "default": { "origin": "User", "name": "User default", "query": "" }, "userpresets": [{ "origin": "User", "name": "My query", "query": "{status} = 1 AND {locked} = false" }, ], "systempresets": [] } }