• Non ci sono risultati.

Design and development of a configuration module for xml-based reporting

N/A
N/A
Protected

Academic year: 2021

Condividi "Design and development of a configuration module for xml-based reporting"

Copied!
136
0
0

Testo completo

(1)

U

NIVERSITÀ DI

P

ISA

S

CUOLA DI INGEGNERIA

M

ASTER OF

S

CIENCE IN

C

OMPUTER

E

NGINEERING

C

URRICULUM

E

NTERPRISE

S

YSTEMS

D

ESIGN AND IMPLEMENTATION OF A CONFIGURATION

MODULE FOR XML

-

BASED REPORTING

R

ELATORI

I

NG

. M

ARIO

G. C. A. C

IMINO

P

ROF

.

SSA

G

IGLIOLA

V

AGLINI

D

OTT

. S

TEFANO

C

IPOLLINI

ANNO ACCADEM ICO 2013/2014

C

ANDIDATA

(2)
(3)

S

UMMARY

Introduction ... 5 Context analysis ... 7

Report types 7

Report content types 8

Report customization methods 9

Existent applications 11

Application using Birt API 13

Used standards ... 15

Software evaluation standards 15

Platform independent file format 16

Report stylesheet standards 16

Existent XML reporting standards 17

User Requirement Definition ... 21

Interview 22

Background 24

Critical Success Factor 25

System Overview 26

Requirement specification 27

Existing subsystems analysis ... 35

Choosing the GUI 35

Choosing the chart engine 37

Choosing the xslt engine 39

Choosing the FO Processor 41

Summary of choices 42

Project realization workflow... 43

.r ptdesign file 43

Activity Diagram 46

(4)

2 System architecture ...51 Class Diagram 52 File organization 64 Results analysis ...79 Test context 79 Feedback 80 Time analysis 81 Quantities analysis 82 Conclusion 82 Researching arguments ...85 Financial sector: XBRL 85 Cultural world: Digital Museums 85 Medical disciplines: Clinical Views 86 IT World: Web Interfaces customization 87 Social disciplines: E-learning 87 Conclusions ...89

Appendix A: Xsd for data representation ...91

Appendix B: Xsd for data customization ...95

Appendix C: User guide ...105

Standard Report Creation with Birt 107 Report Customization 126 Bibliography ...133

(5)
(6)
(7)

I

Introduction

n the context where we are working there are a lot of different clients requesting similar reports with some differences due to customization of elements' position, colours and pages, all of them providing data in an xml document.

At the moment the report's xsl stylesheet is modified for each request. We would like to reduce the number of different reports created and allow the customization of a single one big report that, via some customization steps will provide a pdf report with the desired characteristics for the user.

Currently there are many platforms allowing report creation with a GUI and retrieving data from a structured xml file. What we cannot obtain by any of these existing platforms, is a huge level of contents and a way of representing element customization as the companies are requesting. Particular problems have arisen in choosing pages and elements to be shown, and in customizing colours of charts in a simple way.

Since reports will be customized directly from the client, who knows xml but is not an expert in using it, what we are looking to achieve is an easy way to customize reports in xml language.

The aim of this project is to provide a platform that starting from a complex xml document (derived from an existent application) describing in detail the report structure, will create an easy xml for customization and an xsl stylesheet for the final xsl- fo structure. In a second phase the user will provide the xml document containing the data, charts will be created, customization will be applied to the xsl if they need to modify the xsl structure, or by the xsl if they modify the report structure, and the final customized report is created.

We would like to use as much as possible existing free products, exploiting their potentiality and adding some other newer through some simple actions for the end

(8)

user, who can be either a technical specialist (for report structure creation and customization in case the end user is requesting some particular customization who is not able to apply by itself) or not (for report customization).

(9)

Context analysis

Context analysis 7

Report types 7

Report content types 8

Report customization methods 9

Report structure direct customization 9 Customization through configuration file 10

Existent applications 11

ALTOVA - StyleVision 11

DMXZONE – Crystal Report 12

WINDWARD 12

Telerik 12

Oracle xml publisher 12

Product comparison 13

Application using Birt API 13

BIRT iHub F-Type 13

BIRT analytics 13

BIRT designer 13

BIRT designer pro 14

efore realizing a system for customization of report based on a simple xml structure that can also be used by inexperienced people, we will analyse the world of xml based reports and software allowing their creation and handling.

Report types

The purposes of the usage of a report in a company can be generic or specific. Generic purposes can be:

• diffuse knowledge inside the company; • invite to pay attention;

• understanding of some phenomena and situations • produce events

(10)

On the other hand, specific purposes can be:

• knowledge: provide structural and general knowledge of the company context, for extra-scoped background or a common knowledge for all the internal employees

◦ routine: structured, periodic and standard reports ◦ deepening: made if requested with analytic content ◦ not structured: made for particular problems

• control: created for making decision for specified problems or provide report based on situation for which executives are responsible by using standardized reports

• decision: provide information related with decisions to be made.

Information sent must be adequately detailed, in order to make the current situation of variables to be handled comprehensible for problem discovery and the following problem solving. People situated at different levels in the company’s hierarchy need different information, differentiated especially in detail and aggregation of proposed argument in the way of “the higher the level, the higher aggregation and the lower detail”.

Those reports are created from different companies in a similar manner, even if they have data related to the writer and customizes style and structure.

Report content types

Data customization is usually done through the usage of structured data, done differently for each company requesting the same report design, in an xml document. We have the need to create not only the components' structure, but also the data that have to be inserted, where components of a report can be recognized in:

• texts

• lists and tables

• information related with more categories (cross tables)

• images and charts (where for charts are considered images generated starting from data inserted at report creation time)

(11)

Report customization methods

We can find two principal methods for report customization, one is based on the construction of a single report which is customized from each client directly by modify the report structure and storing all the versions, while the second consists in a single report creation and allows modification at runtime via a configuration file.

For the following analysis it is important to know that:

• The application will run on a server which is small and work loaded. In order to avoid any further expense for buying other server components, the system requests that the storage occupancy and the required workload should be not excessive.

• The dimension of a report structure in about 10x the dimension of the related customization file

