19.10.2015 Views

workbench-en.a4

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Customizing DBDoc Model Reporting Templates<br />

Two objects are defined in the file. The TemplateInfo object and the TemplateStyleInfo object. These objects contain<br />

information about the template that will be displayed in the DBDoc Model Reporting wizard main scre<strong>en</strong>.<br />

4. The first thing you need to change are the object GUIDs that are used in the file. In this example there are two that need replacing:<br />

id="{BD6879ED-814C-4CA3-A869-9864F83B88DF}"<br />

...<br />

id="{7550655C-CD4B-4EB1-8FAB-AAEE49B2261E}"<br />

G<strong>en</strong>erate two new GUIDS. This can be done using any suitable command-line tool. There are also free online tools that can be<br />

used to g<strong>en</strong>erate GUIDs. The info.xml file should th<strong>en</strong> be edited accordingly.<br />

5. Edit the textual information for the TemplateInfo and TemplateStyleInfo objects to reflect the purpose of the custom<br />

template.<br />

6. The modified file will now look something like the following:<br />

<br />

<br />

<br />

Custom basic TEXT report listing schemata and objects.<br />

Custom Basic text report<br />

<br />

<br />

Designed to be viewed with a fixed sized font.<br />

Fixed Size Font<br />

preview_basic.png<br />

fixed<br />

<br />

<br />

custom_report.txt<br />

<br />

<br />

7. The next step is to create the new template file. Again this may best be achieved, dep<strong>en</strong>ding on your requirem<strong>en</strong>ts, by editing<br />

an existing template. In this example the template file report.txt.tpl is shown here:<br />

+--------------------------------------------+<br />

| MySQL Workb<strong>en</strong>ch Report |<br />

+--------------------------------------------+<br />

Total number of Schemata: {{SCHEMA_COUNT}}<br />

=============================================<br />

{{#SCHEMATA}}<br />

{{SCHEMA_NR}}. Schema: {{SCHEMA_NAME}}<br />

----------------------------------------------<br />

## Tables ({{TABLE_COUNT}}) ##<br />

{{#TABLES}}{{TABLE_NR_FMT}}. Table: {{TABLE_NAME}}<br />

{{#COLUMNS_LISTING}}## Columns ##<br />

Key Column Name Datatype Not Null Default Comm<strong>en</strong>t<br />

{{#COLUMNS}}{{COLUMN_KEY}}{{COLUMN_NAME}}{{COLUMN_DATATYPE}} »<br />

{{COLUMN_NOTNULL}}{{COLUMN_DEFAULTVALUE}}{{COLUMN_COMMENT}}<br />

{{/COLUMNS}}{{/COLUMNS_LISTING}}<br />

{{#INDICES_LISTING}}## Indices ##<br />

Index Name Columns Primary Unique Type Kind Comm<strong>en</strong>t<br />

{{#INDICES}}{{INDEX_NAME}}{{#INDICES_COLUMNS}}{{INDEX_COLUMN_NAME}} »<br />

{{INDEX_COLUMN_ORDER}}{{INDEX_COLUMN_COMMENT}}{{/INDICES_COLUMNS}} »<br />

{{INDEX_PRIMARY}}{{INDEX_UNIQUE}}{{INDEX_TYPE}}{{INDEX_KIND}}{{INDEX_COMMENT}}<br />

{{/INDICES}}{{/INDICES_LISTING}}<br />

{{#REL_LISTING}}## Relationships ##<br />

Relationship Name Relationship Type Par<strong>en</strong>t Table Child Table Cardinality<br />

{{#REL}}{{REL_NAME}}{{REL_TYPE}}{{REL_PARENTTABLE}}{{REL_CHILDTABLE}}{{REL_CARD}}<br />

{{/REL}}{{/REL_LISTING}}<br />

---------------------------------------------<br />

{{/TABLES}}<br />

{{/SCHEMATA}}<br />

=============================================<br />

End of MySQL Workb<strong>en</strong>ch Report<br />

This template shows details for all schemata in the model.<br />

8. The above template file can be edited in any way you like, with new markers being added, and existing markers being removed<br />

as required. For the custom template example you might want to create a much simpler template. Such as the one following:<br />

+--------------------------------------------+<br />

80

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!