Author Topic: .NET class library Exporter: Method to generate XM  (Read 12036 times)

dirc

  • EA User
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
.NET class library Exporter: Method to generate XM
« on: October 03, 2003, 06:59:40 am »
I was looking at the marvellous .NET Class Library Exporter for EA kindly provided by Ian Hunter.

Having a few seconds spare time, I tried it out and found that it was not complete in that the XML generation was commented out and incomplete.

I was looking at extending the work he did. Now, my questions are:
  • I have found a method on the Project class to ExportPackageXMI. However, the parameters are not fully documented. For instance:
  • What are the allowable values for XMIType?
  • Also, the parameters are Long, yet the values given are True. So how are you mapping True to a Long? Is it 1 for true and 0 for false?
  • Also, method is supposed to return a string. I was expecting this to be the XML string we are exporting, but this is always blank. however
  • Finally, the exporter uses Repository.ShowWindow(int) What value should be passed in to ensure that the window is not shown?
???

If I can get this working, I may well use this to create an addin which can be used to import any .NET assembly into an EA diagram.
;)
dirc

dirc

  • EA User
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
Re: .NET class library Exporter: Method to generat
« Reply #1 on: October 06, 2003, 06:57:26 am »
Well, since the rush to answer this one was so ovewhelming,  :'(
I soldiered on and got it working by myself! ;D
The only problem I am still left with is the fact that I cannot get the application to load with out showing in a window....

(To recap, I am using the Automation objects to create a package and add classes. When complete, this package is exported as XMI for import into any EA repository.)

Can anyone help with this one (using V3.6) or is this a bug?
dirc

dlundy

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: .NET class library Exporter: Method to generat
« Reply #2 on: October 06, 2003, 01:22:43 pm »
I wish I could help you - so apologies that this post doesn't address your need.

I did want you to know that a number of us read your post, are hoping you create this new tool, and are cheering you on!!

Its not much..but its what I got to give!

Dan
Dan Lundy

Phil_Bachmann

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: .NET class library Exporter: Method to generat
« Reply #3 on: October 06, 2003, 05:56:02 pm »
Currently we are looking into hiding a window, but the new Add-In interface is the way to go if you want seamless integration with EA.

Let me know if it doesn't suit your needs.

Phil Bachmann
Sparx Systems

dirc

  • EA User
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
Re: .NET class library Exporter: Method to generat
« Reply #4 on: October 07, 2003, 01:11:09 am »
I am using the AddInTemplate interface and the EA library. This is causing me some problems because I need to do this in .NET (for obvious reasons) and then make it all ComVisible so it can be used back in the COM world.... working around issues of getting  strong keys into the assembly so I can GAC it and then use it from COM.....needless to say I will probably get this working too.. eventually.... my experience of COM Interop is currently minimal.. but growing very quickly.... any pointers gratefully received!  :-*

Anyway, the point of this reply is to ask for more detailed documentation regarding the AddIn Library....  especially a fully working sample.. the snippets of code are minimal to say the least!... pretty please! ;)

Being able to extend the Application will benefit the community enormously!
dirc

SpoonsJTD

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: .NET class library Exporter: Method to generat
« Reply #5 on: October 07, 2003, 08:42:05 am »
Check out:
http://home.wi.rr.com/skulkarni/COM/COM_Interop.html

Make sure to set 'Register for COM Interop' to True under Project Properties->Configuration Properties->Build.

Here's one I created that loads up:

[size=10]namespace EAAddIn
{
     [Guid("BC797ACA-E8F7-42e7-95CB-BF9832A3F91F"),
     ClassInterface(ClassInterfaceType.None)]
     public class EAAddIn : EAAddInTemplate.Addin
     {

           public EAAddIn()
           {
           }
     
           #region _Addin Members

           public void ShowHelp(string MenuName, string ItemName)
           {
                 // TODO:  Add EAAddIn.ShowHelp implementation
           }

           public void MenuClick(ref EA.Repository Repository, string MenuName, string ItemName)
           {
                 // TODO:  Add EAAddIn.MenuClick implementation
           }

           public object GetMenuItems(string MenuName)
           {
                 // TODO:  Add EAAddIn.GetMenuItems implementation
                 return null;
           }

           public void FileOpen(ref EA.Repository Repository)
           {
                 // TODO:  Add EAAddIn.FileOpen implementation
           }

           public void Connect(ref EA.Repository Repository)
           {
                 //System.Windows.Forms.MessageBox.Show( "TestAddin connected" );
           }

           #endregion
     }
}[/size]

A contribution area for uploads here would be really nice.

Phil_Bachmann

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: .NET class library Exporter: Method to generat
« Reply #6 on: October 08, 2003, 10:11:39 pm »
G'day dirc,

We have studied the situation re: .NET and add-ins and have made some EA add-ins more compatible with .NET in the upcoming release (647).

BE SURE TO READ THE HELP FILE.

Re: Minimal code samples.  Yes they are basic at the moment but we knew that users were going to love add-ins so much that we could waste no time getting the feature out.

Regards,
Phil Bachmann
Sparx Systems

dirc

  • EA User
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
My .NET class library Importer Add-In
« Reply #7 on: October 09, 2003, 08:24:01 am »
I un-installed build 645 and installed build 647 today. This does not seem to have the AddInTemplate dll, the one with the new Disconnect() method...  :o

Please, Mr Sparx, can we have this asap!

Thanks

dirc

Phil_Bachmann

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: .NET class library Exporter: Method to generat
« Reply #8 on: October 09, 2003, 06:00:33 pm »
The dll file has been changed to a tlb file.

dirc

  • EA User
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
Re: .NET class library Importer
« Reply #9 on: October 29, 2003, 06:45:48 am »
After a mad rush (another project went live this week) I am now back on the trail of the .NET inporter.. watch this space!
dirc

mcavigelli

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: .NET class library Exporter: Method to generat
« Reply #10 on: January 09, 2004, 08:33:16 am »
Quote
Well, since the rush to answer this one was so ovewhelming,  :'(
I soldiered on and got it working by myself! ;D
The only problem I am still left with is the fact that I cannot get the application to load with out showing in a window....


The parameters are somehow documented in this forum at
http://www.sparxsystems.com.au/cgi-bin/yabb/YaBB.cgi?board=Latest;action=display;num=1015237306

I have tried to export the diagrams as gif (2) images, which works as expected. However I have not been able to export png (3?) images. The dialog looks like this:

  • the combobox for the image type is set to PNG, but is disabled
  • the check flag in front of "Generate Image Diagrams" is not set, although I only changed the parameter for the image type in the method call


I'm disappointed that I can not export the diagrams to png images by automation :-(

Thanks for any help

Matthias
« Last Edit: January 09, 2004, 08:53:57 am by mcavigelli »