bea.com | products | dev2dev | support | askBEA |
|
e-docs > WebLogic Platform > WebLogic Integration > DI Topics > Translating Data > Importing Metadata |
Translating Data |
Importing Metadata
WebLogic Integration provides utilities that allow you to import COBOL copybooks, convert C structure definitions, and convert FML field table classes into MFL files. The following topics explain how to perform these import operations:
Importing a COBOL Copybook
WebLogic Integration includes a feature that allows you to import a COBOL copybook into Format Builder by creating a message definition to translate the COBOL data. When importing a copybook, you can use comments to document the imported copybook and the Groups and Fields it contains.
To import a COBOL copybook:
Figure 4-1 COBOL Copybook Importer
After you import a copybook, you can work in the same way you work with any message format definition. If you find an error or unsupported data type in the copybook, a message is displayed, informing you of the error. You can choose to have the error displayed or saved in a log file for future reference.
The following table provides a listing and descriptions of the sample files installed for the COBOL copybook importer. All directory names are relative; the specified directories are under under SAMPLES_HOME\integration\samples\di where SAMPLES_HOME is the samples directory in your WebLogic Platform installation.
Importing C Structures
WebLogic Integration includes a C struct importer utility that converts a C struct definition into an MFL message definition by generating the following types of output data:
Whichever type of output you want, you must first specify a .c or .h input file, which must be parsed, and then select the desired structure. Then you can choose between MFL (default) or C code for your output.
All input to the parser must be valid C code. In addition, all external references, such as #include, #define, and typedef statements, must be resolved before you can use them. You can resolve them by editing them manually or by using the compiler's preprocessor.
Various platform-specific parameters may affect the description of data for C code. For example, the length of a long on a particular platform affects the binary data that conforms to a particular structure definition.
Two methods are available 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, if you choose to generate your source in C, you may compile the C code on the desired machine. The compiler on that machine accounts for the necessary platform-dependent information. This approach allows you to produce an executable file that, when run, produces two files: an MFL document and binary data that conforms to that MFL. 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 new 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_HOME\integration\samples\di\cfg directory.
Sample C Struct Importer Files
The following table provides a listing and descriptions of the sample files installed for the C struct importer. All directory names are relative; the specified directories are under SAMPLES_HOME\integration\samples\di.
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 allows you to specify import properties, as described in the following table.
Note: Initially, MFL is specified as the default output type.
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 in the SAMPLES_HOME\integration\samples\di\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 compiler normally used. You should be able to compile and execute it 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 appropriate commands for your platform:
VC++ Compiler
cl /P cprofile.c (output in cprofile.i)
GNU Compiler
gcc -P -E cprofile.c>cprofile.i
cc -P cprofile.c (output in cprofile.i)
Running the Hardware Profile Utility
To execute the cprofile program and specify a hardware profile name, enter the following text at a command prompt:
cprofile configfilename [DESCRIPTION]
A description is optional. If you decide to provide one, put it in the configuration file as the value of DESCRIPTION. If the description contains embedded blanks, enclose it in quotes.
Generating MFL
To generate MFL:
After you determine which errors were generated, you can return to the C Struct Importer and repeat the applicable steps.
Generating C Code
To generate C code:
Importing an FML Field Table Class
The FML Field Table Class Importer facilitates the integration of WebLogic Tuxedo Connector and business process management (BPM) functionality. Tuxedo application buffers are translated to and from XML by the FML to XML Translator that is a feature of WebLogic Tuxedo Connector.
The integration of Tuxedo with BPM functionality requires the creation of the XML that is passed between the WebLogic Tuxedo Connector Translator and the process engine. To create the necessary XML, use the FML Field Table Class Importer and the XML generation feature of Format Tester.
FML Field Table Class Importer Prerequisites
Before starting Format Builder:
The SAMPLES_HOME\integration\samples\di\fml directory contains several fldtbl class fields that you can use as samples. These samples allow you to start Format Builder without completing the previous three steps.
Note: Because most users perform these steps when configuring WebLogic Tuxedo Connector, these class files may already exist.
Sample FML Field Table Class Files
The following table provides a listing and descriptions of the sample files installed for the FML Field Table Class Importer. All files are in the SAMPLES_HOME\integration\samples\di\fml directory.
Creating XML with the FML Field Table Class Importer To create an XML document with the FML Field Table Class Importer: Note: If you create Java classes using WebLogic Tuxedo Connector, you can place the .class files in the \ext directory. You can then populate the Available Fields list automatically from the FML Field Table Class Importer dialog box.