• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Xmla4js
 

Xmla4js

on

  • 711 views

Xmla4js is a standalone javascript library that provides basic XML for Analysis (XML/A) capabilities, allowing javascript developers to access data and metadata from OLAP provides for use in rich ...

Xmla4js is a standalone javascript library that provides basic XML for Analysis (XML/A) capabilities, allowing javascript developers to access data and metadata from OLAP provides for use in rich (web) applications. Xmla4js can be used inside a webpage or in a server environment like node.js

Statistics

Views

Total Views
711
Views on SlideShare
711
Embed Views
0

Actions

Likes
0
Downloads
2
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Xmla4js Xmla4js Presentation Transcript

    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 1 OLAP for Web applications X4js MLA
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 2 Welcome, thanks for attending! ● Roland Bouman; Leiden, Netherlands ● Ex MySQL AB, Sun Microsystems ● Web and BI Developer ● Co-author of “Pentaho Solutions” ● Blog: http://rpbouman.blogspot.com/ ● Twitter: @rolandbouman
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 3 Program ● In a nutshell... ● XML/A overview ● Using XML/A in webpages ● Making life a little easier – Xmla4js ● Demonstration ● Questions and answers ● Links and resources
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 4 Program ● In a nutshell... ● XML/A overview ● Using XML/A in webpages ● Making life a little easier – Xmla4js ● Demonstration ● Questions and answers ● Links and resources
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 5 In a nutshell... ● XML/A = XML for Analysis ● Industry standard for OLAP over HTTP ● Xmla4js = javascript API to enable XML/A ● OLAP data for your web applications
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 6 Program ● In a nutshell... ● XML/A overview ● Using XML/A in webpages ● Making life a little easier – Xmla4js ● Demonstration ● Questions and answers ● Links and resources
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 7 XML/A Overview ● XML for Analysis is a communication protocol – SOAP Webservice: XML, HTTP ● Initiated by Microsoft ● Supported by multiple vendors and products: – Microsoft Analysis Services – Oracle Essbase – SAP BW – PALO Server (EE)
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 8 XML/A is SOAP ● Standard HTTP request/response: – Client sends a request using an URL – Server sends a response ● SOAP Webservice – simple object access protocol – request and response are XML documents – XML format is more or less predefined ● Method invocation analogy
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 9 XML/A Methods ● Discover: – Obtaining metadata – Request: request type, properties, restrictions – Response: Tabular schema rowset ● Execute: – Performing queries – Request: MDX statement, properties – Response: Multidimensional resultset
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 10 Typical XML/A Calling Sequence ServerClient Discover Schema Rowset (metadata) Model (metadata) Visualization (data) Request type, restrictions Statement (MDX) Execute Multidimensional Resultset (data)
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 11 Program ● In a nutshell... ● XML/A overview ● Using XML/A in webpages ● Making life a little easier – Xmla4js ● Demonstration ● Questions and answers ● Links and resources
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 12 Using XML/A in webpages ● Webpage client-side programming: – Javascript ● HTTP requests: AJAX – XMLHttpRequest ● Working with XML: – Document Object Model (DOM) – XPath, XSLT – Framework like jQuery
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 13 XML/A in webpages: Example SELECT [Measures].[Profit] ON COLUMNS, [Product].[All Products].Children ON ROWS FROM [Sales] Measures Profit Drink $ 29,358.98 Food $245,764.87 Non-Consumable $ 64,487.05
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 14 XML/A with raw javascript <script type=”text/javascript”> var url = "http://localhost:8080/pentaho/Xmla?userid=joe&password=password"; var datasource = "Pentaho Analysis Services"; var catalog = "FoodMart"; var mdx = "SELECT [Measures].[Profit] ON COLUMNS," + " [Product].[All Products].Children ON ROWS " + "FROM [Sales]"; var request = "<SOAP-ENV:Envelope" + " xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"" + " SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">" + " <SOAP-ENV:Body>" + " <Execute" + " xmlns="urn:schemas-microsoft-com:xml-analysis"" + " SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">" + " <Command>" + " <Statement>" + mdx + "</Statement>" + " </Command>" + " <Properties>" + " <PropertyList>" + " <DataSourceInfo>" + datasource + "</DataSourceInfo>" + " <Catalog>" + catalog + "</Catalog>" + " <Format>Tabular</Format>" + " </PropertyList>" + " </Properties>" + " </Execute>" + " </SOAP-ENV:Body>" + "</SOAP-ENV:Envelope>"; var xhr = new XMLHttpRequest(); xhr.open("POST", url, false); xhr.setRequestHeader("Content-Type", "text/xml"); xhr.send(request); var response = xhr.responseXML; var rows = response.getElementsByTagNameNS( "urn:schemas-microsoft-com:xml-analysis:rowset", "row" ); var colHeaders = response.getElementsByTagNameNS( "urn:schemas-microsoft-com:xml-analysis:rowset", "row" ); var rowArray = []; for (var i=0; i<rows.length; i++){ var row = rows.item(i); var cols = row.getElementsByTagName("*"); var rowArrayEntry = {}; rowArray.push(rowArrayEntry); for (var j=0; j<cols.length; j++){ var col = cols.item(j); rowArrayEntry[col.nodeName] = col.firstChild.data } } </script>
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 15 Program ● In a nutshell... ● XML/A overview ● Using XML/A in webpages ● Making life a little easier – Xmla4js ● Demonstration ● Questions and answers ● Links and resources
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 16 Xmla4js sample code <script type="text/javascript" src="../src/Xmla.js"></script> <script type="text/javascript"> var rowArray = new Xmla().execute({ async: false, url: "http://localhost:8080/pentaho/Xmla", statement: "SELECT [Measures].[Profit] ON COLUMNS," + " [Product].[All Products].Children ON ROWS "+ "FROM [Sales]", properties: { DataSourceInfo: "Pentaho Analysis Services", Catalog: "FoodMart", Format: "Tabular" } }).fetchAllAsObject(); </script> [ {"[Product].[Product Family].[MEMBER_CAPTION]":"Drink", "[Measures].[Profit]":29358.9754} , {"[Product].[Product Family].[MEMBER_CAPTION]":"Food", "[Measures].[Profit]":245764.86650000003} , {"[Product].[Product Family].[MEMBER_CAPTION]":"Non-Consumable", "[Measures].[Profit]":64487.0545} ]
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 17 Xmla4js Library Overview ● One file (< 20 kb minified but uncompressed) ● Cross browser ● Standalone (no dependency on framework) ● LGPL
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 18 Xmla4js API Overview ● Just three “Classes” – Xmla – Xmla.Rowset – Xmla.Exception ● YUI Doc documentation
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 19 Xmla4js Methods: ● Xmla: – addListener() – request() – discover() – execute()
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 20 Xmla4js Methods: ● Xmla.Rowset: – hasMoreRecords(), curr(), next() – getFields() – fetchAsArray(), fetchAsObject() – fetchAllAsArray(), fetchAllAsObject()
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 21 Program ● In a nutshell... ● XML/A overview ● Using XML/A in webpages ● Making life a little easier – Xmla4js ● Demonstration ● Questions and answers ● Links and resources
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 22 Program ● In a nutshell... ● XML/A overview ● Using XML/A in webpages ● Making life a little easier – Xmla4js ● Demonstration ● Questions and answers ● Links and resources
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 23 Program ● In a nutshell... ● XML/A overview ● Using XML/A in webpages ● Making life a little easier – Xmla4js ● Demonstration ● Questions and answers ● Links and resources
    • Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 24 Links and resources ● Project: http://code.google.com/p/xmla4js/ ● Specification: http://www.xmlforanalysis.com/xmla1.1.doc ● Docs: http://msdn.microsoft.com/en-us/library/ms187178(SQL.90).aspx