How to automate the generation of HTML output in Enterprise Architect

我的未来我决定 提交于 2019-12-03 07:40:03

问题


Enterprise Architect has a way to generate the documentation in HTML/RTF/etc. that you could publish, but you have to use its GUI to do that manually. When you have your *.eap files in a CVS/Subversion server, it would be useful to have a script that would check out daily the latest version and publish it in a web server. As long as I know, EA doesn't have a command line utility for this purpose. I found that you can automate almost anything using its COM interface, but that means it's necessary to write a small program to do that. Any ideas about the easiest/cleanest way to do that (without having to write code, if possible)?


回答1:


I'm afraid you will need to write some code, but it shouldn't be more than a dozen lines or so. The function you will want to call is Project.RunHTMLReport() - a quick search for "RunHTMLReport" in the EA help file will tell you what parameters it needs, and a search on the Sparx website forum will find you an example or two.




回答2:


Thanks chimp, It was easier than I thought. In Java:

class EADump
{
    public static void main(String[] args)
    {
     org.sparx.Repository r = new org.sparx.Repository();

     System.out.println("Repository: " + args[0]);
     System.out.println("Package:    " + args[1]);
     System.out.println("Output:     " + args[2]);
     r.OpenFile(args[0]);
     r.GetProjectInterface().RunHTMLReport(args[1], args[2], "GIF", "<default>", ".html");
     r.CloseFile();
    }
}


来源:https://stackoverflow.com/questions/221654/how-to-automate-the-generation-of-html-output-in-enterprise-architect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!