In this section the user adds a new XML schema file and XML schema components to the BPEL Module project.
The XML schema allows you to visualize and edit XML schemas. Using the XML schema, you can reference external schemas and use advanced queries to analyze the schemas.
GlassFish ESB comes bundled with a rich set of tools to work with various XML documents such as XML Schema, WSDL, BPEL, and XML instance documents. The tools provide several options to edit and visualize XML documents. In addition it also provides refactoring support, search, queries and find usage, seamless navigation between views, design pattern and schema aware code completion support.
Using the XML schema functionality, you can:
Rapidly design complex types and elements, across multi-file schemas using the Design view.
Easily navigate deep schema structures using the Schema view.
Rapidly create WSDL documents using the WSDL editor.
Expand the project node. Right-click either the BPEL Module node or Process Files. Choose New —> Other in the Projects Window.
The New File wizard opens.
In the New File wizard, perform the following:
Select the XML node in the Choose File Type page — Categories list. Select the XML Schema node in the File Types list and click Next.
Type the File Name in the File Name field.
For example, bookInventory
Click Finish.
In the Projects window, the Process Files node now contains a subnode labeled bookInventory.xsd. The Source Editor contains a tab for the XML schema file named bookInventory.xsd. The Schema view for this file is also displayed.
Click the Design button to open the Design view of the XML schema editor.
Select the Complex Types node in the first column of the Schema view.
Right-click and choose Add Complex Type...
This opens the Add Complex Type dialog box.
Type the name in the Name field.
For example, author
Click OK.
Select the Complex Types —> author in the Schema view. Right-click on either author or sequence and choose Add —> Element...
This opens Add Element dialog box.
Type the Name of the Element.
For example, firstname
Type from the list of radio button options. In the current example, choose the Use Existing Type radio button. In the listing area beneath the Type radio button, expand the Built-in Types node. Select string.
Click OK.
The Schema view now contains a node for the firstname element, whose parent is the sequence under the author Complex Types.
Click Save All.
Similarly, create another Element — lastname. Repeat steps 1 through 5.
Click Complex Types — Add Complex Type...
Type Name: book
Click OK.
Click either Complex Types: book or sequence —> Add —> Element —> genre
Use Existing Types —> Build-in Types —> string
Click either Complex Types: book or sequence —> Add —> Element —> title
Use Existing Types —> Build-in Types —> string
Click either Complex Types: book or sequence —> Add —> Element —> author
Use Existing Types —> Complex Types —> author
In the current example, the author is a Global Complex Type because it comprises of two Element Types (firstname and lastname).
Click either Complex Types: book or sequence —> Add —> Element —> price
Use Existing Types — Build-in Types — double
Click either Complex Types: book or sequence —> Add —> Element —> quantity
Use Existing Types — Build-in Types — unsignedInt
Select Elements in the first column of the Schema view.
Right-click and choose Add Element...
This opens Add Element dialog box
Type the Name of the Element.
For example, bookstore
Select the Use Existing Type radio button. In the listing area beneath the Type radio buttons, expand the Complex Types node. Select book.
For example, book
In the current example, book is a Global Complex Type because it comprises of five Element Types (genre, titles, author (Global Complex Type), price, and quantity).
Click OK.
Click Save All.