Copyright ©
Mindbreeze GmbH, A-4020 Linz, 2024.
All rights reserved. All hardware and software names used are brand names and/or trademarks of their respective manufacturers.
These documents are strictly confidential. The submission and presentation of these documents does not confer any rights to our software, our services and service outcomes, or any other protected rights. The dissemination, publication, or reproduction hereof is prohibited.
For ease of readability, gender differentiation has been waived. Corresponding terms and definitions apply within the meaning and intent of the equal treatment principle for both sexes.
The API V2 search request response transformer provides a functionality that allows you to transform API V2 search requests and responses into a format that you can define yourself. This functionality is made available by the creation of a plugin with the Mindbreeze Software Development Toolkit. The SDK creates a sample plugin that can be customized.
The following software components are needed to build and create a plugin with the Mindbreeze Software Development Toolkit:
The Mindbreeze Software Development Toolkit contains a tool for generating a plugin project. The tool is provided as mesjavaplugin.bat for Microsoft Windows and as mesjavaplugin.sh for Linux.
To create a plugin project for an API V2 Search Request Transformer plugin, the tool has to be opened using the following parameters:
mesjavaplugin.<sh|bat> <Plugin Type> <Name> <Base Package>
The Mindbreeze Software Development Toolkit creates a plugin project that is available in the current directory under the name provided.
In order to transform the request, the method transformRequest has to be implemented.
This example is included in the generated code of the SDK and transforms the search request, defined by the HTTP parameters q and num into a Mindbreeze search request. The metadata from the plugin configuration is requested in the Mindbreeze search request in order to be present in the result.
The response transformation is performed in the method transformResponse.
transformResponse(RpcController controller, ResponseTransformationRequest request, RpcCallback<HTTPResponse> done)
The request parameter contains the request to be transformed. The response can be set using the parameter done. The following example writes all titles of the query response as text to the response.
The HTTP content type is determined by defining the MediaType in the response.