SlideShare a Scribd company logo
1 of 24
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

More Related Content

What's hot

Lightweight web frameworks
Lightweight web frameworksLightweight web frameworks
Lightweight web frameworks
Jonathan Holloway
 
Drupal debugging tips
Drupal debugging tipsDrupal debugging tips
Drupal debugging tips
Adolfo Nasol
 

What's hot (20)

FOSDEM 2015: gdb tips and tricks for MySQL DBAs
FOSDEM 2015: gdb tips and tricks for MySQL DBAsFOSDEM 2015: gdb tips and tricks for MySQL DBAs
FOSDEM 2015: gdb tips and tricks for MySQL DBAs
 
More on gdb for my sql db as (fosdem 2016)
More on gdb for my sql db as (fosdem 2016)More on gdb for my sql db as (fosdem 2016)
More on gdb for my sql db as (fosdem 2016)
 
OpenCms Days 2014 - Using the SOLR collector
OpenCms Days 2014 - Using the SOLR collectorOpenCms Days 2014 - Using the SOLR collector
OpenCms Days 2014 - Using the SOLR collector
 
Lightweight web frameworks
Lightweight web frameworksLightweight web frameworks
Lightweight web frameworks
 
Shaping Optimizer's Search Space
Shaping Optimizer's Search SpaceShaping Optimizer's Search Space
Shaping Optimizer's Search Space
 
OpenCms Days 2012 - OpenCms 8.5: Using Apache Solr to retrieve content
OpenCms Days 2012 - OpenCms 8.5: Using Apache Solr to retrieve contentOpenCms Days 2012 - OpenCms 8.5: Using Apache Solr to retrieve content
OpenCms Days 2012 - OpenCms 8.5: Using Apache Solr to retrieve content
 
OpenCms Days 2013 - Site Management Tool
OpenCms Days 2013 - Site Management ToolOpenCms Days 2013 - Site Management Tool
OpenCms Days 2013 - Site Management Tool
 
Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)
Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)
Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)
 
The why and how of moving to php 5.4
The why and how of moving to php 5.4The why and how of moving to php 5.4
The why and how of moving to php 5.4
 
Drupal debugging tips
Drupal debugging tipsDrupal debugging tips
Drupal debugging tips
 
An evening with Postgresql
An evening with PostgresqlAn evening with Postgresql
An evening with Postgresql
 
Cenário atual do PHP e Introdução ao Laravel no Devinvale 2014
Cenário atual do PHP e Introdução ao Laravel no Devinvale 2014Cenário atual do PHP e Introdução ao Laravel no Devinvale 2014
Cenário atual do PHP e Introdução ao Laravel no Devinvale 2014
 
MariaDB Server on macOS - FOSDEM 2022 MariaDB Devroom
MariaDB Server on macOS -  FOSDEM 2022 MariaDB DevroomMariaDB Server on macOS -  FOSDEM 2022 MariaDB Devroom
MariaDB Server on macOS - FOSDEM 2022 MariaDB Devroom
 
OpenCms Days 2015 Workflow using Docker and Jenkins
OpenCms Days 2015 Workflow using Docker and JenkinsOpenCms Days 2015 Workflow using Docker and Jenkins
OpenCms Days 2015 Workflow using Docker and Jenkins
 
OpenCms Days 2014 - Updating to OpenCms 9.5
OpenCms Days 2014 - Updating to OpenCms 9.5OpenCms Days 2014 - Updating to OpenCms 9.5
OpenCms Days 2014 - Updating to OpenCms 9.5
 
OpenCms Days 2015 Creating Apps for the OpenCms 10 workplace
OpenCms Days 2015  Creating Apps for the OpenCms 10 workplace OpenCms Days 2015  Creating Apps for the OpenCms 10 workplace
OpenCms Days 2015 Creating Apps for the OpenCms 10 workplace
 
Quick flask an intro to flask
Quick flask   an intro to flaskQuick flask   an intro to flask
Quick flask an intro to flask
 
Php Power Tools
Php Power ToolsPhp Power Tools
Php Power Tools
 