• It is preferable to avoid redundancy in order to have each change in the report structure available in all the reports so that even not updated customization report files would not produce inconsistent pdfs.

Report structure direct customization

Image 1: Report structure customization

(12)

administrator which is provided to all the clients. Each client that wants to customize the report has to create its own report structure derived from the general one.

• The customized structure can be stored on client side avoiding storage occupancy on server side.

• The pdf of the report can be constructed directly on client side.

• When the general report structure has to be modified, the new file has to be gave to all the clients and each one has to customize it again.

• There is the need of installation of a the program handling the report structure and elements contained.

To avoid the previous point it seems to be better if all the structures reside on the server and when a modification is applied on the general report structure, it is extended to all the customized structures. This action has a lot of problems in recognize object that have been customized, added or removed during customization since they cannot be easily compared.

Customization through configuration file

Image 2: Customization through configuration file

With this method there is a shared report structure created by the report administrator stored on server side. While sharing the report structure, is shared also the customization configuration file. Each client owns a copy of this file and can modify it based on the general report structure.

(13)

• The required overall storage dimension is reduced since the configuration file is one order of magnitude smaller than the report structure.

• For modification of the shared report structure it is not requested to modify the configuration file, but each client can add or remove report elements when desired based on the shared report structure.

• The pdf of the report is created on server side starting from the shared report structure and the customization file of the requesting client.

• There is not the need of any installed program on the client since the configuration file can be modified manually or through a simple user

interface.

Analysing advantages and disadvantages of both the strategies we decided the second (customization through customization file) for the following reasons:

• There is an higher storage request on the server, but it is accepted because there is the advantage of having all the customization files available to the report administrator.

• In case of modification of the main report structure it is not requested to update any file, it is anyway suggested in case of substantial modifications.

• There is an higher compilation request but it is accepted because there is not the need of any program installation.

Existent applications

ALTOVA - StyleVision

StyleVision is a visually- focused interface that makes it possible for designers to focus on delivering business solutions rather than contending with low- level XML details. StyleVision also makes it easy to transform XML inputs (along with SQL database and XBRL inputs) into reports and forms in other formats, including HTML and PDF. StyleVision designs also generate an Authentic enterprise form for interactive reporting. Designers can distribute their designs to Authentic end users, who can select data that they wish to show using drop down menus, check boxes, etc., before generating report

(14)

output.

DMXZONE

– Crystal Report

A robust production reporting tool, SAP Crystal Reports turns almost any data source into interactive, actionable information that can be accessed offline or online, from applications, portals and mobile devices.

WINDWARD

This component of Windward’s report writing and document generation solutions lets you design, format and edit reports completely in Microsoft Office. It is added in to Word and Excel as a ribbon and gives you the power to link your documents and spreadsheets to nearly any data source you have, including SQL and XML.

Telerik

Telerik Reporting is a reporting solution for all .NET cloud, web, and desktop platforms that provides a full range of ready-to-use tools and services to help people throughout your organization create, deploy, and use reports quickly and easily. With Telerik Reporting, you can retrieve data from relational, multidimensional, ORM or custom data layer based data sources (also XML); The ready reports can be viewed in various formats (including PDF, Microsoft Office Word and Excel documents).

Rich interactive and reusable reports can be created by developers inVisual Studio Report Designer, and by end users in the desktop-based Standalone Report Designer.

The Standalone Report Designer is part of the Telerik Reporting package. It is a single EXE file, which simplifies its distribution, and does not require installation. Visual Studio is not required to create reports with the Stand alone Report Designer. Reports are processed on the client machine.

Oracle xml publisher

Oracle XML Publisher is a template-based publishing solution. XML Publisher leverages standard, well-known technologies and tools, so you can rapidly develop and

(15)

Business Suite, but now you can design and control how the report outputs will be presented in separate template files. At runtime, XML Publisher merges your designed template files with the report data to create a variety of outputs to meet a variety of business needs.

Product comparison

Xml data

source Multiple query Interaction for report customization No registration or program installation ALTOVA Stylevision DMXZONE Crystal report WINDWARD TELERIK Oracle xml publisher

Table 1: Product comparison

Application using Birt API

BIRT iHub F-Type

BIRT iHub F-Type is a free server for all BIRT designs that eliminates the need for developers to manually build infrastructure components. Plus, with no extra coding, BIRT F-Type automatically enriches BIRT content with added interactivity and personalization.

BIRT analytics

BIRT Analytics is a visual data mining and predictive analytic tool that enables business analysts to identify customer insights within the organization.

BIRT designer

(16)

logic to data; secure, filter, format and present the resulting reports to users.

BIRT designer pro

BIRT Designer Pro extends the capabilities of the Eclipse open source BIRT designer by adding hundreds of HTML5 charts, gadgets and maps; commercial data drivers; a metadata layer, impact analysis; and cube design and caching features for creating interactive and analytic content.

(17)

Used standards

Used standards 15

Software evaluation standards 15

Open BQR 15

Platform independent file format 16

Report stylesheet standards 16

Xsl Transformation (XSLT) 16

XML Path Language (XPath) 17

XSL Formatting Objects (XSL-FO) 17

Existent XML reporting standards 17

XBRL – eXtensible Business Reporting Language 18

RDL – Report Definition Language 18

ecause of the existence of an high number of machines, operating systems, applications, browsers and so on, we need to create a report document readable in all the possible usage scenarios. In the following all the used standards for software comparison, and report creation and definition are briefly analysed.

Software evaluation standards

Open BQR

Open BQR is an extension and integration of Open BRR and QSOS to address some of the problems of the current OSS evaluation methods: existing methods usually focus on specific aspects of OSS, no OSS evaluation method adequately deals with internal and external product qualities, the dependence of the users of OSS is not adequately assessed, especially the availability of support over time and the cost of proprietary modules developed by third parties.

Like in the Open BRR a list of topics is identified, the characteristics are measured only

(18)

Platform independent file format

Following this requirement, we know that the Portable Document Format (PDF) is a file format used to present documents regardless of application software, hardware, and operating systems. Each PDF file encapsulates a complete description of a fixed-layout flat document, including the text, fonts, graphics, and other information needed to display it.

We now need to discover how an xml representation of data can be transformed in a PDF document.

Report stylesheet standards

In this argument W3C provides a standard with the scope of creating a stylesheet for xml documents: (XSL) eXtensible Stylesheet Language, in order to define a way of xml document organization.

Analysing in detail we discover that XSL is a family of recommendations for defining XML document transformation and presentation. It consists of three parts:

• XSL Transformations (XSLT): a language for transforming XML;

• XML Path Language (XPath): an expression language used by XSLT (and many other languages) to access or refer to parts of an XML document;

• XSL Formatting Objects (XSL-FO): an XML vocabulary for specifying formatting semantics.

Xsl Transformation (XSLT)

Xslt is a language for transforming XML documents into other XML documents. A transformation in the XSLT language is expressed as a well- formed XML document which may include both elements that are defined by XSLT or not. XSLT-defined elements are distinguished by belonging to a specific XML namespace:

http://www.w3.org/1999/XSL/Transform.

(19)

• xsl:template + xsl:apply-template: A template containing rules to apply when a specified node is matched

• xsl:variable: is used to declare a local or global variable (not modifiable)

• xsl:choose: is used in conjunction with <xsl:when> and <xsl:otherwise> to express multiple conditional tests

• xsl:if: is used to put a conditional test against the content of the XML file

• xsl:for-each: allows you to do looping in XSLT

XML Path Language (XPath)

XPath is a language to address parts of an XML document. It uses a compact, non-XML syntax to facilitate its use and operates on the abstract, logical structure of an XML document, rather than its surface syntax. XPath is also designed so that it has a natural subset that can be used for testing whether or not a node matches a pattern.

XSL Formatting Objects (XSL-FO)

Xsl- fo is a markup language for XML document formatting which is most often used to generate PDF: once the XSL-FO document is generated, it is then passed to an

application called a FO processor which converts the XSL-FO document into something

that is readable, printable or both.

An xsl- fo document defines an fo:root element which has the only function of a container. Can be then defined an fo:layout-master-set to create pages layout, and some regions for page division: fo:region-before, fo:region-after, fo:region-body, where can be defined text characteristics.

Inside the regions a lot of report elements can be inserted, each represented by a fo:block element. An important thing provided by the xsl- fo is the possibility to divide the page in different regions with given dimensions. Particularly useful is also the fo:table organization, which provides a method to represent values in tables of any kind (lists, simple table, …).

Existent XML reporting standards

There are some already existent standards for xml reporting, in the following we briefly present XBRL (eXtensible Business Reporting Language) used for information

(20)

representation and RDL (Report Definition Language) used for report structure representation.

XBRL

– eXtensible Business Reporting Language

XBRL is the open international standard for digital business reporting of financial, performance, risk and compliance information, managed by a global not for profit consortium, XBRL International.

XBRL makes reporting more accurate and more efficient, allowing:

• people publishing reports to do so with confidence that the information contained in them can be consumed and analysed accurately

• people consuming reports to test them against a set of business and logical rules, in order to capture and avoid mistakes at their source

• people using the information to do so in the way that best suits their needs, including by using different languages, alternative currencies and in their preferred style

• people consuming the information to do so confident that the data provided to them conforms to a set of sophisticated pre-defined definitions

In Italy it is used by Webtelemaco for financial statement redaction and data transfer among companies.

We will not use it since we do not want to represent only financial data but we want to represent each type of reports.

RDL

– Report Definition Language

RDL is a standard proposed by Microsoft for defining reports.

The goal of Report Definition Language (RDL) is to promote the interoperability of commercial reporting products by defining a common schema that allows interchange

(21)

RDL is a schema definition, and does not specify how report definitions are passed between applications or how reports are processed.

RDL is designed to be output format neutral. This means that reports defined using RDL should be able to be output to a variety of formats including Web and print-ready formats or data- focused formats like XML.

It is expected that the in process of generating different output formats, products may represent RDL constructs slightly differently or ignore certain constructs completely. For example, a product generating a textual format may choose to ignore images in the report.

We will not use it because it has to contains all the data used in the report and for different data source retrieval the structure has to be modified.

(22)
(23)

I

User Requirement Definition

User Requirement Definition 21

Interview 22

Background 24

Critical Success Factor 25

System Overview 26

Requirement specification 27

Functional requirements 27

Non-functional requirements 30

Use cases 31

n this document is reported the result of the requirement elicitation process. The analysis consisted in the discovery, classification, refinement, validation and prioritization of the user requirements through interviews with stakeholders and researches on the domain of the application.

At first, a system overview and a list of coarse user requirements was drawn up; this includes a first idea of the system architecture in terms of existing systems that have to be reused.

(24)

Interview

The initial part of the investigation consists in the documentation about the current operating condition of the clients and internal employees of the company.

This is done with some interviews with the objective to create a background knowledge of the relation among actors and the used procedures.

In the following we report the results obtained from the preliminary stage.

Quali sono i principali obiettivi di questo progetto?

Lo scopo di questo progetto è quello di avere un programma o preferibilmente un'applicazione web che permetta in modo semplice di ottenere varie versioni di uno stesso report a utenti diversi.

Le personalizzazioni vengono fatte sia in termini di pagine da mostrare (non a tutti interessano le stesse pagine, ma molte servono a più utenti) che di colorazioni (ognuno tende a voler utilizzare i propri colori sociali).

Quali sono i principali ostacoli a questo progetto?

I principali ostacoli sono la varietà della tipologia di clientela. Non tutti i clienti infatti sono della stessa tipologia né tanto meno della stessa dimensione. Si passa infatti da banche a Sim, da strutture con un paio di filiali a quelle molto più grandi, da quelle situate molto vicine a livello territoriale, a qualcosa di più lontano e quindi più raramente raggiungibili personalmente.

Quali sono i problemi riscontrati al momento?

Un problema lo si può riconoscere nell'ampia quantità di mail e telefonate che vengono registrate ogni giorno per il personale interno all'azienda. Questo causa ritardi nella comunicazione e quindi all'apporto delle modifiche richieste. Inoltre essendo le modifiche richieste ad altre persone, specialisti tecnici, non è detto che questi siano in grado di comprendere in modo immediato quello che si richiede.

