AMT Help Files

Command Line Interface

Exporting and Importing LionSource files can be automated by using the Command Line Interface of the AMT Developer Studio executable (Liondev.exe) in combination with a parameter file, which contains the actual information about what application/objects, generation sets etc., to export/import.

These pages describe the possibilities of the CLI and the parameter file options of Liondev.exe. Some examples can be found at the bottom of this page.


Command Line syntax

Liondev.exe IMP|EXP /FN:<Filename> [/HELP] [/LN:<Log name>] [/LP:<Log path>] [NOGUI] [SKIPDUP]


Parameters

Parameter Description 
IMP|EXP 

Determines whether an export or import must be executed. EXP for export and IMP for import. 

/FN:<Filename> 

Defines the settings file that must be used for the execution process. A path may be included.

See the chapter "Parameter File" further down on this page for help on reading or setting up a settings file. 

Examples:

  • /FN:import1.txt
  • /FN:process_settings\import.txt
  • /FN:C:\project\process_settings\import.txt

The upper two examples are called from the current path. The third example uses the specification “C:\” to indicate the root.

/HELP  Creates a help file in the subdirectory "Lion_export_import_logfiles", containing a summary of the available batch options for importing or exporting LION sources (depending on the specification <IMP | EXP>). 
/LN:<Log Name> 

Defines the log name. The <Log name> should be entered without an extension, since it will be extended automatically with “.log”, “.err” and/or “.dat”.

If the /LN argument is not added to the command String, the application will automatically generate a log name like:

  • imp_20050812_152018.log
  • imp_20050812_152018.err
  • imp_20050812_152018.dat
  • exp_20050812_152018.log
  • exp_20050812_152018.err
  • exp_20050812_152018.dat

The generated log name consists of a date and a time. This log is generated on: August 12, 2005. at 15:20:18 hours.

/LP:<Log Path> 

Defines the name of the log path. 

If the /LP argument is not added to the command String the application will save the log files in the folder: “lion_import_export_logfiles”. 

NOGUI 

If you want to export/import a lionsource in batch mode and you don't have a GUI environment like a scheduler has, an additional parameter is needed to successful export/import a lionsource, called: NOGUI. If not configured, this switch will be set to "FALSE".

For  instance:
C:\Lion\LionDev.exe EXP /FN:D:\Temp\Params.txt  /LN:logexp /LP:D:\Temp
will export a lionsource and you can see the progress.

If you create: 
C:\projecten\Lion\LionDev.exe EXP /FN:D:\Temp\Params.txt  /LN:logexp /LP:D:\Temp NOGUI
will export a lionsource and you can't see the progress. This way it is possible to use a scheduler or a batch. 

SKIPDUP 

When importing partial exports into an existing applications, objects with the same name and the same content will not get imported and thereby avoiding an unnecessary version increment. This option can also be set in the parameter file.

This argument can only used when importing partial exports into an existing application. In all other cases this argument will be ignored.

 

Parameter File

Settings for the importing and exporting are done through separate text files (parameter files). Some settings are mandatory. This may depend on whether an import or an export is concerned. 

The following settings can be done:

Name  Values  Description 
TYPE  ALL | APP | PAPP

Defines the type of export. This setting is mandatory if the file is used for export processes. When importing LION sources, the utility automatically recognizes the type of export. Therefore, this setting is not applicable for parameter files that are used for import processes. 

ALL: to export all the sources that are located in the repository that is used in your AMT Developer Studio environment.

APP: to export all the sources (from the repository that is used in your AMT Developer Studio environment) of the specified application. All the revisions that are available for the objects will be exported.

PAPP: to export only some specific sources of a specific applications generation set.

APPNAME  <Application name>

Defines the application name. This setting is mandatory if an import or export is concerned for a single application or a part of an application (meaning an export of type APP or PAPP).

APPOPT  TRUE | FALSE 

Determines whether application options must be picked up when doing a partial export (PAPP option). If this setting is omitted, the default value "FALSE" is used, meaning that application options are omitted in partial exports. (Replaces the sysopt setting which is still functional for compatibility.) 

DATAFILE  TRUE | FALSE

If set to “TRUE”, the application will generate a data file. The data file is designed in a manner that it is easy to use as an input file. If not configured, it will be set to “TRUE”. 

For more information on the syntax of the datafile messages see the help page Datafile Messages

ERRORFILE  TRUE | FALSE | IF

Determines if the application must generate an error file. There are tree options "TRUE", "FALSE" and "IF". If set to “IF” there will only be a generated error file if the export was not successful and/or there were faults. If not configured it will be set to “IF”. 

EXITONKEY  TRUE | FALSE

If set to “TRUE”, the export screen stays active after the export procedure has ended until a key stroke to exit the program. If using a batch file this option should be disabled. This way the application will close automatically. If not configured it will be set to “FALSE”.  

EXPORTTEXT  TRUE | FALSE

Determines if the export file must be created as a readable text document or not. A file exported as Text can not be imported anymore. If not configured, this switch will be set to “FALSE”. (Replaces the EXPORTASCII setting which is still functional for compatibility.) 

EXPORTUNICODE TRUE | FALSE 

When set to "TRUE", any Unicode characters included in the object(s)/application will be exported to the export file. When set to "FALSE", these characters will be lost which results in a smaller export file. When not configured, this switch will default to “TRUE”.

FNAME  <"File name(s)"> 

Defines the .Lionsource file(s) (which contains the exported LION sources). This setting is mandatory for all importing processes as well as for all exporting processes. In both cases it must contain the name of the .Lionsource file for the export itself. A path may be included.

For importing, multiple files can be defined in this setting, separated by commas(,) and wrapped in double quotation marks (""). When using multiple files, all the .Lionsource files must be of the same type/version. The objects of multiple files will be imported into the same application.
Example:
FNAME="D:\Sources\Forms.Lionsource","C:\AMT\Sources\Reports.Lionsource"

GENSET  <Generation set name> 

Defines the generation set name to export objects of for export and the generation set to create on import.

Note: This setting is mandatory only if a partial application export is concerned (meaning an export of the type PAPP). 

LOADSHORTCUTS  TRUE | FALSE

This switch determines if the shortcuts must be loaded. If not configured it will be set to “FALSE” as default. This switch only applies to parameter files that are used for importing. 

LOGFILE  TRUE | FALSE | IF Determines if the application must generate a log file. There are three options "TRUE", "FALSE" and "IF". If set to “IF”, a log file will only be generated if the export has been executed successfully without any faults. If not configured, it will be set to “IF”. 
NEWGENSET  TRUE | FALSE

If this switch is set, the application creates a new genset if the defined genset does not exist in the specified application. If not configured it will be set to “FALSE”. This switch only applies to parameter files that are used for importing. 

Object specifications 
 

Specifications of the objects that must be exported or imported. These specifications can only be used if a partial export (file) is concerned (meaning that the export TYPE is set to PAPP). If all objects of a certain type must be imported or exported, this can be indicated with the argument "ALL". Multiple objects of the same type are always delimited by a space. 

For more information on the syntax of the object specifications see the help page Object Specifications

PRETEST  TRUE | FALSE

If set to "TRUE", the procedure of exporting will take place without actually generating an export file. This way it is possible to test the parameter file. If not configured it will be set to “FALSE”. 

SKIPDUP  TRUE | FALSE

If set to "TRUE, this option will prevent overwriting existing objects with the same name, when the objects are identical (e.g. identical code content for a report). This prevents unnecessary increments of the objects version number.

STOPONLOCKED  TRUE | FALSE

If set to “TRUE”, the application will not initiate the import or export sequence if there are locked objects. If not configured it will be set to “FALSE”. 

STOPONNOTFOUND  TRUE | FALSE 

If set to “TRUE”, the application will not initiate the export sequence if there are no objects found. If not configured, it will be set to “FALSE”. 

STOPONOBJFAULT  TRUE | FALSE 

If set to “TRUE”, the application will not initiate the import sequence if there are object definition faults. If not configured it will be set to “FALSE”. 

 

Parameter File Examples:

File for importing sources

 
  FNAME=D:\Sources\DEMO2_REPS.LionSource
  APPNAME=DEMO2
  GENSET=Default from new application
  FO:MENU
  RE:REPORT(1.2.1.1)
  RE:REPORT2
  EXITONKEY=TRUE
  LOGFILE=TRUE
 

PAPP Parameter file for export

 
  TYPE=PAPP
  FNAME=D:\Sources\export_papp.lionsource
  APPNAME=DEMO2
  GENSET=DEVELOPMENT
 
  FO: COUNTRIES PRODUCTS SALES
  GR: IR_HEADER IR_HOME STARTUP
  IN: I_COUNTRY I_TODO I_VENDORN
  RA: ALL
  RE: FILLREPORT R_OVVSALES IREP_HEADER
  TA: T_BUY T_COUNTRY T_TODO
 
  LOGFILE=IF
  ERRORFILE=IF
  DATAFILE=TRUE
  EXITONKEY=FALSE
  EXPORTTEXT=FALSE
  PRETEST=FALSE
  STOPONLOCKED=FALSE
  STOPONNOTFOUND=FALSE
  NEWGENSET=FALSE
  LOADSHORTCUTS=FALSE
 

PAPP Parameter file for import

 
  FNAME=D:\Sources\export_papp.lionsource
  APPNAME=DEMO2
  GENSET=DEVELOPMENT
 
  FO: IF_OK IF_OKCANCEL(1.5) COUNTRIES CUSTCOUNTRY CUSTOMERADD
  GR: IR_HEADER
  RE: R_OVVSALES(1.3.1.1) IREP_HEADER
 
  LOGFILE=IF
  ERRORFILE=IF
  DATAFILE=TRUE
  EXITONKEY=FALSE
  NEWGENSET=FALSE
  LOADSHORTCUTS=FALSE
  PRETEST=FALSE
  STOPONLOCKED=FALSE
  STOPONNOTFOUND=FALSE
  STOPONOBJFAULT=FALSE
 

 

Exit codes

LionDev.exe supports the following exit codes:

Exit code: Description:
0 No error.
97 Database version is incorrect.
98 Error connecting to the database.
99 Exception is thrown while connecting to the database.
100 Error with the Lion.Lic license file.

These exit codes can be accessed by using the ERRORLEVEL command in batch files.