![]() |
![]() |
|
|
Importing Meta Data
XML Translator provides three utilities that allow you to import COBOL copybooks, convert C structure definitions into MFL Message Definition, and import FML Field Table classes. The following topics provide information on how to perform these types of imports.
Importing a COBOL Copybook
XML Translator includes a feature that allows you to import a COBOL copybook into Format Builder creating a message definition to translate the COBOL data. When importing a copybook, comments are used to document the imported copybook and the Groups and Fields it contains.
To import a COBOL copybook:
Figure 4-1 COBOL Copybook Importer
Table 4-1 COBOL Copybook Importer Field Descriptions
Once you have imported a copybook, you may work with it as you would any message format definition. If an error or unsupported data type is encountered in the copybook, a message is displayed informing you of the error. You can choose to display the error or save the error to a log file for future reference.
COBOL Copybook Sample Files
The following table provides a listing and description of the sample files installed for the COBOL Copybook Importer. All directory names are relative to the XML Translator installation directories.
Table 4-2 COBOL Copybook Sample Files
Directory |
File |
Description |
---|---|---|
samples\COBOL |
emprec5.cpy |
Sample Copybook file. |
samples\COBOL |
emprec5.data |
Test data corresponding to emprec5.cpy. |
Importing C Structures
XML Translator includes a C Struct importer utility that converts a C struct definition into an MFL Message Definition by generating the following two types of output data:
Both the MFL document and C code output methods require a .c or .h input file to be specified, parsed, and the desired structure selected before choosing whether to generate MFL (default) or C code.
In addition to the requirement that all input to the parser consist of valid C code, all outside references, such as #include(s), #define(s), and typedef(s) must be resolved prior to use. This may require hand editing or use of the compiler's pre-processor.
There are platform considerations that affect the description of data for C code. For example, the length of a long on a platform will affect the binary data that conforms to a particular structure definition.
There are two methods for dealing with these platform dependencies depending on whether or not MFL is generated directly into Format Builder. If you want to generate MFL and have that MFL displayed immediately in Format Builder, you must supply the platform dependent parameters in a configuration file. Alternately, by choosing to generate C code source, you may compile the C code on the desired machine. The compiler on that machine accounts for the necessary platform dependent information. This will produce an executable file that when run will produce an MFL document and binary data that conforms to that MFL in separate files. The MFL document can be opened in Format Builder and the binary data file can be opened in Format Tester.
Generating MFL directly into Format Builder requires platform configuration parameters found in an existing configuration file or a newly generated configuration file created with the hardware profile editor. The hardware profile editor allows you to specify an existing profile that can be loaded, updated, and saved.
The source code for a utility that generates hardware profiles according to your needs is provided in the samples\cgf subdirectory.
C Struct Importer Sample Files
The following table provides a listing and description of the sample files installed for the C Struct Importer. All directory names are relative to the XML Translator installation directory.
Table 4-3 C Struct Importer Sample Files
Starting the C Struct Importer To start the C Struct Importer:
Figure 4-2 C Struct Importer Dialog Box
The C Struct Importer dialog box opens with MFL specified as the default output and contains the following fields.
Table 4-4 C Struct Importer Field Descriptions
Figure 4-3 C Struct Importer Dialog Box
Understanding Hardware Profiles The hardware profiles used by the C Struct Importer contain data size and alignment information for specific hardware and compiler combinations and are used to generate MFL for C structures. They are stored in configuration files that can be created, loaded, updated, and saved. The cprofile.c source file located in the samples\cfg directory is used to generate these profiles for any platform. This code is designed to be compiled and executed on the target platform with the complier normally used and should compile and execute on any platform with an ANSI standard C compiler in order to generate a profile configuration file that can be imported into the C Struct Importer. Building the Hardware Profile Utility To produce acceptable parser input, execute the following commands for each of the platforms listed.
cl /P cprofile.c (output in cprofile.i)- VC++ Compiler
gcc -P -E cprofile.c>cprofile.i - GNU Compiler
cc -P cprofile.c (output in cprofile.i)
Running the Hardware Profile Utility
At a command prompt, enter the following text to execute the cprofile program and specify a hardware profile name:
cprofile configfilename [DESCRIPTION]
The optional description is placed in the configuration file as the DESCRIPTION value. If the description contains embedded blanks, enclose it in quotes.
Generating MFL
Perform the following steps to generate MFL.
Upon completion, the Structure list box is populated with the list of structures found in the input file.
Note: If your file does not parse correctly, it is recommended that you proceed in one of two ways:
At this point, you must provide some profile configuration data to generate the MFL directly. You can do this by creating a new hardware profile, or specifying an existing profile.
Note: hardware profiles for common configurations are prebuilt and may be found in the samples\c\cfg directory.
Figure 4-4 C Struct Importer Hardware Profile Dialog Box
If errors are detected during the generation process, the MFL Generation Errors dialog box displays providing you the opportunity to view or file the error log.
Figure 4-5 MFL Generation Errors Dialog Box
Once you have determined what errors were generated, you can return to the C Struct Importer and repeat the prior steps.
Generating C Code
Perform the following steps to generate C code.
Upon completion, the Structure list box is populated with the list of structures found in the input file.
Note: If your file does not parse correctly, it is recommended that you proceed in one of two ways:
Note: You must copy the input file containing the struct declarations as well. Both programs, when compiled, take an argument of the output file name.
Importing an FML Field Table Class
The FML Field Table Class Importer facilitates the integration of WebLogic Tuxedo Connector and WebLogic Process Integrator (Process Integrator). Tuxedo application buffers are translated to/from XML by the FML to XML Translator that is a feature of WebLogic Tuxedo Connector.
The integration of Weblogic Process Integrator with Process Integrator requires the creation of the XML that is passed between the WebLogic Tuxedo Connector translator and Process Integrator. To this end, you can use the FML Field Table Class Importer and the XML generation feature of Format Tester to facilitate the creation of the necessary XML.
FML Field Table Class Importer Prerequisites
Perform the following steps prior to starting Format Builder.
The samples/fml directory contains several fldtbl class fields that you can use as samples. These samples allow you to work through the following steps without having completed the previous three steps.
Note: These steps are normally done when configuring WTC, so these class files may already exist.
FML Field Table Class Sample Files
The following table provides a listing and description of the sample files installed for the FML Field Table Class Importer. All directory names are relative to the XML Translator installation directory.
Table 4-5 FML Field Table Class Sample Files
Creating XML with the FML Field Table Class Importer Perform the following steps to create an XML document with the FML Field Table Class Importer.
Because a single FML buffer may contain fields from several field tables, you can enter one or more fldtbl class name files in the Class Names field. The list should be comma separated and each name does not have to include the .class extension.
Note: If any of the listed classes are not fldtbl classes created by the weblogic/wtc/jatmi/mkfldclass utility, or are not in Format Builder's CLASSPATH, then an error dialog box is displayed. However, the valid fldtbl classes in the list will still be processed.
The created XML may be imported into Process Integrator by using the XML instance editor. Refer to the WebLogic Process Integrator documentation for information on importing XML.
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|