For information about the Magnolia supplier that searches over defined JCR workspaces or about creating a custom search result supplier, see Periscope module: Creating a custom search result supplier.
Configuration properties
The REST-based supplier functionality for the Periscope module is provided by the magnolia-rest-client-ui
module as a combination of the following specific Magnolia classes:
- RestClientResultSupplierDefinition
- SearchResultExpressionDefinition
A REST-based search result supplier can be created as a YAML file and configured using the following properties:
| required
|
| required Name of a configured REST client to fetch search data with. |
| required Name of a configured REST call definition in the client. |
| required List of JSON path expressions to get data for each item to be shown in the Find Bar search results area. Provided by the |
| required Expression to get the title of the item, for example:
|
| required Expression to get the URL address of the item, for example:
|
| optional Expression to show the detail of the item. |
| optional Expression to get the editor name of the item. |
| optional Expression to get the last-modified date of the item. |
YAML files with configuration of search result suppliers should be stored in the searchResultSuppliers
folder of your module:
<module-name> ├── apps ├── contentTypes ├── decorations ├── i18n ├── module.yaml ├── restClients │ └── <rest-client-name>.yaml ├── restEndpoints ├── searchResultSuppliers │ └── <search-result-supplier-name>.yaml └── templates
Sample REST integration
The following configuration files illustrate how you can deliver search results from outside of Magnolia. When enabled, the supplier definition integrates the issues from the PyPy project on bitbucket.org. If you query the project's issue titles, the search result area of the Find Bar will display the results.
class: info.magnolia.rest.ui.periscope.RestClientResultSupplierDefinition restClient: bitbucket restCall: searchTitleIssues searchResultExpression: title: $.values[*].title url: $.values[*].links.html.href content: $.values[*].content.raw date: $.values[*].updated_on enabled: true
baseUrl: https://api.bitbucket.org restCalls: searchTitleIssues: method: get entityClass: com.fasterxml.jackson.databind.JsonNode path: /2.0/repositories/pypy/pypy/issues queryParameters: q: "title~\"{query}\""