Modify action defaults

To modify the action defults of a generated Genero application, add a Genero action defaults file (*.4ad) to your BAM project.

The action defaults are initially defined by a default Genero action defaults file (.4ad) located in the styles sub-directory of the template set directory. Two default files are provided, dbapp.4ad for desktop applications and mobile_dbapp.4ad for mobile applications.

To add a new, custom Genero action defaults file:

  1. Select File > New.
    The Select an item dialog opens.
  2. Select either Genero BAM Desktop or Genero BAM Mobile, depending on what type of BAM application you are working with.
  3. Under the Resources section, select Action Defaults (.4ad).
    An untitled Genero action defaults file with a .4ad extension displays in the central workspace. This file is based on the Genero action defaults file for the selected template set.
  4. Modify the Genero action defaults file by adding, modifying,or deleting actions and action attributes.
    For details regarding the syntax of a Genero action defaults file, see the Genero Business Development Language User Guide.
  5. Save the modified file to your project.
    Save the file to the Resources folder in your project and to the '$(ProjectDir)/resources' folder on disk. You can save using the default filename of the Genero action defaults file for a generated app or you can specify a different name.
    The default name expected for a Genero action defaults file is either dbapp.4ad for desktop applications or mobile_dbapp.4ad for mobile applications. If you use a default name, Genero Studio will ignore the template default and use your file at runtime.
    If you save your file using a different name, you must find the BLOCK in the generated code that calls the ui.Interface.loadActionDefaults() method and change the parameter name to the name of your new file. This generated code is found in the application's MAIN module, and the filename can be defined using the l_actionDefaults variable. For example, if your Genero action defaults file is named myActionDefaults.4ad, you would add the following code to the MAIN module:
    {<POINT Name="MAIN.define" Status="MODIFIED">}
    LET l_actionDefaults="myActionDefaults"
  6. To deploy to the GAS, you create a Genero archive file (*.gar). You must update the packaging rules to have your custom Genero action defaults file (*.4ad) included in the Genero archive.
    Package rules define what files are included in the Genero archive (*.gar). Under the Application_GAR package node, the Resources_dbapp and Resources packaging directories manage the packaging of the Genero action defaults files (*.4ad).
    • For the packaging directory Resources_dbapp, all Genero action defaults files (*.4ad) are copied from '$(GSTSETUPDIR)/styles' to '$(RootDir)'. This rule copies the template default dbapp.4ad and mobile_dbapp.4ad files to your package.
    • For the packaging directory Resources, all Genero action defaults files (*.4ad) are copied from '$(ProjectDir)/resources' to '$(RootDir)'. This rule copies any Genero action defaults file you saved in '$(ProjectDir)/resources' to your package.
    If you used the default filename of dbapp.4ad or mobile_dbapp.4ad, you have two options.
    1. Exclude or update one of the packaging directories to keep only the dbapp.4ad or mobile_dbapp.4ad file you want to package.
      For example, to only keep your customized dbapp.4ad or mobile_dbapp.4ad, you need to either exclude the Resources_dbapp packaging directory, or update the definition to exclude copying *.4ad files. To exclude a packaging directory, select the Exclude from package property.
      If you simply exclude the packaging directory, it will exclude all template resource files, not just the Genero action defaults file dbapp.4ad and mobile_dbapp.4ad
      This is the easier of the two methods.
    2. Package dbapp.4ad or mobile_dbapp.4ad in a directory other than '$(RootDir)' by changing the properties of the Resources packaging directory.
      For example, you could update the Destination directory property to specify that the Genero action defaults file (*.4ad) be moved from '$(ProjectDir)/resources' to '$(RootDir)/resources', then update your application configuration (.xcf) to include this new destination directory in its FGLRESOURCEPATH:
      You would also update the Resources_dbapp packaging directory to ensure the the Include files property does not include a default Genero action defaults file. You can simply remove "*.4ad" from the included files list.
      This is the harder of the two methods. You can consider this option if you want to reflect the structure of the sources in the destination; however, it complicates the configuration and requires an update of the configuration file.
    If you used a filename other than the default (dbapp.4ad or mobile_dbapp.4ad), your next steps will depend on whether you saved your file in the recommended '$(ProjectDir)/resources' directory or an alternate directory.
    1. If you saved your file in the recommended '$(ProjectDir)/resources' directory, there is no need to create or modify any packaging directory node. The defaults for the Resources packaging directory ensures that your custom Genero action defaults file is copied to the package.
    2. If you saved your file in a different directory than '$(ProjectDir)/resources' , add a new packaging directory node, where you will:
      • Set the Source directory property to the directory containing your Genero action defaults file.
      • Set the Include files property to include "*.4ad"; you can be specific and include only your custom filename.
      • Set the Destination directory property to '$(RootDir)'.