Kbase 16235: Creating Progress SmartObjects with ERwin - README.TXT
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
Creating Progress SmartObjects with ERwin - README.TXT
Support for Progress SmartObjects in ERwin
*****************************************************************
This document contains the following sections,
1. Templates
2. How ERwin Generates SmartObjects from the Templates
3. Specifying a Directory Location for the Generated
SmartObject Files
4. File Naming Restriction Workarounds
5. Filtering Tables from SmartObject File Generation
6. Developing Your Own SmartObject Templates
*****************************************************************
For Progress users, ERwin includes a set of predefined SmartObject
templates that you can use to generate the most common types of
SmartObjects including: SmartQuery, SmartBrowser, and SmartViewer.
The installation disk contains the PROGRESS.ER1 sample file,
which includes the SmartObject templates, and the SOEXAMP.ER1
sample file, which includes tables to which SmartObject templates
are already attached to demonstrate how ERwin can automatically
generate SmartObjects from the templates.
SmartObject templates are similar to other ERwin templates because
they combine DBMS-specific coding with ERwin's macro language to
create a reusable template that can be applied to multiple tables
or multiple models without alteration. The code for each template
is the standard Progress 4GL code for that SmartObject with embedded
ERwin macros that represent database object names from your
data model.
When you forward engineer a SmartObject template, ERwin
automatically expands the macros and generates a complete
SmartObject script file which you can use directly in
the Progress User Interface Builder (UIB).
This Kbase describes the SmartObject templates in the sample
files on this disk and explains how to use the templates.
1. Templates
The table below shows the SmartObject templates in the sample
files on this disk.
Template Name Description
****************************** **************************************
q-single-table SmartQuery for a single table
q-parent-child-all-columns SmartQuery for two tables of a
Parent-Child relationship
b-single-table-all-columns SmartBrowser that displays all columns
of a single table
b-single-table-pk-columns SmartBrowser that displays only the
Primary Key columns of a single table
b-external-parent-all-columns SmartBrowser that displays all columns
for two tables of a Parent-Child
relationship
b-external-parent-pk-columns SmartBrowser that displays only the
Primary Key columns for two tables of
a Parent-Child relationship
v-single-table-all-columns* SmartViewer that displays all columns
of a single table
v-single-table-pk-columns* SmartViewer that displays only the
Primary Key columns of a single table
v-parent-child-all-columns* SmartViewer that displays all columns
for two tables of a Parent-Child
relationship
v-parent-child-pk-columns* SmartViewer that displays only the
Primary Key columns for two tables
of a Parent-Child relationship
* indicates that the Field width from ERwin generated SmartViewers
is set to 30.
The SmartObject templates are implemented as Schema Level
Post-Script attachments. Choose PROGRESS Schema Property...
from the Server menu and select the Pre & Post Script tab to
access the SmartObject templates. In this Editor, you can attach
or detach a SmartObject template to your data model. When you
attach a SmartObject template, ERwin generates that template for
your data model.
NOTE: It is very easy to inadvertently alter a SmartObject template,
therefore we strongly recommended that you work with a copy of
the sample file.
2. How ERwin Generates SmartObjects from the Templates
The templates are constructed in such way as to create an individual
SmartObject file (.w) for each table or each pair of Parent-Child
tables defined in the data model. ERwin assigns a unique name to
each generated SmartObject file by using a prefix, a table name,
and an extension. This naming convention is controlled by the %File
macro in the header of each SmartObject template which you can
modify to specify the path and filename of the resultant files.
3. Specifying a Directory Location for the Generated SmartObject
Files
You must edit a SmartObject template to define the directory location
of the corresponding SmartObject Script files. Open the SmartObject
template and edit the directory specification text inside the brackets
of the %File macro. Then delete the single quotes enclosing the
directory specification as shown in the example below:
*************** Before Editing ***********
%ForEachEntity(){%ForEachChildRel()
{%File('d:\dlc\demo\b-all-%Parent-%Child.w')
*************** After Editing ************
%ForEachEntity(){%ForEachChildRel()
{%File(c:\v8files\demo\b-all-%Parent-%Child.w)
Note: If you have attached one or more SmartObject templates to
your model, and you want to regenerate your .df file,
you must uncheck the "Schema Post-Script" option in the
Schema Generation Report dialog. If you do not uncheck
this option, ERwin includes the SmartObject UIB code inside
the .df file during schema generation. Alternatively, you
can detach the SmartObject templates so that they are not
generated as part of the schema (.df file).
4. File Naming Restriction Workarounds
The naming convention that ERwin uses for SmartObjects may cause
the generation of long file names. Windows NT and '95 users must
rename the SmartObject files before they can use them in
PROGRESS. For Windows 3.1x users, the naming convention may cause
the .w files to be overwritten because of the 8-character file name
limit imposed by Windows.
To overcome this file naming limitation, you can replace the
%TableName and the %Parent-%Child macros (which are embedded in
the %File macro) with %EntityId() and %RelId respectively.
This generates file names like, q-10.w.
Since this naming convention is not very informative, you can use
the following macro templates to retrieve the Table Names and
Table Ids. You can cut and paste these macros into a new post-script
template and run it, or you can obtain them from the example model.
For the templates in which you replaced %TableName with %EntityId(),
use (Table-id):
%File(d:\progwork\demo\tab-id.txt){
%ForEachEntity() {%EntityId() - %TableName }}
This macro provides the Entity Id and Table name for all of the
tables in the subject area and outputs them to the specified file.
For the templates in which you replaced %Parent with %RelId,
use (Parent-Child-id):
%File(d:\progwork\demo\par-id.txt){
%ForEachEntity() {
%ForEachChildRel() {%RelId - %Parent - %Child }}}
This macro provides the Relationship Id, Parent Table Name and
Child Table Name for the tables in the subject area and outputs
them to the specified file.
5. Filtering Tables from SmartObject File Generation
You can filter tables from the SmartObject file generation using
an ERwin Subject Area. Create a new subject area that contains only
the entities for which you want to create SmartObjects.
Note: When using a SmartObject template that utilizes
Parent-Child related tables, check the 'Filter Dangling
Relationship' option in the Subject Area Editor to ensure
that ERwin generates the correct Parent-Child relationship.
The SmartObject files that ERwin generates are 'Ready-to-Use' by the
PROGRESS User Interface Builder (UIB) and should not require
modification prior to use.
6. Developing Your Own SmartObject Templates
You can also use ERwin's extensive template editing features to
develop your own SmartObject templates. Logic Works is presently
developing a special guide for Progress users that describes the
Progress-specific features in ERwin.
This document is the /erwin26/progress/readme.txt.
Progress Software Technical Support Note # 16235