Importing Schemas

In this task, you import your schemas into your application. The following schema types are supported:

When a schema (described in an XSD or MFL file) is imported into your application, representations of these schemas are available in some of the panes of WebLogic Workshop. In addition, Java interfaces for accessing the data represented in the schemas are generated. To learn more about these Java classes see Java Classes Created From Importing Schemas.

Note: Due to a Windows operating system limitation on file path lengths (256 characters), you might have trouble compiling schemas in which the generated types are nested in a very deep package hierarchy. This may result in an error message stating that a particular class couldn't be found. To work around this limitation, try using an xsdconfig file to guide the naming of generated packages so that the hierarchy is less deep, package names are shorter, etc. For more information, see How Do I: Guide XMLBeans Type Naming During Schema Compilation?.

Importing an XML Schema (XSD file)

When an XSD file (which contains an XML Schema) is imported into a Schema project folder of a WebLogic Workshop application, a build of the application is triggered which generates XMLBeans based on the imported XML Schema. The XML Beans provides Java classes for accessing the XML data that conforms to the imported XML Schema. These Java classes are available as XML types in the type system of the application. To learn more, see Getting Started with XMLBeans.

After XML Beans are generated for an XML Schema, the following options are enabled in WebLogic Workshop:

Importing an MFL File

When an MFL file (which contains a schema describing non-XML data) is imported into a Schema project folder of a WebLogic Workshop application, a build of the application is triggered which generates XML Beans and MflObject class based on the schema in the imported MFL file. From the definitions in the MFL file, Non-XML types as well as XML types (from the schema in the MFL file) are available in the type system of the application.

The generated MflObject Java class provides methods for the conversion between non-XML and XML data, programmatically outside the mapper functionality of WebLogic Workshop. To learn more, see Java Classes Created From Importing Schemas.

The generated XML Bean classes provide methods for access the data that conforms to an MFL file. To learn more about the XML Schema representations generated from an MFL file see Java Classes Created From Importing Schemas. To learn more about XMLBeans, see Getting Started with XMLBeans.

After XML Beans are generated for the schema defined in the MFL file, the following options are enabled in WebLogic Workshop:

To make the schemas in XSD and MFL files available in your process application, you must import them into a Schemas project folder. (To learn more, see a Creating Schemas Projects.) You can import XSD and MFL files into a Schemas project folder, by following the steps described in one of the following tasks:

To Import an XSD or MFL file Into Your Application Using the Import Option of the Schemas Folder Drop-Down Menu

In this task, you import XSD or MFL files using the Import option of the drop-down menu of a Schemas project folder.

  1. In the Application tab, right-click on a Schemas project folder. (If the Application tab is not visible in WebLogic Workshop, choose View —> Application from the menu bar.)
  2. From the drop-down menu, select Import... .
  3. The Import Files dialog box is displayed.

  4. Browse the file system, and select your XSD file (ends in the.xsd extension) or MFL file (ends in the.mfl extension), and click Import.
  5. The schema in the XSD or MFL file is imported. This triggers a build of the current Schemas project folder. (The build verifies that the schema file is well formed. For XSD files, it also verifies that the element and attribute names in the XML Schema do not conflict with the XSD files that have already been imported into the current Schemas project folder.)

    Any errors that occur when compiling your XSD and MFL files will be displayed in the WebLogic Workshop Build tab. For all of the XSD and MFL files imported into a Schema project, you must fix any reported errors before you will be able to use these schemas in business processes or transformations.

To Import an XSD or MFL file Into Your Application Using Drag-And-Drop

In this task, you import XSD or MFL files by dragging-and-dropping them into a Schemas project folder.

In a Windows Explorer pane, select the XSD or MFL file and drag it into a Schemas folder. (If the Application tab is not visible in WebLogic Workshop, choose View —> Application from the menu bar.)

The schema in the XSD or MFL file is imported. This triggers a build of the current Schemas project folder. (The build verifies that the schema file is well formed. For XSD files, it also verifies that the element and attribute names in the XML Schema do not conflict with the XSD files that have already been imported into the current Schemas project folder.)

Any errors that occur when compiling your XSD and MFL files will be displayed in the WebLogic Workshop Build pane. For all of the XSD and MFL files imported into a Schema project, you must fix any reported errors before you will be able to use these schemas in business processes or transformations.

Note: Outside of WebLogic Workshop, you can also copy XSD or MFL files directly into a Schemas project folder in the file system. For example, if your application saved in the C:\user_projects\applications\myApp directory contains the default Schemas project, you can save the MFL file directly into this C:\user_projects\applications\myApp\Schemas directory in the file system. This will trigger a build of the current Schemas project folder in WebLogic Workshop.

Previous Document Next Document