Powershell: Tu nuevo mejor amigo
Powershell: Tu nuevo mejor amigoPowershell: Tu nuevo mejor amigo
Powershell: Tu nuevo mejor amigo
 
Turbo charge your logs
Turbo charge your logsTurbo charge your logs
Turbo charge your logs
 

Similar to Xmla4js

Drupal and the semantic web - SemTechBiz 2012
Drupal and the semantic web - SemTechBiz 2012Drupal and the semantic web - SemTechBiz 2012
Drupal and the semantic web - SemTechBiz 2012
scorlosquet
 
Beginners Guide to Drupal
Beginners Guide to DrupalBeginners Guide to Drupal
Beginners Guide to Drupal
Gerald Villorente
 
Stanford Drupal Camp 2015 - Repelling Bots, DDOS, and other Fiends
Stanford Drupal Camp 2015 - Repelling Bots, DDOS, and other FiendsStanford Drupal Camp 2015 - Repelling Bots, DDOS, and other Fiends
Stanford Drupal Camp 2015 - Repelling Bots, DDOS, and other Fiends
Suzanne Aldrich
 
Embedding Linked Data Invisibly into Web Pages: Strategies and Workflows for ...
Embedding Linked Data Invisibly into Web Pages: Strategies and Workflows for ...Embedding Linked Data Invisibly into Web Pages: Strategies and Workflows for ...
Embedding Linked Data Invisibly into Web Pages: Strategies and Workflows for ...
National Information Standards Organization (NISO)
 

Similar to Xmla4js (20)

Drupal and the semantic web - SemTechBiz 2012
Drupal and the semantic web - SemTechBiz 2012Drupal and the semantic web - SemTechBiz 2012
Drupal and the semantic web - SemTechBiz 2012
 
Scraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHPScraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHP
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in Django
 
Beginners Guide to Drupal
Beginners Guide to DrupalBeginners Guide to Drupal
Beginners Guide to Drupal
 
Shining a light on performance (js meetup)
Shining a light on performance (js meetup)Shining a light on performance (js meetup)
Shining a light on performance (js meetup)
 
Splunk's api how we built it
Splunk's api   how we built itSplunk's api   how we built it
Splunk's api how we built it
 
10 Things Webdesigners tend to do Wrong in SEO - SMX 2014
10 Things Webdesigners tend to do Wrong in SEO  - SMX 201410 Things Webdesigners tend to do Wrong in SEO  - SMX 2014
10 Things Webdesigners tend to do Wrong in SEO - SMX 2014
 
Last Month in PHP - May 2016
Last Month in PHP - May 2016Last Month in PHP - May 2016
Last Month in PHP - May 2016
 
Introduction to PHP (SDPHP)
Introduction to PHP   (SDPHP)Introduction to PHP   (SDPHP)
Introduction to PHP (SDPHP)
 
Open Source.HK Workshop - 2014 Oct 11th
Open Source.HK Workshop - 2014 Oct 11thOpen Source.HK Workshop - 2014 Oct 11th
Open Source.HK Workshop - 2014 Oct 11th
 
S1: Side Labs & Alfresco Webinar
S1: Side Labs & Alfresco WebinarS1: Side Labs & Alfresco Webinar
S1: Side Labs & Alfresco Webinar
 
(some) Drupal Theming by Ryan Price
(some) Drupal Theming by Ryan Price(some) Drupal Theming by Ryan Price
(some) Drupal Theming by Ryan Price
 
Drupal 7 and RDF
Drupal 7 and RDFDrupal 7 and RDF
Drupal 7 and RDF
 
Data Science Salon: A Journey of Deploying a Data Science Engine to Production
Data Science Salon: A Journey of Deploying a Data Science Engine to ProductionData Science Salon: A Journey of Deploying a Data Science Engine to Production
Data Science Salon: A Journey of Deploying a Data Science Engine to Production
 
Keys To World-Class Retail Web Performance - Expert tips for holiday web read...
Keys To World-Class Retail Web Performance - Expert tips for holiday web read...Keys To World-Class Retail Web Performance - Expert tips for holiday web read...
Keys To World-Class Retail Web Performance - Expert tips for holiday web read...
 
