Qlik Sense adaptation
If you want to use your connector with Qlik Sense, you need to:.
- Implement two new methods in the class extending QvxServer
- Include two JavaScript files
- Install the connector
New methods in class extending QvxServer
First, you must implement the Handling JSON request command method and handlers for any command you want to send to your connector from the web UI.
In the class extending QvxServer three handlers have been implemented for different calls. These allow a connector to use the standard select dialog. We have also implemented getInfo, which is used to send information to the connect dialog as well as creating an example for testConnection.
For an example look in the EventLogSimple connector inside the QvEventLogServer.cs file. The call handlers we have implemented are:
- getInfo
- getDatabases
- getTables
- getFields
- testConnection
Including JavaScript files
You also need to provide a set of JavaScript files. The bare minimum is two files:
- connectdialog.js
- selectdialog.js.
As an example we have provided the files needed for EventLogSimple to work with Qlik Sense and its standard select dialog. They can be found in a subfolder to the built connector named web\:
<Solution Path>\QvEventLogConnector\bin\Release\web
We have used AngularJS as the framework for building the dialogs and can with confidence recommend you to do the same.
connectdialog.js
It does not matter how you create your connect string. The only thing that is mandatory in connectdialog.js is that you call the createNewConnection function when you are done. This will create a new connection in the Qlik Sense Repository Service (QRS). The connection will be represented by a new connection in the connection panel on the right side of the script editor.
input.serverside.createNewConnection( $scope.name, $scope.connectionString, $scope.username, $scope.password);
You will also need to support when the user has selected to edit the connection. The connect dialog will in this case be opened with the parameter input.editMode set to True, which enables you to adapt the dialog to edit mode. When you are done, you should call the input.serverside.modifyConnection function.
selectdialog.js
If you want to use the standard Qlik Sense select dialog you have to implement all methods shown in this file. Each method is used to fetch different types of information about your data source and it will be presented in the select dialog when invoked.
Installing the connector
You install connectors in the folder C:\Users\{username}\AppData\Local\Programs\Qlik\Sense\Connectors\