Lesson 4: XMLRAD Overview with a transactional application

Objective

In this lesson, we will walk through the Department demo to discover XMLRAD, XMLGramEditor and XSLStudio main features.
This lesson will describe features related to database connectivity, transactional forms.
None of the options will be detailed very deeply. This lesson covers only a quick tour of XMLRAD IDE.
Following lessons will describe in detail all elements announced in this lesson.

Knowledge

You will learn the following techniques:

Required Tools

Click here to access XMLRAD on-line, you will be able to  follow this lesson even if you don't have XMLRAD installed on your computer.

Click here to access XMLRAD Enterprise Edition which should be installed on your computer.

Required Knowledge

Description

This lesson will review step-by-step major XMLRAD features.
You will need to click on the different link as shown on screen shots.
A little description will defines new terms, and architecture related knowledge required to understand this lesson.
You will discover XMLGramEditor and basic DBExtract instruction. 
You will manipulate XSLStudio to design an exisiting simple data-aware XSL page. 

Step 1: Project Configuration page

If you are using :

Select project Department, in the XMLRAD home page or in the XMLRAD Explorer. 

Project Configuration Page

The Project Configuration Page defines the registered information of your project in XMLRAD.

The project informations of this level are stored in the file:
C:\Program Files\e-delos\XMLRAD\Data\XMLRAD.Projects.xml.

The button Show Advanced Options will display the imported files of the main XMLFile.
Imported files are used to fill the XMLModules combobox in the top frame.

The Project Configuration Page has links to:

Step 2: XMLComponents Framework Administration Pages

You can access to the Application Monitoring Page. It will launch a new web browser to display the XMLComponents Framework administration pages of Department application.

Application Monitoring Page

Application Monitoring Page displays the concurrent modules prepared for execution.
A module may have 2 status : 

 

Modules are implemented as XMLCollection.
An XMLCollection may contain multiple XMLModule, database connections, ... 

When executing administration actions, it does not use one of the user modules. 
It uses a specific XMLCollection reserved for administration actions.

 

HTTP Monitoring Options Page

You can access to the Application Statistics from the XMLComponents Framework administration page, or through XMLRAD Project Configuration Page.

Statistics Page

the Application Statistics Page displays the concurrent modules as columns and the multiple actions group by XMLModule as rows.
On this screen shot, the application has processed one http request for the ListDepartment action, and has processed it in 421ms.

You can close this web browser window.

Step 3: Project Configuration Pages

Let's get back to XMLRAD and to the Project Configuration pages.

Project Configuration Page

 You can access the Advanced Options by clicking on the button "Show Advanced Options": 

Project Configuration Page, Advanced Options

It displays all the imported files, within the main XMLFile: Department.xml.

There is no limit in number of files you may import in the main XMLFile, as well as their structure.

 

However, XMLRAD is using some heuristics to determinate where are located XMLModules, DataSources, Aliases, XMLServices. Changing default values may result in non trivial behaviours.

In the XMLRAD Explorer, click on the InitParams item to access the Application Initialization Parameters:

Application Initialization Parameters

The main parameters are :

InitParams are used to initialized the application, such as concurrent modules, administration path, ...
InitParams are not present in the Context, but can be accessed through XMLApplication.Config.Values['XMLC_InstanceName'] for instance.

In the XMLRAD Explorer, click on the GlobalParams item to access the Application Global Parameters:

Application Global Parameters

In this example, there is 2 GlobalParams which are defined as default params :

Step 4: DataSources Configuration

In XMLRAD Explorer, select the DataSources tab:

Application DataSources

A DataSource is defined: Database.
This DataSource is using the middleware FIB to access natively to the database server InterBase.
For every DataSource you setup, you may choose between ADO, BDE, DBX, FIB, IBX middlewares.
Once the middleware is setup, you need to configure the parameters.
Parameters change depending on the middleware you selected.

Changing the middleware will reset the existing parameters to connect to the DataSource. You will not be able to retrieve previous parameters even getting back to previous page.

Once you changed some parameters values, you need to save the modifications.
Otherwise you may loose the configuration parameters you updated.

Saving the parameters will save the settings into Department.DataSources.xml file.
Department.DataSources.xml contains all the datasources definitions.

There is no limitation in number of DataSources managed by the XMLComponents Framework.

To test the connection you must click first on the Save button, to save the parameters into Department.DataSources.xml file.
Then you can click on the button "Test Connection":

Test DataSource Connection

It will launch in 

"Test Connection" operation is handled by XMLRAD and not by the XMLApplication running in the HTTP server process.

"Test Connection" may be correct through the interactive process of XMLRAD.EXE, and may not be correct through the XMLApplication.

Check that the settings force to use a TCP/IP connection to reach the database server.

Then, you can close this web browser window.

In XMLRAD Explorer, select the Aliases item:

