602SQL Documentation Index  

XML Forms Designer

602SQL includes a simple interface for viewing and editing of database data. For this purpose, it makes use of XML web interface that offers and receives data from the 602XML Filler external program (freeware). Custom forms and reports are designed by means of the 602XML Designer program (commercial program).

XML forms work in this version only in the Windows environment. Porting under Linux is in progress.

Even though it is possible to generate the initial design of the XML form and DAD automatically, meaningful utilization of this interface requires a very good command of:

  1. Design of the XML forms using the 602XML Designer program, including the XPath standard - see documentation for this program;
  2. design and utilization of the DAD transformations for XML transfers in both directions;
  3. database backend of the 602SQL server (i.e. design of tables, domains, queries, programming of triggers and procedures in the SQL language, sequences) - see complete chapter SQL language in 602SQL.

Reports and Forms

Report means an XML form that cannot be edited and which displays data from a query prepared in advance. Within the report, it is possible to add to these data so-called aggregate functions. Within current version of the 602XML Designer, it is possible to use functions defined by the XPath 1.0 standard, i.e. Sum, Count and, in their combination, also Avg. Data are inserted into the XML report by means of the XML transfer, while the DAD object can be generated automatically during design (or you can prepare it in advance, of course).

Forms are XML forms providing for data inserting or editing. A pair of DAD objects are an intermediary between the XML form and the database; the first one that populates the form and the second one that inserts or rewrites data within the tables.

XML Form Designer

The basic mode of the simplest XML forms is created by means of an integrated wizard that will guide user in several steps through selection of the form type, of the data source and - in case of a report - even through its more complex structure.

The first common step is to select a name and type of the XML form. There are three basic types: Report, Insert form and Update form. Afterwards, a form layout is selected:

It is assumed that all initial forms will be subsequently modified in the 602XML Designer environment. The initial design must be explicitly saved in the 602XML Designer and the Designer must be terminated - thus the design is signed and it is possible to continue work with it (i.e. to open it).

The second step for the XML forms that are filled with data at opening (i.e. Reports and Update forms) is selection of the initial data source. Alternatives that are available: Table, Stored query, SQL query specified by query text - from these sources, the DAD with a name specified in the Name for DAD field is generated and stored into the application, or an alternative DAD is used - a DAD of a suitable structure prepared in advance.

Report

In case of a report, its structure and aggregate functions are designed on the wizard third page. Here, in the top section, there is a tree of XML elements from the source DAD and the bottom part contains a grid with the list of subelements and attributes of the element selected in the top section.

Remove report column Mark a row in the bottom section grid and press the Del key.
Add report column It is not possible, it is not valid for aggregates.
Add aggregate function To insert an aggregate function, you must stand one level higher than the counted subelement. In the bottom-section grid, more columns are enabled and a new aggregate is created by filling them (a new row is inserted from the keyboard by pressing the Down arrow key). You will select the counted element from the menu in the Element column, select the text description in the Label field; the aggregate function type is selected in the Aggregate field and the Aggregate element field specifies the data link name that will be created for this counted item in the 602XML Designer.
Change aggregate location In the grid where aggregates are specified, you can move rows using Drag&Drop - move the row containing the aggregate before or after the row containing the element with linked data source rows. The aggregate will be before or after all records.

A report is created in the XML form design as a set of fields having an output value; their content is loaded at the time of opening. The path to XML data from the database is specified by means of an expression described on page Integration of forms with database.

Form for Data Inserting

The second wizard step for the input form selects the DAD; using that, the data inserted to the 602XML Filler are stored into the database. The list offers analytic DADs within the current application, DAD is not created automatically.

In the XML form design, a profile is created (apart from the editing fields) for transferring data using an HTTP request in format described on page Integration of forms with database. By adding repeated sections in the Filler you can specify more than one record at one go.

Form for Data Editing

The editing XML form is a combination of both previous types: The Filler is filled by the first DAD, data are edited and then - by means of the HTTP request for data transfer - they are returned by means of the second DAD to the database.

The DADs used for the editing form must in practice meet following requirements:

Form Repository

The XML forms are not created usually in a way described here, but in the opposite way - the form look is designed first and after that data interpretation of fields in the form is examined and designed. If the forms should be - even in this case - stored in the database, it is usually the simplest way to create them outside the client environment and import them as completed, eventually, to modify the HTTP requests.