Red Hat Training

A Red Hat training course is available for Red Hat JBoss Data Virtualization

10.8. Managing Model Object Extensions

10.8.1. Managing Model Object Extensions

Extending a model adds extra properties to its model objects. One good use of these extension properties is for passing data to a customized Data Services translator. The Teiid Designer model extension framework consists of:
  • Model Extension Definitions (MEDs)
  • MED Registry - keeps track of all the MEDs that are registered in a workspace. Only registered MEDs can be used to extend a model.
  • MED Editor

10.8.2. Create New MED

To create a new MED select the File > New > Other... action to display the New wizard dialog. Select the Teiid Designer > Teiid Model Extension Defn option which displays the New Model Extension Definition dialog. Browse and select existing project or project folder location for MED file and specify unique file name and click Finish.

Note

If a project is already selected when wizard is launched, the location field will be pre-populated.
MED Editor Overview Tab

Figure 10.34. MED Editor Overview Tab

10.8.3. Edit MED

To edit an MED file select an existing .mxd file in your workspace and right-click select the Open action. The MED Editor will open to allow editing .
On the Overview tab, you can specify or change the Namespace Prefix, Namespace URI, the Model Class you wish to extend (Relational, Web Service, XML Document, and Function) and a description.
After entering the basic MED info, you can now switch to the Properties tab and begin creating your extended property definitions for specific model objects supported by selected model class.
MED Editor Properties Tab

Figure 10.35. MED Editor Properties Tab

Start by clicking the Add Extended Model Object toolbar button to display the Model Object Name selection dialog. Select an object and click OK.
Select Model Object Name Dialog

Figure 10.36. Select Model Object Name Dialog

Next, select the model object in the Extended Model Objects section and use the actions and properties table in the lower Extension Properties section to add/remove or edit your actual extended properties. Selecting the add or edit extension properties actions displays a dialog containing sections to edit general properties, value definition (required, masked, allowed values) as well as display name and description values which can be internationalized.
Edit Property Definition Dialog

Figure 10.37. Edit Property Definition Dialog

10.8.4. Extending Models With MEDs

MEDs must be applied to a model in order for their extension properties to be available to that model's model objects. To manage the applied MEDs for a specific model select the model and right-click select the Modeling > Manage Model Extension Definitions action. This will display a dialog listing the current applied MEDS and actions and buttons to add or remove MEDs from a model, extract a MED from a model and save a copy of it locally as a .mxd file and lastly, update the version of MED in a model if it differs from a version in your MED registry.
Manage Model Extension Definitions Dialog

Figure 10.38. Manage Model Extension Definitions Dialog

Clicking the Add button displays a list of applicable MEDS based on model class.
Add Model Extension Definitions Dialog

Figure 10.39. Add Model Extension Definitions Dialog

Note

After adding/removing MEDs from the model, click Finish to accept all of the changes. Canceling the dialog will discard all changes and revert to the original model state.

10.8.5. Setting Extended Property Values

Extension properties are user defined properties available to any extended model object via the Properties View. All extension properties are available under the Extension category and are prefixed with a MED's namespace prefix. If there is an initial value for an extension property it will be set to the default value using the property definition found in the MED.
Properties View For Extended Model Object

Figure 10.40. Properties View For Extended Model Object