Workbench User Guide : Managing and Deploying Applications : How You Can Import and Export Applications and Components : Export an Individual Component
 
Share this page          
Export an Individual Component
In Workbench you can export an individual component from the Develop tab. You can save the file in text or XML format.
To export a component
1. Select the application containing the component to export in the Applications portlet of the Develop tab.
2. Select the component to be exported in the Components portlet.
3. Click File, Export.
The Export a Component dialog appears.
4. Set parameters for the specified component.
See the descriptions for each of these parameters in Parameters for the ExportComp Utility.
5. Click Go.
Note:  You can set defaults for this utility using the Set Tool Defaults dialog. see Set Defaults.
Parameters for the ExportComp Utility
You can specify the following parameters using the Export a Component dialog:
Output File Format
Specifies the format of the file to be exported:
EXP
Specifies OpenROAD proprietary ASCII format
XML (-xml)
Specifies XML format
Metadata (-xmeta)
Specifies whether metadata (AlterBy, AlterDate, Creator, CreateDate) should be exported with the component. If this parameter is not set, OpenROAD assigns no metadata to the exported component. To use this parameter, you must also specify XML as the file input format.
Output File
Specifies the path and name of the file (.exp or .xml) to which the component is being exported. By default, the name of the component is provided; overwrite this to change it. Click Browse to display a standard File Selection dialog so that you can save the file to a different location.
Username (-u)
Lets you use this command as if you were another user, username.
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 Exporting Components to a File (BackupApp)
To export a component to a file, start the BackupApp utility from the command line:
w4gldev backupapp out database application file [-nowindows]
    [-ccomponent | -l [-xml [-xmeta]] [-uusername] [-Lfilename] [-vversion]
    [-T{yes|yes,min|yes,logonly|all|all,min|all,logonly|no}] [-A] [-t]
For more information about including default attribute values and indenting XML elements when exporting, see Effect on File Size of Including Default Attribute Values and Indenting XML Elements.
The following parameters and flags are available from the command prompt:
out
Specifies the export 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 exported
file
Specifies the name of the file to which the component is being exported (.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 to be exported
-l
Directs the BackupApp utility to treat the file parameter as the name of a file containing a list of component name and component source file pairings (separated by a comma)
-xml
Specifies XML format
-xmeta
Specifies whether the original XML metadata (AlterBy, AlterDate, Creator, CreateDate) is exported to the XML component file. If this parameter is not included, OpenROAD assigns new metadata to the exported component. To use this parameter, you must also specify -xml as the file input 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.
-vversion
Specifies the version of the component to export
-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.
-t
Specifies that transactions are committed after each component is exported from the database
IMPORTANT!  Using this parameter decreases contention and log file use. However, if your database server terminates abnormally or the utility is aborted before completion, only some of the application components are exported.
An exit code of zero (0) means success; a non-zero exit code indicates an error.
Examples: ExportComp Utility
The following example exports a component, “comp1” from application “myapp” in the database “mydatabase,” in OpenROAD text format to the export file “comp1.exp”:
w4gldev backupapp out mydatabase myapp comp1.exp -ccomp1
The following example exports a component, “comp2” from application “myapp,” in XML format to the export file “mycomp.xml.” Metadata is not included in the file:
w4gldev backupapp out mydatabase myapp mycomp.xml -ccomp2 -xml
The following example exports a component, “comp3” from application “myapp,” to the export file “mycomp.xml.” Metadata is included in the mcomp.xml file:
w4gldev backupapp out mydatabase myapp mycomp.xml -ccomp3 -xml -xmeta
The following example exports the component source files and comma-separated component name and component source file pairings in the file “comps.lst”:
w4gldev backupapp out mydatabase myapp comps.lst -l
The file “comps.lst” contains the following content:
top, top.exp
proc1, proc1.exp
helloworld, hw.exp
This will export three components from the application “myapp” (in database “mydatabase”) into the following export files:
“top” is exported into the file “top.exp”
“proc1” is exported into the file “proc1.exp”
“helloworld” is exported into the file “hw.exp”