ASNA Mobile RPG® Reference Manual |
Wings Record Format
Wings Record Format (wrf)
A .wrf file (named for ASNA Wings which shares this technology) contains information about each record format in an .aspx display file. This information will allow the runtime to perform Record Level checks to guarantee that the RPG program's display file records match the format of the aspx records. These files can be identified by their .aspx.wrf extension. These records are updated when the DDS file is imported AND when the Display File is exported back to the IBM i library. The format is shown below. (Wings Record Format gets its name from ASNA's RPG modernization suite: Wings, another member of the Monarch Family.)
<WingsRecordFormat LvlChk="*YES" CcsId="37"> <!--This portion is generated by Wings, do NOT change it--> <Layout Version="1.0" Sha1="pwafwChTQejcOTYyzl+KpHxLRU0="> <LastWrite T="634352898063549873" /> <FormatProps> <Format FormatName="SALESREC" FormatLevel="180258555D136"> ... </Format> ... </FormatProps> </Layout> </WingsRecordFormat>
Notice the LvlChk
attribute which
allows the programmer to indicate whether they want record
level checks (*Yes
) or not (*No
). For more on this topic see the LvlChk and LwtChk topic.
During ASNA Mobile RPG Runtime
Inside the WingsRecordFormat
lies the layout of the file records. This section should not be changed by hand, otherwise if
the runtime detects that the record information has been compromised it will issue an error
during record level checks. The record level checks happen when the file is Opened and go as follows:
- The contents of the
Layout
section are hashed and the value is compared against theSha1
attribute. If the values differ then the Layout section has been modified and is not to be trusted, so level checks cannot proceed and an error is issued. - Since the date of the aspx is different than the
LastWrite
tag, - If the
Sha1
values match, then theLastWrite
tag contains the date when the aspx file was last written to disk at the time the Wrf was created. If this date and the current 'last written date' on the aspx file match, then proceed to step 4. - This means the aspx file has been edited since the Wrf was created.
If the website is running a release version with a
web.config that states
DEBUG=FALSE
, then level checks cannot proceed and an error is issued. If the site is running in debug mode then a new layout is computed for the current contents of the aspx and if it is NOT equivalent to theLayout
section of the .wrf, then an error is issued. Otherwise, theLastWrite
tag is updated and the process continues to the next step. - The
FormatLevel
attribute of each record is checked against the format levels of the Display File used when the program was compiled. These format levels must match for the Open process to succeed. - As processing continues, the
CCsId
property value in this record is used to translate record names.