SDK Java Tutorial
42 pages
English

SDK Java Tutorial

-

Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
42 pages
English
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres

Description

SDK Java Tutorial
BusinessObjects 11
Windows 2 Designer’s Guide
Copyright Copyright © 2004 Business Objects. All rights reserved.
If you find any problems with this documentation, please report them to Business Objects in
writing at documentation@businessobjects.com.
Trademarks Business Objects, the Business Objects logo, Crystal Reports, and Crystal Enterprise are
trademarks or registered trademarks of Business Objects SA or its affiliated companies in the
United States and other countries. All other names mentioned herein may be trademarks of their
respective owners.
Contains IBM Runtime Environment for AIX(R), Java(TM) 2 Technology Edition Runtime
Modules (c) Copyright IBM Corporation 1999, 2000. All Rights Reserved.
This product includes code licensed from RSA Security, Inc. Some portions licensed from IBM
are available at http://oss.software.ibm.com/icu4j.
Use restrictions This software and documentation is commercial computer software under Federal Acquisition
regulations, and is provided only under the Restricted Rights of the Federal Acquisition
Regulations applicable to commercial computer software provided at private expense. The use,
duplication, or disclosure by the U.S. Government is subject to restrictions set forth in
subdivision (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at 252.227-
7013.
Patents Business Objects owns the following U.S. patents, which may cover products that are offered
and sold by Business Objects: ...

Sujets

Informations

Publié par
Nombre de lectures 839
Langue English

Extrait

SDK Java Tutorial
BusinessObjects 11
Windows
2
Designers Guide
Copyright Trademarks
Use restrictions
Patents Part Number
Copyright © 2004 Business Objects. All rights reserved. If you find any problems with this documentation, please report them to Business Objects in writing at documentation@businessobjects.com. Business Objects, the Business Objects logo, Crystal Reports, and Crystal Enterprise are trademarks or registered trademarks of Business Objects SA or its affiliated companies in the United States and other countries. All other names mentioned herein may be trademarks of their respective owners. Contains IBM Runtime Environment for AIX(R), Java(TM) 2 Technology Edition Runtime Modules (c) Copyright IBM Corporation 1999, 2000. All Rights Reserved. This product includes code licensed from RSA Security, Inc. Some portions licensed from IBM are available at http://oss.software.ibm.com/icu4j. This software and documentation is commercial computer software under Federal Acquisition regulations, and is provided only under the Restricted Rights of the Federal Acquisition Regulations applicable to commercial computer software provided at private expense. The use, duplication, or disclosure by the U.S. Government is subject to restrictions set forth in subdivision (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at 252.227-7013. Business Objects owns the following U.S. patents, which may cover products that are offered and sold by Business Objects: 5,555,403, 6,247,008 B1, 6,578,027 B2, 6,490,593 and 6,289,352. 307-10-610-01
Contents
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Introduction 3 Using the SDK Java tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Before you start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Navigating through folders 5 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Navigating through folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Navigating through folders to list Web Intelligence document in the CMS . . 7 Searching for and listing universes in the CMS . . . . . . . . . . . . . . . . . . . . . . 9
Viewing a Web Intelligence document 11 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Opening a Web Intelligence document . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Selecting a WebIntelligence report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Setting a pagination mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Setting the image viewing callback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Displaying the report in HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Detecting and refreshing prompts 19 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Detecting a prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Retrieving available prompts in the document . . . . . . . . . . . . . . . . . . . . . . 21 Retrieving a list of values (LOV) for prompts . . . . . . . . . . . . . . . . . . . . . . . 22 Setting values to a prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Drilling in a document 25 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Before drilling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Activating drill mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
SDK Java Tutorial 1
Contents
Chapter 6
Chapter 7
Drilling on a dimension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Retrieving and populating the Drill Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Saving a Web Intelligence document 31 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Saving a document in Personal and Corporate categories . . . . . . . . . . . . . 32
Creating a Web Intelligence document 35 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Creating a document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Saving a new document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Index
2 SDK Java Tutorial
39
En
Introduction
1IUntsriondgutchteioSnDK Java tutorial Using the SDK Java tutorial The SDK Java Tutorial is a series of code examples that show you how to do the following: Retrieve the list of Web Intelligence documents and universe files available in the repository. Refresh Web Intelligence documents. Manage prompts Activate drill mode, specify drill on a dimension, and filter on dimension values. Save a document and set the documents properties. Create and save a new document. Before you start The information in this section applies to all lessons. The following objects are created at login and used throughout the tutorial: IEnterpriseSession: This object is created when the user completes a successful login. ReportEngineobject is created when the user completes a: This successful login and is stored in the users jsp session variable. ISessionMgr: This object is created when the user completes a successful login and is stored in the users jsp session variable. IInfoStore: This object is created when the user completes a successful login and is stored in the users jsp session variable. Refer to the filelogin.jspfor information on these objects. Syntax specific to each tutorial is described before the code examples. For explanations of all other syntax, refer to theREBean Reference Guide. A document can be opened in 2 different ways: Using the document ID. Using a storage token. When a document is refreshed, a new storage token is created. This token can be used in another jsp page. Opening a document using a storage token provides better Web Intelligence server performance than using a document ID. Refer to theCustomizing Web Intelligence with REBeanguide for more information.
4 SDK Java Tutorial
Navigating through folders
NaOvviegravitienwgthroughofdlers
2 Overview This chapter describes how to navigate through folders in the Central Management System (CMS), and retrieve a list of documents and universes. Before running this tutorial, you must understand how to navigate through folders and categories to search for Web Intelligence documents and universes using InfoView. The code used in this tutorial to navigate and view available Web Intelligence documents can be found indocNav.jsp. The code to navigate and view available universes can be found inunvNav.jsp. The following table helps you keep track of your position in the tutorials. The current stage is highlighted. Stage You learn how to... Navigating through foldersNavigate through folders to retrieve a list of Web Intelligence documents and universes. Viewing a Web IntelligenceView, refresh and navigate through a Web documentIntelligence document. Detecting and refreshingRetrieve a document that contains prompts, promptsrefresh and set the document prompts. Drilling in a documentActivate drill mode on a document, drill or filter on a dimension. Saving a Web IntelligenceSave a document. document Creating a Web IntelligenceCreate a new Web Intelligence document documentand save it.
Learning objective In this chapter you will learn how to program the following: Query the CMS to retrieve folder information. Navigate through folders Retrieve a list of Web Intelligence documents from the CMS. Retrieve a list of universes from the CMS.
6 SDK Java Tutorial
orgughttanivagislderhfognitagivaNsNerldfohugroth
2
Navigating through folders All sub folders that contain Web Intelligence documents are created under the root folder (with id 0). The root folder is created when Web Intelligence is installed. To list folders stored in the CMS, you must first open the root folder, using the root folder ID; it is then possible to list sub folders and create a sub folder navigation functionality.
SDK Java Tutorial 7
In this tutorial, when you open a folder, available sub folders and Web Intelligence documents are listed. The code used to browse sub folders and retrieve the documents and universes is described below. Navigating through folders to list Web Intelligence document in the CMS ThedocNav.jspscript uses the following steps to implement the navigation functionality. 1.sID from the HTTP request parameters. The sIDRetrieve the variable parameter is the unique ID for the top folder to be listed. If this parameter is null, the root folder ID (0) is used automatically. 2.Retrieve and list theIInfoObjectrepresenting the top folder. 3.Retrieve theIInfoObjectssub folders contained in the toprepresenting folder. Create links to docNav.jsp for each sub folder, pass the ID of the folder to be navigated in the sID parameter. 4.Retrieve and list theIInfoObjectsrepresenting Web Intelligence documents contained in the top folder.
8 SDK Java Tutorial
The folder navigation functionality To retrieve a list of folders on a Web Intelligence server, the CMS has to be queried. A query is run using theIInfoStoreobject. In these tutorials the IInfoStoreis created when the user logs on to the Web Intelligence server, it is added to the users jsp session attributes. To retrieve folders or documents in the CMS,TCEJSCINI_OBFOmust be queried. The type of object searched for is controlled usingSI_KINDin the query and theCeKindobject. The following code taken fromdocNav. jspshows how to retrieve the top folder in the document file structure. Example:Retrieve the top folder in a file structure. IInfoStoreiInf = (IInfoStore;)"erotSofnIssoi)este("ributAttn.ge ... String SI_NAME, SI_PARENTsQuery = "SELECT S _ , I ID ID FROM  _ ( I_ID + CI INFOOBJECTS WHERE S = " + iID + ") AND SI KIND=\'" _ +F.LOEDRCeKind + "\' ORDER BY SI_NAME ASC "; ... IInfoObjectsparentFolders = (IInfoObjects) iInf.query(sQuery); Note:In these tutorials, theISessionMgr,IInfoStore,ReportEngineandUserInfoobjects are created when the use logs in (login.jsp) and I stored in the users jsp session attributes for later use. These objects are retrieved when necessary using session.getAttribute(attributeName). By querying on theSI_ID, for a specified kind (dniKeCREDLOF.) only the top or root folder is returned. To query for a list of sub folders,SI_PARENTIDis used in the query. The result of this query is used to create the navigation mechanism. The following code shows the navigation functionality in docNav.jsp. Example:The navigation functionality in docNav.jsp. sQuery = "SELECT SI_ID, SI_NAME, SI_PARENTID FROM  + CI_INFOOBJECTS WHERE ( SI_PARENTID = " + iID + ") AND SI_KIND =\'" +REDLOFind.CeK + "\' ORDER BY SI NAME ASC "; _ IInfoObjectssubFolders = (IInfoObjects) iInf.query(sQuery); intiSize = subFolders.size(); ... for(inti=0; i<iSize; i++) { IFolderiFld = (IFolder)i;eg(tub)ss.erldFo ... <% <A HREF="docNav.jsp?sID=<%=iFld.getID()%>"
2
SCMethnintemucodecnegillegavingtideolNarsuorhfhgitagtgnWebInttolistfloedsrtrhuohgaNiv
dlofSsrecraegnihorfndaislngtiuinevsrseinhteCMSNvaingigatughthro
Listing Web Intelligence documents in a folder To retrieve and work with a list of Web Intelligence documents in a folder is essentially the same as retrieving and working with a list of sub folders. What changes is theCeKindused in the query. The following code taken from docNav.jspshows how to retrieve a list of Web Intelligence documents. Example:How to retrieve a list of Web Intelligence documents. sQuery = "SELECT SI_ID, SI_NAME, SI_PARENTID " + "FROM _ WHER ( _ TID = " CI INFOOBJECTS E SI PAREN + iID + ") AND SI_KIND =\'" CeKind.WEBI + _ ASC";  \ ORDER BY SI NAME + " ' IInfoObjectswebiDocuments = (IInfoObjects) iInf.query(sQuery); intwSize = webiDocuments.size(); ... for(intj=0; j<wSize; j++) { IInfoObjectiObj = (IInfoObject)webiDocuments.get(j); ... }
2
SDK Java Tutorial 9
Searching for and listing universes is done in theunvNav.jspfile. The method used to navigate through folders and list universes is the same as that used to navigate through folders and list Web Intelligence documents. The differences are: You select objects fromCI APPOBJECTSto navigate to and list universes. _ To navigate and list documents,IInfoObjectsare retrieved from CI INFOOBJECTS. _ The Root folder ID for Universes is 95
<%=iFld.getID()%></A> %> ... }
Note:Web Intelligence documents are represented by an IInfoObject in the CMS, their is no specialized object such asIFolderused for folders. Searching for and listing universes in the CMS
  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents