Defining the Schema for a DTD File Structure

6-110 Oracle Fusion Middleware Users Guide for Technology Adapters Figure 6–64 Native Format Builder Wizard File Description Page

7. Click Next. The Generated Native Format File page is displayed, as shown in

Figure 6–65 . Figure 6–65 Native Format Builder Wizard Field Properties Page The following is the sample native schema that is generated: ?xml version=1.0 encoding=UTF-8 ? --This Schema has been generated from a DTD. A target namespace has been added to the schema.-- xs:schema xmlns:xs=http:www.w3.org2001XMLSchema targetNamespace=http:TargetNamespace.comReadUI xmlns=http:TargetNamespace.comReadUI nxsd:version=DTD xmlns:nxsd=http:xmlns.oracle.compcbpelnxsd xs:element name=GlobalDatabaseName type=xs:string Native Format Builder Wizard 6-111 xs:element name=DatabaseAttributes xs:complexType xs:attribute name=Type use=required xs:simpleType xs:restriction base=xs:NMTOKEN xs:enumeration value=Production xs:enumeration value=Development xs:enumeration value=Testing xs:restriction xs:simpleType xs:attribute xs:attribute name=Version use=optional default=9i xs:simpleType xs:restriction base=xs:NMTOKEN xs:enumeration value=7 xs:enumeration value=8 xs:enumeration value=8i xs:enumeration value=9i xs:restriction xs:simpleType xs:attribute xs:complexType xs:element xs:element name=Comments type=xs:string xs:element name=Administrator xs:complexType xs:simpleContent xs:extension base=xs:string xs:attribute name=EmailAlias use=required type=xs:string xs:attribute name=Extension use=optional type=xs:string xs:extension xs:simpleContent xs:complexType xs:element xs:element name=OracleSID type=xs:string xs:element name=DatabaseName xs:complexType xs:sequence xs:element ref=GlobalDatabaseName xs:element ref=OracleSID xs:element ref=DatabaseDomain xs:element maxOccurs=unbounded ref=Administrator xs:element ref=DatabaseAttributes xs:element ref=Comments xs:sequence xs:complexType xs:element xs:element name=DatabaseDomain type=xs:string xs:element name=DatabaseInventory xs:complexType xs:sequence xs:element maxOccurs=unbounded ref=DatabaseName xs:sequence xs:complexType xs:element xs:schema

8. Click Next. The Native Format Builder Finish page is displayed.

6-112 Oracle Fusion Middleware Users Guide for Technology Adapters

9. Click Finish. The Adapter Configuration Wizard Messages page is displayed

containing the generated NXSD.

6.4.9 Defining the Schema for a COBOL Copybook File Structure

This use case shows how the Oracle File and FTP Adapters process a file in COBOL Copybook format through use of the Native Format Builder wizard to create a native schema file for translation. The following COBOL Copybook examples are provided: ■ Multiple Root Levels ■ Single Root Level, Virtual Decimal, Fixed-Length Array ■ Variable Length Array ■ Numeric Types Multiple Root Levels A COBOL Copybook can have multiple root levels. If all root levels are at 01 level, then each such group implicitly redefines the other. In this use case, the Native Format Builder uses a fixed-length file type, po-ccb.cpy, that contains the purchase order details such as buyer name, address, and items. Every element in this po-ccb.cpy native file has a fixed length. The data in the sample text file, po-ccb.cpy, appears as follows: 05 PO-RECORD. 10 PO-BUYER. 15 PO-UID PIC 97. 15 PO-NAME PIC X15. 15 PO-ADDRESS. 20 PO-STREET PIC X15. 20 PO-CITY PIC X10. 20 PO-ZIP PIC 95. 20 PO-STATE PIC X2. 10 PO-ITEM. 15 POITEM OCCURS 3 TIMES. 20 PO-LINE-ITEM. 25 PO-ITEM-ID PIC 93. 25 PO-ITEM-NAME PIC X40. 25 PO-ITEM-QUANTITY PIC 92. 25 PO-ITEM-PRICE PIC 95V92. 10 PO-TOTALPIC 97V92. You can generate the corresponding NXSD and also test it. Perform the following steps to run the use case: 1. Get the following files from the artifacts.zip file contained in the Adapters-105CobolCopyBook sample. ■ artifactssamplespo-ccb.cpy ■ artifactssamplespo-ebcdic.data You can obtain the Adapters-105CobolCopyBook sample by accessing the Oracle SOA Sample Code site and selecting the Adapters tab. Copy these files to your samples directory. Native Format Builder Wizard 6-113 2. Launch the Adapter Configuration Wizard and navigate to the Messages page, as displayed in Figure 6–4 , and click Define Schema For Native Format. The Native Format Builder Welcome page is displayed, as shown in Figure 6–5 .

3. Click Next. The Choose Type page is displayed, as shown in

Figure 6–26 .

4. Select Cobol Copybook to be converted to native format. The Choose Type page

is displayed, as shown in Figure 6–66 . Figure 6–66 Native Format Builder Wizard Choose Type Page

5. Click Next. The Native Format Builder Cobol Copybook Description page is

displayed.

6. Click Browse and select the po-ccb.cpy file, as shown in

Figure 6–67 . Figure 6–67 Native Format Builder Wizard File Description Page