Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - dano_labrosse

Pages: [1]
1
Automation Interface, Add-Ins and Tools / ImportPackageXMI()
« on: September 26, 2005, 07:29:00 am »
Hello,

I have tried to automate the HTML documentation process using EA’s COM API. The idea is to have it run nightly, check out the XMI files from CVS, generate the HTML reports and copy the HTML to our web directory.

However, I ran into a problem in that some XMI file are created as “root model”, so when importing an XMI file into a EA Project a dialog pops up requiring manual intervention, which not exactly ideal when your trying to automate something! There doesn’t seem to be a way to suppress this dialog in their API. However, if someone can find out how to turn off “root model” functionality when creating their XMI files, I would appreciate it if you let me know.

-Dano

2
Problem solved!

EA.Project proj = new EA.ProjectClass();  
proj.LoadProject("C:\\EAProjects\\UMLDoc\\UMLDoc.EAP");  
proj.ImportPackageXMI("5C22316B-4766-4741-B9EE-21941353F08F", "C:\\dev\\workspace\\UML\\Test.xml", 1,1);
proj.RunHTMLReport ("Test", "c:\\", "png", "<default>", ".htm");

The first param in ImportPackageXMI specficies the GUID of the element that you wish to add the XML file to. In my case I created an View called "Build" which was a child of the root level "Views" node. I then got the GUID of the "Build" node and added it to the above code. The last parameter specifies whether to add the node if it already exists which means you can have duplicate nodes (would be nice if it would overwrite an existing node though)

Thanks for your help!

3
Yeah, I can import manually (using the GUI) and generate the html doc without and trouble. Its just the ImportPackageXMI method that does not seem to be working for me. Im using C#.

Thanks

4
EA.Project proj = new EA.ProjectClass();  
proj.LoadProject("C:\\EAProjects\\UMLDoc\\UMLDoc.EAP");
proj.ImportPackageXMI("Views", "C:\\dev\\workspace\\UML\\Test.xml", 1,0);
proj.RunHTMLReport ("Test", "c:\\", "png", "<default>", ".htm");

The code above loads the project and generates the doc. however it still does not import the XMI file correctly. Not sure where to go from here?

Thanks

5
It would be good if I could just create a new EA project and add the XMI files into it on the fly. But i failed to the code below to work. Do you have any idea what I might be doing wrong?

EA.Project proj = new EA.ProjectClass();  
proj.ImportPackageXMI("Test","C:\\dev\\workspace\\UML\\Test.xml", 1,1); //load the XMI
proj.RunHTMLReport ("Test", "c:\\", "png", "<default>", ".htm"); //run the html report

Thanks

6
Hi,

I want to be able to check out our XMI files from CVS and automatically generate HTML documentation based on each XMI file. Currently, I can generate HTML doc from EAP files. i.e. by calling LoadProject and RunHTMLReport but I have been unable to do this by loading the XMI files only. Anyone know if this is supported?

Thanks
-Dano

Pages: [1]