Book a Demo

Author Topic: Automatic generation of documentation  (Read 6836 times)

vitmatejka

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Automatic generation of documentation
« on: April 20, 2005, 09:48:27 am »
I have a need to regularly generate HTML documentation from my model.
I think about some script (e.g. bat file) which could call EA from command line to generate HTML documentation.
Is it possible ?

Thanks,
Vit Matejka

didier

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile

thomaskilian

  • Guest
Re: Automatic generation of documentation
« Reply #2 on: April 21, 2005, 03:52:44 am »
Hi,
by coincidence I found out that specifying a GUID of {} will do the job  :)

didier

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Automatic generation of documentation
« Reply #3 on: April 21, 2005, 04:35:58 am »
Correct - Thank you

vitmatejka

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Automatic generation of documentation
« Reply #4 on: April 21, 2005, 04:50:24 am »
Is it possible to generate HTML documentation using the pl script mentioned below as well ?

didier

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Automatic generation of documentation
« Reply #5 on: April 21, 2005, 07:43:15 am »
Yes, using RunHTMLReport

Example :
Replace
   $pi->RunReport ($GUID, $template, $target)
by
   $pi->RunHTMLReport ($GUID, "C:\\Temp\\", "PNG", "", ".htm")

vitmatejka

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Automatic generation of documentation
« Reply #6 on: April 21, 2005, 08:24:41 am »
That's great !

Thanks a lot.

michael_rainwater

  • EA User
  • **
  • Posts: 53
  • Karma: +0/-0
    • View Profile
Re: Automatic generation of documentation
« Reply #7 on: April 21, 2005, 02:33:30 pm »
This is very helpful.  I was looking for something very similar to this recently (and posted a query here).

I noticed you are using a method RunReport() in the EA API.  But I don't see this method when I search the help file.  I guess it just isn't documented. :-(

Does this method have any other options?  Can I use it to generate docs from a class that is stereotyped as "Model Document"?  See the Help file under Creating Documents --> Virtual Documents to see what I'm talking about.

If I can't do this, can I use the method to generate a document if it is defined in the Resource View (this saves the template info as well)?

Thanks for your help.  This is a great example because it's short and easy to understand.  I appreciate you posting this and making it available.

thomaskilian

  • Guest
Re: Automatic generation of documentation
« Reply #8 on: April 22, 2005, 02:29:00 am »
Actually the method is documented (if you know where). Honestly speaking I'd expect an EA repository with all methods and attributes to be the documentation source for the automation interface. Once I had Rose I would have reverse engineered the DLL in order to get a handy documentation - but (I still have a key but don't like to go through reinstalling the whole stuff)...
Still waiting for the upcomming next release - reverse engineering EA's DLL to have the automation interface in EA. :)

Regarding the Model Document. Although this is a new nice feature I don't believe it will fit in the old documentation scheme. Try F8 with the Model Document and you'll see. It only works with the Menu.

I'd rather like EA to stop adding new features and work on the existing ones to be more consistent :( (Yes, Paolo, I'm in line with you)

Edit: Search for "getprojectinterface" in the help. The third hit will show you the methods you looked for. :-/
« Last Edit: April 22, 2005, 02:49:41 am by thomaskilian »

mikewhit

  • EA User
  • **
  • Posts: 608
  • Karma: +0/-0
  • Accessing ....
    • View Profile
Re: Automatic generation of documentation
« Reply #9 on: April 22, 2005, 05:18:54 am »
Quote
I'd rather like EA to stop adding new features and work on the existing ones to be more consistent
Seconded. (But sorting out DDL is good!)

michael_rainwater

  • EA User
  • **
  • Posts: 53
  • Karma: +0/-0
    • View Profile
Re: Automatic generation of documentation
« Reply #10 on: April 26, 2005, 07:10:19 am »
I thought I would also point out... I took the GUID from my class which was stereotyped as "Model Document" and tried to use this in the script.

As suspected (and Thomas pointed out) this doesn't work.  I can't seem to pass the GUID of the model document class to the RunReport() method and get only the packages specified in that class included in the RTF.  In my case, it actually created the whole document.  This had the same effect as using "{}" as the GUID.

So, I still can't seem to generate the RTF from these model document classes using the API.  :'(

Jake

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Automatic generation of documentation
« Reply #11 on: September 05, 2005, 06:07:17 am »
Hi

I generate HTML report with autodoc.pl
It work fine when I run il interactively.
But, when It run via the scheduler (windows 2003 server, user with administrative rigths, logged off), there is no file generated.

Can someone help ?

Tks

thomaskilian

  • Guest
Re: Automatic generation of documentation
« Reply #12 on: September 05, 2005, 07:07:45 am »
Maybe some Path issue? Try to add code that produces a log file in the beginning. So you see whether it's called at all. You can then add logging information to trace the problem.

Jake

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Automatic generation of documentation
« Reply #13 on: September 05, 2005, 08:00:29 am »
Any idea ?
The perl script is launched by a bat file.
I have make a simple test :
- run a scheduled task while NOT logged on
- run a scheduled task while logged on

The logged off test fails (see the pl script below):
- Logged off :
+++ starting EA

- Logged on :
+++ starting EA
+++ opening model
+++ getting project interface
+++ Enumerating projects 1
+++ running HTML Report
+++ Atodoc ended


Here is the pl :

Open the model file
print "+++ starting EA\n";

my $ex = Win32::OLE->new('EA.Repository', \&OleQuit) or die "Can't start EA\n";

print "+++ opening model\n";
$ex->OpenFile($model);

# get the XML/Report interface

print "+++ getting project interface \n";

my $pi = $ex->GetProjectInterface();

# the next call is not necessary, but without it does not work :-/

print "+++ Enumerating projects 1\n";


$pi->EnumProjects(1);
# start the report

my $GUID = "{}"; # can be found in the properties window

print "+++ running HTML Report\n";

$pi->RunHTMLReport ($GUID, "$ContentDir", "PNG", "", ".htm") ;
#

print "+++ Atodoc ended\n";



Jake

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Automatic generation of documentation
« Reply #14 on: September 05, 2005, 08:03:31 am »
i forget the sub of the pl :


sub OleQuit {
   my $self = shift;
   $self->Exit();
}