Application Aliases

Application Aliases are mainly used within XSL files to dereference the physical application binary.
XSL file reference Department application as: <xsl:select value-of="/document/Aliases/DepartmentDLL"/>

This feature has been introduced to compile multiple XMLModules either in multiple binaries, or in a single binary.

Compiling multiple XMLModules in a single binary reduces significantly the overhead of binaries, memory and resources (database connections, handles, ...) 

In XMLRAD Explorer. select EventLog item:

Application EventLog

This page list all errors which occured in the application. 
For each error, you will find the complete description of the error, the callstack, the Cookies, the HTTP Params, and the current Context.
You can replay the error with the complete context to reproduce the error.
You can use EventLog also for non-regression tests.

Step 5: XMLModule Configuration Page

In XMLRAD Explorer, select the "xmDepartment" XMLModule:

XMLModules Selection

Once you selected the XMLModule, it will display the XMLModule's Configuration page in the main frame:

XMLModule Configuration Page

An XMLModule is a container of multiple XMLServices (the http requests actions).
The XMLModule Configuration Page contains:

Click on the button Show Advanced Options: 

XMLModule Configuration Page, Advanced Options

It displays the imported XMLServices files.

There is no limit in number of files you may import in the XMLModule file, as well as their structure.

However, XMLRAD is using some heuristics to determinate where are located XMLServices. Changing default values may result in non trivial behaviours.

Step 6: XMLService Pages

In XMLRAD Explorer, select the ListDEPARTMENT XMLService:

XMLService Configuration Page

An XMLService is the action invoked in the http requests.
The following http request will invoke this action : http://xmlrad.com/DepartmentBin/Department.dll/ListDEPARTMENT  

The XMLService Configuration page displays:

Icons right to the XMLGram, XML and XSL edit fields launch the XML editor XMLSpy. Only accessible in XMLRAD Professional version. You can configure your own XML editor.

XMLService Process Diagram

This diagram shows the main steps in the internal process of the XMLService to create the resulting html page :

  1. HTTP request is dispatched to the XMLService by XMLApplication
  2. XMLGram describes all the data operations to execute against the SQL server
  3. XMLGram processing builds the XML document
  4. XML document is transformed into HTML using an XSL document
  5. the resulting HTML page is sent back to the client browser through IIS

 

In XMLRAD Explorer, click on WSDL item:

XMLService WSDL Page

InputParams may be used to generate XML document at design time. 
InputParams may be used to generate WSDL for your entire application at run-time, per XMLModule or per XMLService WSDL.
InputParams are used when you click on the run icon.
InputParams are stored in the XMLServices file.

Step 7: XMLGram Editor

In XMLRAD Explorer, select "ListDEPARTMENT.xmlgram" item:

XMLGram Editor

The XMLGram Editor contains:

The XMLGram file contains all the SQL statements which will be processed by the XMLComponents Framework to produce the XML OutputDoc.
The XML OutputDoc will then be passthrough the XSL file to produce the resulting HTML page sent to the client.

XMLGram Editor displays in a certain manner the XMLGram elements respecting the XMLGram grammar.

Every value edited in the TextField of the XMLGram Editor results in the same behavior as editing the XMLGram file directly with any XML editor.

XMLGram is a hierarchy of XMLInstructions such as :

Select the DBExtract instruction named "DEPARTMENT":

XMLGram Editor, DBExtract

DBExtract instruction is the most important since it is used to build from a SQL statement a whole XML hierarchy of elements.
Programming the behavior of the DBExtract instruction to produce manually the resulting DOM tree would require for each extraction between 1,000 to 10,000 lines of code.

To watch the resulting records generated for this DBExtract click on the icon "Run SQL Query":

XMLGram Editor, DBExtract, Run SQL Query

Note: this dataset is generated by XMLRAD and not by the XMLComponents Framework.

To watch the dataset generated by the XMLComponents Framework, select in the XMLRAD Explorer "ListDEPARTMENT.xml" item:

"XML Data Viewer" item

It displays the XML document produced by the XMLGram. When there is no XMLGram specified, the XMLComponents Framework provides a basic XML document.
This XML document will be used by XSLStudio. 

The generation of the XML document is done by calling the Department application running in the HTTP Server. 

XML document is produced by the XMLComponents Framework.

Step 8: Running Department

To run the application, select "ListDEPARTMENT" item in XMLRAD Explorer, then right-click on the item to display the popup menu, and select the option "Run this XMLService":

Run the XMLService

It will open the application in a new browser.

ListDEPARTMENT invocation

It launches a new web browser window, invokes the url: http://localhost/DepartmentBin/Department.dll/ListDEPARTMENT
The application displays the page built by the XMLService ListDEPARTMENT.

This demo transactional application will demonstrate basic features of data-aware applications.

ListDEPARTMENT Grid

XMLComponents Framework, XMLRAD and XSLStudio lets you build easily this kind of table very easily.

Click on a link to get to the detailed information of a selected Department:

Master/Detail Form: FormDEPARTMENT

Transactionnal forms built with XMLRAD can be simple form, or master/detail forms.

In this example, it also includes a graph built dynamically by the application.

To update an employee information, click on the employee's link:

Simple Form: FormEMPLOYEE

FormEMPLOYEE is a simple form to let the user update some information.

Submit updates

Click on the button Submit when updates are done.

Doing so, the web browser will batch all parameters of the form to the application. The XMLComponents Framework will update the data back into the database using an XMLGram (UpdateEMPLOYEE), and then displays the NextAction defined for this XMLService: FormDEPARTMENT.

FormDEPARTMENT with the new values

FormDEPARTMENT is then displayed back to the user.

Close the web browser.

Step 9: XSLStudio

In XMLRAD Explorer, select "ListDEPARTMENT.xsl" item to open XSLStudio:

Select XSL item to open XSLStudio

It will display the XMLService in design mode.

XSLStudio is a tool to edit XSL page within the web browser. 
It is a designer like Delphi or VB.
XSLStudio runs inside XMLRAD and contains multiple frames :

Over 50 components are delivered with XSLStudio. In the first component palette, you will find all basic HTML elements.
A component description is done in Lesson 3, Step 7.

To select a component, move the cursor to the component you want to select, and click with the left button:

XSLStudio, Component Selected

The selected component has a blue frame, and the bottom frame displays its elements and attributes.

We will remove the column DEPT_NO: title cell and data cell.
To do so, you will select the "td" element in the property inspector in the bottom frame. Click on the desired element.

XSLStudio, Cut Selected Element

Invoke the popup menu, with a right button click on the "td" element, once it has been selected.

Before invoking the popup menu on an element check that you first selected the element in the property inspector.

Invoking a popup menu action without selecting first the element in the property inspector will certainly results in non trivial behaviours.

Select in the popup menu, the "Cut" option.

XSLStudio, Selected Element Cut

Process with the same styeps to delete the remaining DEPT_NO cell.

Let's try to see this new page running in the application.
In XMLRAD Explorer, select the "ListDEPARTMENT" XMLService, right-click on the item and select the option "Run this XMLService":

Execute ListDEPARTMENT

It launches a new web browser window:

ListDEPARTMENT new version

Immediately, the new version is available for the users.

When invoking an XMLService, the XMLComponents Framework checks if the XSL file version is more recent on disk, and then forces to reload the XSL file before using it to transform the XML document.

Any update to the XSL file will be immediately available for the next http request.

Close this web browser window.

Step 10: XMLComponents Framework Administration Pages

Let's get back to the Project Configuration Page. In XMLRAD Explorer select "Department" project item.

Project Configuration Page

In the Project Configuration Page, select the Monitoring icon.
You can access to the Application Monitoring Page. It will launch a new web browser to display the XMLComponents Framework administration pages of Department application.

XMLComponents Framework HTTP Monitoring Page

Application Monitoring Page displays the concurrent modules prepared for execution.
A module may have 2 status : 

 

Modules are implemented as XMLCollection.
An XMLCollection may contain multiple XMLModule, database connections, ... 

One module handles one http request and only one. 

When executing administration actions, it does not use one of the user modules. 
It uses a specific XMLCollection reserved for administration actions.

You can access to the Application Statistics from the XMLComponents Framework administration page, or through XMLRAD Project Configuration Page.

XMLComponents Framework Statistics Page

The Application Statistics Page displays the concurrent modules as columns and the multiple actions group by XMLModule as rows.
Now on, you may have several values listed in the first Module.

Note: The first Module is not reserved specifically to your http requests. It may get used by any http request when this first module is available.
A module becomes available as soon as it has returned its content to client side.

Note: The second module has less requests (77), since it has not been used as much as the first module. It also means that there was few concurrent request to the Department application, meaning when 2 users sending 2 different requests at the exact same time , the second request is dispatched in the second module.

Average CPU time is 326ms for the overall application, and the average CPU time for XMLServices is 126ms.
Average CPU time to process ListDEPARTMENT XMLService is 104ms, and the application received 311 http requests for this XMLService.

This form is very useful to diagnose performance lacks per XMLService.

To obtain detailed statistics on the XMLService, you can click on its name. Click on FormDEPARTMENT XMLService:

XMLComponents Framework Advanced Statistics Page for XMLService FormDEPARMENT


This page describes the internal statistics of the XMLGram provessing.
It contains all the SQL statements, and for every SQL statement, their average CPU processing time, fetches.
This form is very useful to diagnose performance lacks per SQL statement, such as missing index, filtering error, too much fetches.

You can close this web browser window.

Summary

In this lesson: