Book a Demo

Author Topic: filtering diagram types for doc generation  (Read 7942 times)

wink

  • EA User
  • **
  • Posts: 48
  • Karma: +0/-0
  • Montjoie, que jamais ne choit!
    • View Profile
filtering diagram types for doc generation
« on: April 21, 2005, 12:42:37 am »
Hello everybody,

I wonder if there is a way to filter diagram types when generation RTF documentation.

I'd like to do the following:
For a given project tree lioke this,

ROOT
 +-- Package A
 |    +-- Class Diagram
 |    +-- Activity Diagram
 |    +-- Sequence Diagram
 |    +-- classes and other elements...
 +-- Package B
 |    +-- Class Diagram
 |    +-- Activity Diagram
 |    +-- Sequence Diagram
 |    +-- classes and other elements...


I'd like to generate a documentation only for activity and sequence diagrams but not for class diagrams.
I've looked in the help but unfortunately I didn't find any info about that.

Any ideas?

thanks in advance!
best regards,
Manfred
Best regards,
Manfred

thomaskilian

  • Guest
Re: filtering diagram types for doc generation
« Reply #1 on: April 21, 2005, 01:29:38 am »
You could run a script to turn on the "Exclude from RTF" for the unwanted diagrams.

wink

  • EA User
  • **
  • Posts: 48
  • Karma: +0/-0
  • Montjoie, que jamais ne choit!
    • View Profile
Re: filtering diagram types for doc generation
« Reply #2 on: April 21, 2005, 02:28:38 am »
Hi Thomas,

Thanks for the reply. Could you please give me a hint on how to write such a script?
I must admit that I don't really know where to start and how to launch it. ???

thanks in advance,

cheers Manfred
Best regards,
Manfred

thomaskilian

  • Guest
Re: filtering diagram types for doc generation
« Reply #3 on: April 21, 2005, 04:05:06 am »
Manfred,
you can start with this perl script http://sharepoint.knowledgerecovery.com/external/eaug/Tools/Forms/DispForm.aspx?ID=3&Source=http%3A%2F%2Fsharepoint%2Eknowledgerecovery%2Ecom%2Fexternal%2Feaug%2FTools%2FForms%2FAllItems%2Easpx&RootFolder=%2Fexternal%2Feaug%2FTools. You only need to find the according diagrams and set the attribute. Consult EA help for "automation" to find out more.

wink

  • EA User
  • **
  • Posts: 48
  • Karma: +0/-0
  • Montjoie, que jamais ne choit!
    • View Profile
Re: filtering diagram types for doc generation
« Reply #4 on: April 21, 2005, 06:19:42 am »
Thanks Thomas,

I just downloaded perl and installed it.
How do I launch the script?

Do I have to type perl -w <scriptname.pl> from the command line? or is there a way to launch it from inside EA?

EDIT:
Sorry to bother you again!
I just tried to run the script (after I adapted it to my project) but I get the following errors. It seems that the rtf.pm package needs something I don't have on my machine.  ???


D:\DvE\LMDU\EArchitect\Scripts>perl -w DocPackages.pl
Can't locate RTF/Writer.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib
.) at C:/Perl/lib/rtf.pm line 15.
BEGIN failed--compilation aborted at C:/Perl/lib/rtf.pm line 15.
Compilation failed in require at DocPackages.pl line 15.
BEGIN failed--compilation aborted at DocPackages.pl line 15.

Do you have an idea what to do?

many thanks in advance!

« Last Edit: April 21, 2005, 07:02:14 am by wink »
Best regards,
Manfred

mikewhit

  • EA User
  • **
  • Posts: 608
  • Karma: +0/-0
  • Accessing ....
    • View Profile
Re: filtering diagram types for doc generation
« Reply #5 on: April 21, 2005, 07:32:09 am »
The message suggests it needs the RTF::Writer Perl module.
According to Google, this is RTF-Writer.pm

Have you installed all of the RTF stuff ?

wink

  • EA User
  • **
  • Posts: 48
  • Karma: +0/-0
  • Montjoie, que jamais ne choit!
    • View Profile
Re: filtering diagram types for doc generation
« Reply #6 on: April 21, 2005, 07:37:14 am »
Hi Mike,

I thought that I had everything installed but it seems not. Is the RTF module a standard perl component or is it some kind of add-on?

Sorry I'm behaving like an idiot, but today is the first day I ever touch "perl", so I'm a bit confused.
Best regards,
Manfred

thomaskilian

  • Guest
Re: filtering diagram types for doc generation
« Reply #7 on: April 21, 2005, 08:28:37 am »
I also put a modified rtf.pm on the Sharepoint. But I meant this to be only a sample script. You should remove all rtf-related things first. You need a bit of practice with PERL but it's quite trivial to use and extend. With this script you will have an example on how to traverse the repository. What you need to add is finding the diagrams and the appropriate attributes. You could also write this with VB or C++ (or whatever language you like).

BTW: A medieval use for EA 8) I'd rather expect rocket techies to use it ;)
« Last Edit: April 21, 2005, 08:37:19 am by thomaskilian »

michael_rainwater

  • EA User
  • **
  • Posts: 53
  • Karma: +0/-0
    • View Profile
Re: filtering diagram types for doc generation
« Reply #8 on: April 21, 2005, 01:36:58 pm »
There is a much easier solution than scripting anything.

