REST - Document - SavedSearch
REST-Interface
Get saved search by id
Load a saved search by its ID.
URL
GET <application-url>/api/document/savedsearch/<savedSearchId>
Path parameter
-
savedSearchId
The id of a specific Saved Search
Query parameter
-
languageKey
possible: de, en, fr, it, …
default: de
language key
Produces
application/json
application/xml
com.matterial.mtr.api.object.SavedSearch
- 200 OK
- 400 BAD_REQUEST
- 404 NOT_FOUND
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
GET http://localhost:8080/mtr-backend/api/document/savedsearch/1
Get saved searches
URL
GET <application-url>/api/document/savedsearch
Query parameter
-
onDashboard
possible: true, false
dashboard-only (true)
not on dashboard (false)
all (not set) -
showPersonalOnly
possible: true, false
default: false
show only personal saved searches -
hidePersonal
possible: true, false
default: false
hide personal saved searches -
languageKey
possible: de, en, fr, it, …
default: de
language key -
orderBy
possible: id, name, prio
default: name
the order by -
orderDir
possible: asc, desc
default: asc
the ordering direction
Produces
application/json
application/xml
List<com.matterial.mtr.api.object.SavedSearch>
- 200 OK
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
GET http://localhost:8080/mtr-backend/api/document/savedsearch?orderBy=prio
Create saved search
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
- 201 CREATED
- 400 BAD_REQUEST
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
POST http://localhost:8080/mtr-backend/api/document/savedsearch
Update saved search
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
-
savedSearchId
The id of a specific Saved Search
Consumes
application/json
application/xml
com.matterial.mtr.api.object.SavedSearch
Produces
application/json
application/xml
com.matterial.mtr.api.object.SavedSearch
- 200 OK
- 400 BAD_REQUEST
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
PUT http://localhost:8080/mtr-backend/api/document/savedsearch/4
Update Dashboard Prios
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
-
savedSearchIds
List of ids
Consumes
application/json
application/xml
List of Long
Produces
text/plain
Integer - Count of updated SavedSearches
- 200 OK
- 400 BAD_REQUEST
- 404 NOT FOUND - if nothing could be updated
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
PUT http://localhost:8080/mtr-backend/api/document/savedsearch/prio
Remove saved search
URL
DELETE <application-url>/api/document/savedsearch/<savedSearchId>
Path parameter
-
savedSearchId
The id of a specific Saved Search
Consumes
application/json
application/xml
com.matterial.mtr.api.object.SavedSearch
Produces
text/plain
Integer
- count of removed
- 200 OK
- 400 BAD_REQUEST
- 404 NOT_FOUND
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
DELETE http://localhost:8080/mtr-backend/api/document/savedsearch/4
Recreate initial saved searches
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
- 200 OK
- 500 INTERNAL_SERVER_ERROR
Permission
instanceOwnerRequired
Sample
PUT http://localhost:8080/mtr-backend/api/document/savedsearch/initial
Get documents by saved search
Depending on the param “query”, this redirects to db-query or search-query.
URL
GET <application-url>/api/document/savedsearch/<savedSearchId>/execute
Path parameter
-
savedSearchId
The id of a specific Saved Search
Query parameter
-
allLanguages
possible: true, false
default: false
optionally overwrites the language key to return all docs in all languages
since 2.4.0 -
languageKey
possible: de, en, fr, it, …
default: de
optionally overwrites the language key -
loadRoleRights
possible: true, false
default: false
db-only -
loadCategoriesPublicOnly
possible: true, false
default: false
db-only -
loadCategories
possible: true, false
default: false
db-only -
loadResponsibles
possible: true, false
default: false
db-only -
loadAuthors
possible: true, false
default: false
db-only -
loadLastAuthorOnly
possible: true, false
default: false
db-only -
loadFollowers
possible: true, false
default: false
db-only -
loadAmIFollowing
possible: true, false
default: false
This does only try to load the currently logged-in user as follower.
db-only -
loadMarkedAsHelpfulBy
possible: true, false
default: false
db-only -
attachmentOrderBy
possible:
id - attachment-id
name - attachment-name
createtime - attachment-createtime
default: name
the order by of attachments
db-only -
attachmentOrderDir
possible: asc, desc
default: asc
the ordering direction of attachments
db-only -
loadAttachments
possible: true, false
default: false
db-only -
loadLanguageAttachments
possible: true, false
default: false
db-only -
loadDocumentAttachments
possible: true, false
default: false
db-only -
loadRelatedDocumentIds
possible: true, false
default: false
db-only -
loadAdditionalProperties
possible: true, false
default: false
db-only -
loadExtensionValues
possible: true, false
default: false
db-only -
loadReadConfirmationTimes
possible: true, false
default: false
db-only -
loadSnapFlag
possible: true, false
default: false
db-only -
loadComments
possible: true, false
default: false
db-only -
categoryAggregations
possible: true, false
default: false
whether to build category aggregations or not
search-only -
languageAggregations
possible: true, false
default: false
whether to build language aggregations or not
search-only -
lastChangeAggregations
possible: true, false
default: false
whether to build last change aggregations or not
search-only -
count
possible: true, false
default: false
additionally loading count of documents
db-only - offset
- limit
Produces
application/json
application/xml
com.matterial.mtr.api.object.SearchResult<Document>
- 200 OK
- 404 NOT_FOUND
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
GET http://localhost:8080/mtr-backend/api/document/savedsearch/5/execute?count=true