Book a Demo

Author Topic: Frustrated with Document Templating (help)?  (Read 12132 times)

speedco

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: Frustrated with Document Templating (help)?
« Reply #15 on: February 25, 2017, 12:52:06 am »
Geert,

If you are there, can you help me with one other problem? I've now got Virtual Documents working, pulling in ToC and Cover, using package tags (in fact, I've extended some classes for my client, specifically for these purposes). This is all working well for now.

My problem? Well, my Virtual Documents, using a Report Package for the top level, has a set of Model Documents. For each Model Document, I allocate a template and customise the output as required. All is well, if these are packages. However, when I have a package with a diagram in, I can't find a way to get the diagram to show.

If I use a template that is not associate to a Virtual Document, The diagram element option works and the diagram shows. However, when I use a fragment, I don't get to see it.

Further to this, I've tried using JScript. I've got scripts that return XML elements that will show happily if textual. I.E. The XMl returns Name value Pairs, in which the value is a string, I can show the custom field. However, I can't figure out and ask, is it possible to return the UML Diagram somehow? I can identify it from the package, but can't find a way to return it so that is placed into the template.

Thoughts would be appreciated? I appreciate that I'm getting rather technical now.

Kind regards

Carl

speedco

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: Frustrated with Document Templating (help)?
« Reply #16 on: February 25, 2017, 02:36:50 am »
Figured a way to do it. Again, as you state, I've had to accept the 'weirdness' of its implementation. This could be so much easier.

My solution was to create a standard template:

Code: [Select]
package >
{Template - Heading Selector}
diagram >
{Diagram.DiagramImg}
< diagram
child packages >
< child packages
< package

My Header selector then determine's whether to show the package name, which is the heading for me. This allows me to have a set of packages in the Model Document, knowing that I can sterotype the packages with H1, H2, .. H9 to instruct the templating to create the right heading for the content. Document Artifacts can be added to these sections and their content are placed into the output. Note: If there isn't a H1 - H9 tag, then the package is therefore assumed as content only.

Any images are positioned in a Package::Img and will be in-lined between the packages, therefore falling into the postion of the document.

This probably isn't the best approach, but it is working and enables me to handover to my client in an easy to use form.

Kind regards

Carl

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Frustrated with Document Templating (help)?
« Reply #17 on: February 25, 2017, 05:47:32 am »
Hi Carl,

Glad to see that you found a way to get it working.
In general that is what I do as well, try to figure out a way to get the templates to produce what I need.
Sometimes it takes some iterations to find a way that works using the combinations of virtual documents, templates, and all kinds of template fragments.

But in the end I've always been able to produce really nice looking professional documents. Just this week an external auditor had been reading the generated documents and he was really surprised to learn that they were actually generated instead of hand crafted. I guess that's the best compliment you can get as template author  :D

Geert