ASNA WingsRPG™ Reference Manual |
Web.config <appSettings>
Web.config is an ASP.NET configuration file with data stored
as XML text. The nested XML tags and sub-tags have attributes that specify
the configuration settings entered between the <configuration>
and
</configuration>
XML tags. These configuration settings encompass two areas:
section-handler declarations and configuration settings. This topic deals
only with configuration settings.
Multiple Web.config files can be located in each website application, each applying its individual configuration settings to its own directory and any subdirectories, which can override or modify settings from its parent directory. The root ASP.NET Web.config file has the settings that are applied to all ASP.NET applications that use the same version of ASP.NET Framework so a Web.config file is only needed for settings that override those default settings.
Case-Sensitivity
The XML tags, sub-tags, and attributes are well formed XML and
therefore are case-sensitive. The tag and attribute names must have
a lowercase first letter and uppercase on the first letter of any
subsequent word(s) i.e. appSettings
. String attribute values have an
uppercase first letter and an uppercase first letter of any subsequent word(s)
i.e. MonarchMessageFileFolder
. The only exceptions are true
and
false
, which are all lowercase letters.
appSettings Usage in ASNA Wings
The appSettings section of the Web.config file has the configuration settings for the following.
- Locating display files via a library list
- Locating imported message files at runtime
- Setting display file special character replacement values
- Setting the location of the Asna5250Terminal.aspx page
- Changing the order of function keys
Locating Imported Message Files at Runtime
If any of the Display Files in your application use certain DDS keywords, the corresponding
Message Files need to be imported. Messages coming from the Program Message Queue do not need
to be imported unless the containing file is the same as that of messages related to these
keywords: ERRMSGID, MSGID, MSGCON
and SFLMSGID
.
When the Wings application needs to get the descriptions for messages associated with these
keywords, a full path to the imported Message File is needed. The application expects to find
an entry in the website configuration file, Web.config, with the value corresponding to
the folder where the Message Files are located.
The key is MonarchMessageFileFolder
and it is defined as an application setting.
Like any other application setting, the entry should be manually added to the appSettings
section of the Web.config file.
For example,
<appSettings file="AppSettings.Config">
<add key="MonarchMessageFileFolder" value="~\MessageFiles\" />
</appSettings>
The value may be one of the following.
value= | Description |
---|---|
blank (or missing) | The IIS default root path, which is located on C: drive: c:\Inetpub\wwwroot\. |
~ |
The root of the website. |
~\folder\ |
A folder with a relative location with respect to the root of the website. |
absolute folder\ |
A full path including drive designation where the Message Files are located. |
In the example shown above, all the Message Files used by Display Files for the website should be imported to the "MessageFiles" folder under the website's root folder.
Notes:
- Once the Monarch Message File Folder value is loaded from the Web.config, the value is cached to memory.
- Message descriptions are cached into memory and shared among users of the website. If the application uses a very large message file, consider using another technique for messages, such as a physical file.
- If the source for an imported Message File is used by any of the RPG programs and that file is modified, the original Message File needs to be kept in sync manually; otherwise there may be inconsistent descriptions presented to the user.
Display File Special Character Replacement
MonarchSpecialCharReplacements is used to specify the replacement values for the special characters in Display File names since Microsoft Windows imposes some restrictions in file naming and some valid IBM i object names may not be valid in Windows. The values are entered as a list of comma separated pairs. Each pair consists of a special character and its replacement string separated by an equal sign.
Invalid special characters in Windows can include the following list. Be sure to double check for invalid file name characters for your ASP.NET application and set a replacement value in the Web.config file as necessary.
# (pound sign) | % (percent sign) | . (period) | " (double quote) |
* (asterisk) | & (ampersand) | : (semicolon) | ? (question mark) |
< (less than) | > (great than) | | (vertical bar) | @ (at symbol) |
/ (back slash) | \ (forward slash) | $ (dollar sign) | leading or trailing spaces |
The ASNA Wings import process will automatically replace the invalid characters with equivalent valid values based upon the character replacements specified here. There is no need to modify the RPG program since ASNA Wings runtime will do this conversion when the ASPX Page is requested as a result of an open Workstation file operation.
<appSettings file="AppSettings.Config">
<add key="MonarchMessageFileFolder" value="~\MessageFiles\" />
<add key="MonarchSpecialCharReplacements" value="@=_at_, #=H_lb_, $=_usd_" />
</appSettings>
value= | Description |
---|---|
blank (or missing) | The default is: @=_at_, #=H_lb_, $=_usd_ - which replaces the three characters @, # and $ for _at_, _lb_ and _usd_ respectively. |
Comma separated List containing: specialcharacter=replacement |
Single special character to be replaced, equal sign, replacement value. |
Display File Pages via Library List
Many ILE/RPG programs make use of the library list to find their display files. A classic .NET
application does not have an inherent library list. The ASNA Wings runtime makes use of the
MonarchDspFileLibl
application setting in the
Web.config file to resolve the path to a
display file when "LIBL is provided as its library.
The MonarchDspFileLibl
value represents an ordered list of comma separated folders
that are to be searched when opening display files whose
library is set to *LIBL
. Each entry in the list must specify the
relative path from the root folder of
the website to the folder(s) to be searched. Each named
folder will be searched in the order they are entered. If the entry ends with a "/*
" (or "\*
"), then ASNA Wings will search all subfolders for display files although there is no guaranteed order in
which subfolders are searched when using "/*
" (or "\*
").
In the example below, *LIBL
display files will be searched for in the folder
MyLibrary, then
in the
folder DspFiles/ARLib, and then in Views and all the
children of Views/*
.
As soon as an ASPX page is found with
the display file name, the search is over.
<appSettings file="AppSettings.Config">
<add key="MonarchMessageFileFolder" value="~\MessageFiles\" />
<add key="MonarchSpecialCharReplacements" value="@=_at_, #=H_lb_, $=_usd_" />
<add key="MonarchDspFileLibl" value="MyLibrary, DspFiles/ARlib, Views/*" />
</appSettings>
value= | Description |
---|---|
blank (or missing) | The default is: /* - which causes all of the folders in the website to be searched to resolve *LIBL . |
ordered comma separated List containing: 1searchfolder, ..., ..., lastsearchfolder |
qualified search folder(s) separated by a comma(,). |
Asna5250Terminal.aspx Folder
Asna5250Terminal.aspx page is required whenever DataGate needs to display a
5250 datastream. Monarch redirects to this page using the folder location
specified in the Web.config file <appSettings>key "Asna5250TerminalFolder" value
.
An example entry for this key is shown highlighted below showing
"~/Themes/Current" as the location for the Asna5250Terminal.aspx page.
<appSettings file="AppSettings.Config">
<add key="MonarchMessageFileFolder" value="~\MessageFiles\" />
<add key="MonarchSpecialCharReplacements" value="@=_at_, #=H_lb_, $=_usd_" />
<add key="MonarchDspFileLibl" value="MyLibrary, DspFiles/ARlib, Views/*" />
<add key="Asna5250TerminalFolder" value="~/Themes/Current"/>
</appSettings>
The value may be one of the following:
value= | Description |
---|---|
blank (or missing) | The default location is ~Themes\Current - which is relative to the root of your website. |
~ |
The root of the website. |
~\folder\ |
A folder with a relative location with respect to the root of the website. |
absolute folder\ | A full path including drive designation where Asna5250Terminal.aspx is located. |
Change the Order of Function Keys
Developers can set the order of the function keys in the banner on the page, by setting the MonarchDdsFileKeyOrder key. The key takes values of Enter, Fx, F1 through F24, representing the available function keys, while Fx renders every function key from F1-F24 which isn't mentioned elsewhere. This allows convenient constructions such as F3, Fx, F7 which would render as "F3, F1, F2, F4, F5, F6, F8, F9 ... F24, F7." The setting defines a global (application-wide) key-order style; it does not allow specifying a unique order for a particular record (or page).
The values provided below are merely an example, the "F12,F6,F11,F4,F3,Enter
" keys correspond to
the 'Enter', 'Exit', 'Prompt', 'New', 'Delete' and 'Cancel'
buttons on
the Customer Maintenance screen for Iron Monger. When the settings below
are applied, the order presented will be will be:
'Cancel', 'New', 'Delete', 'Prompt', 'Exit' and 'Enter
.'
Note: This is a runtime feature. The Web Form designer does not show the overriden key order (Web.config is not available at design time).
<appSettings file="AppSettings.Config">
<add key="MonarchMessageFileFolder" value="~\MessageFiles\" />
<add key="MonarchSpecialCharReplacements" value="@=_at_, #=H_lb_, $=_usd_" />
<add key="MonarchDspFileLibl" value="MyLibrary, DspFiles/ARlib, Views/*" />
<add key="MonarchDspFileKeyOrder" value="F12,F6,F11,F4,F3,Enter"/>
</appSettings>
The value may be one of the following:
value= | Description |
---|---|
Fx | Represents every function key from F1-F24 which isn't mentioned elsewhere. |
F1-F24 |
Represent an IBM i function key. |
PageDown |
Represents the IBM i PageDown (or PgDn) key. |
PageUp |
Represents the IBM i PageUp (or PgUp) key. |
Enter |
Represents the IBM i "Enter" key. |
See Also
ASNA Monarch Framework References
- Display File Concepts
- Describes the main framework concepts behind Monarch Display Files, the AVR commands provided specifically to support Display Files, and a description of the similarities and differences in Legacy Display Files and Wings Display Files. Subtopics are related to the installed language templates, master pages, and cascading style sheets creating a "theme" in your website.