ASNA Mobile RPG® Reference Manual |
Sign on Screen
The ASNA Mobile RPG signon screen, SignOn.aspx, works in conjunction with MobileRPGJob<.vr>/<.cs>/<.vb> to capture the user login credentials when running ASNA Mobile RPG applications, typically used in the modernization environment. This file is part of the template included in each ASNA Mobile RPG solution in Visual Studio.
AVR
<PermissionSetAttribute(SecurityAction.LinkDemand, Name := "FullTrust")> _ <PermissionSetAttribute(SecurityAction.InheritanceDemand, Name := "FullTrust")> _ Public Class VBCodeProvider _ Inherits CodeDomProvider
C#
<PermissionSetAttribute(SecurityAction.LinkDemand, Name := "FullTrust")> _ <PermissionSetAttribute(SecurityAction.InheritanceDemand, Name := "FullTrust")> _ Public Class VBCodeProvider _ Inherits CodeDomProvider
Sign On Display
The SignOn.aspx, if left unchanged, will resemble the image below and have the data fields shown in the subsequent table.
Data Fields | Description |
---|---|
System | The IBM i server name containing the RPG/ILE programs with the Handler keyword if in modernization mode, or the server that is used for production after your application has been deployed. |
Port | The port number of the server connection. The default is 5042. However, this should be the same port number assigned when you installed ASNA DataGate for IBM i. |
User | The user name. |
Password | The user's password. |
Program/procedure Menu | The cl program or procedure you want to execute or the menu program. |
Current Library | The library the program, procedure, or menu is located in. This would be the library containing the RPG ILE programs that have the Handler keyword. |
Modifying the Sign on Logic
The sign on display file and logic provided with the Design Aid may be functional for the programmer in a testing environment but it does not provide restricted access to the other servers that may not be available to all users and it can be cumbersome for most daily users in a runtime environment. To eliminate both of these issues the sign on display and logic can be changed in a couple of ways.
Preload Variables and Display Only
One option is to set all of the variable values except
for the user name and password in the MobileRPGJob.cs, .vr, or .vb code and
change the Usage
attribute in
the SignOn.aspx for those variables that you preset to "OutputOnly"
.
The MobileRPGJob.cs example is shown below setting the server,
program, library, and port to specific values; and the user, password, menu, and message to spaces.
In practice, instead of a single program (Custinqcl in the
example), a menu may be the starting program which
the user works from throughout the day. In that case, set
the menu name instead of the program name and set the
Usage
attribute to "OutputOnly"
for both the program and menu.
Next, you want to change the Signon.aspx to reflect a Usage
attribute of "OutputOnly"
for those variables that you preset
in MobileRPGJob that you do not want the user to override,
namely server, program, menu, library, and port.
The following image shows the Usage
attribute changed to "OutputOnly"
for the server field.
Preload Variable and Remove from the SignOn.aspx
In the above example, the user sign on still displays all of the sign on information but only the user name and password are entered. Under some circumstances you may want to display only the user name and password and hide the remaining fields that you preset with values.
Remove SignOn.aspx and Call your Sign On Program
There may be an instance where you already have your own sign on program that you want to use instead of the SignOn provided with the ASNA Mobile RPG Design Aid. If that is the case, you will need to do several things.
- Add the
"Handler"
keyword to the workstation file in your sign on RPG program on the IBM i and recompile it.- See Add the Handler Keyword for more detail.
- Remove SignOn.aspx from the Web Site Solution.
- In the Visual Studio Solution Explorer window, select SignOn.aspx. Right mouse click and select Delete from the dropdown menu. The file will be removed from the project.
- Remove all references to the Signon.aspx from the
MobileRPGJob code and add the appropriate values to the MobileRPGJob
code to call your IBM i server signon program.
- Remove the
LogonScreen
region. Collapse the region, right mouse click, and select Cut from the dropdown menu. - Remove
goMenu
. Collapse the code section, right mouse click, and select Cut from the dropdown menu. - Remove
CallQcmdExec
. Collapse the code section, right mouse click, and select Cut from the dropdown menu.
- Remove the
- Change
MobileRPGJob
code to call your sign on program.