Method #1 (my preference):
Simply generate your RTF with all the stuff in it.  This is your baseline RTF.
Now, create an MS Word document with the links to the various packages or diagrams.  There are instructions in the EA Help file.    Go to help and select Contents tab.  Select the tree: Creating Documents | Using MS Word | Bookmarks.  This shows you all the steps you need.  The only problem is the help doesn't tell you that MS Word 2003 has a drop-down on the "Insert" button and you have to select "Insert Link" from this.  Otherwise, it is easy.

Method #2:
Another simple method, if you really want to generate a simple RTF is described in help.  First follow the steps in help under Creating Documents | Virtual Documents.  Then, follow the steps in Creating Documents | RTF Documents | The RTF Dialog | Save as Document.  This will make it easy to regenerate the document.

Hope this helps.

wink

  • EA User
  • **
  • Posts: 48
  • Karma: +0/-0
  • Montjoie, que jamais ne choit!
    • View Profile
Re: filtering diagram types for doc generation
« Reply #9 on: April 21, 2005, 11:56:30 pm »
Thanks Thomas and Michael for your help!

Wow I'm amazed by the possibilities of EA!!!
Well now I'll try whatever solution will fit best my needs!

Syre Thomas, so you think that knights only wore swords and helmets? ::) They invented UML to build theyr castles   ;D
(never read the book: "In the name of the ROSE" ?)
:D

BTW, you're not as far from rockets as you may think, actually I'm working in the nuclear industry and I'm designing software for embedded systems.
The medieval stuff is just a personal passion! :D
On the other hand I have also written an application which controls the stage lights for our medival spectaculums

Thanks again for your help and have a nice day!
Best regards,
Manfred

thomaskilian

  • Guest
Re: filtering diagram types for doc generation
« Reply #10 on: April 22, 2005, 02:39:28 am »
 :) :) :)

jbaalmann

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: filtering diagram types for doc generation
« Reply #11 on: February 06, 2006, 06:07:41 am »
Hi,

I just tried the first proposed solution of michael_rainwater but it does not work for me. Acutally, I can reproduce two possible results:
1. The MS Word "INCLUDETEXT" object seems to be right, but no diagram is displayed (also after an update with "F9").
2. The MS Word "LINK" or "INCLUDETEXT" or whatever is regarded as invalid by Word.

Can someone post a working INCLUDETEXT directive (something like [INCLUDETEXT "C:\\test.doc" "BKM_EE2F2175_D288_42b0_8609_6A46FA15A91E"]) so that I am able to verify at least the correct syntax?

Can someone verify the mentioned method to work with the (almost) current version of EA that I am using (6.1.785)? Also, I am using MS Word 2003 (11.6359.6360) SP1.

TIA for any hint.

Bye - J.Baalmann

wink

  • EA User
  • **
  • Posts: 48
  • Karma: +0/-0
  • Montjoie, que jamais ne choit!
    • View Profile
Re: filtering diagram types for doc generation
« Reply #12 on: February 06, 2006, 07:21:56 am »
Hello,

Here is what I use in my doc files:
for images:
Code: [Select]

 { INCLUDEPICTURE " Images\\EAID_E565EE3A_56F6_4f21_84F1_73D98E21BA20.GIF" \* MERGEFORMAT \d }


for RTF documents:
Code: [Select]

 { INCLUDETEXT "D:\\DvE\\LMDU\\Documentation\\LMDU_General Use Case Model .RTF" \! }


HTH
cheers Manfred
Best regards,
Manfred

jbaalmann

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: filtering diagram types for doc generation
« Reply #13 on: February 06, 2006, 07:52:59 am »
Hello Manfred,

Thanks for the quick reply. Nevertheless, I think you use a different approach than me. I actually generate a RTF document with all model diagrams included and then try to reference only a particular one from within MS Word. Therefore, I used something like

Code: [Select]

{ INCLUDETEXT "C:\\test.rtf" "BKM_EE2F2175_D288_42b0_8609_6A46FA15A91E" }


This should link to my generated document (test.rtf) and reference the specific diagram within it. This actually fails. I managed to include a full RTF document, but that is not my goal. Maybe I should try the 2nd approach from michael_rainwater, but as he mentioned that his first is his preferred one (and the documentation suggests it) I tried that one only.

The first code snippet seems to include a picture that was generated via "Generate HTML documentation", right? How did you manage to create a file with a somehow unique filename?
With my version of EA, I only get file names like "EA10.png" in a directory structure named "EA1\EA3" and so on. This seems to change when inserting new elements in the model, so I did not try to include these files.

wink

  • EA User
  • **
  • Posts: 48
  • Karma: +0/-0
  • Montjoie, que jamais ne choit!
    • View Profile
Re: filtering diagram types for doc generation
« Reply #14 on: February 06, 2006, 08:16:52 am »
Well actually I use the same approach as you.

I generate the RTF documents from the model including the diagrams and then include the RTF in a master MSword document.
(See the second snippet in my previous post)

Then you select "update fileds" from the right mouse popup menu and you will see the text and images as well.

If you now select (highlight) only an image from that inclusion and choose "toggle filed" you will actually see a line like the first snippet in my previous post.

This comes from the fact that EA generates the image names based on its own CLSID's and then puts them in the "/images" folder. Then it puts the includeImage statement inside the RTF document.

BTW, you can choose to include the images inside RTF in the document generation options!

I hope I was clear enough  

:D

cheers,
Manfred
Best regards,
Manfred