Sophro Ksantypa2 report editor and generator: Architecture Design - PDF

Please download to get full document.

View again

of 18
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information Report
Category:

Documents

Published:

Views: 3 | Pages: 18

Extension: PDF | Download: 0

Share
Related documents
Description
Last change: :08 Authors: Carolina Hołubowicz: Jarosław Cellary: Jakub Tomczak: Sophro Ksantypa2 report editor and generator:
Transcript
Last change: :08 Authors: Carolina Hołubowicz: Jarosław Cellary: Jakub Tomczak: Sophro Ksantypa2 report editor and generator: Architecture Design Edited on Edited by J. Cellary Changes Initial version 1. Overview The system will consist of 2 basic parts: Report template editor Report generator class Module overv iew Report template editor Report generator Core sd Interaction ov erv iew Report template editor The only data flow between the Report template editor and the Report generator occurs through the repository of report templates. Additionally both systems use a configuration file which describes the schema of the Ksantypa database Reads Adds, removes and changes the report templates «datastore» Ksantypa database schema «datastore» Report template storage Reads Reads the templates Report generator Generates the report Reads the enrolment data «datastore» Generated reports «datastore» Ksantypa database 2. Core 2.1. Ksantypa database schema file This should be an xml file which lists all the tables and the connections between them, together with the descriptions of the columns. Below a preliminary sample is provided Tables Table Name kandydaci /Name Columns Name k_id /name Type Int32 /Type Name k_nazwisko /name Type String /Type Name k_wydzial /name Type Int32 /Type /Columns PrimaryKey ColumnName k_id /ColumnName /PrimaryKey References ForeginTableName wydzialy /ForeginTableName ColumnReferences ColumnReference LocalColumnName k_wydzial /LocalColumnName ForeginColumnName w_id /ForeginColumnName /ColumnReference /ColumnReferences /References /Table Table Name wydzialy /Name Columns Name w_id /name Type Int32 /Type Name w_nazwa /name Type String /Type /Columns PrimaryKey ColumnName w_id /ColumnName /PrimaryKey /Table /Tables 2.2. Report template files This should be an xml file which describes the body of the report using the agreed components and its properties. Below a preliminary sample is provided Document Body Text TextProperties Font FontFamily Arial /FontFamily FontSize 10 /FontSize /Font /TextProperties Value This is a sample report /value /Text Table TableProperties HeaderProperties TextProperties Font FontFamily Arial /FontFamily FontSize 12 /FontSize /Font /TextProperties /HeaderProperties RowProperties TextProperties Font FontFamily Arial /FontFamily FontSize 10 /FontSize /Font /TextProperties /RowProperties /TableProperties Columns HeaderText Nazwisko kandydata /headertext DataSetColumnName Kandydat_Nazwisko /DataSetColumnName HeaderText Wydział /HeaderText DataSetColumnName Wydzial_Nazwa /DataSetColumnName /Columns DataSet DataSetDescTableCollection DataSetDescTable DataSetDescColumnReal Name Kandydat_Nazwisko /Name ReportDataTableColumn ColumnName k_nazwisko /ColumnName ParentTable kandydaci /ParentTable /ReportDataTableColumn /DataSetDescColumnReal DataSetDescColumnReal Name Kandydat_WydzialId /Name ReportDataTableColumn ColumnName k_wydzial /ColumnName ParentTable kandydaci /ParentTable /ReportDataTableColumn /DataSetDescColumnReal /DataSetDescTable DataSetDescTable DataSetDescColumnReal Name Wydzial_Id /Name ReportDataTableColumn ColumnName w_id /ColumnName ParentTable wydzialy /ParentTable /ReportDataTableColumn /DataSetDescColumnReal DataSetDescColumnReal Name Wydzial_Nazwa /Name ReportDataTableColumn ColumnName w_nazwa /ColumnName ParentTable wydzialy /ParentTable /ReportDataTableColumn /DataSetDescColumnReal /DataSetDescTable DataSetDescTablePairs DataSetDescTablePair ConnectionType Equals /ConnectionType FirstColumn Name Kandydat_WydzialId /Name /FirstColumn SecondColumn Name Wydzial_Id /Name /SecondColumn /DataSetDescTablePair /DataSetDescTablePairs /DataSetDescTableCollection /DataSet /Table /Body /Document Additionally when the report template is filled with the actual data the DataSet tags are replaced. In such state the xml has the following structure: Document Body Text TextProperties Font FontFamily Arial /FontFamily FontSize 10 /FontSize /Font /TextProperties Value This is a sample report /value /Text Table TableProperties HeaderProperties TextProperties Font FontFamily Arial /FontFamily FontSize 12 /FontSize /Font /TextProperties /HeaderProperties RowProperties TextProperties Font FontFamily Arial /FontFamily FontSize 10 /FontSize /Font /TextProperties /RowProperties /TableProperties Columns HeaderText Nazwisko kandydata /headertext DataSetColumnName Kandydat_Nazwisko /DataSetColumnName HeaderText Wydział /HeaderText DataSetColumnName Wydzial_Nazwa /DataSetColumnName /Columns DataSet Rows Row Columns Name Kandydat_Nazwisko /Name Value Tomczak /Value Name Wydzial_Nazwa /Name Value Informatyka i zarządzanie /value /Columns /Row Row Columns Name Kandydat_Nazwisko /Name Value Cellary /Value Name Wydzial_Nazwa /Name Value Ochrona środowiska /value /Columns /Row /Rows /DataSet /Table /Body /Document 2.3. Core code class Core DataSetDesc ReportDataSchema class DataSetDesc ISerializable The DataSetDesc can be easily transformed into and from + fromxml(string) : DataSetDesc xml. + toxml() : String However it needs to be reconsidered whether the real serialization provided by Java can be used, because this can be problematic when the class structure changes insignificantly and some reports are already created. The DataSetDesc automatic convertion would fail in such case. Needs to be reconsidered. DataSetDesc SingleTable - orderby: datasetdesccolumn[] + fromxml(string) : DataSetDesc + toxml() : String 1 1 The DataSetDesc Package DataSetDescTa blecollection DataSetDes ctablepair is a class based description of a data set. It actually represents a structure which is very simmilar to SQL - column1: DataSetDescColumn - column2: DataSetDescColumn - type: DataSetDescColumnConnectionType DataSetDescTable - columns: DataSetDescColumn[] - reportdatatable: IReportDataTable Queries. Because of that this class hierarchy can be easily converted to real SQL Queries to get the desired «enumeration» DataSetDescColumnConnectionType 1 data when generating the report. This class only contains the description of the data. It is up to other classes to define the visual structure (Whether the data set will be a table, «enum» Equals Differs Smaller Greater GreaterOrEquals SmallerOrEquals 2 DataSetDescColumn list etc.) DataSetDescCol umnreal DataSetDescColumnRowNumber DataSetDescCol umncurrentdate DataSetDescColumnFilter - column: IReportDataTableColumn - customname : String - filters: DataSetDescColumnFilters[] DataSetDescColumnFilterSubquery DataSetDescColumnFilterDiffers - function: DataSetDescColumnFunction - table: DataSetDescTable - subquery: DataSetDesc - visible: boolean DataSetDescColumnFunction DataSetDescColumnFilterSmaller DataSetDescColumnFilterEquals DataSetDescColumnFilterGreater DataSetDescColumnFunctionCount DataSetDescColumnFunctionMin DataSetDescColumnFunctionMax class ReportDataSchema «singleton» ReportDataSc hemamanager + gettables() : IReportDataTable[] Loades and builds on sturtup in memory the database schema. The clients operatores then only on the public interfaces. The classes are restricted only to this package and cannot be accessed or modified publicly «instantiate» «instantiate» ReportDa tatable + addcolumn(reportdata TableColumn) : void + addreferencedtable(reportdatatablereference) : void + getcolumns() : IRepo rtdatatablecolumn[] + getname() : String + getreferencedtables() : IReportDataTableColumn[] ReportDataTableColumn + getreportdatatable() : IReportDataTable IReportDataTable + getcolumns() : IReportDataTableColumn[] + getname() : String + getreferencedtables() : IReportDataTableReference[] IReportDataTableColumn + getcolumntype() : ReportDataTableColumnType + getreportdatatable() : IReportDataTable «enumeration» ReportDataTableColumnType «enum» Int String Dou ble Date Time 3. Report template editor The report template editor is a web application which enables the editing of report templates. The templates are stored as xml files inside a database. class Report template editor Presentation Busines slogic Data base 3.1. Presentation layer class Presentation Layer LoginDialog BrowseTemplatesDialog The functionality of GWT needs to be tested to find a reasonable way how to implement the editor. After that the architecture needs to be developed. EditTemplateDialog 3.2. Business logic layer class Business logic layer ReportTe mplates Users DataSe tdesc ReportDataSchema (from Core) (from Core) class ReportTemplates «singleton» Database:: DatabaseAccess This class makes stores the Document structure as xml, and builds the structure from xml «singleton» ReportTemplateManager + createnewreporttemplate(string) : IReportTemplate + getreporttemplatebynam e() : IReportTemplate + getreporttemplatenamelist() : String[] + savereporttemplate(ireporttemplate) : void ReportTemplateE ntitytranslator + getentityfromreporttemplate(ireporttemplate) : ReportTemplateEntity + getreporttemplatefromentity(reporttemplateentity) : void IReportTemplate + getdocumentbody() : DocumentBody + getdocumentproperties() : DocumentProperties + getfooter() : HeaderFooter + getheader() : HeaderFooter ReportTemplate + getreporttemplateentity() : ReportTemplateEntity + ReportTemplate(ReportT emplateentity) : void It should be defined later on what visual properties should a document exactly have The general idea is that a document consists of a list of elements. These can be text elements (normal text), special values like generation time and data sets which will be filled during report generation with actual data. HeaderFooter + getdocumentbody() : DocumentBody DocumentBody + getfirstelementiterator() : DocumentElementIterator + insertelementafter(documentelement, DocumentElementIterator) : void + insertelementbehind(documentelemen t, DocumentElementIterator) : void It needs to be reconsidered what DocumentElementIterator DocumentElement properties should this class have. + getnext() : DocumentElementIterator + getprevious() : DocumentElementIterator + getvalue() : DocumentElement TotalPageCountAutoFilledElement AutoFilledElement TextElement DataSetElement - textproperties: TextProperties - text: String - datasetdesc: DataSetDesc - textproperties: TextProperties - properties: int - reportdatatablecolumns: DataSetElementColumn[] PageNumberAutoFilledElement DataSetElementColumn - datasetdesccolumn: DataSetDescColumn - header: String GenerationTimeAutoFilledElement - format: int The visual properties of all of the document elements need to be TextProperties - font: int - headertextproperties: TextProperties - rowtextproperties: TextProperties reconsidered Font - color: int - fontfamily: String - size: double class Users This is an open point. Probably user permissions from the new Ksantypa Administration Application will be used. Needs to be clarified. «singleton» Database:: Databas eaccess «singleton» UserManager + getuserbynameandpassword(string, String) : boolean User + getuserentity() : UserEntity + User(UserEntity) : void IUser + getname() : String 3.3. Database layer class Database layer «singleton» Databas eaccess DAO::UserDAO + getuserbynameandpassword(string, String) : UserEntity + saveuser(userentity) DAO::ReportTemplatesDAO + gettemplates() : Entities::ReportTemplate[] + savetemplate(entities::reporttemplate) : void Entities::UserEntity + getid() : Integer + getname() : String + getpassword(string) : void ~ setid(int) : void + setname(string) : void + setpassword(string) : void Entities::ReportTemplateEntity + getid() : Integer + getname() : String + getxml() : String + ReportTemplateE ntity() : void ~ setid(int) : void + setname(string) : void + setxml(string) : void Entities::IEntity + getid() : Integer 4. Report generator The report generator is a web application which enables the generation of reports using report templates class Report generator Presentation Busines slogic Data base 4.1. Presentation layer class Presentation layer LoginDialog BrowseReportTe mplatesdialog GenerateReportDialog 4.2. Business logic layer class Business logic layer ReportTemplates DataSe tdesc ReportDataSchema (from Core) (from Core) class ReportTemplates The general idea is that the report template is read. The whole structure is stored as a standard Xml Tree build by Java. Only the data sets are taken and converted to special objects. These objects are then used to get the data from DB. When the data is received, then Xml Node with the description of the data set exchanged by the actual data. Such Xml is then processed by the actual report generator «singleton» ReportTemplateManager + getreporttemplatebyname(string) : ReportTemplate + getreporttemplatenames() : String[] ReportTempla texmlreader + getreporttemplatefromxml(string) : ReportTemplate Gets the data from database based on the description of the data and fills the xml with the real data ReportTemplate ReportTemplateFiller + getdatasets() : ReportTemplateDataSet[] + getxmldocument() : XmlDocument + fillreporttemplate(reporttemplate) : XmlDocument ReportTemplateDataSet - datasetdesc: DataSetDesc - node: XmlNode «singleton» ReportTemplateGenerationManager + generate(string, Rep orttemplate) : void + getreportgeneratornames() : String[] This generator gets an Xml Dom object, converts it to Xml and transfers using the given Xslt file. This is very useful when converting the Xml report from the internal format to the one required by the external tool IReportGenerator + generate(xmldocument) : void XsltConv erter + convert(xmldocument, XsltDocument) : String JasperReportGenerator + generate(xmldocument) : void 4.3. Database layer class Database layer «singleton» Databas eaccess IDAOProvider DAO::IUserDAO + getuserbynameandpassword(string, String) : UserEntity + saveuser(userentity) DAO::IReportTemplatesDAO + gettemplatebyname(string) : Entities::ReportTemplate + gettemplatenames() : String DAO::IReportDataDAO + getdata(datasetdesc) : DataSetResult Entities::UserEntity + getid() : Integer + getname() : String + getpassword(string) : void ~ setid(int) : void + setname(string) : void + setpassword(string) : void Entities::ReportTemplateEntity + getid() : Integer + getname() : String + getxml() : String + ReportTemplateEntity() : void ~ setid(int) : void + setname(string) : void + setxml(string) : void DataSetResult:: DataSetResult DataSetResult:: DataSetResultRow DataSetDesc::DataSetDesc - orderby: datasetdesccolumn[] + fromxml(string) : DataSetDesc + toxml() : String Entities::IEntity + getid() : Integer DataSetResult:: DataSetResultValue DataSetResult:: DataSetResultValueString DataSetResult:: DataSetResultValueDateTime DataSetResult:: DataSetResultValueInt DataSetResult:: DataSetResultValueDouble class Oracle Database::IDAOProvider DAO::IUserDAO + getuserbynameandpassword(string, String) : UserEntity + saveuser(userentity) DAO::IReportTemplatesDAO + gettemplatebyname(string) : Entities::ReportTemplate + gettemplatenames() : String DAO::IReportDataDAO + getdata(datasetdesc) : DataSetResult OracleDAOProv ider OracleUserDAO + getuserbynameandpassword(string, String) : UserEntity + saveuser(userentity) OracleReportTemplatesDAO + gettemplatebyname(string) : Entities::ReportTemplate + gettemplatenam es() : String OracleReportDataDAO + getdata(datasetdesc) : DataSetResult OracleDataSetDescToSqlQueryTransformer + createsql(datase tdesc) : String
Recommended
View more...
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks