Visokio website     Downloads     Video tutorials     KnowledgeBase  
Parameters: On-demand parametric data set delivery - Visokio Forums
Parameters: On-demand parametric data set delivery
  •     Veaceslav December 12, 2014 6:55AM

    Generate custom dashboards on demand


    Scenario/Problem


    You have an Omniscope server (2.9 or higher) installed and publicly available at your-omniscope.your-domain.com

    In addition, you have another web server (Apache, Jetty, etc) providing services or any useful information to your customers/users. For the purpose of this post I'll consider that you have an apache web server at your-apache.your-domain.com, even though you can achieve this with most web servers.

    On a particular page on your Apache web server you have a list of links that you want to open different dashboards based on some particular parameter (e.g. user id)
    A link might look like this: http://your-apache.your-domain.com/users?userid=5

    Clicking that link the user should see a dashboard page having data that concerns him/her, the dashboard would be generated on the fly.

    You have a dashboard/IOK file configured to load data from a particular SQL database.

    You want to load data that matches a parameter for a particular user. E.g.
    SELECT * FROM [dbo].[bigtable] WHERE [somefield]={{Userid}}

    Solution


    IOK File

    1. Open the IOK file, DataManager tab and add a parameter. E.g. Name: Userid, Type: Fixed value, Data type: Integer, Value: 3

    2. Open database source block and add your custom SQL query. E.g.
    SELECT * FROM [dbo].[bigtable] WHERE [Liq Cat]={{Userid}}

    3. Save your file

    image

    Your apache web server

    1. Implement a request handler to deal with your special GET requests http://your-apache.your-domain.com/users?userid=5 and read user id value. The server will not send a response unless all next steps finish executing (either successfully or not)

    2. Generate an action file (e.g. Action.xml) that:
    • Sets data manager parameter value (for Userid parameter)
    • Refreshes from source, this sub-action will execute the SQL query again and load records matching the new user id
    • Save IOK file to a new unique location in mobile folder. E.g. mobile/custom-dashboards/12345.iok


    <?xml version="1.0" encoding="UTF-8"?>
    <schedulerFileAction source="/location-of-your-iok-file/file.iok" logTimings="false">
    <subActions>
    <schedulerFileActionSetDataManagerParameterValue parameterName="Userid">
    <binding>
    <manualparambinding type="INTEGER" publishedPublicly="false">
    <values>
    <e>
    <v type="java.lang.Long" value="5" />
    </e>
    </values>
    </manualparambinding>
    </binding>
    </schedulerFileActionSetDataManagerParameterValue>
    <schedulerFileActionRefreshFromSource clearCacheBefore="true" clearCacheAfter="true" failOnError="false" />
    <schedulerFileActionSaveIok location="/location-of-our-new-dashboard/12345.iok" />
    </subActions>
    </schedulerFileAction>


    3. Execute the new action
    E.g. On windows (same parameters on Linux -executeAction /some-path/Action.xml)
    OmniscopeEnterprise.exe -executeAction "some-path\Action.xml"

    4. Once the scheduler action is executed successfully, your Apache web server will return a redirect response to the client

    The client/browser will be redirected to your-omniscope.your-domain.com/custom-dashboards/12345.iok

    You may want to set up a proper back-end configuration, hardware load balancer + software load balancer, caching requests, etc. Also, you may want to make sure your paths are randomly generated, to prevent other users from viewing other dashboards.
    Attachments
    param-1.png 40K
    param-2.png 38K

Welcome!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership