34
Using extension points to customize the Web Intelligence interface ■ SAP BusinessObjects Business Intelligence Suite 4.1 Support Package 2 2013-11-07

Sbo41sp2 Webi UI Extension_Points User Guide

Embed Size (px)

DESCRIPTION

Webi UI Extension_Points User Guide

Citation preview

Page 1: Sbo41sp2 Webi UI Extension_Points User Guide

Using extension points to customize the Web Intelligence interface■ SAP BusinessObjects Business Intelligence Suite 4.1 Support Package 2

2013-11-07

Page 2: Sbo41sp2 Webi UI Extension_Points User Guide

© 2013 SAP AG or an SAP affiliate company. All rights reserved. No part of this publication may bereproduced or transmitted in any form or for any purpose without the express permission of SAP AG.

Copyright

The information contained herein may be changed without prior notice. Some software productsmarketed by SAP AG and its distributors contain proprietary software components of other softwarevendors. National product specifications may vary. These materials are provided by SAP AG and itsaffiliated companies ("SAP Group") for informational purposes only, without representation or warrantyof any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials.The only warranties for SAP Group products and services are those that are set forth in the expresswarranty statements accompanying such products and services, if any. Nothing herein should beconstrued as constituting an additional warranty. SAP and other SAP products and services mentionedherein as well as their respective logos are trademarks or registered trademarks of SAP AG inGermany and other countries. Please seehttp://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademarkinformation and notices.

2013-11-07

Page 3: Sbo41sp2 Webi UI Extension_Points User Guide

Contents

About this guide......................................................................................................................5Chapter 1

Document history....................................................................................................................7Chapter 2

About Web Intelligence extension points................................................................................9Chapter 3

About the extension bundle...................................................................................................11Chapter 4

About the IExtension interface................................................................................................114.1About the extension bundle....................................................................................................114.2To create an extension bundle................................................................................................124.2.1Extension bundle recommendations.......................................................................................124.3To declare the extension bundle contribution..........................................................................134.4To implement the IExtension interface....................................................................................144.5About the getExtension method properties............................................................................154.5.1To build the extension bundle.................................................................................................154.6For 64 bit Windows: To deploy the extension point bundles on the Tomcat application server.164.7To test the extension bundle..................................................................................................164.8About the extension bundle sample........................................................................................174.9

The user interface JavaScript APIs.......................................................................................19Chapter 5

About the user interface JavaScript APIs...............................................................................195.1addEventListener...................................................................................................................195.1.1setWaitCursorDisplayed........................................................................................................205.1.2displayErrorMessage..............................................................................................................205.1.3navigateTo.............................................................................................................................215.1.4getContext.............................................................................................................................215.1.5loadReport.............................................................................................................................215.1.6reloadPane.............................................................................................................................225.1.7attachDefaultButton...............................................................................................................225.1.8setTitle...................................................................................................................................225.1.9resize.....................................................................................................................................235.1.10

2013-11-073

Page 4: Sbo41sp2 Webi UI Extension_Points User Guide

close......................................................................................................................................235.1.11setButtonText........................................................................................................................235.1.12setButtonTitle........................................................................................................................235.1.13setButtonDisabled.................................................................................................................245.1.14setButtonDisplayed................................................................................................................245.1.15buttonEvents..........................................................................................................................245.1.16

Using the Web Intelligence services JavaScript APIs..........................................................25Chapter 6

About the Web Intelligence services JavaScript APIs.............................................................256.1getParameters.......................................................................................................................256.1.1refreshDocument...................................................................................................................256.1.2getReports.............................................................................................................................266.1.3createReport..........................................................................................................................266.1.4updateReport.........................................................................................................................266.1.5getReportSpecification...........................................................................................................276.1.6updateReportSpecification.....................................................................................................276.1.7getReportMap........................................................................................................................276.1.8getReportOutput....................................................................................................................286.1.9getDataProviders...................................................................................................................286.1.10getReportElement..................................................................................................................286.1.11getDPDetails..........................................................................................................................296.1.12addDataProvider....................................................................................................................296.1.13updateDataProvider...............................................................................................................296.1.14getDPQuerySpec...................................................................................................................306.1.15updateDPQuerySpec.............................................................................................................306.1.16updateDPNbFlows.................................................................................................................306.1.17getDPFlowDetails..................................................................................................................316.1.18exportReportListingMode.......................................................................................................316.1.19exportReportElement.............................................................................................................316.1.20getVariables...........................................................................................................................326.1.21addVariable............................................................................................................................326.1.22updateVariable.......................................................................................................................326.1.23getVariableDefinition..............................................................................................................336.1.24deleteVariable........................................................................................................................336.1.25

2013-11-074

Contents

Page 5: Sbo41sp2 Webi UI Extension_Points User Guide

About this guide

This document provides a description of how to use the Extension Points SDK to interact with the WebIntelligence (DHTML and Java interfaces) and Web Intelligence documents via the JavaScript APIs.

This guide is intended for SAP BusinessObjects administrators and report creators who wish to customizethe interface and use the JavaScript API calls to create and interact with reports. This document describeshow to create your extension and use the calls to interact with documents.

2013-11-075

About this guide

Page 6: Sbo41sp2 Webi UI Extension_Points User Guide

2013-11-076

About this guide

Page 7: Sbo41sp2 Webi UI Extension_Points User Guide

Document history

The following table provides an overview of the most important document changes.

DescriptionDateVersion

New product for the 4.1 release.November 2013SAP Web Intelligence User In-terface Extension Points API 4.1SP02

2013-11-077

Document history

Page 8: Sbo41sp2 Webi UI Extension_Points User Guide

2013-11-078

Document history

Page 9: Sbo41sp2 Webi UI Extension_Points User Guide

About Web Intelligence extension points

Develop and deploy extension bundles in order to create functions that can be used by specific groupsof Web Intelligence users. You use the CMC to define which extensions are available to a selecteduser group.1. Declare and deploy the extension bundles.2. Use the provided models to define and call the Javascript user interface APIs. refer to the JavaScript

APIs to call the RESTful services in order to interact with Web Intelligence Documents.3. In the CMC, use the customization panel in order to select the extensions that you want to make

available to users.

Related Topics• About the IExtension interface• About the user interface JavaScript APIs

How to create extension points and use the RESTful services API to interact with WebIntelligence documents.

• About the Web Intelligence services JavaScript APIs

An overview of how you can use theWeb Intelligence RESTful web service JavaScript APIsto interact with reports.

2013-11-079

About Web Intelligence extension points

Page 10: Sbo41sp2 Webi UI Extension_Points User Guide

2013-11-0710

About Web Intelligence extension points

Page 11: Sbo41sp2 Webi UI Extension_Points User Guide

About the extension bundle

4.1 About the IExtension interface

All bundle extension contributors will implement the IExtension interface. This class is created in thecom.sap.webi.toolkit.extension package, which must be exported to make the interface available forthe extensions.

The interface IExtension has to methods:

ExtensionProperties getExtensionProperties (String lang):

The implementation of this method must return the Extension Properties.

List<IUIElement> getContribution (String lang):

The implement of this method must return 1 or N UIElements. The parameter lang takes the currentUI language as value.

4.2 About the extension bundle

The extension bundle is a webpath bundle. Its folders must be organized following somerecommendations. Please see paragraph 2.2.2 for more details. The bundle must be a fragment linkedto the bundle host webpath.AnalyticalReporting. It behaves like language pack fragment. The contentof the extension is merged to webpath.AnalyticalReporting host. Here is an example of merged folderstructure.

webwebiAppletwebiDHTML

viewer…extension

<Provider><Extension name>

2013-11-0711

About the extension bundle

Page 12: Sbo41sp2 Webi UI Extension_Points User Guide

4.2.1 To create an extension bundle

You must have SAP Business Objects Enterprise Server installed in your development machine.

Create the extension bundle in order to use the extension points. To create an Extension bundle, it ishighly recommended to build a development environment based on Eclipse 3.6 or higher.1. Open Eclipse and select Plug-in Development perspective as your work perspective2. Edit the Eclipse preferences and set the Java/Installed runtimes to JDK 1.6.0.x.3. Right-click on "Package Explorer" and select "Import."4. In the "Import" dialog box, select Plug-in development/import plug-ins and Fragments and click

Next.5. Select the Directory option in Import From. The directory must be C:\Program Files (x86)\SAP

BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\warfiles\webapps\BOE\WEB-INF\eclipse\plugins.

6. Select "com.businessobjects.webpath.AnalyticalReporting" bundle and click Finish.You can now create the extension bundle

7. Right-click on Package Explorer and select New/Plug-in Development. Select Fragment projectand click Next.

8. Fill in the "New Fragment Project" dialog box as below and click Next.a. Select Use default locationb. Select Create a Java project"(Source folder": src," Output folder": bin)• Select an OSGi framework: Equinox

9. Fill in the "Fragment Content" as below:a. ID: com.businessobjects.webpath.AnalyticalReporting_SAP_ExtensionNameb. Version: 1.0.0c. Name: Extension Named. Provider: SAPe. Execution Environment: JavaSE-1.6

10. Click Finish.

4.3 Extension bundle recommendations

Following recommendations

2013-11-0712

About the extension bundle

Page 13: Sbo41sp2 Webi UI Extension_Points User Guide

Extension bundle naming conventionThe name of the extension bundle must follow the template below in order to fit the BOE deployment.

com.businessobjects.webpath.AnalyticalReporting_<Provider>_<ExtensionName>

Note:Provider and Extension name must contain only alphanumeric characters. The space character is notrecommended. If a space is required it can be replaced by the underscore character and they must bethe same as those provided by the extension attributes.

Bundle folders organizationIn the BOE OSGI framework, the webpath.AnalyticalReporting bundle host and its fragment bundles(language packs and extensions) are merged. In order to avoid some files overriding others, respectthe following constraints to the extension bundle folders organization. The extension bundle is a webpathand it must organize its folders as following way:

webextension

<Provider><Extension name>

…WEB-INF

lib

• web: is the top folder of all webpath bundles,• extension: means the sub-folders belong to an extension bundle,• Provider: the name of bundle provider. The provider can be a vendor or a company name• Extension name: the name should reflect the functionality provided by the extension• WEB-INF/lib: the folder where you can deploy libraries. Mainly jar files.

Add folders and jars to the classpath in order to be found and loaded by the class loader.

Root pathThe root path of the extension bundle is the folder from where the resource files are deployed.

The root path is web/extension/<Provider>/<Extension name>.

The bundle resources can be html, JavaScript, jsp, images files. This is non-exhaustive list of file types.Important: all URL to resources must be relative to root path.

Extension bundle contributionThe extension bundle is created to contribute to the webpath.AnalyticalReporting bundle host.The extension declaration is done in the MANIFEST.MF file. We will use the manifest editor to do it.Open the MANIFEST.MF file and select the Overview tab. Click on Extensions link in“Extension/Extension Point Content” area.

4.4 To declare the extension bundle contribution

2013-11-0713

About the extension bundle

Page 14: Sbo41sp2 Webi UI Extension_Points User Guide

The extension bundle is created to contribute to the webpath.AnalyticalReporting bundle host.The extension declaration is done in the MANIFEST.MF file.1. Open the MANIFEST.MF file and select the Overview tab.2. Click on Extensions link in “Extension/Extension Point Content” area3. In Extensions tab, you click on Add button to display the list of available extension points.4. Select the com.businessobjects.webpath.AnalyticalReporting.webiApplication

extension point and click Finish.5. Select the created extension com.businessobjects.webpath.AnalyticalReporting_SAP_CustomButton

in order to define attributes.

Table 4-1:

PropertyAttribute

com.sap.custombuttonid

com.sap.custombutton.Extensionclass

Custom Buttonname

SAPprovider

1.0.0varsion

The id attribute can take the bundle name and class attribute refers a java class that implementsthe interface IExtension.

4.5 To implement the IExtension interface

The extension bundle must implement the IExtension interface to contribute to webpath.AnalyticalReporting bundle host.

The interface has two methods. Both methods must be implemented by the created java class.

The method getExtensionProperties (String lang) returns Extension Properties in requiredlanguage.1. create a package with the template: com.<Provider>.<Extension name>. The package must

contain alphanumeric characters and a dot character as separator.2. Select the created package and right-click on it to create a java class.The java class must implement

the IExtension interface.

2013-11-0714

About the extension bundle

Page 15: Sbo41sp2 Webi UI Extension_Points User Guide

4.5.1 About the getExtension method properties

This method returns an instance of ExtensionProperties class. The instance is provided by the Extensionand it must contain the following properties:• Title: The extension Title that is displayed in Extension Management UI in CMC application.• Description: it provides a short description of the feature provided by the Extension.

4.6 To build the extension bundle

To use the Extension bundle in your deployment, build the bundle to create a deployable jar file. In ouruse case we only create a build binary.

Note:In the out-of-the-box installation, Tomcat 6 is used as an application server. The warpath bundles arenot deployed as jar files but as sub-folders under <Tomcat DIR>\webapps\BOE\WEB-INF\eclipse\pluginsfolder.

1. In the Project Explorer (or Package explorer), double-click on the build.properties file to open it.2. Select folders according to the table below and click on “Export deployable plug-ins and fragments”

button (surrounded in red). The Export dialog is displayed to set some options on how to export thebundle.

Binary build files to select

META-INF

bin

web

3. Click the“Export deployable plug-ins and fragments” icon (top right)4. Select the Extension bundle project in plug-ins list and specify in Destination tab the folder where

the jar is generated. If you select the project folder then a new folder with name “plugins” and theplugin jar is copied in this folder.

5. Convert the Extension bundle jar file to a zip file.6. Create a new folder webpath.AnalyticalReporting_SAP_CustomButton in the same folder as the

built jar file.7. Right-click on the jar file and select “Extract files”. Select the new folder webpath.AnalyticalRe

porting_SAP_CustomButton to extract the content of the jar.8. Create a zip file webpath.AnalyticalReporting_SAP_CustomButton_1.0.0.zip and put

the folder webpath.AnalyticalReporting_SAP_CustomButton into the zip file.

2013-11-0715

About the extension bundle

Page 16: Sbo41sp2 Webi UI Extension_Points User Guide

4.7 For 64 bit Windows: To deploy the extension point bundles on the Tomcatapplication server

How to deploy the jfxrt.jar file for using Web Intelligence user interface extension points with the JavaApplet.

You must have Java 7 installed on the computer where you deploy the extension points.

Note:When deploying the extension points for Web Intelligence Rich Client, there is no specific action required.

When deploying the extension points for a desktop computer for use wiith the Java Applet, you mustcreate a copy of the jfxrt.jar file. Do the following:• Copy the jfxrt.jar file to the extension file. How you do this depends on whether you are using a

32-bit or 64-bit machine:a. For aWindows 32-bit machine, copy the file C:\Program Files\Java\jre7\lib\jfxrt.jar

to the folder: C:\Program Files\Java\jre7\lib\ext.b. For a Windows 64-bit machine, copy the file C:\Program Files

(x86)\Java\jre7\lib\jfxrt.jar to the folder: C:\Program Files(x86)\Java\jre7\lib\ext.

4.8 To test the extension bundle

Use the zip file webpath.AnalyticalReporting.webpath_SAP_ExtensionSample_1.0.0.zip to test theExtension Points.1. Stop Tomcat2. Extract all the contents of the zip file in <Tomcat DIR>\webapps\BOE\WEB-

INF\eclipse\plugins and also in Tomcat cache: <Tomcat DIR>\work\Catalina\localhost\BOE\eclipse\plugins.

3. Start Tomcat.4. Log on to the CMC and in the home page click on the User Groups link.5. Click on the" Group List" item on the left pane to display all available groups.6. Right-click on a group name you want to customize and click on Customization item.7. A customization dialog page is displayed. Select the "Extensions" tab to display all installed

Extensions.8. Check the Extensions you want to validate and make them available for users of the selected group.9. Click on Save and close button to save your selection.

2013-11-0716

About the extension bundle

Page 17: Sbo41sp2 Webi UI Extension_Points User Guide

10. In order to see the Extension in action, your test User must be a member of the customized "UserGroup".

4.9 About the extension bundle sample

You can start using the provided Extension bundle sample as a starter kit for your Extension bundledevelopment. The sample shows how to use the provided JavaScript APIs to interact withWebI DHTMLapplication and also with WebI services. This sample has two functionalities.• Start and stop a periodic refresh of the document in the side panel.• Show and update Report Specification in a custom dialog box.

To use the sample, you just deploy the provided zip on your installed BOE server build. You must haveinstalled an out-of-the-box build and the Tomcat installation folder is C:\Program Files (x86)\SAPBusinessObjects\Tomcat6. We call this folder <Tomcat DIR>.

2013-11-0717

About the extension bundle

Page 18: Sbo41sp2 Webi UI Extension_Points User Guide

2013-11-0718

About the extension bundle

Page 19: Sbo41sp2 Webi UI Extension_Points User Guide

The user interface JavaScript APIs

5.1 About the user interface JavaScript APIs

How to create extension points and use the RESTful services API to interact with Web Intelligencedocuments.

This chapter provides a description of how to use the extension points SDK to modify and setup theWeb Intelligence interface to interact with Web Intelligence documents via the RESTful services API.

5.1.1 addEventListener

You can add an event listener to your code

/*** Add event listenerbr** @parambr* Object eventType: WebiApplication.Events* callback: Function*/WebiApplication.addEventListener(

{eventType,callback

})

WebiApplication.Events ={UNDO_REDO,REPORT_PAGE_LOADED,DATA_REFRESHED,REPORT_SELECTEDREPORT_ELEMENT_SELECTED

}

The callback function is called when the event manager caches an event. The callback function willreceive 2 parameters: eventType and data. The second parameter is optional and its value dependson the eventType.

2013-11-0719

The user interface JavaScript APIs

Page 20: Sbo41sp2 Webi UI Extension_Points User Guide

DataeventType

No valueUNDO_REDO

No valueRE-PORT_PAGE_LOAD-ED

No valueDATA_RE-FRESHED

Report IDREPORT_SELECT-ED

No value. You can get the list of selected report elements from the WebiApplica-tion.getContext().selectedReportElementsInfo attribute.

REPORT_ELE-MENT_SELECTED

5.1.2 setWaitCursorDisplayed

Use this to display or hide a wait cursor.

/*** Display/Hide wait cursor** @param* display Boolean. Default value: true. It displays a wait cursor.*/WebiApplication.setWaitCursorDisplayed(display)

5.1.3 displayErrorMessage

/*** Display error message** @param* Object message: String* code (optional): String* title (optional): String. The text to display on dialog title bar*/WebiApplication.displayErrorMessage(

{message,code,title})

2013-11-0720

The user interface JavaScript APIs

Page 21: Sbo41sp2 Webi UI Extension_Points User Guide

5.1.4 navigateTo

/*** Navigate to a page in a target frame** @param* Object url (relative URL): String* targetFrame: WebiApplication.TargetFrames*/WebiApplication.navigateTo(

{url,targetFrame})

WebiApplication.TargetFrames ={SAME_FRAME,DIALOG_BOX}

5.1.5 getContext

/*** Get application context** @returns* Object applicationType: WebiApplication.ApplicationTypes* documentName: String* currentUser: String. The account name of the current user.* selectedReportId: int* pageNumber: int* selectedReportElements: Array of selected Report Elements* pvl (Preferred Viewing Locale): String* lang (UI language): String*/applicationContext = WebiApplication.getContext()

WebiApplication.ApplicationTypes ={DHTML,APPLET,DESKTOP}

5.1.6 loadReport

/*** Load report** @param

2013-11-0721

The user interface JavaScript APIs

Page 22: Sbo41sp2 Webi UI Extension_Points User Guide

* Object (Optional). If not specified the current report will reloaded* reportId: int. Default to current report* pageNumber: int. Default to current page*/WebiApplication.loadReport(

{reportId,pageNumber})

5.1.7 reloadPane

/*** Reload pane*/WebiApplication.sidepane.reloadPane()

5.1.8 attachDefaultButton

/*** Set default button** @param* button WebiApplication.dialogbox.Buttons*/WebiApplication.dialogbox.attachDefaultButton(button)

