Home Screenshots Download License Credits Known users Release Notes Installation User Guide Configuration Project Page Mailing Lists Bug Reports CVS Access |
ConfigurationRendering EngineThis section explains how to configure h3270's rendering engine, which allows you to transform your host applications from a character-based layout to the look and feel of a web application. The rendering engine uses regular expressions as known from many programming tools and languages such as Perl and also Java. In the following, we assume that you are basically familiar with regular expressions. To learn about them, we recommend the book Mastering Regular Expressions by Jeffrey Friedl.The basic idea is that you provide an HTML template page (or short: template) for one or more host screens. A template says how a particular screen (or a group of screens) should appear in HTML. Each template consists of three parts: an accept pattern, a match pattern, and an HTML body.
accept
resp. match in the indicated positions. The
regular expressions start in the following line and extend to
the end of the comment, not including the final newline before
the end-of-comment marker. This marker also needs to go into
the first column. The rest of the template file, after the two
special comments, is the HTML body (it needn't be
in <HTML></HTML> tags).
<!-- accept Accept Pattern Here --> <!-- match Match Pattern Here --> <html> HTML Body Here </html>
When h3270 starts up, the rendering engine initializes itself by
reading all template files from the
directory The accept pattern is an ordinary regular expression, which is applied to the host screen in JDK standard mode with no optional flags. The pattern only needs to match somewhere inside the host screen, not the entire screen. In the textual representation against which the pattern is matched, screen lines are terminated with newline characters (which correspond naturally to newlines in the pattern). Input fields in the host screen are marked by "{" and "}" characters (these appear in the exact positions where the field attributes were in the original host screen).
The match pattern is applied to the screen after the
corresponding accept pattern was found to match. Unlike the
accept pattern, the match pattern is applied in DOTALL mode
(where "." matches everything, including a newline), because
that is more convenient in the match pattern. You can change
this by switching DOTALL mode off inside the pattern with
"
Within the match pattern, you can use capturing groups
(parenthesized subexpressions) to capture text from the host
screen for later insertion into the HTML body. If you
want to include an input field from the host screen
within the rendered HTML page, you must match this input
field within a capturing group. The result must be a capturing
group that starts and ends with "{" and "}" characters; such
groups are recognized and handled specially by the engine.
Thus, a common expression to match and capture an input field is
"
Within the HTML body, you can use placeholders such
as #1, #2, #3 for text that was captured by corresponding
groups of the match pattern. To include a literal "#" character
in your HTML page, write it as
As an additional feature, you can write a qualified Java class
name within braces after a placeholder, such as
" Available Color Schemes and FontsYou can modify the available color schemes and fonts by editingWEB-INF/h3270-config.xml .
You can add a custom color scheme by placing a scheme tag inside the colorschemes
tag. Each scheme has the following mandatory attributes:
Each color attribute must contain a HTML color code like LayoutBy default the simple JSP pagewebapp/simple-screen.jsp is used to display the h3270 screen. The configuration option style allows to use a simple table-based layout:
The value can be set to a directory which must contain the files head.jsp and navbar.jsp. These files are included and displayed by h3270. The distribution contains two examples of this feature:
style in the configuration file, set it to one of these values and look at the directories webapp/h3270 and webapp/it-fws .
|