Workbench User Guide : Managing and Deploying Applications : How You Can Import and Export Applications and Components : Import an Application
 
Share this page          
Import an Application
The ImportApp utility lets you copy an entire application from a previously exported text or XML file into a database.
You should run the ImportApp utility with a value for the -n parameter (described in Parameters for the ImportApp Utility) to resolve name conflicts between imported and existing applications and components. Such conflicts can arise in any of the following situations:
If the name of a component being merged into an existing application already exists in that application
If you create a new application with the same name as an application that already exists in the database
The most efficient method of accessing the ImportApp utility is from the Develop tab of Workbench.
To import an application
1. Click the header bar of the Applications portlet on the Develop tab to make it the active portlet.
2. Click File, Import.
The Import an Application dialog appears.
3. Set parameters for the specified application.
See the descriptions for each of these parameters in Parameters for the ImportApp Utility.
4. Click Go.
Parameters for the ImportApp Utility
You can specify the following parameters using the Import an Application dialog:
Input File Format
Specifies the format of the application file to be imported:
EXP
Specifies OpenROAD proprietary ASCII format
XML (-xml)
Specifies XML format
Any
Allows OpenROAD to determine the format of the application file. OpenROAD first tries to import using its proprietary format; if this fails, it imports using XML format.
Input File
Specifies the name of the file from which the application is being imported. Click Browse to display a standard File Selection dialog.
Application Name
Specifies the name of the application that is to be created or merged into
Name Conflict (-n)
Specifies how to treat name conflicts with one of the following values:
Abort
Directs OpenROAD to abort this utility and to back out any components that were already added
Replace
Replaces the old component with the new component
Version
Specifies that if an application or application component being imported already exists, the existing application or component is versioned before being replaced
Default: Abort
Display Errors (-e)
If any component has compilation errors, causes OpenROAD to write the component's 4GL script and any errors to the Trace window
Treat Warnings as Errors (-w)
Instructs OpenROAD to treat compiler warnings as errors
Merge (-m)
Merges the components from the input file into the existing application
Transaction (-t)
Specifies that transactions are committed after each component is added to the database
IMPORTANT!  Using this parameter decreases contention and log file use. However, if your database server crashes or the ImportApp utility is aborted before completion, only some of the application components are loaded.
Force Compilation (-f)
Forces compilation of the application components before they are loaded into the database.
If there is a compilation error, the component is still loaded into the database, but is marked as “out of date.”
If you do not include this parameter, components are copied into the database marked “out of date,” and are compiled the first time you compile or run the application.
Username (-u)
Lets you use this command as if you were another user, username. This entry field can be used only if Execute in Background is enabled.
Note:  You, not username, own all files created by OpenROAD.
Log Path (-L)
Specifies the name of a log file. This entry field can be used only if Execute in Background is enabled and Trace Window is set to Yes. If the log path specified is not a full path, the file is created in the ingres\files directory.
Trace Window (-T)
Lets you control display of the Trace window by entering one of the following values:
All
Specifies that the Trace window does appear
Yes
Specifies that the Trace window appears but suppresses informational messages output by the system
Yes (Minimized)
Specifies that the Trace window appears minimized as an icon
No
Specifies that the Trace window does not appear, and a log file is not created
Note:  This entry field can be used only if Execute in Background is enabled.
Append to Log File (-A)
Appends the trace output of the current command to the end of the existing error log file. Otherwise, that log file is replaced. This entry field can be used only if Execute in Background is enabled.
Note:  The error log file, w4gl.log, is located in %USERPROFILE%\AppData\Local\OpenROAD\Profiles\installation_ID. If the -L flag is passed, a new name and location can be provided for the OpenROAD log file.
Execute in Background
Begins a new process while you are using this utility.
If enabled, Execute in Background makes Username, Log Path, Trace Window, and Append to Log File available for use.
Note:  You can set defaults for this utility using the Set Tool Defaults dialog. see Set Defaults.
Command Line Method of Importing an Application from a File (BackupApp)
To import an application from a file, start the backup app utility from the command line:
w4gldev backupapp in database application file
    [-nowindows] [-xml] [-uusername] [-Lfilename] [-e] [-f]
    [-n{prompt|abort|replace|version}] [-m] [-t]
    [-T{yes|yes,min|yes,logonly|all|all,min|all,logonly|no}] [-A]
The following parameters and flags are available from the command prompt:
in
Specifies the import mode of the BackupApp utility
database
Specifies the name and location of the database in which the application resides
application
Specifies the name of the application to import
file
Specifies the name of the file from which the application or component is being imported
-nowindows
Lets the application run without the window manager running. This option does not provide full batch mode execution, because some interaction with the application still may be required through the Trace window.
-xml
Specifies XML format
-uusername
Lets you use this command as if you were another user, username.
Note:  You, not username, own all files created by OpenROAD.
-Lfilename
Specifies the name of a log file. If the log path specified is not a full path, the file is created in the %II_SYSTEM%\ingres\files directory.
-e
Specifies that the component's 4GL script and any errors should be written to the Trace window, if any component has compilation errors
-f
Forces compilation of the application components before they are loaded into the database.
If there is a compilation error, the component is still loaded into the database, but is marked as “out of date.”
If you do not include this parameter, components are copied into the database marked “out of date,” and are compiled the first time you compile or run the application.
-noption
Specifies how to treat name conflicts. The option can be one of the following values:
prompt
Requests a prompt when there is a conflict
abort
Directs OpenROAD to abort this utility and to back out any components that were already added
replace
Replaces the old component with the new component
version
Specifies that if an application or application component being imported already exists, the existing application or component is versioned before being replaced
Default: abort
-m
Merges the components from the input file into the existing application
-t
Specifies that transactions are committed after each component is added to the database
IMPORTANT!  Using this parameter decreases contention and log file use. However, if your database server crashes or the ImportApp utility is aborted before completion, only some of the application components are loaded.
-T
Controls the display of the Trace window by entering one of the following values:
yes
Specifies that the Trace window appears but suppresses all informational system messages
yes,min
Specifies that the Trace window appears minimized as an icon, and all informational system messages are suppressed
yes,logonly
Specifies that the Trace window does not appear, but all messages are saved in a log file without informational system messages
all
Specifies that the Trace window does appear and all messages are written
all,min
Specifies that messages are written to the Trace window, which appears minimized as an icon
all,logonly
Specifies that the Trace window does not appear, but all messages are saved in a log file
no
Specifies that the Trace window does not appear, and no log file is created
-A
Appends the trace output of the current command to the end of the existing error log file.
Note:  The error log file, w4gl.log, is located in %II_SYSTEM%\ingres\files.
An exit code of zero (0) means success; a non-zero exit code indicates an error.
Examples: ImportApp Utility
The following example imports an application, “myapp,” from the export file “myapp.bck.” This command also forces the application components to be compiled before being loaded into the database:
w4gldev backupapp in mydatabase myapp myapp.bck -f
The following example replaces the “myapp” application in mydatabase with the application contained in the file “myapp.bck”:
w4gldev backupapp in mydatabase myapp myapp.bck -nreplace
The following example imports the “myapp” application in “mydatabase” with the application contained in the file “myappxml.xml”:
w4gldev backupapp in mydatabase myapp myappxml.xml -xml