Chat now with support
Chat with Support

Toad Data Modeler 6.2 - User Guide

Introduction User Interface Models and Model Objects
Physical Data Model
About Physical Data Modeling Benefits of Physical Data Model Entity Relationship Diagram Objects Basic Database Design Advanced Database Design
Universal Data Model Logical Data Model Working with Model Objects Model Properties Model Statistics
Features and Tools
Application Variables Export/Import DDL Script Generation Graphics Model Actions Print Projects Reports Reverse Engineering Scripting and Customization SQL Templates Tips and Tricks Toad for Oracle Integration Toad Intelligence Central (TIC) Integration Tools Version Control
Options and Configuration Databases
Supported Databases Connection Types by Database DB2 UDB v. 8 (LUW) DB2 v. 9 (LUW) DB2 v. 9.5 (LUW) DB2 v. 9.7 (LUW) DB2 v. 10.1 (LUW) DB2 v. 10.5 (LUW) DB2 z/OS v. 9 DB2 z/OS v.10 DB2 z/OS v. 11 Greenplum 4.1 Greenplum 4.2 Ingres 9.3 Ingres 10.0 Microsoft Access 2000/2002/2003 Microsoft Access 2007/2010 Microsoft Azure SQL Database Microsoft Azure SQL Database V12 Microsoft SQL Server 2000 Microsoft SQL Server 2005 Microsoft SQL Server 2008 Microsoft SQL Server 2012 Microsoft SQL Server 2014 Microsoft SQL Server 2016 MySQL 5.0 MySQL 5.1 MySQL 5.5 MySQL 5.6 MySQL 5.7 Oracle 9i Oracle 10g Oracle 11g Release 1 Oracle 11g Release 2 Oracle 12c Release 1 Oracle 12c Release 2 PostgreSQL 8.1 PostgreSQL 8.2 PostgreSQL 8.3 PostgreSQL 8.4 PostgreSQL 9.0 PostgreSQL 9.1 PostgreSQL 9.2 PostgreSQL 9.3 PostgreSQL 9.4 PostgreSQL 9.5 SQLite 3.7 Sybase ASE 12.5 Sybase ASE 15 Sybase ASE 15.5 Sybase ASE 15.7 SAP ASE 16.0 Sybase IQ 15.2 Sybase SQL Anywhere 11 SAP SQL Anywhere 17 Teradata 13 Vertica Database 8.0
Legal Information

Custom Property Example

Features and Tools > Scripting and Customization > Custom Properties > Custom Property Example

Scenario

You would like to add an additional property to all entities which would indicate that modeling of a particular entity is not done yet and there are more things to be done before the entity is considered complete. The property could be named InProgress.

Solution:

Create a simple custom property and add a checkbox to Entity Properties linked to the property. Use the following steps as a guide:

  1. Right-click any entity in Model Explorer and select Add Custom Property.

  2. In the New Custom Property dialog, enter the following:
    Caption/Name - enter InProgress as Name and anything you want as Caption
    Level - we assume the property should be available in all entities in all models, select PEREntity
    Type - the boolean type is the most suitable for our type of property (true/false)
    Readonly - the property value should be editable, do not check this checkbox
    Script Implementation - the property value is not dependent on other property values and it doesn't change any other property value either, do not check this checkbox
    Package - feel free to choose any Package

  3. Confirm the changes, you will need to restart the application in order to access the newly created property.

  4. The custom property is now available for use. You can verify that by accessing it via scripting.

  5. Now it's time to add a checkbox to the Entity Properties form. Right-click anywhere in the form and select Customize Form.

    Note:If you have chosen Package other than My Package, you need to select Customize Form as option and choose the Package you have selected previously (step 2). This option is disabled by default. To enable it, go to Settings Menu | Options | Expert Mode and uncheck the Save the definitions the the 'My Package' option.


  6. The Entity Properties form is now editable and several other forms appear. The checkbox for our property should be placed somewhere where we can see it no matter what tab is currently selected. Let's place it next to the Generate option. First, click the bottom section of the form, where the option is placed along with several buttons.

    Note: If you accidentally close some of the customization forms, go to Settings Menu | Options | Expert Mode | Editable Forms and check the appropriate option to show them again.


  7. Now find the Component Palette, go to Data section and double-click DataCheckBox to add it to the form.


  8. Move the newly added checkbox next to the Generate option (you can use Alignment form). Make sure the checkbox is selected, then locate the Component Inspector.

  9. In Component Inspector, change the following properties:
    Caption - enter a descriptive caption, e.g. In Progress
    DataSource - choose Entity
    DataField - find your custom property in the list and select it (InProgress in our case)

  10. Close the editable Entity Properties via cross button in the upper-right corner. This will cause you to exit the editable mode of the form.
  11. Right-click anywhere in the form and select Save Form. The changed form definition will be saved to My Package.

  12. Your custom property is now available in all entities across all databases. The property and the modified form definition are stored in My Package (or in other package, depending on what you chose in step 2).

