Generating UML diagrams from ATG repositories

How to generate UML diagrams from your ATG repositories

Document Information

Title
Generating UML diagrams from ATG repositories
Subject
How to generate UML diagrams from your ATG repositories
Author(s)
Wilco Boumans
Comments
 

Document Version

v1@13/08/2008

Copyright

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.

No Warranty

This document is provided 'as is' without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement.

The contents of this publication could contain technical inaccuracies or typographical errors. Changes are periodically added to the information herein; these changes will be incorporated in the new editions of the publication. Spindrift may make improvements and/or changes in the publication and/or product(s) described in the publication at any time without notice.

Limitation of Liability

In no event will Spindrift be liable for direct, indirect, special, incidental, economic, cover, or consequential damages arising out of the use of or inability to use this documentation even if advised of the possibility of such damages.

Contact

Web
www.spindriftgroup.com

Contents

1 Introduction
    1.1 Document Goals
    1.2 Related Documents
2 Step by step instructions
    2.1 Getting the Repository XML
    2.2 Processing the XML
    2.3 Reverse engineering in Enterprise Architect
    2.4 Arranging the diagram
    2.5 Distribute

1 Introduction

1.1 Document Goals

This document shows how to generate a UML class diagram out of ATG repositories.

1.2 Related Documents

The following documentation is related to this document:

2 Step by step instructions

2.1 Getting the Repository XML

Using ATG dyn/admin, you can browse to the repository that you want to model. Examples are the ProfileAdapterRepository in /atg/userprofiling and the ProductCatalog in /atg/commerce/catalog. On the page of that component, you see a 'View template repository definition'. Click that link and the page shows the XML that results from merging all the repository definitions in the various modules that define this component, including your own. Copy and paste that XML into an editor and save that to the file system.

2.2 Processing the XML

Once the XML is on the file system, you can convert it into Java using XmlSpy or xsltproc. The XSLT to apply is available as a file download. When applying the transformation, a Java file is generated. Capture this output and save it to a file.

xsltproc repository.xml convertRepository2Java.xslt > repository.java

In XmlSpy, convert the XML using 'Apply XSLT'. Save the resulting output.html as repository.java. The resulting file contains multiple java classes, one for each item in your repository. None of these are public, so the name under which you store the result isn't that critical.

2.3 Reverse engineering in Enterprise Architect

Create a new class diagram in EA, and name it 'repository'. If you need to reverse engineer multiple repositories, it is wise to create a new folder for this repository; each class in the java file is going to be a new class in the folder (package) into which you reverse engineer the file.

On menu 'project / code engineering' select 'import java classes'. This imports the entire java file and creates a class element for each class in the java file. All associations and inheritance relationships are included as well. Because the java language does not allow all characters that a repository item can contain (ie a '-' is not accepted in a class name), the xslt converts illegal characters when generating the Java file.

2.4 Arranging the diagram

With 'Layout diagram' the initial layout is somewhat corrected. A reasonably complex repository does however confuse the crap out of auto layout mechanism. Therefore, some manual restructuring of the diagram is required. Try to focus on the conglomerated blocks first, by zooming out and re-arrange the blocks first. This is complicated by the bent lines, they have a fixed anchor-point at each bend. Be aware, that when removing a mid-point out of a line (ctrl-q), a straight line is formed. Doing that for more then one association overlays the lines. Be careful not to hide relationships because of that. Immediately drag the two lines apart when you notice this!

Once your diagram is laid out to your satisfaction, you could add details, remarks, color codes (at one customer for example, we used colors to denote the different sources of data for the repository items).

2.5 Distribute

After the diagrams have been created, you should distribute them. Generating an HTML report in EA is a nice and interactive way to document your models. You can publish them on a shared drive or web site...