Anche il sistema utilizzato attualmente non è ideale in quanto non c'è la possibilità di avere un'anteprima grafica di quello che si andrà a vedere nel risultato. Si ha quindi un grande dispendio di tempo per la costruzione e piccole modifiche del report attuale.

(25)

Chi e come beneficerebbe del progetto? Chi sono i principali stakeholders?

I principali stakeholders possono essere identificati in: • i clienti

• i dipendenti dell'azienda che si occupano della creazione e dell'apporto di personalizzazioni nel report

• l'azienda

I clienti otterranno un livello di personalizzazione del report più intimo e privato. Non ci sarà più bisogno di richiedere sempre ogni modifica all'azienda fornitrice di apportare una seppur minima modifica al report. Un altro vantaggio che questi otterrebbero sta nella possibilità della visualizzazione di tutte le parti del report utilizzate da altri clienti a loro simili e quindi potersi accorgere di nuovi metodi per la rappresentazione dei dati utili a un migliore sviluppo interno.

I dipendenti dell'azienda andrebbero ad avere un minor carico di lavoro. Si diminuiscono i tempi per l'inserimento delle modifiche per i report condivisi e molto ampi così come per la loro nuova creazione. Anche la personalizzazione per ciascun cliente viene resa molto più semplice di come è attualmente, in modo tale che la maggior parte delle richieste che vengono fatte siano eseguite direttamente dal cliente senza quindi scaricare tutto sul dipendente interno all'azienda, che si limiterà a effettuare solo le modifiche ritenute complesse dai clienti.

L'azienda otterrà dei miglioramenti se pur in modo indiretto. I clienti avranno la possibilità di creare i loro report in tempi molto più rapidi, partendo da uno condiviso ma comunque con un'elevata possibilità di personalizzazione, incrementando perciò il loro livello di soddisfazione e fiducia per l'azienda che di conseguenza avrà una maggiore possibilità di successo per una successiva prosecuzione del rapporto lavorativo. Nello stesso momento, andando a ridurre il carico di lavoro per i dipendenti interni, questi avranno la possibilità di poter effettuare in modo migliore e più attento gli altri compiti di cui devono occuparsi, sia di mantenimento che di sviluppo tecnologico dell'intera azienda.

Ci sono idee o suggerimenti da mettere a punto?

Lo sviluppo del progetto deve essere tale da rispettare la filosofia aziendale seguita, ovvero rendere tutto il più possibile personalizzabile dall'utente anche a discapito della semplicità di utilizzo, pur cercando di mantenerlo accessibile ed utilizzabile ad utenti non esperti.

(26)

Background

From the information retrieved during the interview and the documentation received, we are now able to describe the actual background situation on which we are going to operate.

The analysis is referred to a group of clients composed by companies with different operation characteristics. Some of them can be considered similar, divided in three or four big groups of operating segment, but anyway they are all autonomous one from each other.

A first analysis can be done in the report creation phase:

• When the company has to create a new shared report, an employee has to: • create the xsl stylesheet

• create an xml configuration file requested by the specific report • try to see the report result.

• Frequently happens that the report result is not as expected, in terms of position and dimension of the single elements. So he has to modify manually the xsl stylesheet or xml configuration file many times.

A second analysis is for the customization phase:

• Each time a client company wants to have a new report representing the data review of a period, a day or anything else, has to ask to a supplier employee.

• He has to adapt the report to the changes requested from the client.

• Since he cannot see the results immediately, if the changes are consistent it can be possible that he has to modify other elements in the report, wasting a lot of time. In case of simple changes he has however to modify the stylesheet of the report suspending the process he was doing before.

(27)

• There can be also the possibility that the result is not what the client exactly expected, so the communication between the parts is done many times.

For these reasons, the proposed project has the purpose to handle in a better way report generation and customization, by implementing suitable services for the encountered problems solving, for example:

• Report creation: a GUI application is provided. It is able to render a quick preview of the report in order to see immediately the position and dimension of each element in the report.

• Report customization: an xml document will be provided for the standard report structure. By modifying it the client can achieve his personal report. The document will be very simple and for the future it can be modified via a graphical user interface.

• Employees workload reduction: the reduction of the workload of the employees is achieved both by reducing the time of standard report construction and transferring to the client the customization of the report.

Critical Success Factor

Critical Success Factors are high level guidelines strictly related to company's objectives. Their explanation will be useful in the following as a guide for analysis and study of our project. A number of objectives has been chosen.

(28)

Objective Critical success factor Maximize the possibility

of usage of the same project for more clients

Create an as much shareable as possible report, in order it will be used by more clients.

Minimize the workload for

internal employees Tend to make easier and faster the customization of the report for each client, or, when possible, move the customization on the client side

Maximize the

customization of report Maintain the standard report at an high level, locate all the possible customization, and organize an easy way of setting desired values.

Table 2: Critical success factor

System Overview

The system shall be able to provide the customization of reports starting from one, or more, bigger and shareable, for each different user. On the other end it shall represent a simpler way for shared report creation in order to make faster, and then cheaper for the company, the work of the technical specialist in report creation and xml language usage.

After interviews with stakeholders, a first list of overall functional requirements is the following:

1 The system shall provide a GUI for report creation

1.1 the GUI can be internal or external to the system

2 The system shall provide a way of customization of the report

2.1 a way to customize the content of texts and graphs

2.2 a way to customize the pages to be shown or hidden of the report

2.3 a way to customize the elements to be shown or hidden in the page

(29)

2.6 a way to select the visualization language for the report

2.7 a way to customize graphics' colours based on passed data or company's logo

3 The system shall provide the correct customized report for the user in PDF format shall provide a default standard way of styling the report elements in case the user does not specify any;

3.1 shall maintain the report customization for each user, in case of modification in the standard report too;

4 The system shall be faster and cheaper then the existing way of producing reports;

5 The system shall be maintainable for the future changing of type of the elements containing in the reports, or the way of representing them;

Requirement specification

In this section are listed and specified the functional requirements of the system as extracted from the analysis of the current activities. The requirements are ranked by importance.

The system has to meet the following requirements:

Functional requirements

Function #1 Provide a GUI for report design

Importance High

Description The GUI can be achieved by the introduction of an

external product.

