Jump to content
  • Configuration Blocks - an Oil and Gas use case


    Configuration Blocks are one of the unique features in Spotfire, article shows a possible use case in Oil and Gas to use configuration blocks and inject properties before opening the document.

    Background Story and Motivation:

    Imagine having two dashboards, both of them monitors the same set of pumps. First monitors the electricity consumption and fluid flow over time. The other dashboard monitors the pressure and performance in general.

    Imagine something like:

    rtaImage.png.bb7ca10e107f70ac2593eca2b4fe92c2.png

    Problem and use case

    Our use case was user starts with dashboard A to check one of the pumps say P1, and then they need to check another variable for the same pump in dashboard B, so we need to show P1 only in dashboard B and nothing else!!

     

    Configuration Blocks in Spotfire

    Configuration Blocks in Spotfire is a way to pass or adjust some features in a non-opened dashboard (.dxb file) at the time of opening. Imagine you have a dashboard with 100 curves and you want to open this dashboard for one specific curve, this is one of many applications. In general, configuration blocks can control/adjust the following aspects of a .dxb file:

    • SetPage: Specifies the initial page of an analysis
    • ApplyBookmark: Applies a bookmark
    • SetFilter: Specifies the initial setting of a filter of an arbitrary type
    • SetMarking: Initializing a marking
    • Setting a document property

    Checkout the one of the many use cases when you utilize the Document Property along with Python Script to trigger a different Python Script for each Scenario.

    Screenshot2023-11-13145731.png.3b89857985fd16b85582db2392198957.png

    Where to use Configuration Blocks:

    There are 5 places where you can use the configuration blocks:

    • As C# extension
    • In Web pages using JS API
    • In Spotfire Analyst Client using command line
    • In Automation Services using the 'Open Analysis' Task
    • In Web URL when accessing the dashboard from the web (Web Player)

    We will focus on the last task in Article, injecting variables in the URL when opening a dashboard through the web browser.

    Web URL structure:

    Screenshot2023-11-13145938.png.9bb708430a1af2f7d48f419712025a7b.png

    URL Encoding

    In order for the configuration block feature to work properly, you need to URL encode everything after the (=) in the structure above. To do so there are many websites, I used this website in my example. It?s recommended that you write all your configuration statements, encode them and paste them after the (=) sign. Here is an example on how to encode a setPage configurator to make the dashboard go to "HOME" page

    once it's opened.

     

     

    Step1: URL encode your statement

    1_ETneYw30Z6QyJxI-l1iQJA.gif.5509e18275b638db17c95927ea5dfaba.gif

    Step2: Assemble your URL (Do not forget the semicolon at the end of each configuration statement)

    Assembeled URL is: http://yourSpotfireServer.com/pathToYourFileAndFileName&configurationBlock=setPage(PageTitle%3D%22HOME%22);

     

    1_d2bawhcJXG_ILmrDKCeTZw1.thumb.gif.d92ca9c3b1463d4b545f5bc3e00bb589.gif

     

     

    the URL below is an example of passing the Page Title, Table name and filtering.

     https://spotfire-next.cloud.tibco.com/spotfire/wp/analysis?file=/Samples/Introduction%20to%20Spotfire&configurationBlock=SetPage(pageTitle=%22Filtering%22);SetFilter(tableName=%22World%20Bank%20Data%22,columnName=%22Region%22,values=%7B%22North%20America%22,%22Europe%20%26%20Central%20Asia%22%7D);
     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...