JBoss.orgCommunity Documentation
Models are the primary resource used by the Teiid Designer. Creating models can be accomplished by either directly importing existing metadata or by creating them using one of several New Model wizard options. This section describes these wizards in detail.
The Teiid Designer currently supports the following types of models:
Use one of the following options to launch the New Model Wizard.
New Model Wizard
Choose the File > New... > Metadata Model action .
Select a project or folder in the Figure 4.2, “Model Explorer View” and choose the same action in the right-click menu.
Select the New button on the main toolbar and select the Metadata Model action .
Model names are required to be unique within Designer. When specifying model names in new model wizards and dialogues error messages will be presented and you will prevented from entering an existing name.
Create New Relational Source Model
To create a new empty relational source model:
Step 1 - New Model Wizard
Step 2 - Specify a unique model name.
Step 3 - Select Relational option from Model Class drop-down menu.
Step 4 - Select Source Model from Model Type drop-down menu.
Step 5 - Click Finish.
You can change the target location (i.e. project or folder) by selecting the Browse... button and selecting a project or folder within your workspace.
In addition to creating a new empty relational source model, the following builder options are available:
Copy from existing model of the same model class.
This builder option allows construction of a relational model containing one or more of the procedures required for accessing file-based data via a file translator.
To create a new relational model containing file translator procedures, complete Create New Relational Source Model above and continue with these additional steps:
Step 5 - Select the model builder labeled Generate File Translator Procedures and click Next >. The Generate File Translator Procedures dialog will be displayed.
Step 6 - Check one ore more of the Available File Translator Procedures Click Finish
This builder option allows construction of a relational model containing one or more of the procedures required for accessing web-service-based XML data via a web s translator.
To create a new relational model containing file translator procedures, complete Create New Relational Source Model above and continue with these additional steps:
Step 5 - Select the model builder labeled Generate Web Service Translator Procedures and click Next >. The Generate File Translator Procedures dialog will be displayed.
Step 6 - Check one ore more of the Available Web Services Translator Procedures Click Finish
This builder option performs a structural copy of the contents of an existing model to a newly defined model. You can choose a full copy or select individual model components for copy.
To create a new relational model by copying contents from another relational source model, complete Create New Relational Source Model above and continue with these additional steps:
Step 5 - Select the model builder labeled Copy from existing model of the same model class and click Next >. The Copy Existing Model dialog will be displayed.
Step 6 - Select an existing relational model from the workspace using the browse button.
An existing model will be pre-selected if a relational model in the workspace is selected in the Figure 4.2, “Model Explorer View” prior to starting the new model wizard.
Step 7 - Check the Copy all descriptions option if desired. Click Finish
Create New Relational View Model
To create a new empty relational view model:
Step 1 - New Model Wizard
Step 2 - Specify a unique model name.
Step 3 - Select Relational option from Model Class drop-down menu.
Step 4 - Select View Model from Model Type drop-down menu.
Step 5 - Click Finish.
You can change the target location (i.e. project or folder) by selecting the Browse... button and selecting a project or folder within your workspace.
In addition to creating a new empty relational view model, the following builder options are available:
Copy from existing model of the same model class.
Transform from existing model.
This builder option performs a structural copy of the contents of an existing model to a newly defined model. You can choose a full copy or select individual model components for copy.
To create a new relational model by copying contents from another relational view model, complete Create New Relational View Model above and continue with these additional steps:
Step 5 - Select the model builder labeled Copy from existing model of the same model class and click Next >. The Copy Existing Model dialog will be displayed.
Step 6 - Select an existing relational model from the workspace using the browse button.
Step 7 - Check the Copy all descriptions option if desired. Click Finish
This option is only applicable for creating a relational view model from a relational source model with the added feature of creating default transformations (SELECT * FROM SourceModel.Table_X) for each source table. The steps are the same as for the Section 7.2.1, “Copy From Existing Model” described above.
There is an additional option in the second page of the wizard which can automatically set the relational table's supports update property to false. If this is unchecked the default value will be true.
In the Teiid Designer you can use your existing schema models to generate relational view tables.
To create a new relational view model from XML schema:
Step 1 - Select any XML Schema model (XSD) in in the Figure 4.2, “Model Explorer View” tree.
Step 2 - Right-click to display the context menu and select the Modeling > Create Relational View Model from Schema action.
Step 3 - In the Create Virtual Tables from XSD Schema Wizard dialog, specify a relational view model name.
Step 4 - Select one or more global schema entities and move from left panel to the right panel. Click Finish when done.
When model generation is complete the new model will be opened in an editor for your viewing.
Create XML Document View Model
To create a new empty xml document view model:
Step 1 - New Model Wizard
Step 2 - Specify a unique model name.
Step 3 - Select XML option from Model Class drop-down menu.
Step 4 - Select View Model from Model Type drop-down menu.
Step 5 - Click Finish.
You can change the target location (i.e. project or folder) by selecting the
button and selecting a project or folder within your workspace.In addition to creating a new empty xml document view model, the following builder options are available:
Copy from existing model of the same model class.
Build XML documents from XML schema.
This builder option performs a structural copy of the contents of an existing model to a newly defined model. You can choose a full copy or select individual model components for copy.
To create a new relational model by copying contents from another xml document view model, complete Create XML Document View Model above and continue with these additional steps:
Step 5 - Select the model builder labeled Copy from existing model of the same model class and click Next >. The Copy Existing Model dialog will be displayed.
Step 6 - Select an existing relational model from the workspace using the browse button.
Step 7 - Check the Copy all descriptions option if desired. Click Finish
This option creates an XML View document model based on a selected XML schema and its dependencies.
To create a new xml document view model by from XML schema, complete Create XML Document View Model above and continue with these additional steps:
Step 5 - Select the model builder labeled Build XML documents from XML schema and click Next >. The Select XML Schema dialog will be displayed.
Step 6 - Select an existing schema model from the workspace using the browse button.
An existing model will be pre-selected if an XSD model in the workspace is selected in the VDB explorer prior to starting the new model wizard. The schema must be found in the workspace so if you need to get one or more into the workspace use the XSD Schemas on file system importer.
Step 7 - Move the available schema root elements you want to become virtual documents in the new model over to the Virtual Documents list by using the arrow button for selected elements or the button to move all elements.
Step 8 - Select the appropriate document options and mapping options. Click Finish
Step 9 - Click Finish to create a model of all selected document entities or (optional) click Next > to view Selected Documents Statistics page which shows document entity statistics and gives you an idea the size of the model being created.
Step 10 - (Optional) Click Finish to create a model of all selected document entities or click Next > to view Preview Generated Documents page that allows you to exclude document specific entities then click Finish.
For deeply nested schema, your total entity count may be large. If so, displaying the preview may take some time.
Create XML Schema Model
To create a new empty xml schema (.xsd) model:
Step 1 - New Model Wizard
Step 2 - Specify a unique model name.
Step 3 - Select XML Schema (XSD) option from Model Class drop-down menu.
Step 4 - Select Datatype Model from Model Type drop-down menu.
Step 5 - Click Finish.
You can change the target location (i.e. project or folder) by selecting the
button and selecting a project or folder within your workspace.In addition to creating a new empty xml schema model, the following builder option is available:
Copy from existing model of the same model class.
This builder option performs a structural copy of the contents of an existing model to a newly defined model. You can choose a full copy or select individual model components for copy.
To create a new relational model by copying contents from another xml schema model, complete Create XML Schema Model above and continue with these additional steps:
Step 5 - Select the model builder labeled Copy from existing model of the same model class and click Next >. The Copy Existing Model dialog will be displayed.
Step 6 - Select an existing relational model from the workspace using the browse button.
Step 7 - Check the Copy all descriptions option if desired. Click Finish
Create Web Service View Model
To create a new empty web service view model:
Step 1 - New Model Wizard
Step 2 - Specify a unique model name.
Step 3 - Select Web Service option from Model Class drop-down menu.
Step 4 - Select View Model from Model Type drop-down menu.
Step 5 - Click Finish.
You can change the target location (i.e. project or folder) by selecting the
button and selecting a project or folder within your workspace.In addition to creating a new empty web service view model, the following builder options are available:
Copy from existing model of the same model class.
Build from existing WSDL file(s) or URL.
This builder option performs a structural copy of the contents of an existing model to a newly defined model. You can choose a full copy or select individual model components for copy.
To create a new relational model by copying contents from another web service view model, complete Create Web Service View Model above and continue with these additional steps:
Step 5 - Select the model builder labeled Copy from existing model of the same model class and click Next >. The Copy Existing Model dialog will be displayed.
Step 6 - Select an existing relational model from the workspace using the browse button.
Step 7 - Check the Copy all descriptions option if desired. Click Finish
This builder option creates a Web service model based on a user-defined WSDL file and its referenced schemas. In addition, applicable XML schema files and XML View document models (optional) are created.
To create a new relational model by copying contents from another web service view model, complete Create Web Service View Model above and continue with these additional steps:
Step 5 - Select the model builder labeled Build from existing WSDL file(s) or URL and click Next >.
The remaining wizard steps are identical to those found using the Section 6.5, “Import WSDL Into Web Service” action option.
This method is recommended for experienced users for consistent and rapid deployment of Web services designed to query relational sources. It provides detailed control of all Web service interfaces, operations and required transformations from XML Views
To create a Web service model from relational models or objects:
Step 1 - Select any combination of relational models, tables and/or procedures in the Figure 4.2, “Model Explorer View” tree..
It is recommended that the user selects single source models, which enables auto-naming of input/output schema and Web service models in \ Step 3.
Step 2 - Right-click select Modeling > Create Web Service action .
Step 3 - In the Create Web Service dialog, specify file names for the generated Input Schema file, Output Schema file and Web service model. Change options as desired. Click Finish when done.
Step 4 - When model generation is complete, a confirmation dialog should appear. Click OK.
Web Service models and their corresponding Interfaces and Operations can be generated in Teiid Designer from XML View model components. Namely, XML View Documents and XML View Document roots.
To create a new Web service model from XML components::
Step 1 - Select either a single XML Document or single XML Document root in Figure 4.2, “Model Explorer View”.
Step 2 - Right-click select Modeling > Create Web Service action .
Step 3 - Fill in missing properties in Web Service Generation Wizard shown below.
Step 4 - Click Finish to generate model. When model generation is complete, a confirmation dialog should appear. Click OK.
Users can change the Web Service Model and Interface Name values (via "..." buttons) to use existing Web service model components. This will create a new operation in an existing model.
Create New Extensions Model
To create a new empty extensions model:
Step 1 - New Model Wizard
Step 2 - Specify a unique model name.
Step 3 - Select Model Extensions option from Model Class drop-down menu.
Step 4 - Select Model Class Extension from Model Type drop-down menu.
Step 5 - Click Finish.
You can change the target location (i.e. project or folder) by selecting the
button and selecting a project or folder within your workspace.In addition to creating a new empty extensions model, the following builder option is available:
Copy from existing model of the same model class.
This builder option performs a structural copy of the contents of an existing model to a newly defined model. You can choose a full copy or select individual model components for copy.
To create a new relational model by copying contents from another extensions model, complete Create New Extensions Model above and continue with these additional steps:
Step 5 - Select the model builder labeled Copy from existing model of the same model class and click Next >. The Copy Existing Model dialog will be displayed.
Step 6 - Select an existing relational model from the workspace using the browse button.
Step 7 - Check the Copy all descriptions option if desired. Click Finish