Drupal 7 and schema.org module (Jan 2012)
Drupal 7 and schema.org module (Jan 2012)Drupal 7 and schema.org module (Jan 2012)
Drupal 7 and schema.org module (Jan 2012)
 
Stanford Drupal Camp 2015 - Repelling Bots, DDOS, and other Fiends
Stanford Drupal Camp 2015 - Repelling Bots, DDOS, and other FiendsStanford Drupal Camp 2015 - Repelling Bots, DDOS, and other Fiends
Stanford Drupal Camp 2015 - Repelling Bots, DDOS, and other Fiends
 
DrupalCon Europe 2020 Low Code
DrupalCon Europe 2020 Low CodeDrupalCon Europe 2020 Low Code
DrupalCon Europe 2020 Low Code
 
Embedding Linked Data Invisibly into Web Pages: Strategies and Workflows for ...
Embedding Linked Data Invisibly into Web Pages: Strategies and Workflows for ...Embedding Linked Data Invisibly into Web Pages: Strategies and Workflows for ...
Embedding Linked Data Invisibly into Web Pages: Strategies and Workflows for ...
 
Leancamp - are you ready to rock
Leancamp - are you ready to rockLeancamp - are you ready to rock
Leancamp - are you ready to rock
 

More from Roland Bouman (10)

Beyond OData: Introducing the XML/A model for ui5
Beyond OData: Introducing the XML/A model for ui5Beyond OData: Introducing the XML/A model for ui5
Beyond OData: Introducing the XML/A model for ui5
 
Moving and Transforming Data with Pentaho Data Integration 5.0 CE (aka Kettle)
Moving and Transforming Data with Pentaho Data Integration 5.0 CE (aka Kettle)Moving and Transforming Data with Pentaho Data Integration 5.0 CE (aka Kettle)
Moving and Transforming Data with Pentaho Data Integration 5.0 CE (aka Kettle)
 
Writing MySQL User-defined Functions in JavaScript
Writing MySQL User-defined Functions in JavaScriptWriting MySQL User-defined Functions in JavaScript
Writing MySQL User-defined Functions in JavaScript
 
3. writing MySql plugins for the information schema
3. writing MySql plugins for the information schema3. writing MySql plugins for the information schema
3. writing MySql plugins for the information schema
 
2. writing MySql plugins general
2. writing MySql plugins   general2. writing MySql plugins   general
2. writing MySql plugins general
 
Common schema my sql uc 2012
Common schema   my sql uc 2012Common schema   my sql uc 2012
Common schema my sql uc 2012
 
Common schema my sql uc 2012
Common schema   my sql uc 2012Common schema   my sql uc 2012
Common schema my sql uc 2012
 
Optimizing mysql stored routines uc2010
Optimizing mysql stored routines uc2010Optimizing mysql stored routines uc2010
Optimizing mysql stored routines uc2010
 
Writing MySQL UDFs
Writing MySQL UDFsWriting MySQL UDFs
Writing MySQL UDFs
 
Roland bouman modern_data_warehouse_architectures_data_vault_and_anchor_model...
Roland bouman modern_data_warehouse_architectures_data_vault_and_anchor_model...Roland bouman modern_data_warehouse_architectures_data_vault_and_anchor_model...
Roland bouman modern_data_warehouse_architectures_data_vault_and_anchor_model...
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
UK Journal
 

Recently uploaded (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

Xmla4js

  • 1. Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 1 OLAP for Web applications X4js MLA
  • 2. 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
  • 3. 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
  • 4. 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
  • 5. 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
  • 6. 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
  • 7. 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)
  • 8. 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
  • 9. 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
  • 10. 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)
  • 11. 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
  • 12. 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
  • 13. 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
  • 14. 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>
  • 15. 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
  • 16. 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} ]
  • 17. 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
  • 18. 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
  • 19. Roland Bouman: http://rpbouman.blogspot.com/ Xmla4js: http://code.google.com/p/xmla4js/ 19 Xmla4js Methods: â—Ź Xmla: – addListener() – request() – discover() – execute()
  • 20. 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()
  • 21. 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
  • 22. 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
  • 23. 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
  • 24. 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