open bi server - Custom Command Handler Plugin
The open bi server is extensible with plugins which are .NET DLLs placed in the OPENBI\httpserver\plugins folder. In this article we are going to explore how to create a plugin for the command API which then can be called by a client with our client APIs from NuGet.
First create a new .NET library for netstandard2.0 and a references to the open bi server files like OPENBI\ibssolution.bioxRepository.exe. Then add a class which implements the Ibssolution.biox.Repositoryserver.IAsyncRequestHandler interface.
The Process_Command method is called for all commands which are not recognized by the open bi server itself and provides access to the current request, session and JSON response.
Check if the request.Command can be handled and if so return true otherwise return false so other custom command handler plugins can try to handle the request.
For debugging add a custom post build event which automatically copies the DLL to the OPENBI\httpserver\plugins folder. Also use the OPENBI\ibssolution.bioxRepository.exe as starting executable. Because the executable needs to be run as administrator make sure to open the IDE with administrator rights.
It is also possible to reference other NuGet packages as well but make sure that these DLLs are copied directly into the OPENBI folder.
Here is the sample code for creating a plugin which also uses dependency injection to get the ILicense from the open bi server.
The corresponding .NET client API would look like this: