Author Topic: Document template as toolbox element ?  (Read 843 times)

JohnDoe

  • EA User
  • **
  • Posts: 191
  • Karma: +0/-0
  • EA rocks !
    • View Profile
Document template as toolbox element ?
« on: April 12, 2008, 03:49:15 am »
I want to drag a custom symbol from my custom toolbox (profile) to a diagram. Then by double clicking that symbol, I would like to open the RTF editor, which already contains a prepared document (an empty meeting protocol).

The idea is, to setup a toolbox with maybe 10 prepared document templates, which can be drag'n dropped into diagrams containing template documents (e.g. meeting protocol, risk analysis document etc.).

I want to offer my users a simple way to mount these documents to diagrams without forcing them to use the hidden "Project->Documentation->Generate RTF-Documentation" Dialog. I want to offer them prepared templates in a custom toolbox.

Thanks in advance for tips or ideas
Bernd

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Document template as toolbox element ?
« Reply #1 on: April 12, 2008, 05:02:19 am »
Why not create an MDG Technology with a small profile (to set up a stereotype so EA will recognize your customized element), a toolbox pane (so there will be a custom icon) and perhaps a diagram definition.

Then write a short MDG add-in (not simply an automation project with the 'regular' API) to trap the appropriate events on your element - creation, double-click, invoking the properties dialog. You can show your own customized dialog, trigger additional actions as appropriate, then cancel EA's default handling of the event (so you won't get the EA dialog after yours).

David
No, you can't have it!

JohnDoe

  • EA User
  • **
  • Posts: 191
  • Karma: +0/-0
  • EA rocks !
    • View Profile
Re: Document template as toolbox element ?
« Reply #2 on: April 17, 2008, 09:19:57 pm »
Hello Midnight,

hmm .. is there any tutorial/example available to show me how to do this ? :-)

I made it to create a toolbox using profiles (using this diagram metaClasses thing), but I did not know that you can create custom property dialogs. Are there any tutorials available about custom dialogs ?  :P

Thanks
Bernd

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Document template as toolbox element ?
« Reply #3 on: April 17, 2008, 10:04:46 pm »
Sadly, there's not much information on this Bernd,

This is not something you do as part of creating the MDG Technology - in the sense of the XML file - but rather it is a form of EA Add-in. You need to create a project that responds to the events that EA generates.

There might be a white paper - I have not looked for some time - that covers this. Otherwise you are left with the EA documentation and searching the forum.

Don't panic! It can look a bit daunting at first, but it is actually not too difficult. Once you get the swing if it you'll be fine.

Look in the EA help file. The section you want is right above the 'usual' automation section. It is titled - at least in the build 828 documentation - Enterprise Architect Add-in Model, and is above the EA Object Model section. This describes the events you will need. I suspect that you will find what you need under Broadcast Events.

Remember to cancel the EA dialog when you bring up your own. If you don't nothing bad will happen, but you will get both your dialog and the EA default dialog in sequence, which can be disconcerting.

HTH, David
No, you can't have it!