Sparx Systems Forum

Enterprise Architect => Suggestions and Requests => Topic started by: Silvio Di Pasquale on August 18, 2008, 12:13:44 am

Title: Template Editor
Post by: Silvio Di Pasquale on August 18, 2008, 12:13:44 am
Many times I need control the information section that I put on my document template in order to print in particular order the requirement information or to print something based on the value of the stereotypes etc., etc. etc. ... I suggest to introduce in a easy control leaguage that allow management of  the information section...

Silvio
Title: Re: Template Editor
Post by: marcelloh on August 20, 2008, 07:49:53 pm
A solution would be to have a real template language included in EA.

So you can do stuff like (Pseudo-code):

$package
for each element {
....if type="UseCase"
....{
........${name} - ${note}
....}
}

or:
for each UseCase{
....${diagram.name} - ${diagram.img}
....for each Request{
........${req.name} - ${req.note}
....}
}

This would give the author so much more freedom in the way a document is generated.

There are good template engine in the open source field.....,
the only thing is to feed it with the right objects.
Title: Re: Template Editor
Post by: Dermot on August 21, 2008, 12:29:07 pm
If suggest you have a look at the code for the Automation Interface to Word - See: http://www.sparxsystems.com.au/resources/developers/autint_vb_download.html & http://www.sparxsystems.com.au/resources/developers/autint_vb.html - this gives the full flexiblity to code what output you want.
Title: Re: Template Editor
Post by: marcelloh on August 21, 2008, 03:04:12 pm
Okay, perhaps I'm just not a MsWord Lover  ;)
Let's try this....

Oh wait, I've got an error.  >:(

An error occurred while attempting to communicate with an AddIn:
EADocuments (EADocuments.EAAddin)
EA_MenuClick: Component "COMDLG32.OCX" or one of its dependencies not correctly registered: a file is missing or invalid. Please contact the add-in provider for assistance.

So, yet again, we are stuck, dear Watson....

Okay, attempt no. 2

Register some more stuff like this "COMDLG32.OCX".

Yeah, something can be run. Let's do this  :)

I can choose Use Case. (so that is one use case, hmmmm, it seems like it wants me to generate a report for each separate use case.)
Let's select one use case and run the addin.

Let's type something in this introduction field.
Oh, wait, that doesn't work. :o

It starts, it's running.... wait a minute, another error  >:(

Use Case Main - Err: - Het gevraagde lid van de collectie bestaat niet
(Which is Dutch by the way, saying something like: The requested member of the collection does not exist)

Okay, perhaps my mistake..., let's do attempt no. 3:
Generate my docs from a selected process.

Since it takes some time, and I'm typing this 'report' live, I switched from EA back and forth to my browser. Which of course I shouldn't have done, because there's another strange behaviour: A window mentioning that I have to (translated from Dutch) Activate,  Redo, Cancel. Whatever button I choose, again I've lost some more minutes.
This again must be my mistake....  :-/

Let's kill EA, and do it again, while not switching form app to app.
Attempt no. 4:
No difference from attempt no. 2
(By the way, this is the moment where WINWORD stays in memory causing attempt no. 3 to fail.)


Let's go some more higher up in my tree.
Let's do all use cases, attempt no. 5:
Again, but more quickly the same message as attempt no. 3.

So basically, I've spend a half hour, because I really believe this stuff is going to work, but without any positive result.

If anyone can kick me in the right direction, that would be great.
(and yes, I like to get kicked around  ;) )

Title: Re: Template Editor
Post by: «Midnight» on August 21, 2008, 10:40:01 pm
What did you use to register the add-in? If you used regsvr32 you are doing it wrong. Use the regasm tool that comes with Visual Studio.

[That is documented in VS, and would show up on a forum search.]

Make sure you are using a recent version of .Net. If not (for example, if you are using .Net 1.1) then create your own interop assembly - following the usual directions that apply to .Net - and reference that assembly. If you use the one that comes with EA you'll have two .Net versions and things will break.

Search the forum, follow the directions, then please post the results in a concise fashion. I do appreciate how frustrating this can all be, but you're making it very difficult for the rest of us to help you.

David
Title: Re: Template Editor
Post by: marcelloh on August 21, 2008, 10:56:35 pm
I followed instructions found on this page (I always look at the site before scanning the forum):

http://www.sparxsystems.com.au/resources/developers/autint_vb_calling_from_ea_addin.html

And there they mention to regsvr32 the dll, so I did.

I don't have visual studio, and not gonna buy it.
I run a tool called VersionCheck to see which version of .Net is installed.
1.1.4322.2407
2.0.50727.1433
(It's just a customers machine with Win2000 and can't do much about it.)

Title: Re: Template Editor
Post by: «Midnight» on August 21, 2008, 11:00:51 pm
I suggest you start a new thread for this.

Also, include the tool and language you are using to create the add-in (i.e. is it VBA, VB6, VB.Net) and the version.
Title: Re: Template Editor
Post by: Silvio Di Pasquale on August 24, 2008, 02:41:08 pm
Hi Dermont,

 :-/  before to submit my request I already saw the example that you have suggested, but it require big effort to build efficiently a template.... In addition, it could be not a "confortable" path to follow when someone (like me) work for many customer and each one has different template... I figure out that the powerful of the Standard Template Editor is efficiently enough...  I'd like to keep this feature and do not lose it passing to your suggestion... To increase the power on the Standard Template Editor could be enough just little "filters, conditions, sort" to put in the information section  ;)