Contents |
UNDER CONSTRUCTION
NOTE: Some of the information found on these pages is dependent on having the not yet released Sentinel Log Manager 1.0.0.3 installed. The following features will not work without Sentinel Log Manager 1.0.0.3 installed:
Sentinel RD and Sentinel Log Manager (collectively we'll refer to them as Sentinel) include a reporting engine that allows users to generate reports that display data queried from the server. The reporting engine utilizes the open source Jasper Reports engine in order to define and generate reports that display the data in a nicely formatted layout. Many report definitions are included out of the box. It is possible, however, to upload additional (custom) report definitions.
A Report definition is packaged in Sentinel in a form called a Report plugin-in. The plugin-in is a zip file that contains all the files required in order for the Sentinel reporting engine to run the report.
The aim of this page is to explain how to develop Report plug-ins that can be used with Sentinel RD and Sentinel Log Manager.
Sentinel 6.1 and prior releases used Crystal Report technology instead of Jasper. Developing Crystal Reports is not covered here.
Jasper Reports is an open source project that is available for everyone to use. The most basic part of a Jasper Report is its .jrxml file. This file contains the query to execute as well as how to format the results of the query. Formatting can include tables, columns, graphs, charts, etc.
Editing the .jrxml file can be done by hand, however since formatting can get quite complex, editing the file by hand is not recommended. iReport is a free, open source, program that provides a GUI development environment for editing .jrxml files and makes the task of editing .jrxml files significantly easier.
Both Jasper Reports and iReport are rich tools for developing and running reports. Since there is a lot of information about these tools already available on the Internet, we will not attempt to document all aspects of these tools here. Instead, this documentation will focus on what you need to know in order to use these tools with the Sentinel SDK.
Here are some links to more information on these tools. This list is not exhaustive, however, so a web search is recommended in order to find more information:
This section assumes that you have already completed the setup steps detailed in SDK Pre-Requisites and SDK Installation and Configuration. It also assumes that you are going to create a new Sentinel Report plug-in using a report template provided by the Sentinel SDK.
To begin creating a new Sentinel Report plug-in:
As you develop your report, additional files may be added including custom java classes, additional properties files, and so forth.
This procedure will clone the Report template to create a new skeleton Report in a development directory. You will edit the files in this new Report plug-in to add code, meta-information, documentation, and other key features.
Within this documentation, we refer to the .jrxml file as the report definition. The report definition contains all of the settings Jasper Reports needs to know in order to generate a report. Since there are a number of complexities in the report definition, it is best to start from a template report definition that has many of the common settings already setup. This way, you can focus on adding the specific query and formatting that you are interested in. To get started with the template, do the following.
In order to build your plug-in from the development directory into a functional plug-in, perform the following steps within Eclipse:
/proj/content/build/<plug-in name>.
It is expected that you will build your plug-in many times during development; the build process is fully automated. In addition to the ant build command, which does a complete build, you can also use the ant build-zip which only builds the portion of the plug-in based on code (e.g. no documentation etc), for more rapid development cycles.
After building the Report, import it into your system using the web interface provided. The exacts steps for doing this various between Sentinel products. Refer to the product documentation for the exacts steps.
The development process consists of:
Using iReport is the best method for editing report as it provides a rich IDE that allows you to customize virtually all aspects of the Jasper report.
Sentinel products store a variety of data that is useful to report on. This section explains the kinds of data stored in Sentinel products and where, in each product, the data and be found. The location of the data will affect the way the report query is written.
Note also that many reports are heavily dependent on event taxonomy; filters and colors are often applied based on [[SentinelTaxonomy][that taxonomy]].
It is important to note that since these two kinds of data are stored in different locations and because a single Jasper report can query only one location at a time, a single Jasper report is limited to querying for either events or configuration data, but it cannot query for both. The data fields that can be included in a given report are defined by the database views that can be queried (plus any additional external data sources). The full list of database views is available in the Sentinel documentation, available on the Novell [[1][documentation site]]. (future link: Sentinel DB Views)
Since Jasper has built-in support for querying databases, developing a report to run against the Log Manager configuration database is just like writing a Jasper report for any system that queries a database. For example, when defining the query, there is no need to specify a language because by default the Jasper report engine will assume it is SQL:
<queryString>
<![CDATA[SELECT
...]]>
</queryString>
In order to create a SQL query that will run against the Log Manager's database, you'll need to know the Log Manager database schema. You can find this schema here: {link needed} For more information about how to develop Jasper reports that query the database, use the following link: https://twiki.innerweb.novell.com/bin/view/SentinelDev/SentinelContentDev#Reports Data stored in an embedded PostgreSQL can be queried for using a normal SQL queries. The iReport manual contains a lot of information about how to add data to a report when the source of the data is a database, therefore refer to this manual for more information.
If you are writing a report for SLM, there is additional information you need to know beyond what is typically needed when writing a report that runs against a database. The reason is that SLM uses an optimized data store for events instead of a database. This additional information can be found here.
Within iReport, you define custom report parameters to be used to control various aspects of report generation. Some of these parameters can be selected at report runtime, these are called "prompted parameters". In general, you need to "export" these parameters from the report itself to Sentinel's external parameter format so that the platform (e.g. Novell Identity Audit) can properly prompt for them. To do so:
For more details on the plug-in parameters, see Parameters.
Parameters used can be of various types such as String, Date etc., Most commonly used parameters are:
Parameters can also be dynamic, which can be retrieved using the SQL query as explained in 'Implementing Cascading parameters'.
The tag '<IsForPrompting>0</IsForPrompting>' can be used in parameters which are not intended for prompting to the user. Use 1 in place of 0 if we need to prompt that parameter.
Note that the order specified in the 'tempalte.pml' would define the order of parameters displayed in the parameter screen when running the report.
(Add discussion of localizing dates and times, etc)
Using the Cascading parameters syntax (described below), JasperReport Plugin developers can tie multiple report parameters together such that when the value of one parameter changes, any dependent parameters will be updated accordingly.
Suppose a report had two parameters
In this case, the employees listed "Employees" combobox should change based on the department selected in the "Department" combobox. Cascading report parameters are used with the previously existing "OptionQuery" parameter type. The OptionQuery parameter type allows you to specify a query that gets executed at run time to query the database and dynamically generate the options that get displayed in the parameter's combobox.
To support cascading parameters, the following syntax has been defined:
<PluginParameterDefinition> <Type>String</Type> <DisplayName>Cascading Option 1</DisplayName> <InternalName>CascadingOption1</InternalName> <Description>Select a plugin type.</Description> <DefaultValue>JASPER_REPORT</DefaultValue> <IsForPrompting>1</IsForPrompting> <PreventDuplicates>1</PreventDuplicates> <OptionQuery>SELECT SENTINEL_PLUGIN_TYPE AS NAME, SENTINEL_PLUGIN_TYPE AS VALUE FROM SENTINEL_PLUGIN</OptionQuery> </PluginParameterDefinition> <PluginParameterDefinition> <Type>String</Type> <DisplayName>Cascading Option 2</DisplayName> <InternalName>CascadingOption2</InternalName> <Description>Select a plugin.</Description> <IsForPrompting>1</IsForPrompting> <OptionQuery>SELECT SENTINEL_PLUGIN_NAME AS NAME, SENTINEL_PLUGIN_ID AS VALUE FROM SENTINEL_PLUGIN WHERE SENTINEL_PLUGIN_TYPE='##CascadingOption1##'</OptionQuery> </PluginParameterDefinition>
Some more notes:
Jasper includes the <nop>JFreeChart charting library as part of its solution, but we have significantly extended that to support more useful chart types and to match our design aesthetic. In general you should use the SentinelJasperCustomCharts to build charts for your reports.
Relevant link which lists out the various customizations researched on the charts: JasperReportsResearchTasks
Reports are typically viewed as a PDF when they are generated. In order for unicode characters to display properly in the PDF, reports must use one of the following fonts:
Only these fonts are mapped to a PDF font (arialuni.ttf/Arial Unicode MS) and PDF encoding (Identity-H) that are capable of displaying unicode characters. NOTE: The PDF mapping above has been implemented in Pilin, Sakura, Sentinel 6.1.1.1, and Identity Audit 1.0.0.2 and above. Earlier versions don't display unicode characters properly.
After you've done a certain amount of development work on your report, it's a good idea to preview the report in iReport to make sure it works properly.
(follow heading link)
© 2009 Novell, Inc. All Rights Reserved.