Overview
This article describes changes made in V31.20 to improve the usability of GlobalSettings files.
1) Allow the GlobalSetting file to work with the XML file directly
Given a GlobalSetting.xml file whose content needs to be loaded into the CLIENT storage area. This can either be a VBI file produced by a previously compiled GlobalImports script or it can be that GlobalImports script itself. If it is the script itself, it is compiled here creating the VBI file "Just In Time". Though the GlobalImports script will have ended in Store.Close() operation the name of the VBI file that it created is still available from the Store service class. That name is retrieved and then is used to do the actual open of that VBI file.
...
Create a GlobalSettings script (e.g. usr\GlobalSettings,xml). Specify the location where the tool should create the compiled VBI file using the identifier attribute of the Storage command. Typically this will be relative to the workspace\log folder (e.g. log\GlobalSettings.vbi). Here is an example with some registry and remove commands:
Code Block |
---|
<GlobalImports>
<Storage Action="Create" Identifier="GlobalSettings.vbi" />
<Registry type="libname" source="msado28.tlb" target="msado15.dll" />
<Registry type="RefactorFile" Source="(%= VirtualRoot%)\TailwindPOS.vbp">
<Refactor errorStatus="warn">
<Remove identifier="TailwindPOS.frmSales.LastReceipt"/>
<Remove identifier="TailwindPOS.frmSales.LastReceipt.Get"/>
<Remove identifier="TailwindPOS.frmSales.ReturnFromPause"/>
<Remove identifier="TailwindPOS.ucLettersPad.Command1_Click"/>
<Remove identifier="TailwindPOS.EndShiftWithAmount"/>
<Remove identifier="TailwindPOS.PadAmount"/>
<Remove identifier="TailwindPOS.ValidateUserPassword"/>
<Remove identifier="TailwindPOS.ValidateUserPasswordAdmin"/>
</Refactor>
</Registry>
<Storage Action="Close" />
</GlobalImports> |
Next <Select GlobalSettings command in the template translation script. This will name the location off the GlobalSettings script. It will typically be placed prior to the Compile command, for example:
Code Block |
---|
<gmBasic> <Storage Action="Create" Identifier="%JobId%" /> ... <Select GlobalSettings="%UserFolder%\GlobalSettings.xml" /> <Compile Project="%SrcPath%" Resx="%ResxFolder%"> ... <Storage Action="Close" /> </gmBasic> |
When the translator encounters the GlobalSettings command, it will process the indicated script then load the resulting VBI file.
2) If two <Registry commands for the same type and source exist, they are merged
...
Detailed Description of Registry IMSLIB.Registry.EditFile.\test\App\src\App\Applications\glbl-modShift.bas with root address 15545: Property | Content -------- | ------- target | 15590: Text Registered via this entry: RecNo | Rai | nRec | Content ----- | --- | ---- | ------- 1 | 32 | 24 | <Fix name="EditFile"> 2 | 32 | 67 | <Replace status="active" name="Add Strong typing for Control 6"> 3 | 32 | 52 | <OldBlock><![CDATA[cmbIN As Control]]></OldBlock> 4 | 32 | 53 | <NewBlock><![CDATA[cmbIN As ComboBox]]></NewBlock> 5 | 32 | 13 | </Replace> 6 | 32 | 9 | </Fix>
...
Detailed Description of Registry IMSLIB.Registry.RefactorFile.\test\App\src\App\Applications\glbl-modMETSDBFunctions.bas with root address 15510: Property | Content -------- | ------- target | 15787: Text Registered via this entry: RecNo | Rai | nRec | Content ----- | --- | ---- | ------- 1 | 32 | 13 | <Refactor> 2 | 32 | 103 | <FixType identifier="FillFunctionPriorityCombo.cmbFunctionIN" type="ComboBox" Status="Dynamic" /> 3 | 32 | 72 | <FixType identifier="CheckCloseDB.dbIn" type="ADODB.Connection" /> 4 | 32 | 94 | <FixType identifier="modMETSDBFunctions.CheckCloseDB.dbIN" type="ADODB.Connection" /> 5 | 32 | 112 | <FixType identifier="modMETSDBFunctions.ClearBPUDisplay.lblArrayIN" type="Collection" status="Label" /> 6 | 32 | 17 | </Refactor>