More Information...................................................................................................................99Appendix A
2010-11-164
Preface
Preface
The ReportEngine Java developer guide helps you to customize web application using Java SDK.
1.1 What you can learn from this guide?
This guide describes the processes and procedures for creating web application using SAP
BusinessObjects Enterprise SDK and the ReportEngine SDK.
1.2 Who should use this guide?
This guide is intended for developers who are interested in developing web applications using SAP
BusinessObjects Enterprise SDK and the ReportEngine SDK.
1.3 What you should know?
To use the SAP BusinessObjects Enterprise SDK and ReportEngine SDK, you need a working knowledge
of the concepts of distributed computing systems, HTTP server technology, and JSP or .NET
development. You also need a basic knowledge of the products in the SAP BusinessObjects product
line. Familiarity with SAP BusinessObjects Enterprise is assumed.
1.4 Related documents
For more information on classes and interfaces of SAP BusinessObjects Enterprise SDK and
ReportEngine SDK, refer to the following guides:
•
SAP BusinessObjects Enterprise Java API Reference guide
2010-11-165
Preface
•
ReportEngine Java API Reference guide
For information on assembling and deploying web application, refer
Interactive Analysis ReportEngine SDK
guide.
Deploying the SAP BusinessObjects
1.5 List of APIs not functional from the SAP BusinessObject XI 4.0 release onwards
In SAP BusinessObjects XI 4.0 release, the Report Engine SDK does not support the following features:
•Drilling in Web Intelligence documents
•Building queries
•Document and report editing
The following public classes and interfaces are no longer functional from SAP BusinessObjects XI 4.0
onwards:
2010-11-166
Introduction to the ReportEngine SDK
Introduction to the ReportEngine SDK
The ReportEngine SDK is used to view Interactive Analysis and Desktop Intelligence documents. It is
also used to create and modify Interactive Analysis documents. The ReportEngine SDK is considered
as a component of SAP BusinessObjects Enterprise SDK as they are designed to work together. For
example, if you want to modify and view a Interactive Analysis document in SAP BusinessObjects
Enterprise, then you must use SAP BusinessObjects Enterprise SDK and ReportEngine SDK in an
integrated fashion.
You can use COM, Java, or .NET API interfaces to create web portals that access the back-end SAP
BusinessObjects Enterprise server. Custom application developed using this SDK has the same
functionality as Infoview since it is created with some of the same APIs.
2.1 Packages for customizing SAP BusinessObjects Enterprise
There are two packages for customizing SAP BusinessObjects Enterprise:
•SAP BusinessObjects Enterprise SDK
This package is called the platform package and provides platform functions of the SAP
BusinessObjects servers and document scheduling.
•ReportEngine SDK
This package plugs into SAP BusinessObjects Enterprise SDK. It provides functionalities of Interactive
Analysis ReportEngines.
2010-11-167
Introduction to the ReportEngine SDK
2.2 ReportEngine SDK in SAP BusinessObjects Enterprise environment
SAP BusinessObjects Enterprise is a framework of servers that facilitates enterprise-wide, web-based
management and distribution of reports. Web applications can access the functionality of SAP
BusinessObjects Enterprise through APIs provided by the SAP BusinessObjects Enterprise SDK and
ReportEngine SDK. For detailed information on SAP BusinessObjects Enterprise, see the
The ReportEngine SDK enables you to create and modify Interactive Analysis and Desktop Intelligence
reports. These report modification services are provided by the ReportEngine server. For more information
about SAP BusinessObjects Enterprise servers, see the
Guide
.
The diagram below illustrates the relationship between the ReportEngine SDK and other SAP
BusinessObjects Enterprise components,
.
SAP BusinessObjects Enterprise Administrator's
SAP
2010-11-168
Introduction to the ReportEngine SDK
2010-11-169
Introduction to the ReportEngine SDK
2010-11-1610
Workflow of ReportEngine SDK application
Workflow of ReportEngine SDK application
All applications that use ReportEngine SDK do not have the same features. But all typically provide
features for listing and viewing documents contained in the SAP BusinessObjects Enterprise Central
Management System (CMS).
3.1 Application essentials
Every application that uses ReportEngine SDK has to perform common tasks such as importing the
appropriate packages, and creating and managing the user's SAP BusinessObjects Enterprise session
(login).
Every application has to take user profiles into account and ensure that errors are handled properly.
See User rights for categories and folders and User preferences.
3.2 Document management
Document management features include listing the documents that the current user can view depending
on user's rights. It allows the user to browse and manage categories and folders used to organize
documents.
Document management also include features such as saving and scheduling documents.
3.3 Viewing reports
An application that allows to view documents can display them using the default DHTML format. It is
easy to extend the functions to handle documents that contain prompts, and to provide drilling functions.
These extended functions are handled when a document is refreshed.
The viewing features depends on the type of document opened. The report-viewing part of the application
should include routines for viewing reports in the following document types:
2010-11-1611
Workflow of ReportEngine SDK application
•Interactive Analysis (*.wid)
•other document types, for example Adobe Acrobat, Microsoft Excel or XML format.
See Viewing reports for a full listing of available formats.
3.4 Formatting documents
Formatting documents involves creating and positioning the elements of a report (blocks, sections, and
cells) in the appropriate report structure. Using ReportEngine SDK you can build reports from scratch.
ReportEngine SDK includes classes for controlling report page decoration (fonts, colors, headers, and
footers) and layout.
3.5 Open document workflow
The following diagram shows the workflow for opening a document.
The document contains data that is retrieved from the data source (universe). Each document is identified
by an unique ID which is required to open a document.
3.6 Refresh document workflow
The following diagram shows the workflow for refreshing a document.
2010-11-1612
Workflow of ReportEngine SDK application
The document must be refreshed to get the latest information from the data source. The refresh action
requires prompt information if the document contains prompts, and context information if the document
contains contexts.
2010-11-1613
Workflow of ReportEngine SDK application
2010-11-1614
Setting up development environment
Setting up development environment
This section describes how to set up a development environment for web application based on
ReportEngine SDK in a Java environment.
4.1 Installing ReportEngine SDK components
The ReportEngine SDK components are added to the development machine when SAP BusinessObjects
Enterprise is installed on the system. To develop a custom ReportEngine SDK application it is necessary
to connect to a running SAP BusinessObjects Enterprise server. However, the development environment
need not be on the same machine as the SAP BusinessObjects Enterprise Server.
To install the ReportEngine SDK components on a development machine, perform the following steps
:
1.
Run SAP BusinessObjects Enterprise installer.
2.
Choose the Setup language and click OK.
3.
Click Next on the "BusinessObjects Enterprise XI 3.1 Installation Wizard" window.
4.
Select the I accept the License Agreement in the "License Agreement" panel.
5.
Click Next.
6.
Enter your corporate information and keycode.
7.
Click Next.
8.
Click Next.
9.
In the "Install Type" window, select Custom or Expand Install button.
10.
Specify the destination folder in the "Destination Folder" text box.
11.
Click Next.
12.
Deselect all BusinessObjects Enterprise Features.
13.
Enable the Developer Components.
To install J2EE components only, deselect the SDK products feature and install the Java features
sub-component.
14.
Click Next.
2010-11-1615
Setting up development environment
15.
Click Next.
This installs all components necessary to develop custom Business Objects applications; Java libraries
are installed and registered correctly.
4.2 Setting up the Java environment
To setup the ReportEngine Java environment, refer the following sections:
•Setting up the Eclipse framework
•Project Setup
4.2.1 Setting up the Eclipse environment
Eclipse is an Integrated Development Environment (IDE) which provides a universal toolset for application
development. Eclipse is an open development platform and can be downloaded from the eclipse web
site for free of cost.
To create a Java web-based application, you must have an application server and Java Development
Kit (JDK) installed on the machine. By default, Apache Tomcat application server is installed along with
SAP BusinessObjects Enterprise installation. Hence, an example on creating a dynamic web project
is explained considering Apache Tomcat as an application server.
4.2.2 Project Setup
It is recommended to create a dynamic web project using Eclipse. It has the following advantages:
•External jars and other Eclipse projects can be included in the working project.
•Easy to export a war file which can be deployed in any application server.
•Easy to run the application code.
The Web project contains the JSP files, images and various web components in a structured manner.
The WEB-INF, lib, classes and other directories which are required to create a web application will be
predefined. This makes the coding simpler.
2010-11-1616
Setting up development environment
4.2.2.1 Creating a dynamic web project
The following are the pre-requisites for creating a web application:
•Eclipse must be installed and configured.
•Apache Tomcat application server must be installed.
•Java Development Kit (JDK) must be installed and configured.
1.
Launch Eclipse by selecting a workspace.
2.
In the Package Explorer panel, right-click, select New and click Project.
"Select a Wizard" window appears.
3.
In the list box, expand Web and select Dynamic Web Project.
4.
Click Next.
"Dynamic Web Project" window appears.
5.
Enter the "Project Name".
6.
Under "Target Runtime", click New.
"New Server Runtime" window appears.
7.
Under "Select the type of runtime that you want to define:", expand Apache and select the runtime.
8.
Click Next.
"Tomcat Server" window appears.
9.
Under "Tomcat installation directory", click Browse and select the Tomcat installation directory.
10.
Under JRE, click Installed JREs.
"Installed JREs" window appears.
11.
Click Add, enter "JRE name", "JRE home directory " and click OK.
12.
In the "Installed JREs" window, select the JRE and click OK.
The <BOProductName>Interactive Analysis SDK package
log4j.logger.com.businessobjects.rebean.ReportEngines allows you to integrate trace messages
from your own application with those generated by the SAP BusinessObjects servers and
<BOProductName>Interactive Analysis SDK.
The following sections describe the REBean logging in more details:
•"Trace Levels"
•"Activating logging by editing the configuration files"
•"Activating logging by using the default settings"
•"Activating logging while Tomcat is running"
4.3.1.1.1 Trace Levels
The following table shows the trace levels available through the above mentioned trace systems:
2010-11-1619
Setting up development environment
Provides messages onTrace Level
•helper classes
DEBUG
•calls from REBean to the report engine server
•JHSAL activity
•entry of each JSP
INFO
WARN
ERROR
•calls to the methods exposed by REBean
•potentially harmful situations
•non-fatal exceptions
•exceptions that stop the execution of applica-
FATAL
tion
4.3.1.1.2 Activating logging by editing the configuration files
To activate logging, you must edit the webi.properties file. When you change this file, you need to restart
Tomcat for your changes to take effect.
To activate the logging system, add the following lines to the webi.properties configuration file:
Where LEVEL can be one of: DEBUG, INFO, WARN, ERROR, or FATAL. This automatically selects
the log4j logging system and sets the trace level to LEVEL. If there is no log4.properties file,
log4.properties.todo is generated.
system is one of: Log4jLogger (log4j), or StandardLogger (debugdiag)
This activates logging, selects the system logging system, and sets the trace level to LEVEL. If there
is no configuration file for the logging system a .todo file is generated.
4.3.1.1.3 Activating logging by using the default settings
To activate the logging system using the default settings:
1.
Add the following line to the webi.properties configuration file:
Trace=1
2.
Start, or restart Tomcat.
2010-11-1620
Setting up development environment
This activates logging, by default the log4j logging system is selected, and the trace level is set to
INFO. If there is no log4j.properties file, log4j.properties.todo is generated.
4.3.1.1.4 Activating logging while Tomcat is running
To activate logging while Tomcat is running, put the following code in a file called traces.jsp and
put the file in the same folder at the InfoView files. Then, to activate logging, open traces.jsp in a
web browser and select the options (logging system, and trace level) you want.
The following is an example of the traces.jsp file:
Example: Activating logging while Tomcat is running
4.3.1.2 Configuring the Jakarta log4j logging system
The Jakarta log4j logging system uses a configuration file called log4j.properties. This file must be
present in the classes directory of the web application, for example, webapps\wijsp\WEB-INF\classes.
If the configuration file is not present log4j.properties.todo is created in the bin folder of the application
server, however you should move this file to the classes directory for your web application (and remove
the "todo" from the file name) so you can have one configuration file for each application.
This logging system is delivered with the SAP BusinessObjects platform. It is installed in
$INSTALLDIR\classes. See also http://jakarta.apache.org/log4j/docs/index.html for further explanation
of the configuration options for this tool.
The following sections describe the Jakarta log4j logging system in more details:
•Setting the trace level
•Setting the trace mechanism
•Setting the trace output
•Specifying the trace level for individual classes
4.3.1.2.1 Setting the trace level
You set the trace level in log4j.properties. The possible levels are DEBUG, INFO, WARN, ERROR,
and FATAL.
The trace level setting in log4j.properties takes precedence over the trace level setting in webi.properties.
4.3.1.2.2 Setting the trace mechanism
You set the trace output mechanism in log4j.properties. Possible output mechanisms are: file, console
(stdout), or a socket.
4.3.1.2.3 Setting the trace output
You can set the output format in log4j.properties. The following table shows the formatting tokens you
can use.
2010-11-1622
Setting up development environment
Adds this to the traceThis token
date%d
thread%t
trace level%p
the name of the logger%c
time since the trace system was initialized%r
thread content, for example, the session ID%x
the message%m
4.3.1.2.4 Specifying the trace level for individual classes
You can specify the trace level for a package or a class.
For example, if the root trace level is DEBUG, but you do not want to see the trace for the REBean
package, add the line log4j.logger.com.businessobjects.rebean.wi=WARN to
log4j.properties.
Similarly, you can exclude the trace for the ReportEngine interface with log4j.logger.com.busi
nessobjects.rebean.wi.ReportEngine=WARN
log4j.properties
Example: log4j.properties
The following lists the contents of log4j.properties. In this example, the root trace level is set to
DEBUG, and traces from the Report interface are excluded.
4.4 Configuring ReportEngine using webi.properties
You can configure individual ReportEngine SDK or viewer applications such as InfoView to improve
their efficiency on application server on which they have been deployed. The purpose of this chapter
is to tell you how to improve SAP BusinessObjects Enterprise application efficiency.
4.4.1 What is webi.properties?
Each ReportEngine web application can have a webi.properties file. For SAP BusinessObjects Enterprise
applications this file is optional. The webi.properties file is located in the WEB-INF\classes subdirectory
of the <BOProductName>AnalyticalReporting. For example, if you have deployed InfoView on a Tomcat
application server the webi.properties file would be found in the following directory:
The webi.properties file is a plain text file containing variables used to tune the individual
<BOProductName>Web Intelligence web application. The variables defined in the webi.properties file
are taken in to account when your <BOProductName>Interactive Analysis server starts up. To change
variable settings in webi.properties, Business Objects recommends that you do the following:
1.
Navigate to the classes subdirectory in your <BOProductName>Interactive Analysis web application,
that is to say <MyWebIntelligenceApp>/WEB-INF/classes.
2.
Make a copy of the webi.properties file. This copy is to stay in the
<MyWebIntelligenceApp>/WEB-INF/classes subdirectory as a backup.
2010-11-1624
Setting up development environment
3.
Copy webi.properties to a temporary directory.
4.
Edit webi.properties using text editor, set the value of the variables as required.
5.
Replace <MyWebIntelligenceApp>/WEB-INF/classes/webi.properties with your updated version.
6.
Restart the server.
A comprehensive list of variables to update can be found in the next section.
4.4.3 Configuration Options
TEMP_DIR
The directory where temporary
files generated by <BOProductName>Interactive Analysis are
stored.
Default ValueDescriptionVariable Name
same as the Java temporary
directory
XML_TRANSFORMER
CHUNK_SIZE
FAILOVER_SIZE
MAX_HEAP_SIZE
Trace
The parser used for XML translation.
The size of binary or character
object sent between the client
browser and the <BOProductName>Interactive Analysis server.
Control the maximum number of
document states kept in memory.
Prevent the web application from
consuming all the heap of the
Java Virtual Machine.
Set the application to trace internal <BOProductName>Interactive Analysis calls.
The following variables can be used to tune web applications:
Note:
For application servers running with the Java Virtual Machine 1.4 and above, runtime.maxMemory is
used to set the MAX_MEMORY variable internally. This ensures that your <BOProductName>Interactive
Analysis application does not consume the Java Virtual Machine heap.
Sets the limit of undo actions
possible for DocumentInstance
objects.
Set to 0 for no limit for file persistence and token are storage until
memory reaches
FAILOVER_SIZE.
Default ValueDescriptionVariable Name
11
In order to optimize resources on the Interactive Analysis server, the STORAGE_TOKEN_STACK_SIZE
parameter is used to limit the size of the stack by limiting document serialization. For the end user, this
means the number of undo actions that can be done.
The default value of STORAGE_TOKEN_STACK_SIZE is 10, the same as the FAILOVER_SIZE variable.
•If STORAGE_TOKEN_STACK_SIZE =0, then there is no limit for file persistence and token are
stored into memory until reaching FAILOVER_SIZE. If failover happens, the maximum number of
DocumentInstance objects in the storage manager will fail over to a backup application server.
•If STORAGE_TOKEN_STACK_SIZE <= FAILOVER_SIZE, then there is no file persistence.
•If STORAGE_TOKEN_STACK_SIZE > FAILOVER_SIZE up to (STORAGE_TOKEN_STACK_SIZE
minus FAILOVER_SIZE), instances are stored in file system.
The memory footprint for a document state that is higher than the value of
STORAGE_TOKEN_STACK_SIZE in the stack is deleted. If a client tries to use an out of stack token
to access a document state the ReportEngine will throw an exception. You can retrieve the stack size
programmatically and validate storage tokens using:
This section describes the procedures to develop a custom web application using ReportEngine SDK.
5.1 Application Essentials
5.1.1 Overview
Before providing viewing, reporting, and editing functions, the ReportEngine SDK applications need
to perform basic tasks, such as referencing the appropriate package and creating a BusinessObjects
Enterprise session for the user.
This section covers the essential concepts and tasks, which all the applications that customize
BusinessObjects Enterprise must use.
5.1.2 "Hello World"
The simplest application you can write with SAP BusinessObjects Enterprise SDK is the one that creates
a SAP BusinessObjects Enterprise session which provides log in and log out functions.
This is the basis for building much more sophisticated applications that provide functions to list, view
and create documents, and attach them to hierarchical categories.
2010-11-1627
Developing web application using ReportEngine SDK
This application gathers login details from the user, and sends the details to another page which uses
SAP BusinessObjects Enterprise SDK to open a SAP BusinessObjects Enterprise session. If the session
is successfully created, the application displays a "Hello World" message and the option to log out.
When the user clicks the logout link, the application closes the user's SAP BusinessObjects Enterprise
session with SAP BusinessObjects Enterprise SDK and displays the first page again.
Each page that uses SAP BusinessObjects Enterprise SDK must:
•reference SAP BusinessObjects Enterprise SDK
•create or reference an IEnterpriseSession object
•create or reference an IInfoStore object
See "Implementing "Hello World"" for code that implements this application.
5.1.2.1 Referencing SAP BusinessObjects Enterprise SDK
Referencing SAP BusinessObjects Enterprise SDK gives your web application access to the SAP
BusinessObjects Enterprise platform functions exposed by the SDK.
Note:
You must use SAP BusinessObjects Enterprise SDK prior to using ReportEngine SDK.
To develop a Java application SAP BusinessObjects recomments that you add all libraries found in the
<BusinessObjectsHome>\Tomcat55\webapps\AnalyticalReporting\WEB-INF\lib into
the WEB-INF\lib directory of your JSP project.
5.1.2.1.1 Referencing SAP BusinessObjects Enterprise SDK
To reference SAP BusinessObjects Enterprise SDK, import the SAP BusinessObjects Enterprise
packages.
2010-11-1628
Developing web application using ReportEngine SDK
Example: Referencing SAP BusinessObjects Enterprise SDK
To import SAP BusinessObjects Enterprise SDK packages, add the following line to pages that use
the packages.
You need to include this line in every page that uses SAP BusinessObjects Enterprise SDK.
5.1.2.2 Creating a new user session
In SAP BusinessObjects Enterprise SDK, the ISessionMgr allows user to log in to the SAP
BusinessObjects Enterprise server and create a session. Session information is stored in the IEnter
priseSession object returned by logon method. Every session has a corresponding IEnterpris
eSession object which is used to access the ReportEngine SDK.
5.1.2.2.1 Creating an ISessionMgr object
To create a user session for an application that uses SAP BusinessObjects Enterprise SDK, you must
first instantiate a new ISessionMgr object.
Every user of InfoView requires a SAP BusinessObjects Enterprise session for logging in and using
the system. The SAP BusinessObjects Enterprise session represents the user's current interaction with
SAP BusinessObjects Enterprise. A user's SAP BusinessObjects Enterprise session provides access
to the user's details, and objects that are subject to the rights of the user, for example, the list of universes
that the current user can use to create documents.
2010-11-1629
Developing web application using ReportEngine SDK
You must create a SAP BusinessObjects Enterprise session for the user which is a key part of the log
in and authentication process.
To create a session for a user:
1.
Get the user's login information:
•name
•password
•the Central Management System (CMS), that the user wants to log into
•authentication type (Enterprise, LDAP, winAD)
2.
Establish a valid SAP BusinessObjects Enterprise session for the user.
5.1.3.1 Getting login information
The simplest way to get a user's login information is to use an HTML form in which the user enters the
name, the password, the CMS, and the auth type. When the user submits the form, the values for the
fields are passed through the query-string to a page that processes the values.
Example: HTML form for gathering a user's login information using Java
When the user enters login information and clicks the Login button, the values of the fields are passed
to Login.jsp in the query string parameters. The method attribute of the form is set to POST, and therefore
these values will not be visible in the URL.
2010-11-1630
Loading...
+ 74 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.