The external product has to give the possibility to insert all the reports elements required at the moment (static text, text retrieved in the xml of the data, table, cross tab, pie chart, bar chart, line chart), and to provide a detailed xml file containing content type, content retrieval instruction and elements position.

(30)

Function #2 Provide a shared stylesheet

Importance High

Description When the report designer creates a new report, he

must provide a shared report xsl stylesheet to be followed during report customization phase.

Function #3 Get customized text and charts

Importance High

Description When the user is creating a report, data inserted in all

the elements must be retrieved from the xml of data provided.

Since the report structure is shared, the xml of data must follow the xsd schema provided, that will be analysed in next chapters.

Function #4 Show/hide pages in report

Importance High

Description Each user must be able to select the pages he wants

to visualize or not.

In the provided xsd for customization must be planned a field for the choice about the visibility for each page in the shareable report.

In the xsl stylesheet must be considered for each page if it has to be printed or not, by retrieving the information in the xml for customization document.

Function #5 Show/hide elements in page

Importance High

Description Each user must be able to select the elements he

wants to visualize or not.

In the provided XSD for customization must be planned a field for the choice about the visibility for each element in the shareable report.

In the xsl stylesheet must be considered for each element if it has to be printed or not, by retrieving the information in the xml for customization document. The system has to consider also if the data are present in the xml received.

Function #6 Select the report language

Importance Medium-High

(31)

Function #6 Select the report language numbers.

The XSD for data should provide a field for selecting the language for texts and numbers' representation in the report, and the possibility to insert different values for different languages in the data representation file. The xsl stylesheet must be able to retrieve data in the selected language, if present, or a default value otherwise.

Function #7 Customize chart style

Importance Medium

Description Each user must be able to select the visibility for the

entire chart, but also the visibility and positioning for title, legend and labels.

Based on those information, the application will create the correct chart.

The XSD for customization should provide an element for chart customization, containing the possibility of choose the visibility and position for title, legend and labels.

Function #8 Customize the style for all the elements in the

report

Importance Medium

Description The user must be able to provide a style (background

colour, border type and colour, margin...) for each element in the report, and for elements characterized from different elements (as header, content and footer for tables), this specification should be extended to each part.

The XSD for data customization should provide a way of global styling definition and local styling selection. The xsl structure should be modified before pdf creation in order to add the requested styling.

A default styling should be provided.

Function #9 Customize colors used in charts

Importance Medium

Description The user must be able to customize the style of the

representation of each element in the graph (bar, line, slice) by selecting the desired colour for each.

The XSD for data customization should provide a field for colour selection, retrievable directly or from a path in the data xml.

(32)

Function #9 Customize colors used in charts styling.

Function #10 Provide a default style

Importance Medium

Description If the user does not select a custom style, the report

must be organized in a standard way, based on most common report styling.

The application should:

- create a standard representation of styling while xsl and xml creation starting from the detailed xml provided by the supporting program

- merge standard and customization styling, without overriding the second, before report creation.

Function #11 Maintain the customization done when

updating the report

Importance Medium-Low

Description When report structure is modified, it is required to

not delete/override the customization done by the client, unless requested.

Non-functional requirements

The following table summarized the non functional requirements of the system that have been identified.

(33)

Requirement Description Importance

Security The system uses private and

sensible data for client company that must not be known from other. Since those data are sent through the network, a secure way of sending must be provided

High

Maintainability The system should be

maintainable in case of future modification of client requirements

Medium

Sustainability The system should be used in an

online way. It is recommended to inform end users that it is better to create report readable on screen avoiding printing them

Medium

Availability The system should be available

when requested. This is not a high important requirement since it will not create a problem if in some moments during the day it is not available for a few

Low

Table 3: Non functional requirements

Use cases

The Use case diagram in the following picture represents the functional requirements described above. After that, you can find the use cases specification.

(34)

Use case Design report

Id 1

Brief

description The administrator creates a visual design for the report

Actor Admin

Main flow 1. The actor creates a new project in the user

interface

2. FOR each page 2.1 creates a grid

2.2 FOR each element in the page 2.2.1.creates a grid

2.2.2.inserts the element

2.2.3.connects the content with the xml of data

Use case Create schemas

Id 2

Brief

description The admin creates the xsl stylesheet for the shared report and the default styling

Actor Admin

Precondition The admin knows the path of the report design to

translate

Main flow 1. The actor asks to translate the design

2. SYSTEM asks for url where to save report's stylesheet and default style document

3. The actor inserts the urls

4. SYSTEM generates the files and saves the elements

Use case Create customization schema

Id 5

Brief

description The admin asks to create the customization file for each users

Actor Admin

Precondition The actor knows the path of the report standard

styling

Main flow 1. The actor provides the standard styling url

2. FOR each end user

2.1. The actor asks to create the customization file

(35)

Use case Customize report

Id 6

Brief

description The user customizes the report

Actor User

Main flow 1. User requests to customize a report

2. SYSTEM provides the file for customization of the report

3. FOR each element to be modified 3.1. User inserts the customization 4. user confirms the customization 5. SYSTEM saves the customization

Use case Create customized report

Id 7

Brief

description The user creates the customized report

Actor User

Main flow 1. User requests to create the customized report

2. SYSTEM retrieves the report xsl and customization

3. User provide xml of data 4. SYSTEM creates the report

(36)
(37)

Existing subsystems analysis

Existing subsystems analysis 35

Choosing the GUI 35

JasperSoft® studio 36

Birt 37

Choosing the chart engine 37

JfreeChart 38

Choosing the xslt engine 39

Saxon HE 40

Choosing the FO Processor 41

Summary of choices 42

n this section the current management of the existent systems is described, which were their requirements and the reason of each choice. Then will be presented the activity diagram for the entire application.

Choosing the GUI

We are looking for a free product providing access to an xml file representing the report structure. In the xml file provided we need to find information about all the element inserted:

• style • position • dimension • type

We also need the information about the way of retrieving data from the xml source. For that reason we need to know:

• how data are organized for a better usage of the program

(38)

• how is represented the insertion in the complex elements of the report • how the path to get the real value in the xml for the data is recreated

A program that is not able to provide any of this requirement cannot be used in our system.

In the following picture are represented the use cases requested for the GUI