WebiApplication.dialogbox.Buttons ={OK_BUTTON,APPLY_BUTTON,CANCEL_BUTTON,HELP_BUTTON}

5.1.9 setTitle

/*** Set dialog title** @param* title String*/WebiApplication.dialogbox.setTitle(title)

2013-11-0722

The user interface JavaScript APIs

Page 23: Sbo41sp2 Webi UI Extension_Points User Guide

5.1.10 resize

/*** Resize dialog box** @param* Object width: int* height: int*/WebiApplication.dialogbox.resize(

{width,height})

5.1.11 close

/*** Close current dialog box*/WebiApplication.dialogbox.close()

5.1.12 setButtonText

/*** Set button text** @param* Object button: WebiApplication.dialogbox.Buttons* text: String*/WebiApplication.dialogbox.setButtonText(

{button,text})

5.1.13 setButtonTitle

/*** Set button title** @param* Object button: WebiApplication.dialogbox.Buttons* title: String. It is a tooltip of the button

2013-11-0723

The user interface JavaScript APIs

Page 24: Sbo41sp2 Webi UI Extension_Points User Guide

*/WebiApplication.dialogbox.setButtonTitle(

{button,title})

5.1.14 setButtonDisabled

/*** Disable/Enable button** @param* Object button: WebiApplication.dialogbox.Buttons* disable: Boolean. If true then button is disabled else (false) the button is enabled*/WebiApplication.dialogbox.setButtonDisabled(

{button,disable})

5.1.15 setButtonDisplayed

/*** Display/Hide button** @param* Object button: WebiApplication.dialogbox.Buttons* display true (disable button), false (enable button)*/WebiApplication.dialogbox.setButtonDisplayed(

{button,display})

5.1.16 buttonEvents

/*** Button Events*/WebiApplication.dialogbox.Events =

{OK_CLICK,APPLY_CLICK,CANCEL_CLICK}

2013-11-0724

The user interface JavaScript APIs

Page 25: Sbo41sp2 Webi UI Extension_Points User Guide

Using the Web Intelligence services JavaScript APIs

6.1 About the Web Intelligence services JavaScript APIs

An overview of how you can use the Web Intelligence RESTful web service JavaScript APIs to interactwith reports.

Use the Web Intelligence RESTful web service JavaScript APIs to interact with reports. You can do thefolIowing:• Manipulate Web Intelligence documents and reports• Retrieve data from a dataprovider• Retrieve a list of available universes and details of an universes• Schedule documents

You can also create an empty SAPWeb Intelligence document and fill the document by using a ReportSpercification. To edit a document, you must do this by updating the report specification. The WebIntelligence RESTful web service SDK relies on the BI platform RESTful web services.

6.1.1 getParameters

/*** Get document parameters** @returns* Object containing the list of parameters*/WebiServices.document.getParameters()

6.1.2 refreshDocument

