Download presentation
Presentation is loading. Please wait.
1
Pentaho JavaScript API
Andy Grohe December 8, 2010
2
Agenda Motivation, Goals and Principles Current API Components
Modules/Samples Solution Repository Metadata Analysis CDA Application Next Steps Source code available at code.google.com/p/pentaho-addon
3
Motivation James Dixon Technical WebEx – September 2009
Analytical Application/Plugins will leverage JavaScript API
4
JS API Goals Facilitate development of Pentaho Analytic applications and plugins Significantly reduce creation/knowledge of server side components Provide useful objects for client side processing of user interactions Provide common layer for disparate components on server Solution Repo, Session, Metadata, Analysis, Scheduling, etc… Provide functionality beyond what is provided by existing server API Example: Retrieve the last 10 reports/actions run by the platform Example: Execute an arbitrary MQL, MDX or SQL query Ability for a web developer to create a Pentaho application/plugin with only knowledge of JavaScript, HTML and CSS The API would be A LOT smaller if biserver was 100% REST based Still need API for client side sugar, but moves into nice to have
5
JS API Principles Follow best practices for JavaScript development
Minimize globals, create and use objects instead of calling global functions Follow best practices for server communications Data is provided by the server, UI is rendered by the client Use dedicated objects to talk to server Google Maps, Yahoo Maps, Open Layers, Bing Maps, Netflix, NPR Do not make direct ajax requests from a web page Leverage model JS objects that know how to talk to the server Provide some API sugar Consumers of JSAPI only communicate in JS objects No need to parse responseText or responseXML or eval() JS strings JS objects have additional methods that are not necessarily on server Remain library/framework neutral All JavaScript required ships with server already
6
JS API Architectural Layers
7
Talking to the BI Server- xhr.js
Manages communication to the server Where does the BI server place XML response? responseText responseXML Methods execute SOAP2JS parseXML Could substitute jQuery $.ajax at this level
8
Repository – solrepo.js
Discover Pentaho actions exposed to the current user via the BI server Execute actions on the server and return results to the browser Save and Load action state to the repository Classes/Objects Solution Repository (solRepo) Solution Directory Action Execute Load Save
9
Metadata – pmd.js Discover Pentaho Metadata exposed via BI server
Execute Metadata Queries on the server Classes/Objects BusinessModel BusinessView BusinessColumn
10
Analysis – pas.js Discover Pentaho Analysis content exposed via BI server Execute arbitrary MDX and return results to the browser Likely to include PAT or xmla4js integration in future Classes/Objects Cube At this point, no interaction with schema level objects
11
Data Access – cda.js Discover Data Access objects exposed vi CDA plugin Execute Data Access Queries on the server Descriptor discoverQueries Query discoverParameters Why not use $.getJSON(listQueries) instead? Above functions return JS objects that have sugar methods EX: discoverQueries returns array of pentaho.cda.Query, can walk the whole hierarchy without knowing servlets or server API’s.
12
Browser Utilities puc.js location.js
Manages interaction with Pentaho User Console Register to handle PUC events Save, Edit Mode location.js Parses out browser url location into JS objects
13
Application Framework
Client-side application framework based on N Zakas’ theory Structure to independently manage modules/widgets on a page
14
Application – app.js Promotes lose coupling of modules
Modules communicate by notify and listen functions Application starts and stops modules Independent of base JS library Create applications for type of use (Metadata, Analysis, etc…) Promotes reuse of application types while maintaining separation How is Application different than a CDF Dashboard? Application is not a singleton, i.e. can have multiple on a page Modules can communicate in ways other that pre/post and change Modules can be create before/after dependencies Modules aren’t hard wired together with global variables as parameters Application does not require usage of jQuery and jQueryUI Application can embed CDF components and manage communication Leverage notify and listen to wrap pre/post/change events
15
Sample Plugin with JS API
Demo
16
Next Steps Provide additional coverage for server API’s
Scheduler Content Repository Others ? Update to Sugar 4.0 Solution Repository Pentaho Report Builder Replacement for WAQR with parameter prompts and drill linking Build new MQL queries or use existing CDA files Server Side JavaScript with Rhino Create sevlets using RFWA ( ) Render web pages with claypool ( or env.js and YUI/jQuery ( )
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.