REST - Document - SavedSearch
REST-Interface
REST-Interface
Load a saved search by its ID.
URL
GET <application-url>/api/document/savedsearch/<savedSearchId>
Path parameter
Query parameter
Produces
application/json
application/xml
com.matterial.mtr.api.object.SavedSearch
Permission
Login
Sample
GET http://localhost:8080/mtr-backend/api/document/savedsearch/1
URL
GET <application-url>/api/document/savedsearch
Query parameter
Produces
application/json
application/xml
List<com.matterial.mtr.api.object.SavedSearch>
Permission
Login
Sample
GET http://localhost:8080/mtr-backend/api/document/savedsearch?orderBy=prio
When creating a saved search, the following properties can be passed in the consumed object:
Property | Description |
---|---|
name | The name of the saved search |
dashboardPrio | If > 0 then the saved search will be displayed on the dashboard. The actual dashboard priority can be set using the prio function (see below) |
dashboardStyle | The style of the dashboard: List=0, ListDark=1, ListLight=2, Columns=3, ColumnsDark=4, ColumnsLight=5, Grid=6, GridDark=7, GridLight=8 |
params | The search parameters. This is a Key-Value list where each item specifies a query parameter key and its value of the search to be executed. See Document Search for details. |
roleIds | Set the ids of the roles. The permission EDIT_GLOBAL_SAVED_SEARCH is required to set the roleIds |
URL
POST <application-url>/api/document/savedsearch
Consumes
application/json
application/xml
com.matterial.mtr.api.object.SavedSearch
Produces
application/json
application/xml
com.matterial.mtr.api.object.SavedSearch
Permission
Login
Sample
POST http://localhost:8080/mtr-backend/api/document/savedsearch
The properties that can be updated are the same as when creating a new saved search (see above)
URL
PUT <application-url>/api/document/savedsearch/<savedSearchId>
Path parameter
Consumes
application/json
application/xml
com.matterial.mtr.api.object.SavedSearch
Produces
application/json
application/xml
com.matterial.mtr.api.object.SavedSearch
Permission
Login
Sample
PUT http://localhost:8080/mtr-backend/api/document/savedsearch/4
This updates the dashboard prios
of all SavedSearches
. The order of the given list of ids define the new priority (first gets highest prio - the highest prio has the highest value in dashboardPrio).
URL
PUT <application-url>/api/document/savedsearch/prio
Query parameter
Consumes
application/json
application/xml
List of Long
Produces
text/plain
Integer - Count of updated SavedSearches
Permission
Login
Sample
PUT http://localhost:8080/mtr-backend/api/document/savedsearch/prio
URL
DELETE <application-url>/api/document/savedsearch/<savedSearchId>
Path parameter
Consumes
application/json
application/xml
com.matterial.mtr.api.object.SavedSearch
Produces
text/plain
Integer
- count of removed
Permission
Login
Sample
DELETE http://localhost:8080/mtr-backend/api/document/savedsearch/4
This recreates the initial saves searches:
latest documents
news
all
This just adds these three SavedSearches
without regarding if there are existing ones. This also will not set “Dashboard-Prios”. All new SavedSearches
will get a dashboardPrio = 1
.
URL
PUT <application-url>/api/document/savedsearch/initial
Produces
text/plain
Integer - Count of added SavedSearches
Permission
instanceOwnerRequired
Sample
PUT http://localhost:8080/mtr-backend/api/document/savedsearch/initial
Depending on the param “query”, this redirects to db-query or search-query.
URL
GET <application-url>/api/document/savedsearch/<savedSearchId>/execute
Path parameter
Query parameter
Produces
application/json
application/xml
com.matterial.mtr.api.object.SearchResult<Document>
Permission
Login
Sample
GET http://localhost:8080/mtr-backend/api/document/savedsearch/5/execute?count=true