Spotfire Integration & Dynamic Output creation


Published on

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Spotfire Integration & Dynamic Output creation

  1. 1. Dynamic Creation and/or Content Modification of Spotfire output (DXP files) Proposed Integration Solution with Pipeline Pilot
  2. 2. What are Spotfire Output (or DXP) files? <ul><li>Software and Use </li></ul><ul><ul><li>TIBCO Spotfire is a comprehensive software platform that allows customers to access, analyze and create dynamic report(s) on their data. </li></ul></ul><ul><ul><li>A report that is created/opened using Spotfire is referred to as an Analysis Document and when saved is given an extension of “ .DXP ”. </li></ul></ul><ul><ul><li>This DXP file not only contains a series of metadata information, but it also contains references to the data itself and to various other components being part of the document, such as pages, filtering, bookmarks etc. </li></ul></ul>
  3. 3. TIBCO Spotfire Architecture TIBCO Spotfire Automation Services Spotfire Automation Services provides a platform and tools for automating TIBCO Spotfire without user interaction and visible user interface .
  4. 4. TIBCO Spotfire Developer (SDK) <ul><li>TIBCO Spotfire Developer has a complete set of application programming interfaces (APIs) for not only configuring and automating the platform, but extending it with entirely new capabilities as well . </li></ul><ul><li>The SDK provides required Spotfire developer resources: the Spotfire Extension Project Template, development assemblies, example projects, and the Package Builder application wrapping the extensions for deployment </li></ul><ul><li>A Spotfire extension is the smallest functional unit added to the platform. It is developed in Visual Studio® and is included in a Spotfire add-in, enabling versioning, licensing, deployment and loading. </li></ul>
  5. 5. TIBCO Spotfire APIs & Integration with PP (PP Custom Extension) Pipeline Pilot
  6. 6. Automation Services - Terminology Task An Automation Services Task is the building block for creating a complex Job. Automation Services comes with a number of predefined tasks such as Apply Bookmark or Send Email , but since the platform is extendible, additional tasks may be supplied by other vendors or by end user’s IT organization. Job An Automation Services Job is a collection of Tasks to be executed in a sequential manner. A Job is stored in a Job File. Job File A Job File is a human-readable XML defining a Job. Job Builder The Automation Services Job Builder is an application that runs within Spotfire Professional and provides an easy-to-use interface for creating and editing Jobs
  7. 7. Spotfire Automation Services - Architecture The Job is normally created in the Job Builder and saved as an XML Job File . This file is then sent to the Automation Services Web Service for execution - from the Job Builder window (for testing), - or using the provided ClientJobSender tool, - or by your own custom tool. For each Job in XML format sent to the Automation Services Web Service for execution, a Job Executor process is started. This internal Job Executor logs on to a Spotfire Analytics Server using credentials stored in the Spotfire.Dxp.Automation.Launcher.exe.config file, executes the tasks one by one and then exits when a task fails or all tasks have completed successfully The PP Custom Task will be used when creating a Job and saving the Job file . The ClientJobSender tool will be used by Pipeline Pilot to send the Job file to the Automation Services Web Service . (Pipeline Pilot) ( PP Custom Ext. )
  8. 8. Automation Services – Scheduling a Job To programmatically activate a Job file, Spotfire has provided an application that excepts two arguments. The first parameter is the URL to the web server where the Automation Services is installed and the second argument is the path to the Job file, consisting of the custom task(s). (Spotfire.Dxp.Automation.ClientJobSender.exe) For example: First Argument: http://localhost/SpotfireAutomation/JobExecutor.asmx Second Argument: pathToJobFile/jobfilename.xml &quot;c:tempdxpdataSpotfire.Dxp.Automation.ClientJobSender.exe&quot; &quot;http://laptopdayton/SpotfireAutomation/JobExecutor.asmx&quot; &quot;c:tempdxpdataDXPRequestJob.xml&quot;
  9. 9. Solution – Develop Communication Message Using Spotfire provided ClientJobSender tool. <ul><li>An XML formatted message will be defined to enable Pipeline Pilot to specify details for the type of DXP file to generate or the updates to make to an existing DXP file. </li></ul><ul><li>The PP Custom Task will also be aware of this custom developed XML formatted message and will be translate them into APIs calls to create the DXP file dynamically. </li></ul>Spotfire Automation Services PP Custom Task Capable of creating a new DXP file or modifying an exiting DXP by using the Spotfire APIs Pipeline Pilot Protocol Capable of activating the PP Custom Task that is part of the Spotfire Automation Services.
  10. 10. Solution – Transmitting / Receiving Messages Spotfire Automation Services PP Custom Task Pipeline Pilot Protocol Activate the PP Custom Task job using Spotfire provided ClientJobSender tool. <ul><li>Pipeline Pilot formats and places a XML formatted message requesting a DXP file. The details for the type of DXP file to create, the data file to use and other required information is stored in this file. </li></ul><ul><li>Pipeline Pilot activates the PP Custom Task to process it’s request for a DXP file. </li></ul><ul><li>The PP Custom Task retrieves the DXPRequest.xml file, interprets the instructions from Pile Pilot and using the APIs create/modify a DXP file. </li></ul><ul><li>The resultant DXP is stored in the Results folder. </li></ul><ul><li>Pipeline Pilot retrieves the resulting DXP file. </li></ul>REQUEST FOLDER Accessible to both Spotfire and Pipeline Pilot. DXPRequest.xml 1 3 1 2 3 2 RESULTS FOLDER Accessible to both Spotfire and Pipeline Pilot. filename.dxp 5 4 4 5
  11. 11. Implementing the Solution – DXP Request Message format <ul><li>DXP Request Message: </li></ul><ul><ul><li>An XML formatted message structure will be defined for Pipeline Pilot to request customized DXP files from the Custom Spotfire task. </li></ul></ul><ul><ul><li>Both Pipeline Pilot and the Custom Spotfire Task will need to be aware of the message structure. </li></ul></ul><ul><li>Communication Medium: </li></ul><ul><ul><li>Some form of communication mechanism is required between Pipeline Pilot and the Spotfire Custom Task. One option is to use a common folder or folders to store the requests and the results. Pipeline Pilot and the Spotfire App would each monitor these folder(s) periodically or when activated. </li></ul></ul>
  12. 12. Implementing the Solution – Spotfire Related <ul><li>Extension: A custom extension will be developed as a Spotfire Add-in using the Spotfire SDK. </li></ul><ul><li>Task: The custom Spotfire Add-in is then registered as an Automation Services Task. </li></ul><ul><li>Job Builder : The Automation Services Job Builder will then be used for defining a Job consisting of this custom task and a Job File will be saved. </li></ul>
  13. 13. Implementing a Solution: Pipeline Pilot Related <ul><li>Pipeline Pilot Components: </li></ul><ul><li>Components will be developed to support this functionality. </li></ul><ul><li>As a minimum, a component that can create a Spotfire Analysis Request file using the predefined message structure. </li></ul><ul><li>Another component to move the Analysis request file to the predefine Spotfire folder and activate the Automation Services Job. </li></ul><ul><li>And yet another component that will retrieve the resulting analysis document (.DXP file) that the custom task has created. </li></ul>
  14. 14. Proof-Of-Concept Demo <ul><li>Communication Between Spotfire and Pipeline Pilot: </li></ul><ul><li>Three folder were created that were accessible to both Pipeline Pilot and Spotfire. </li></ul><ul><li>Folder named DXPRequests : This folder is in which the XML formatted analysis requests are stored by Pipeline Pilot and retrieved by the custom task in Spotfire. </li></ul><ul><li>Folder named DXPResults: This folder is in which the Spotfire generated analysis document (.DXP file) is stored and retrieved by Pipeline Pilot. </li></ul><ul><li>Folder Named DXPData: This is a folder is used for storing sample data files and preconfigured XML formatted requests (that will be used in the demo.) </li></ul>
  15. 15. Proof-Of-Concept Demo <ul><li>Spotfire Setup: </li></ul><ul><li>The custom task was registered as an Spotfire Automation Services task. </li></ul><ul><li>Using the Job Builder, a Job file was created that consisted on our custom Automation Services task. </li></ul><ul><li>The resulting XML formatted Job File was saved in the DXPData folder. (DXPRequestJob.xml) </li></ul><ul><li>A copy of the Spotfire Spotfire.Dxp.Automation.ClientJobSender.exe was saved in the DXPData folder. </li></ul>
  16. 16. Proof-Of-Concept Demo <ul><li>Pipeline Pilot Setup: </li></ul><ul><li>Two sample Analysis Request files were created and stored in the DXPdata folder. The contents of one of the files is shown below. (This request file is for the demo only and the format of the final message is still to be developed.) </li></ul><ul><ul><li><?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?> </li></ul></ul><ul><ul><li><PPDXPRequest xmlns:xsi=&quot;; xmlns:xsd=&quot;;> </li></ul></ul><ul><ul><li><dxpRequest>2</dxpRequest> </li></ul></ul><ul><ul><li><xDataColumnName>Cost</xDataColumnName> </li></ul></ul><ul><ul><li><yDataColumnName>Sales</yDataColumnName> </li></ul></ul><ul><li><plotDataFile>c:tempdxpdataSalesData.txt</plotDataFile> </li></ul><ul><li><dxpResultFile>c:tempdxpresultsSalesDataScatterPlot.dxp</dxpResultFile> </li></ul><ul><ul><li></PPDXPRequest> </li></ul></ul><ul><li>The custom task is hard coded to recognize that dxpRequest code of 2 is for a scatter plot and that the data source is the file specified in plotDataFile node and that the resultant DXP file is to be stored as specified in the dxpResultFile node. </li></ul>
  17. 17. Proof-Of-Concept Demo <ul><li>(Cont.) Pipeline Pilot Setup: </li></ul><ul><li>Three components were created to </li></ul><ul><li>execute a command line to copy a predefined request file from the DXPData folder to the DXPRequestFile folder. </li></ul><ul><li>to execute a command line to activate the Automation Services Job containing our custom task. </li></ul><ul><li>to open the resulting analysis (.DXP) file stored in the DXPResults folder by Spotfire. </li></ul>
  18. 18. Proof-Of-Concept Demo <ul><li>Pipeline Pilot Setup: </li></ul><ul><li>Using these simple components the following protocol was created. </li></ul>
  19. 19. Proof-Of-Concept Demo Execution Sequence: 1) Create and Submit Analysis Request (file) On activating the protocol, a user is requested to selected one of the two predefine analysis request files. The selected request file is copied to the DXPData folder and renamed to dxprequest.xml – This is the name of a file that the custom task on Spotfire will look for.
  20. 20. Proof-Of-Concept Demo <ul><li>Execution Sequence: 2) Activate Automation Services Job </li></ul><ul><li>Once the request file is copied to the DXPRequests folder, a another component activates the Automation Services Job on Spotfire to process this request. (there are other options for activating the Automation Services Job besides the method used in this demo.) </li></ul><ul><ul><li>The command line executed by this component is </li></ul></ul><ul><ul><li>&quot;c:tempdxpdataSpotfire.Dxp.Automation.ClientJobSender.exe&quot; &quot;http://laptopdayton/SpotfireAutomation/JobExecutor.asmx&quot; &quot;c:tempdxpdataDXPRequestJob.xml“ </li></ul></ul>
  21. 21. Proof-Of-Concept Demo <ul><li>Execution Sequence: 3) Execute Analysis Instructions (Spotfire) </li></ul><ul><li>The XML formatted instructions from the file and the Spotfire APIs are used for modifying an existing analysis document or for creating a new analysis document. </li></ul><ul><li>In our example the contents of the XML Request file is as follows </li></ul><ul><li><?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?> </li></ul><ul><li><PPDXPRequest xmlns:xsi=&quot;; xmlns:xsd=&quot;;> </li></ul><ul><li><dxpRequest>2</dxpRequest> A Request Type of 2 was implied to mean a Scatter Plot <xDataColumnName>Cost</xDataColumnName> Column name of the x data values </li></ul><ul><ul><li><yDataColumnName>Sales</yDataColumnName> Column name for the y data values </li></ul></ul><ul><ul><li><plotDataFile>c:tempdxpdataSalesData.txt</plotDataFile> Location of the source data </li></ul></ul><ul><ul><li><dxpResultFile>c:tempdxpresultsSalesDataScatterPlot.dxp</dxpResultFile> location for the resulting analysis document. </li></ul></ul><ul><li></PPDXPRequest> </li></ul>
  22. 22. Proof-Of-Concept Demo Cont. When the Automation Services Job is activated, it executes the code of the custom task and also provides access to the running TIBCO Spotfire instance. A document opened in a running instance of TIBCO Spotfire is referred to as an Analysis Document. The document not only contains a series of metadata information, but it also contains references to the data itself, and to various other components being part of the document, such as pages, filtering, bookmarks etc. Since a data file was specified, the custom task uses the Open method of the Analysis Application and the specified data file. We now have a default analysis document that can be customized with the requested visualization. In this request file the requested visualization is for a scatter plot and so the available method(s) are used for adding a scatter plot visualization to the analysis document using the data file and the X and Y data column names. The analysis document is then saved using the name/location specified in the request file.
  23. 23. Proof-Of-Concept Demo Execution Sequence: 4) Receive Requested Analysis (.DXP File) Once control is returned, the resulting analysis file will have been stored in the DXPResults folder by the custom task that was executed by the Spotfire Automations Services Job.
  24. 24. Proof-Of-Concept Demo <ul><li>Execution Sequence: 5) View Analysis Document (.DXP file) </li></ul><ul><li>And finally the analysis file is opened by a component executing the following command line </li></ul><ul><ul><ul><li>c:tempdxpresultssalesdatascatterplot.dxp </li></ul></ul></ul><ul><li>Note: The following plot was created using the default template provided by Spotfire’s API. The Filters; The Page and the Details-on-Demand were preconfigured but could be customized. In this case the data file and name of the X and Y columns were provided. </li></ul>
  25. 25. Phase-II <ul><li>Gather a list of all possible DXP file requests that are required from Pipeline Pilot. </li></ul><ul><li>Using this data, an XML formatted message structure will need to be to determined that would be able to support all the requests. </li></ul><ul><li>Determine if these requests can be implemented using Spotfire APIs. </li></ul><ul><li>Develop a library of Pipeline Pilot components that an end user could use with or without modifications. </li></ul><ul><li>Develop the custom task to interpret these DXP requests. </li></ul>