Notes:
This topic applies only if your data source project is MCP T27 or OS 2200 UTS.
This topic applies only to the MVC Web and Web Forms presentation project types. Refer to Creating an MVC Web Application and Creating Web Forms Application Projects.
As the fields of the screens are captured, the terminal attributes of the ClearPath application are captured. The ClearPath ePortal software assigns Cascading Style Sheet (CSS) classes to each attribute or combination of attributes. The captured attributes include:
Input
Bright
Reverse
Blink
Underline
Foreground Color (Black, Red, Green, Yellow, Blue, Magenta, Cyan, or White) (UTS only)
Background Color (Black, Red, Green, Yellow, Blue, Magenta, Cyan, or White) (UTS only)
You can configure ePortal Developer so that CSS classes are included at runtime for each field on your web page. The CSS classes correspond to the terminal attributes that were captured. In order for the CSS classes to be included, all of the following must be true:
For an MVC project, you must have scaffolded the application using the Scaffold Unisys Controller for ePortal Data Source with Views Dialog, and selected Preserve Screen Layouts and Styles. In addition, if you configured advanced options, Map terminal highlights to CSS must remain checked on the Terminal Options Dialog.
For a web forms project, the property MapTerminalHighlightCharactersToCSS must be true. This is the default setting if you created a web application with terminal screen appearance. Refer to Creating an ASP.Net Web Application (Terminal Screen Appearance) and Presentation Generation Properties.
The property ApplyHostStylesOnOutput must be true for the corresponding field in the corresponding client message. This is the default setting; refer to Message Editor for more information. If you set ApplyHostStylesOnOutput to false, you can omit the CSS classes from individual fields. Therefore, you can enable or disable the inclusion of terminal attribute CSS classes at the project level or at the client message field level.
You can use CSS to map how the various attributes from the captured terminal application appear on the web page. For more information on CSS, refer to http://www.w3schools.com/css/.
How to Style Your Web Page
There is a CSS class for each terminal attribute or combination of terminal attributes. In addition, for UTS, there is a class for each color, for both background and foreground. The color class names are of the form bg_<color> and fg_<color>, where <color> is one of the colors listed above.
These classes are defined in one or more CSS files; the location of the CSS file(s) depends on the project type:
For MVC web presentation projects: The stylesheet file unisys.RunTimeDefault.css in the folder Content\unisys defines the properties for each of the terminal attribute classes.
For web forms presentation projects: For screens that you explicitly capture, the stylesheet file TerminalStyles.css defines the properties for each of the terminal attribute classes. For screens that you do not capture, ePortal generates the web page at runtime. For these generated pages, the file RunTimeDefault.css defines each of the terminal attribute classes. Both of these files are located in the folder pages\StyleSheets in your presentation project.
If you wish to change the defaults that ePortal provides, you can use Visual Studio to edit the appropriate CSS file to define you own style rules. In this way, you can map the terminal attributes to the style that appears on the web page. Below are a few simple examples.
Example: Configure Different Font for Bright
By default, the Bright terminal attribute is mapped to bold, black text, as follows:
.t27Bright { color:black; font-weight:bold; } … .utsBright { color:black; font-weight:bold; }
You can configure the bright text from the terminal to be rendered in a different font to make it stand out even more than just being bold. To do this, add the following rule to the end to the appropriate CSS file. In this case, the font-family rule is added to the already existing rules for color and font-weight.
.utsBright, .t27Bright { font-family:Andale Mono; }
Example: Eliminate Colors (UTS only)
Even though ClearPath ePortal has captured color information, you can ignore this information and simply present all text as black text on a white background in your web presentation. To do this, you can add the following rules to the end of the appropriate CSS file; by adding these rules last, they will override the default definitions for the bg_color and fg_color classes:
.fg_Black, .fg_Red, .fg_Green, .fg_Yellow, .fg_Blue, .fg_Magenta, .fg_Cyan, .fg_White { color:Black; }
.bg_Black, .bg_Red, .bg_Green, .bg_Yellow, .bg_Blue, .bg_Magenta, .bg_Cyan, .bg_White { background-color:White; }
Example: Remap a Foreground/Background Color Combination (UTS Only)
If you always use a red foreground on green background for error messages in your UTS application, you can define a CSS rule to remap the foreground and background colors. By default, the definitions for the bg_Green and fg_Red classes are:
.bg_Green { background-color: Green; } .fg_Red { color: Red; }
However, if you also use a green background with a different color foreground for non-error cases, you might want to leave the bg_Green class definition unchanged. Instead, you can define a more specific CSS rule that only applies when the background green and foreground red classes both occur together. For example:
.bg_Green.fg_Red { background-color: white; color: red; font: bold large serif; }