Customizing Webintelligence En

  • Published on
    03-Apr-2015

  • View
    276

  • Download
    4

Embed Size (px)

Transcript

<p>Customizing Web Intelligence with REBean</p> <p>BusinessObjects Enterprise XI Windows and UNIX</p> <p>Copyright</p> <p>If you find any problems with this documentation, please report them to Business Objects S.A. in writing at documentation@businessobjects.com. Copyright Business Objects S.A. 2004. All rights reserved.</p> <p>Trademarks</p> <p>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. 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.</p> <p>Patents</p> <p>ContentsChapter 1 Chapter 2 Introduction Introduction to WebIntelligence SDK 7 9 Packages for customizing WebIntelligence . . . . . . . . . . . . . . . . . . . . . . . . 10 Migrating to BusinessObjects XI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 A typical Web Intelligence SDK application . . . . . . . . . . . . . . . . . . . . . . . . 11 Chapter 3 Application Essentials 15</p> <p>Hello World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 BusinessObjects Enterprise sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Implementing Hello World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 User preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Exception handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Reporting essentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Chapter 4 Document Management 33</p> <p>Document types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Document state: storage tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Organizing documents in categories and folders . . . . . . . . . . . . . . . . . . . . 39 Working with documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Document properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Chapter 5 Viewing Web Intelligence Reports 61</p> <p>Viewing reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Handling prompts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Displaying a report map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Chapter 6 Drilling in Web Intelligence Reports 79</p> <p>Introduction to drilling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Drilling in Web Intelligence reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83</p> <p>Customizing Web Intelligence 3</p> <p>Chapter 7</p> <p>Building and Editing Data Providers</p> <p>91</p> <p>Data providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Building a data provider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Executing queries and retrieving the data . . . . . . . . . . . . . . . . . . . . . . . . 102 Chapter 8 Formatting Reports 103</p> <p>Creating and editing the document structure . . . . . . . . . . . . . . . . . . . . . . 104 Creating and editing cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Page layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Appendix A Working with Recordsets 119</p> <p>Anatomy of a recordset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 Appendix B Business Objects Information Resources 123</p> <p>Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Customer support, consulting and training . . . . . . . . . . . . . . . . . . . . . . . . 125 Useful addresses at a glance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127</p> <p>Customizing Web Intelligence 4</p> <p>ExamplesReferencing BusinessObjects Enterprise SDK 17 Instantiating the ISessionMgr class 18 HTML form for gathering a users login information 19 Establishing a session 20 Printing a users preferences 26 Setting a users report panel preference to Java 28 Adding a new preference to a users profile 29 Importing the REBean package 31 Instantiating a ReportEngine object 31 Storage token life cycle 36 how to check that a user has the right to create categories 40 Recursively traversing the category tree 41 Retrieve a users Inbox and Favorites folder IDs 43 Creating a new folder or category 45 Moving and renaming categories or folders 46 Retrieve the properties for a category 46 Displaying a document list 49 Save a Web Intelligence document 50 Scheduling a document 51 Retrieve the list of groups to which a user belongs 52 Sending a document to folders and categories 53 Send a document to the inbox of groups of users 55 Getting the name of a Web Intelligence document using REBean 58 Adding a property to a Web Intelligence document 58 Viewing all the reports in a Web Intelligence document 63 Viewing a report in a Web Intelligence document 63 Viewing a report in Microsoft Excel format 64 Handling a single, simple prompt 66 Dynamically creating input names 68</p> <p>Customizing Web Intelligence 5</p> <p>Examples</p> <p>Handling many, simple prompts 68 Displaying a simple list of values 70 Handling multivalued prompts 72 Handling multicolumn lists of values 72 Order of filling a hierarchy of nested prompts 74 Handling nested prompts 74 Refreshing a list of values containing nested prompts 75 Traversing the report map for a Web Intelligence document 77 Defining the query string parameters 84 Setting the drill path 86 Displaying the drilled report 88 Launching the Web Intelligence Java Report Panel 96 Building a data provider 98 Creating a simple condition 100 Structure of a complex condition 101 Including a prompt in a condition 101 Creating a blank document 104 Creating a document structure 107 Creating an attachment 109 Editing the sections of a report 109 Building a report: adding expressions to axes 112 Accessing the values in a recordset 121</p> <p>6 Customizing Web Intelligence</p> <p>Customizing Web Intelligence</p> <p>Introduction</p> <p>chapter</p> <p>1</p> <p>Introduction About this guide</p> <p>About this guideThis guide describes the processes and procedures for creating web applications using BusinessObjects Enterprise SDK and the Web Intelligence Report Engine SDK REBean package.</p> <p>Who should read this guideTo use the BusinessObjects Enterprise SDK and Web Intelligence Report Engine SDKs you need a working knowledge of the concepts of distributed computing systems, HTTP server technology, and JSP development. You also need a basic knowledge of the products in the BusinessObjects product line. Familiarity with Web Intelligence is assumed.</p> <p>Business Objects information resourcesFor more information and assistance, see Business Objects Information Resources on page 123. This appendix describes the Business Objects documentation, customer support, training, and consulting services, with links to online resources.</p> <p>8 Customizing Web Intelligence</p> <p>Customizing Web Intelligence</p> <p>Introduction to WebIntelligence SDK</p> <p>chapter</p> <p>1OverviewWebIntelligence SDK consists of a number of Java packages. Typically, every application that uses these packages must implement the same kinds of workflows. This chapter briefly introduces WebIntelligence SDK and the workflows a typical application needs to implement.</p> <p>Packages for customizing WebIntelligenceThere are four packages for customizing Web Intelligence:</p> <p>Web Intelligence SDK You use Web Intelligence SDK to customize Web Intelligence. BusinessObjects Enterprise SDK The "platform package," provides platform functions of the Business Objects servers, and document scheduling. Web Intelligence Report Engine SDK This package plugs into Business Objects Enterprise SDK. It provides the functions of the Web Intelligence Report Engine.</p> <p>BusinessObjects Enterprise SDK Crystal Enterprise Documents View Refresh Analyze Platform functions Manage sessions and users Manage documents and categories List universes, documents Schedule</p> <p>Web Intelligence SDK Web Intelligence documents View Refresh Analyze Create Format Metadata (universe) Explore</p> <p>BusinessObjects Enterprise SDK is called the platform package because it exposes the platform functions of the Business Objects servers. Web Intelligence Report Engine exposes the functions of the Web Intelligence Report Engine.</p> <p>10 Customizing Web Intelligence</p> <p>1Migrating to BusinessObjects XIIf you already have a business intelligence solution based on previous versions of Developer Suite you might need to migrate your solution. Migration affects the following areas:</p> <p>referencing components of the Business Objects platform controlling user sessions listing and navigating through folders and categories managing and viewing documents handling security commands using the various dictionaries deploying your application</p> <p>For more information on migration issues see the Migrating Business Objects 6 Customized Applications to BusinessObjects XI guide.</p> <p>A typical Web Intelligence SDK applicationNot all applications that use Web Intelligence SDK have the same features, but all typically provide features for listing documents in the BusinessObjects Enterprise Central Management System (CMS) and viewing documents. A more sophisticated application could also include features such as document creation and report formatting.</p> <p>Application essentialsEvery application that uses Web Intelligence SDK needs to perform a few common tasks such as importing the appropriate Java packages, and creating and managing the users BusinessObjects Enterprise session (login). While it is not absolutely necessary, every application should also take user profiles into account and ensure that errors are handled properly. See User rights for categories and folders on page 39 and User preferences on page 25.</p> <p>Document managementDocument management features include the ability to list the documents that the current user can view, and, depending on the users rights, allowing the user to browse and manage categories and folders used to organize the documents.</p> <p>Customizing Web Intelligence 11</p> <p>1Document management can also include features such as saving, and scheduling documents.</p> <p>Viewing reportsAn application that provides a feature for viewing reports can display reports using the default HTML format. It is easy to extend this to handle reports that contain prompts, and to provide drilling functions. These extended functions have to be handled when a document is refreshed. How you provide these viewing features depends on the type of document. The report-viewing part of the application should include routines for viewing reports in the following document types:</p> <p>Web Intelligence (*.wid) Crystal Reports documents other document types, for example Adobe Acrobat, Microsoft Excel or XML format.</p> <p>Creating documents: building and editing data providersTo give users the ability to create documents and generate their own reports, you need to provide them with tools to build and edit data providers. A data provider encapsulates information about the information source and the query that defines what information is retrieved. Creating a document essentially means creating a data provider. You can use the same classes to provide different features for editing a query, such as adding conditions and changing the scope of analysis.</p> <p>Formatting documentsFormatting documents involves creating and positioning the elements of a report (blocks, sections, and cells) in the appropriate document structure. Using Web Intelligence Report Engine SDK you can build reports from scratch. Web Intelligence Report Engine SDK also includes classes for controlling the page decoration (fonts, colors, headers, and footers) and page layout of a report.</p> <p>Example workflowsInfoView is implemented using BusinessObjects Enterprise SDK and Web Intelligence SDK. The Web Intelligence InfoView viewer interface has three zones:</p> <p>the document tool bar, which shows the users position in the document</p> <p>12 Customizing Web Intelligence</p> <p>1 the report map, which shows the structure of a report the rendering area, which is where reports are displayed The pages manage these zones in sequence. First the document is opened, the prompts are filled and the position is set, then the report map is populated and finally the report is rendered and displayed.</p> <p>Open document workflowThe following diagram shows the workflow for opening a document.Client pages open a document check for prompts fill prompts until there are none left unfilled fill document toolbar fill report map fill rendering area Web Intelligence SDK</p> <p>get the report map get the report in the requested format</p> <p>Customizing Web Intelligence 13</p> <p>1Refresh document workflowThe following diagram shows the workflow for refreshing a document.Client pages Web Intelligence SDK</p> <p> update document toolbar</p> <p>refresh the report refresh check for prompts fill prompts until there are none left unfilled set the position</p> <p>fill document toolbar fill report map fill rendering area</p> <p>get the report map get the report in the requested format</p> <p>14 Customizing Web Intelligence</p> <p>Customizing Web Intelligence</p> <p>Application Essentials</p> <p>chapter</p> <p>2OverviewBefore providing viewing, reporting, and editing functions Web Intelligence SDK applications need to perform basic tasks, such as referencing the appropriate package and creating a BusinessObjects Enterprise session for the user. This chapter covers the essential concepts and tasks that all applications that customize Web Intelligence must use.</p> <p>Hello WorldThe simplest application you can write with Web Intelligence SDK is one that creates a BusinessObjects Enterprise session, that is, provides log in and log out functions. You can use this as a basis for building much more sophisticated applications that provide, for example, functions to list, view and create documents, and publish them in hierarchical categories.</p> <p>get name and password from user</p> <p>Name = janderson Pass = *******</p> <p>open a session</p> <p>close session</p> <p>display Hello World and a logout link</p> <p>Table 2-1 Application for logging in and out of BusinessObjects Enterprise</p> <p>This application gathers login details from the user, and sends the details to another page which uses BusinessObjects Enterprise SDK to try to open a BusinessObjects Enterprise session. If the session is successfully created, the application displays a Hell...</p>