Support Statement: Using GlobalIncludes

Purpose

The GlobalIncludes technique is a means of building a consistent, consolidated description of the symbols declared in the #include files of an ASP site.  This description is produced by analyzing the ASP site VBI files and saved as an IDF-like XML document.  If desired, the XML file can be edited manually to fine tune type data and other information. The XML file is then loaded in subsequent translations of either single pages or groups of pages from the site.    

Usage (gmGlobalIncludes.exe)

Starting with the March 2021 release, the GlobalIncludes feature is implemented using gmAPI and C# rather than gmSL and C.    The new approach is described in the sample gmIncludes script below.

 


<!--
Description: GlobalIncludes Analysis Reporting.

These script is used as part of the ASP GlobalIncludes process.
This process has five steps:

1. Run Page translations for all page files in your ASP site. 
   
   These translations may be optimized for type inference and
   other details and these optimizations will impact the 
   GlobalIncludes results. 
   
   The optimizations may be placed in a GlobalSettings script 
   used in the page translations.

2. Prepare GlobalIncludes.xml script like this one to process the 
   page file VBIs generated in step 1.
   
3. Run gmGlobalIncludes.exe as a gmStudio tool to process 
   the GlobalIncludes.xml script created in step 2.
   This will produce a GlobalIncludesReport.xml 
   report.
   
   You may run gmGlobalIncludes.exe by adding a Task to your
   gmProj file with the following TScript value:

      GlobalIncludes.xml/TOOL:gmGlobalIncludes.exe
      
   Typically this task will be the last one in your 
   solo page translation project you used in step 1.

4. Embed or <Include> the GlobalIncludesReport.xml content 
   in the GlobalSettings.xml script you used for page
   translations in step 1.
   
5. Register gmGlobalIncludes.exe as a gmBasic Utility 
   with the following commands in the SITE script:
   
   <Select GlobalSettings="%UserFolder%\GlobalSettingsWeb" />
   <gmMU Utility="%AppExeFolder%\gmGlobalIncludes.exe" events="FinishAnalyser"/>

Note that gmGlobalIncludes.exe is both a gmStudio Tool executed 
as a stand alone process and as a gmBasic Utility executed 
by gmBasic during the FinishAnalyser stage of the translation 
process.  

The process above should find the gmGlobalIncludes.exe 
in the gmStudio installation folder.  gmGlobalIncludes.exe uses a 
file called gmGlobalIncludes.vbi found in the same folder as 
the exe.  This VBI file is generated from gmGlobalIncludes.gmsl.

Contact GreatMigrations if you have questions or wish to use 
customize the GlobalIncludes process.
-->
   <Storage Action="Create" Identifier="GlobalIncludes" />
   <Select Target="%UserFolder%" />
   <Output Status="New" Filename="%UserFolder%\GlobalIncludesReport.xml" />  
   <GlobalIncludes>
      <VbiFile identifier="FMSWebSolo-401k_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-AccountSummary_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-browse_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-BuyStock_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-cart_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-ChartPortfolio_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-checkout_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-default_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-FindProduct_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-Home_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-Logout_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-news_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-OfflinePortfolio_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-Portfolio_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-SellStock_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-SellStockAction_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-SellStockReceipt_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-store_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-template_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-testRS_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-TickerDetail_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-TickerList_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-ViewProduct_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-_about_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-_GetXMLPortfolio_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-_GetXMLTickerHistory_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-_NewAccount_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-_runsql_asp-std-csh.vbi" />
      <VbiFile identifier="FMSWebSolo-_version_asp-std-csh.vbi" />
   </GlobalIncludes>
   <Storage Action="Close" />
</gmMU>


Usage (gmsl Deprecated))

  1. Prepare solo page translations for the page files in the site.  The resulting VBI files will be inputs to the GlobalIncludes process.  Adding FixTypes adn pre-edits to assist with getting good translations is acceptable.  Making the ASP.NET projects generated for the solo pages is also a good best practice.  You should also make sure the set of solo page VBIs are from "good" pages that are truly active within the site.  Junk/old pages create "bad data" that can interfere with getting good translations.  
     
  2. Prepare a GlobalIncludes script (see below) that will direct the tool to perform the global analysis VBI files and IDFs.
     
  3. Run the GlobalIncludes script  to produce the GlobalIncludes report .
     
    This operation requires a special gmBasic extension (AspGlobalIncludes.dll)
    This operation runs on the VBI files produced by page translations.
    It produces an IDF for the #includes detected in processing the site folder. 

  4. Unbundle the GlobalIncludes report 
     
  5. Modify the translation script to load the GlobalIncludes report.  This is typically done by the following

    in the a GlobalSettings file 

    <Include filename="..\usr\GlobalIncludes.xml" />)

    then in the Tscript: 

    <LoadRuntime Dllname="AspGlobalIncludes.dll" />
    <Select GlobalSettings="GlobalSettings" />
    <Select UseUserControls="on" />



Sample
<gmBasic>
<!--
This script will build interface definitions for include files in an ASP site.
The interfaces are used to author interfaces to support cross-references 
and prevent ambiguities between the classes for your generated ASP.NET site.
The output of this script is a <Registry type="GlobalInclude"> report
The report will be found in  %BndPath%.
The report maybe inserted into your GlobalSettings script.
-->
   <Storage Action="Create" Identifier="%MigName%_GlobalIncludes" />
   <Select progress="3" />
   <Select Target="%UserFolder%" />
   <LoadRuntime Dllname="AspGlobalIncludes.dll" />
   <Output Status="New" Filename="%BndPath%" />
<!-- 
This GlobalIncludes tells the tool where to find VBI files for 
the translated ASP pages.
-->
   <GlobalIncludes site="%ProjFolder%\log" />
   <Storage Action="Close" />
</gmBasic>