The system permits to save and load queries:
- Current user default query. For example, a user may decide to always apply a filter when running a query without explicit query string.
- System presets. Some lists propose predefined and commonly used queries.
- User presets. As user can save a list of queries with name.
URL
The following URLs permit to get, add, modify or delete layouts. All actions are private to the current user.
(GET) ./list/queries
(GET) ./list/queries/default
(PUT) ./list/queries/userpresets
(PUT) ./list/queries/default
MANAGE PRESETS
The following API methods are available:
URL | Description |
---|---|
(GET) list/queries | Gets a list of all queries. This is an object with properties:
|
(PUT) list/queries/userpresets | Sets a list of user presets. Include the JSON array in the HTTP BODY. To clear all presets, set an empty array.
|
(GET) list/queries/default | Gets the user's default query. This is the same object you receive in the "default" property when calling list/queries (see above).
|
(PUT) list/queries/default | Sets the user's default query. Include the query object in the HTTP BODY. If the body is empty, the system clears the query (no filter applied).
|
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": [] } }