Image 4: Use case: GUI

Now we have determined all the use cases, we can choose a program providing all o f those.

JasperSoft® studio

https://community.jaspersoft.com/project/jaspersoft -studio

JasperSoft® Studio is an open source eclipse based report designer for JasperReports engine. It is able to create very sophisticated layout including tables, texts, charts, images...

All the most important elements are present and can be sufficiently customized.

All the elements, their data information and structure can be retrieved.

Only absolute position can be retrieved. This is a problem since it is not possible to construct an xsl- fo document by knowing the elements' absolute positions but not their dimensions. It is not possible to organize data in other way.

(39)

That solution cannot be used, so we need to look for another program providing all the requested functions.

Birt

http://eclipse.org/birt/

Birt is an open source eclipse plug-in. It provides a GUI and an engine able to create complex data visualization styles and reports.

All the most important elements are present and can be sufficiently customized.

All the elements, their data information and structure can be retrieved.

Position cannot be retrieved. Anyway it is possible to organize pages with grids with known dimensions and by organizing them in tree the exact position of the element can be retrieved.

That program provides all the elements useful for our report analysis and creation, so we decided to use it.

Birt provides a chart engine also but, since we do not want to use directly that program for our final report creation, we look for that engine's stand alone usage but we found that it is deprecated. We do not want to use it, so we need to look for something providing chart designing.

Choosing the chart engine

We are looking for a chart engine that:

• provides an easy way to organize the data set • allows title and legend customization

• allows an easy way of colours customization

(40)

Image 5: Use case: chart engine

Now we have determined all the use cases, we can choose a program or library providing all of those. Since we are planning to use a java program for the final report construction, we can use a java library doing that.

In a first phase we have analysed following the Open BQR method some java libraries for charts creation, obtaining the following scores:

Indi cat ors Assigne d we ig h t Nor ma lize d we ig h t Jfree Char t Ev aluati on Wei g h te d ev alua tio n Jcc Kit Ev aluati on W ei gh te d ev alua tio n Open C hart2 Ev aluati on Wei g h te d ev alua tio n j Charts Ev aluati on Wei g ht e d ev alua tio n T arget usage typ e of license 5 6,17 10 6,17 8 4,94 10 6,17 8 4,94 standard compliance 0 0,00 0,00 0,00 0,00 0,00 implementation language 0 0,00 0,00 0,00 0,00 0,00 internationalization support 0 0,00 0,00 0,00 0,00 0,00 books 10 12,35 10 12,35 6 7,41 5 6,17 2 2,47

analysts and co nsultants 5 6,17 9 5,56 6 3,70 6 3,70 3 1,85

Extern al qualities

bug number 8 9,88 5 4,94 6 5,93 6 5,93 4 3,95

average time for def ect

removal 8 9,88 5 4,94 5 4,94 6 5,93 6 5,93

effect of donations of defect

removal speed 8 9,88 5 4,94 6 5,93 5 4,94 8 7,90 Internal qualiites complexit y 10 12,35 8 9,88 7 8,64 7 8,64 5 6,17 reuse 8 9,88 7 6,91 4 3,95 5 4,94 4 3,95 dependencies 6 7,41 7 5,19 5 3,70 6 4,44 6 4,44 others 5 6,17 3 1,85 8 4,94 4 2,47 5 3,09 Future suppo rt number of releases 8 9,88 8 7,90 3 2,96 5 4,94 2 1,98 number of or ganizations

supporting the softwa re 0 0,00 0,00 0,00 0,00 0,00

number of prog rammers pe r

organization 0 0,00 0,00 0,00 0,00 0,00

number of independent

programmers 0 0,00 0,00 0,00 0,00 0,00

Total 100,00 70,62 57,04 58,27 46,67

Image 6: chart engine comparison

We decided to use JfreeChart library, analysed better in the following.

(41)

JFreeChart is a free 100% Java chart library that makes it easy for developers to display professional quality charts in their applications.

Each chart type has a different constructor but this is not a problem since we a priori know the chart type. Also chart data set is slightly different depending on chart type (in that case it is different for chart with or without axes)

Chart and legend position can be chosen among North, South, East, West and set by setPosition() function. Their visibility is selected at chart creation.

Colours can be customized by creating a CustomRenderer with an array of Paint representing each value's colour as parameter.

That library satisfies all the requirements for chart creation. We decide to use it for our report creation.

Choosing the xslt engine

We are planning to have an xml file with data and customization and an xsl file with the structure. We are now looking for an engine that from those two files will create an xsl- fo file.

In the following picture are represented the use case for the report constructor.

Image 7: Use case: report constructor

(42)

those. Since we are planning to use a java program for the final report construction, we can use a java library doing that.

In a first phase we have analysed following the Open BQR method some java libraries for charts creation, obtaining the following scores:

Indicators Assigned w eight Norm alized w eight

Saxon XSLT X a la n

Evaluation Weighted

evaluation E v a lua t ion e

Weighted valuation Target usage type of license 8 8,3 3 10 8,3 3 10 8,33 standard compliance 10 10,42 10 10,42 8 8,33 implementation language 7 7,2 9 8 5,8 3 8 5,83 internationalization support 0 0,0 0 0,0 0 0,00 books 10 10,42 0,0 0 0,00

analysts and consultants 7 7,2 9 7 5,1 0 6 4,38

External qualities

bug number 10 10,42 3 3,1 3 2 2,08

average time for defect

removal 8 8,3 3 6 5,0 0 4 3,33

effect of donations of defect

removal speed 5 5,2 1 8 4,1 7 7 3,65 Internal qualiites complexity 7 7,2 9 6 4,3 8 5 3,65 reuse 7 7,2 9 5 3,6 5 5 3,65 dependencies 7 7,2 9 6 4,3 8 5 3,65 others 0 0,0 0 0,0 0 0,00 Future support number of releases 10 10,42 10 10,42 6 6,25 number of organizations

supporting the softw are 0 0,0 0 0,0 0 0,00

number of programmers per

organization 0 0,0 0 0,0 0 0,00

number of independent

programmers 0 0,0 0 0,0 0 0,00

Total 100,00 64,79 53,13

Image 8: XSLT processor comparison

We decided to use Saxon HE library, analysed better in the following.

Saxon HE

http://saxon.sourceforge.net/

The open-source implementation of XSLT 2.0, and XPath 2.0 and 3.0, and XQuery 1.0 and 3.0. This provides the "basic" conformance level of these languages; it also supports some optional features of the specifications such as serialization and support for XQuery modules.

(43)

The problem of getting just one file as input can be solved by unifying the two files containing data and customization in a single one organized in two parts.

The output file is chosen before and we can set the destination of the pdf at its creation.

The url of the xsl file representing the structure is given as input of our java program and have to be selected before.

That library satisfies all the requirements for xslt transformation. We decide to use it for our report.

Choosing the FO Processor

As we have seen, an XSL-FO file is a mixture of text from your XML source document and XSL-FO tags that suggests how the text should be formatted. It is the XSL-FO processor that creates the typeset of text and lays it on pages. An XSL-FO processor typically generates a PDF or PostScript file that can be passed to a printer to produce hardcopy output.

Currently there are many XSL-FO processors, but few of them fully implement standards. The authors of the XSL-FO standard recognized how difficult it would be to implement, and so divided it into three levels of conformance: basic, extended, and complete. That way a processor can claim conformance to the lower conformance levels and produce useful output, while still be under development for the higher conformance levels. Some examples are:

• FOP is a Java-based processor available free from the Apache XML Project (http://xml.apache.org/fop/). It can produce usable output, but it is still under development and has some limitations.

• Unicorn Formatting Objects is a commercial product from Unicorn Enterprises SA (http://www.unicorn-enterprises.com). Implements only a subset of the XSL- FO standard. For Windows only.

• XML2PDF is a commercial product from Altsoft (http://www.alt-soft.com/). For Windows only.

(44)

obtaining the following scores:

Indicators Assigned

weight

Normalized weight

Apache FOP Unicorn formatting objects XML2PDF

Evaluation Weighted evaluation Evaluation Weighted evaluation Evaluation Weighted evaluation Target usage ty pe of license 3 4,69 10 4,69 5 2,34 10 4,69 standard compliance 7 10,94 8 8,75 7 7,66 2 2,19 implementation language 0 0,00 0,00 0,00 0,00 internationalization support 5 7,81 8 6,25 7 5,47 8 6,25 books 9 14,06 10 14,06 0 0,00 3 4,22

analy sts and consultants 7 10,94 8 8,75 7 7,66 7 7,66

External qualities

bug number 9 14,06 5 7,03 8 11,25 8 11,25

av erage time for defect

removal 7 10,94 5 5,47 4 4,38 8 8,75

eff ect of donations of def ect

removal speed 0 0,00 0,00 0,00 0,00 Internal qualiites complexity 0 0,00 0,00 0,00 0,00 reuse 0 0,00 0,00 0,00 0,00 dependencies 0 0,00 0,00 0,00 0,00 others 0 0,00 0,00 0,00 0,00 Future support number of releases 5 7,81 7 5,47 5 3,91 5 3,91 number of organizations

supporting the software 8 12,50 10 12,50 1 1,25 6 7,50

number of programmers per

organization 4 6,25 7 4,38 3 1,88 6 3,75

number of independent

programmers 0 0,00 0,00 0,00 0,00

Total 100,00 77,34 45,78 60,16

Image 9: PDF creator comparison

For that reason the Apache FOP has been chosen.

Summary of choices

Before proceeding in projecting the system system, we are now resuming our choices:

• we will use the gui and xml provided by the Birt plug-in for eclipse • JFreeChart as chart engine for our application

• Saxon HE as xslt transformer • Apache FOP as FO Processor

In addition we will use xml file for data reporting and data customization, and xsd schemas for their structure validation.

(45)

Project realization workflow

Project realization workflow 43

.rptdesign file 43 Property 44 Data-sources 45 Data-sets 45 Styles 46 Page-setup 46 Body 46 Activity Diagram 47

Sequence Diagrams for some Use Cases 49

Create schemas 49

Create customized report 50

.r ptdesign file

Rptdesign is a file that contains the complete description of a report, including Actuate BIRT technology such as Actuate BIRT data object, information object, and report document data source. An Actuate BIRT report design file contains Extensible Markup Language (XML) elements that extend the report design (.rptdesign) file format to support these Actuate BIRT report elements.

Rptdesign file is divided in many parts:

• some "property" tags containing a property of its parent node. It can be used as a single property or in a "list-property” tag containing more "property" elements.

• an element "data-sources" containing the reference to the document representing the source for data in the final report.

(46)

• "data-sets" element with the datasets created in Birt for data grouping and insertion and "cubes" for multidimensional data grouping.

• "style" element containing all the styles created in Birt • "page-setup" for general page construction.

• in the "body" tag the list of elements (texts, tables, charts, images ... ) contained in the report.

All the information in this file are retrieved by the application and analysed in order to create the stylesheet of the report and the customization file.

Property

This tag can be added as son of each element defining all the properties it can have. It has the attribute “name” representing the name of the property and the text content of the node represents the value.

There is also another possibility to use this tag: there can be a list or properties identified as a single one. In this case you can find a child of the property element containing al list of properties

Image 10: rptdesign property tag

Data-sources

This tag contains information about data sources. Each data source is represented from the oda-data-source element. The property “FILELIST” contains the path of the

(47)

Data-sets

Image 11: rptdesign data-sources tag

This tag contains information about data sets. A dataset represents the grouping of data that are relevant to stay together. Each data set is represented by the oda-data-set tag which contains an attribute “name” useful for the future recognition and some properties tag including the referred data source file. In the xml-property element are contained information about the query used for data grouping and extraction and for designing in the final report.

Styles

Image 12: rptdesign data-sets tag

In this tag are represented information about styles used inside the report. A set of “style” elements are containing each one representing a different style, characterized by properties.

Page-setup

Image 13: rptdesign styles

In this tag are contained information about page properties such as orientation and dimension, page-header and page- footer details such as

(48)

Body

In this tag is contained the structure of the report. Notice that the report is organized as a grid with column and rows containing cells, in each cell can be contained a grid or one of the elements that can be inserted: text, image, table (extended-item is for charts) …

Image 15: rptdesign body tag

Activity Diagram

In the following activity diagram is highlighted the flow of the files in the system.

When the administrator wants to create a new structure and customization set for a report, he has to ask the system providing the *.rptdesign file. The system creates three files that will be used later from the system:

(49)

Image 16: Activity diagram of the application • xsl file as stylesheet of the entire report

• xml file for default styling

• xml file for customization (only if requested, it can also be created several times for different users)

When the user needs to create a customized report he has to provide the xml of data and the system: creates a complete xml with information about charts, custom style and default style when no customization is specified, transfers the styles in the xsl stylesheet and creates the pdf.

In the last phase there were two possibilities:

(50)

2. Apply customization in the xsl and then create the pdf

We chose the first because we decide to not modify, neither at run time the xsl stylesheet, except for styles insertion.

Sequence Diagrams for some Use Cases

In this chapter are shown sequence diagrams related to the most occurring system's use cases.

Create schemas

(51)

Create customized report

(52)
(53)

System architecture

System architecture 51 Class Diagram 52 parserUtility 54 ABS_analyser 54 ABS_SourceTransformer 55 ABS_XslCreator 56 ABS_XmlCreator 56 DocumentHandler 57 ABS_RE 57 ABS_RE_Table 57 QuickSearch 58 birtParser 58 analyser 58 BirtTransformer 59 XslCreator 59 TemplateHandler 60 XmlCreator 60 XmlGraphSettings 61 PathInfo 62 Elements' classes 62 creator 63 Creator 63 ABS_Chart 64

Chart's specialization classes 64

File organization 64

XSD file for data 64

XSD file for customization 69

XSL file for report structure 74

n the following is represented the classes for the analysis representing the key concept of our product. In the last paragraph will be presented the two files that have to be produced in order to not have errors in the execution, and the explanation of their composition.

(54)

Class Diagram

In the following diagram there will be shown classes that have been identified in this phase and the relations among them. In order to obtain an easier readable diagram, each class' detail is reported later on.

(55)

Classes have been divided in three packages:

1. parserUtility: this package contains all the classes that can be useful for each program used for creating the structure through a GUI providing an xml.

• ABS_analyser class, the most general class in this package, instantiates (a form of composition) an ABS_SourceTransformer, the general class representing each type of source that can be retrieved from a report design program.

• ABS_SourceTransformer contains an ABS_XmlCreator and an ABS_XslCreator: two abstract classes representing the transformation engine from the general structure to the xml for customization and the shared xsl for the report's structure

2. birtParser: this package contains the implementation of the classes in the parserUtility package for the decomposition of the xml file retrieved from Birt and some other useful classes.

• Analyser, BirtTransformer, XmlCreator and XslCreator are the classes related to Birt correspondent to the abstract classes in the parserUility package.

• The XmlCreator instantiates an XmlGraphSetting for the construction of the part in the xml for configuration related to chart construction.

• The XslCreator instaitiates the correspondent element class each time it is found in the report. They could be: RE_Table, RE_List, RE_Chart, RE_Image, RE_Text and RE_Crosstab, the last one has also the need o f the XmlCreator instantiation for insertion of data related to the content.

• TemplateHandler class is used for writing xsl templates, and instantiates the RE_Table, RE_Crosstab and RE_List classes in order to use their methods for xsl template creation

(56)

data can be found.

3. Creator: This package contains the classes for the pdf creation starting from the xsl for report structure, xml for customization and xml of data.

• Creator class is the main class for that package. By using that it is possible to choose the report structure, provide the xml for customization and the xml of data.

• INT_Chart interface defines the methods that classes realizing charts should have. LineChart, BarChart and PieChart are the implementation for the interface class.

In the following there’s a brief description of each class' functionality. For each one will be provided a schema describing variables and operations.

parserUtility

ABS_Analyser

This class allows, starting from a complex xml document of the report generated from a specific program, to create a simpler one.

(57)

Fields

sourceUri Contains the url of the document extracted from the external program, where the administrator has designed the report xmlUri

xslUri Represent the Uri at which the xml containing the standard style, and the xsl with the will be saved finalXmlDoc

finalXslDoc Contain the document in which are composed the xml and xsl structures transformer Represents an element of the transformer class which is able

to extract from an xml document created by a report designer program an xsl and xml document describing the report stylesheet and default styling

Functions

prepareXslHeader

prepareXmlHeader These functions prepare the xml and xsd common tags for describing version, structure and name spaces saveXml

saveXsl

saveCustomSchema

These functions save in a file the referred document

generateSchemas generateschemasIn ternally

This functions generate the document, internally before

cleanElement This function cleans each element in the xml containing data for default styling in order to make it customizable

ABS_SourceTransformer

This class provides the methods to transform each element of the xml file created in the program for report designing, in an element of the xml and xsl stylesheet which will be useful for report creation and customization.

Image 21: ABS_SourceTransformer class detail

Fields

sourceDoc Represents the document of the xml retrieved from the report design program

xslCreator xmlCreator

Represent the classes able to transform each element in the source document in the correspondent element in the xml and xsl

Riferimenti

Documenti correlati

Abstract In this paper we analyze the effects of restricted participation in a two-period general equilibrium model with incomplete financial markets and two key elements:

149 In order to simultaneously encompass both bandwagon and snob effects, in the 150 updating preference functions we will introduce a threshold effect (see Granovetter 151 1978),

A: The acknowledgement of the WFD in the national legislation is expected within December 2003 followed from the identification of the Districts of Basin and of the authorities

Assume now we consider interacting cells in the case when the interaction is of contact type, like the volume constraint (or others which occur at the membranes of the cells,

The second chapter, titled ‘Marlene NourbeSe Philip: A Geography of Voices’, is made of three parts: part one is made of two introductory sections, the first

The second chapter will talk the analysis of the case law on the liability of the State as legislator, Public Administration and Court of last instance for failure of

Both phosphate and silicate ions can react with molybdate in alkaline solution, producing the yellow molybdophosphate and molybdatosilicate. Further reduction with ascorbic

It has never been discussed by the Italian courts whether, according to Shevill (Case C–68/93), the claimant in an antitrust action can recover from a defendant, sued under Article