/*** Refresh Document** @param* Object (optional): it contains a list of parameters with answer*/WebiServices.document.refreshDocument(

{

2013-11-0725

Using the Web Intelligence services JavaScript APIs

Page 26: Sbo41sp2 Webi UI Extension_Points User Guide

"parameters": [{parameter:{...}]})

6.1.3 getReports

/*** Get all document reportsbr ** @returns* Object containing the document reports*/WebiServices.document.getReports()

6.1.4 createReport

/*** Create a report** @param* Object (optional): it contains the report namebr ** @returns* Object containing the success message and the report ID created*/WebiServices.document.createReport(

{"report": {"name": "<REPORT_NAME>"}

})

6.1.5 updateReport

/*** Update the specified report with the specified values** @param* Object reportId: int. A valid report identifier* requestBody (optional): Object** @returns* Object containing the success message and the report ID updated*/WebiServices.document.updateReport(

{"reportId": <REPORT_ID>,"requestBody": {"report": {"name": "<REPORT_NAME>",

"showDataChanges":< true|false>}}

})

2013-11-0726

Using the Web Intelligence services JavaScript APIs

Page 27: Sbo41sp2 Webi UI Extension_Points User Guide

6.1.6 getReportSpecification

/*** Get the report specification** @param* Object that specifies the report identifier** @returns* Report specification in XML format*/WebiServices.document.getReportSpecification(

{"reportId": <REPORT_ID>,

})

6.1.7 updateReportSpecification

/*** Update the report specification** @param* Object reportId: int. A valid report identifier* requestBody: string. New report specification XML** @returns* Object containing the success message and the report ID updated*/WebiServices.document.updateReportSpecification(

{"reportId": <REPORT_ID>"requestBody": "<XML>"

})

6.1.8 getReportMap

/*** Get the report map** @param* Object reportId: a valid identifier of a report* reference: (optional) a valid reference of a map node** @returns* Object containing the report map*/WebiServices.document.getReportMap(

{"reportId": <REPORT_ID>,"reference": “<REFRENCE_NODE>”

})

2013-11-0727

Using the Web Intelligence services JavaScript APIs

Page 28: Sbo41sp2 Webi UI Extension_Points User Guide

6.1.9 getReportOutput

/*** Get report output in XML format** @param* Object reportId: int. A valid report identifier* dpi (optional): int. Min=75, max=9600, default=96* chartOutputFormat (optional): String. Chart format.

** @returns* Report output in XML format*/WebiServices.document.getReportOutput(

{"reportId": <REPORT_ID>,"dpi":<DPI_VALUE>,"chartOutputFormat":”<bmp|gif|jpeg|png>" //defaut: png

})

6.1.10 getDataProviders

/*** Get document data providersbr ** @returns* Object containing the data provider list*/WebiServices.document.getDataProviders()

6.1.11 getReportElement

/*** Get the report element detailsww ** @param* Object: reportId: int. A valid identifier of a report inside the WebI document.* elementId: int. A valid identifier of an element inside the report.** @returns* Object containing report element details*/WebiServices.document.getReportElement(

{"reportId": <REPORT_ID>," elementId ": “<ELEMENT_ID>”})

2013-11-0728

Using the Web Intelligence services JavaScript APIs

Page 29: Sbo41sp2 Webi UI Extension_Points User Guide

6.1.12 getDPDetails

/*** Get document data provider details** @param* Object: a valid data provider identifier** @returns* Object containing data provider details*/WebiServices.document.getDPDetails(

{"dpId": "<DP_ID>"

})

6.1.13 addDataProvider

/*** Add a data provider** @param* Object: it contains data provider name and the data source ID* In case of BEx queries, the datasource ID is equal to “<DATASOURCE_ID>;<QUERY_NAME>”** @returns* Object containing the success message and the data provider ID created*/WebiServices.document.addDataProvider(

{{"dataprovider": {"name": "<DATAPROVIDER_NAME>",

"dataSourceId": “<DATASOURCE_ID>”}}

} )

6.1.14 updateDataProvider

/*** Update a document data provider** @param* Object dpId: int. A valid data provider identifier* requestBody: Object. Data provider info** @returns* Object containing the success message and the data provider ID updatedbr */WebiServices.document.updateDataProvider(

{{"dpId": "<DP_ID>","requestBody": {"dataprovider": {"name": "<DP_NAME>"}},"purge": true|false", //purge data"purgeOptions": "prompts" //purge prompts values (optional)}})

2013-11-0729

Using the Web Intelligence services JavaScript APIs

Page 30: Sbo41sp2 Webi UI Extension_Points User Guide

6.1.15 getDPQuerySpec

/*** Get the query specification attached to a given data provider** @param* Object: it contains a valid data provider identifier** @returns* XML String containing the query specification attached to a data provider*/WebiServices.document.getDPQuerySpec(

{"dpId": "<DP_ID>"

})

6.1.16 updateDPQuerySpec

/*** Update the query specification attached to a given data providerbr ** @param* Object dpId: String. A valid data provider identifier* requestBody: String. New query specification XML** @returns* Object containing the success message and the data provider ID updated*/WebiServices.document.updateDPQuerySpec(

{"dpId": "<DP_ID>","requestBody": “<XML>”

})

6.1.17 updateDPNbFlows

/*** Get number of available flows, for a given data provider** @param* Object: it contains a valid data provider identifier** @returns* The number of flows for the data provider specified (String value).*/WebiServices.document.getDPNbFlows(

{"dpId": "<DP_ID>"

})

2013-11-0730

Using the Web Intelligence services JavaScript APIs

Page 31: Sbo41sp2 Webi UI Extension_Points User Guide

6.1.18 getDPFlowDetails

/*** Get detail of a given flow for a given data provider** @param* Object dpId: int. A valid data provider identifier* flowId: int. Flow index** @returns* Details of the given flow (CSV format)*/WebiServices.document.getDPFlowDetails(

{"dpId": "<DP_ID>","flowId": <FLOW_ID>

})

6.1.19 exportReportListingMode

/*** Export a report in listing mode** @param* Object reportId: int. A valid report identifier* dpi (optional): int. Min=75, max=9600, default=96* chartOutputFormat (optional): String. Chart format.** @returns* Report output in HTML format*/WebiServices.document.exportReportListingMode(

{"reportId":<REPORT_ID>,"dpi":<DPI_VALUE>,"chartOutputFormat":”<bmp|gif|jpeg|png>" //defaut: png

})

6.1.20 exportReportElement

/*** Export an element of a report** @param* Object reportId: int. A valid report identifier* elementId: int. A valid identifier of an element inside the report* datapath (optional): String. It allows specifying a datapath* (ex: DP1.DObc:2004,DP1.DOa6:Austin)* dpi (optional): int. Min=75, max=9600, default=96* chartOutputFormat (optional): String. Chart format.** @returns* String in HTML format*/

2013-11-0731

Using the Web Intelligence services JavaScript APIs

Page 32: Sbo41sp2 Webi UI Extension_Points User Guide

WebiServices.document.exportReportElement({

"reportId":<REPORT_ID>,"elementId":<ELEMENT_ID>,"datapath":<DATA_PATH>,"dpi":<DPI_VALUE>,"chartOutputFormat":”<bmp|gif|jpeg|png>" //defaut: png

})

6.1.21 getVariables

/*** Get the content of a document variables dictionary** @returns* Object containing the list of variables*/WebiServices.document.getVariables()

6.1.22 addVariable

/*** Add a variable to dictionary** @param* Object: it contains the variable definition** @returns* Object containing the success message and the variable ID updated*/WebiServices.document.addVariable(

{"variable":{ "@dataType":”<Numeric|String|Date|DateTime>”,

"@qualification":”<Measure|Dimension|Attribute>”,"name":”<VARIABLE_NAME>”,"definition":”<VARIABLE_EXPRESSION>”

}})

6.1.23 updateVariable

/*** Modify the definition of an existing variable from the document's expressions dictionarybr ** @param* Object variableId: String. A valid variable identifier* requestBody: String. It defines the update of the variablebr ** @returns* Object containing the success message and the variable ID updatedbr */WebiServices.document.updateVariable(

{"variableId":”<VARIABLE_ID>”,"requestBody": {"variable": {"@dataType":”< DATA_TYPE_VALUE>”,"@qualification":”<QUALIFICATION_VALUE>”,

2013-11-0732

Using the Web Intelligence services JavaScript APIs

Page 33: Sbo41sp2 Webi UI Extension_Points User Guide

"name":”<VARIABLE_NAME>”,“definition”: ”<VARIABLE_EXPRESSION>”

})

6.1.24 getVariableDefinition

/*** Get the definition of a variable from the document's expressions dictionary** @param* Object: it contains a valid variable identifier, obtained from the expressions dictionary** @returns* String contains variable definition in XML format*/WebiServices.document.getVariableDefinition(

{"variableId":”<VARIABLE_ID> ” })})

6.1.25 deleteVariable

/*** Delete a variable from the document's expressions dictionary** @param* Object: it contains a valid variable identifier, obtained from the expressions dictionary** @returns* Object containing the success message and the variable ID deleted*/WebiServices.document.deleteVariable(

{"variableId":”<VARIABLE_ID>”

})

2013-11-0733

Using the Web Intelligence services JavaScript APIs

Page 34: Sbo41sp2 Webi UI Extension_Points User Guide

2013-11-0734

Using the Web Intelligence services JavaScript APIs