This set of slides is part of the course Data Visualization GE, available on FIWARE platform, whose SpagoBI is the reference implementation. In this course it is explained how a simple analytical document can be developed from scratch.
1. Data Visualization GEri - SpagoBI
Davide Zerbetto, Nunzia Marotta
Engineering
Data Visualization GE Manager, Data Visualization GE Course Creator - FIWARE
davide.zerbetto@eng.it ,nunzia.marotta@eng.it
2. Birt Report Designer
TOPIC OF THE COURSE:
this course shows the
creation process of a
dataset and an analytical
document from scratch
SpagoBI Project
3. Prerequisite: having a working SpagoBI Server installation
Installation instructions are available here:
http://spagobi.readthedocs.org/en/latest/admin/README/index.html
We will refer to the SpagoBI Server base folder as SPAGOBI_SERVER_HOME.
In this course we will focus on:
➢
configuring a new datasource connection;
➢
creating a new dataset;
➢
creating a new chart;
4. Step 1. Set datasource connection.
In order to configure a new JNDI Data Source, you have to stop
SpagoBI Server and edit the server.xml file, located in the folder
“SPAGOBI_SERVER_HOMEconf”, as follows:
Don’t foget to add the relative jdbc driver inside the folder:
SPAGOBI_SERVER_HOME/lib.
5. Next, you have to edit every context.xml file located in every
“SPAGOBI_SERVER_HOMEwebappsSpagoBIxxxMETA-INF” folder, including
“SPAGOBI_SERVER_HOMEwebappsSpagoBIMETA-INF”.
Delete SPAGOBI_SERVER_HOME/conf/Catalina.
6. Start SpagoBI Server and log-in as
superadmin; then enter Resources -->
Data Source
Using SpagoBI you can define a
new data source in two ways:
➢
JNDI data source;
➢
JDBC data source.
We recommend to define only
JNDI datasources as described.
7. Test and save it.One can also select “Read Only” and/or
deselect the “Write default”: if the datasource
is Write-default, it will be used by cache
mechanism
In our example we
use a test database
called
“my_database”
8. Setting the JDBC connection
presumes to know the URL
of the DB and access it with
a user ID and a password.
By the way, it is widely
recommended to use the
JNDI connection in
production environment
since it relies on connection
pool while the JDBC one
does not.
9. A dataset is a generic data provider. When defining an analytical
document, users specify the dataset(s) to be considered for data
retrieval, therefore they can completely forget about the data
source: is this sense, the dataset can be considered a layer that
levels all data sources and hides the underlying complexity.
Step 2. Create a new dataset.
10. There are several types of SpagoBI datasets, listed below:
➢ SQL query (most common)
➢ File
➢ Java Class
➢ Web Service
➢ Script
➢ QbE query
➢ REST service
➢ NGSI query
➢ CKAN resource
12. As an example we show the manual query definition.
Enter the 'Type' tab and choose the query dataset type. Then insert
your query and enter 'Preview' tab.
15. Some definitions before moving to the next steps:
Analytical document: object that defines an analysis that should satisfy the
users analytical needs.
These kind of documents can be created by technical users (editing a template
or using the SpagoBI Studio package) or by final users (using the ad-hoc
reporting tool). In this course we will focus on those documents developed by
technical users.
Template: file containing the Analytical Document specifications.
Developed using external tools such as SpagoBI Studio
Versions: many template versions can be stored for a single Analytical
Document.
A new version is registered for every deploy from the SpagoBI Studio and every
time you manually upload a template from the administrator GUI on the
SpagoBI Server
16.
17. To create a new chart the technical user has mostly two options:
1) one can write manually a chart template, simply setting the right
properties in the relative XML file and, consequently, uploading the
template as a new document into SpagoBI Server;
2) using the SpagoBI Studio package and deploying to SpagoBI
Server.
We refer to our dedicated course “My first report” available on FIWARE
platform to see how to build a new Report with Birt inside the SpagoBI
Studio and use the deploy function.
See the website https://edu.fiware.org/course/view.php?id=141
Step 3. Create a new chart.
18. Enter the Document Browser section and click on Create Document to
create your analytical document
19. Let's suppose we want to
create a bar chart.
In this case, its template
is an XML file and it will
look like the one showed
here aside.
21. Go back to the Documents Browser and click on the document icon
in order to display the result:
22. Note that the State defines
the document's visibility:
only techinal users can
access documents in
development state.
Technical users must
change the State to
'Released' option to let final
users see the document.