TIP: If you want to transfer your customizations to another installation of Toad Data Modeler, simply move the package file from the Packages folder to the same folder of the target installation (e.g. "C:\Program Files (x86)\Quest Software\Toad Data Modeler 5.5\Packages\User\My Package.txg")

Scripting and Customization Sample

Create New Package

Features and Tools > Scripting and Customization > Scripting and Customization Sample > Create New Package

Why Do We Need a New Package?

Packages are containers for groups of scripts, customized Form definitions, metamodels etc. In Toad Data Modeler, the following three types of packages may exist.

  • System packages - have the lowest priority (distributed with Toad Data Modeler application).
  • Add-on packages - have higher priority than system packages (can be downloaded from web site, shared among users etc. No add-on package exists after installation.).
  • My Package - has the highest priority (created automatically upon installation of Toad Data Modeler).

User packages exist as separate XML files with extension .TXG. System packages are in binary format with extension .TBG.

You can make your modification without the necessity to create a new package, but all scripts and modifications you will ever make will be stored in the My Package.txg file. If you plan to share your modifications with others, it's a good idea to create a new package for this purpose. In this example, we will create a new package CustomerFeedback, and store all scripts used in this tutorial, metamodel and form modifications into this package. It will give us the possibility to share the CustomerFeedback.txg file with others.

Create a New Package

Click Expert Mode| Customization | New Package or activate Package Explorer and click the New Custom Package icon.

Define Name of the package.

 

Select packages on which the new package depends. In this example, the Customer Feedback will not be dependent package. It will just extend existing packages.

Example of dependent package: Package RE Microsoft SQL Server 2005 depends on RE Microsoft SQL Server package and extends Microsoft SQL Server 2005 package. (RE is abbreviation for Reverse Engineering.)

Select packages you want to extend. In our example, we will be extending Database Oracle 10g package and HTML Reports for Oracle 10g.

You can write description to the Description tab.

Newly created package will appear in the Package Explorer. You can also see package extensions there. Custom packages have blue icon.

Just to compare, see My Package (where all modifications are stored if you don't use add-on packages) - it has a green icon and is listed at the top.

Well, a new package exists, let's continue adding new properties.

For more information, see Add New Properties in Metamodel.

Add New Properties in Metamodel

Features and Tools > Scripting and Customization > Scripting and Customization Sample > Add New Properties in Metamodel

Properties and methods can be added visually, via Metamodel.

For our purpose, we will need two new properties.

  • ConfirmedByCustomer (boolean)
  • NotesFromCustomer (string)

This is where our values will be stored. The properties will be assigned to items that will appear in Entity Properties form. The ConfirmedByCustomer property value will be assigned to a checkbox, and the NotesFromCustomer value will be assigned to a text box.

How To Add New Properties

Right-click the CustomerFeedback package and select Open Metamodel.

Empty metamodel digram opens.

Right-click the workspace and select Add Class...

Select class you want to extend. For our purpose, we need to extend PEREntityOR10 class.

PER - Physical Entity Relationship model.

Entity - Items must be accessible in the Entity Properties form.

OR10 - Modification will be made for Oracle 10g only.

Select the newly added class and right-click it. Select Edit.

Add two new properties to the class.

ConfirmedByCustomer, data type Boolean.

On tab Attributes of the Property Properties dialog, you can define property Attributes. Select Editable (we need to be able to edit the values) and Store Property (we want to store the values with model).

Now define the second Property NotesFromCustomer, on tab Attributes, select the same attributes - Editable and Store Property.

Properties have been added to the metamodel. Now it's necessary to save the metamodel and restart the application. Then we can continue modifying Entity Properties form.

Note: Metamodels are XML documents stored as .TXM files.

For more information, see Modify Form.

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating