Was this helpful?
Import an Individual Component
In Workbench you can import an individual component into an existing application. To import a single component, you must have previously exported that individual component to a separate text or XML file.
Note:  You can set defaults for this utility using the Set Tool Defaults dialog. see Set Defaults.
To import a component
1. Click the application into which you want to import the component on the Applications portlet of the Develop tab.
2. Click the Components header bar to activate the portlet.
3. Click File, Import.
The Import a Component dialog appears.
4. Click Browse to locate and select the .exp or .xml file containing the component you want to import.
A standard File Selection dialog appears.
5. Set parameters for the specified component.
See the descriptions for each of these parameters in Parameters for the ImportComp Utility.
6. Click Go.
Parameters for the ImportComp Utility
You can specify the following parameters using the Import a Component dialog:
Input File Format
Specifies the format of the application file to be imported:
EXP
Specifies the 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 path and name of the file from which the component is being imported. Click Browse to display a standard File Selection dialog.
Component Name (-c)
Specifies the name of the component 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 not import the component
Replace
Replaces the old component with the new component
Prompt
Requests a prompt when there is a conflict
Version
Specifies that if an 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 Warnins as Errors (-w)
Instructs OpenROAD to treat compiler warnings as errors
Force Compilation (-f)
Forces compilation of the application component before it is 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, the component is copied into the database marked “out of date,” and is 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 %II_SYSTEM%\ingres\files.
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 Components from a File (BackupApp)
To import one or more components from a file, start the BackupApp utility from the command line:
w4gldev backupapp in database application file [-nowindows]
    [-ccomponent | -l] [-Lfilename] [-xml] [-uusername] [-e] [-w] [-f]
    [-n{prompt|abort|replace|version}]
    [-T{yes|yes,min|yes,logonly|all|all,min|all,logonly|no}] [-Ttitletitle] [-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 from which the component is being imported
file
Specifies the name of the file from which the component is being imported (.exp or .xml)
-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.
-ccomponent
Specifies the name of the component that is to be created or merged into
-l
Directs the ImportComp utility to treat the file parameter as the name of a file containing a list of component source files or component name and component source file pairings (separated by a comma)
-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. You may include the following replacement parameters in the file name.
%p
Replaced by the Process Identifier (PID)
%d
Replaced by the current date in YYYYMMDD format
%t
Replaced by the current time in HH_MM_SS format
-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.
-e
Specifies that the component's 4GL script and any errors should be written to the Trace window, if any component has compilation errors
-w
Instructs OpenROAD to treat compiler warnings as errors
-f
Forces compilation of the application component before it is 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, the component is copied into the database marked “out of date,” and is 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 not import the component
replace
Replaces the old component with the new component
version
Specifies that if an application component being imported already exists, the existing application or component is versioned before being replaced
Default: abort
-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
-Ttitletitle
Replaces the title of the OpenROAD Trace window with title. If the title contains spaces, you must enclose it with single or double quotes.
-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: ImportComp Utility
The following example imports a frame, TestFrame, from the file “testframe.frm” into the “myapp” application, and prompts the user if the frame already exists in the application:
w4gldev backupapp in mydatabase myapp testframe.frm -ctestframe -nprompt
The following example imports the backup version of the “myapp” application and merges all the components into the “bigapp” application. If any components in bigapp have the same names as those in myapp, it replaces them with the components from myapp:
w4gldev backupapp in mydatabase bigapp myapp.bck -m –nreplace
The following example imports a component, “comp1” from application “myapp,” from the export file “myapp.bck.” This command also forces the application component to be compiled before being loaded into the database:
w4gldev backupapp in mydatabase myapp myapp.bck -ccomp1 -f
The following example imports a component, “comp2” from application “myapp” in “mydatabase,” from the export file “mycomp.xml”:
w4gldev backupapp in mydatabase myapp mycomp.xml -ccomp2 -xml
The following example imports the component source files and comma-separated component name and component source file pairings in the file “comps.lst”:
w4gldev backupapp in mydatabase myapp comps.lst -l
The file “comps.lst” contains the following content:
top.exp
proc1, proc1.exp
HelloWorld, hw.exp
Last modified date: 06/25/2024