ASNA Mobile RPG® Reference Manual |
Web.config <appSettings>
Every Mobile Display file will have at least one Web.config file. Web.config is an ASP.NET configuration file;It contains data stored as XML text with nested XML tags and sub-tags with attributes that specify 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 with configuration settings only.
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 Mobile RPG
The appSettings section of the Web.config file has the configuration settings for the following.
- Setting display file special character replacement values
- Locating a Display File via Library List
- Setting the location of the Asna5250Terminal.aspx page
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 Mobile RPG 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 Mobile RPG 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. |
Locating Display File Pages via Library List
Many ILE RPG programs make use of the library list to find their display files. A .NET application does not have an inherent library list. The ASNA Mobile RPG 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 Mobile RPG 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. |
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 Web Pages. Subtopics are related to the installed language templates, master pages, and cascading style sheets creating a "theme" in your website.