1
Automation Interface, Add-Ins and Tools / Re: Generating daily HTML report of entire reposit
« on: January 11, 2013, 10:29:47 pm »
Just FYI, this is how we did it here (I only have some Java knowledge from yeeeeeaaars ago at school, but it does the trick
).
The connection string is easy to find by right clicking the project in the popup when starting EA.
We have a few models, my required package is in the "Corporate" model, then browsing through a few package directories until you got at the one you would be right clicking on when doing it yourself.
The tmppath is just to publish this locally (afterwards I have a scheduled bat-file that runs the java program and copy pastes the HTML files to our SharePoint).
The template is a copy of the default web template with a few modifications, called "Value Circle".
Hopefully it helps you, I would have been happy to find that kind of script when I was looking for it

Code: [Select]
import org.sparx.*;
public class valuecircle2html {
public static void main(String[] args) {
org.sparx.Repository repo = new org.sparx.Repository();
org.sparx.Package corporate = null;
org.sparx.Package bpm = null;
org.sparx.Package bpm_vc = null;
org.sparx.Package vc = null;
org.sparx.Package pack = null;
// Connect to database
String conn = "SparxEa --- DBType=1;Connect=Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=SparxEa;Data Source=SS-BXL-DBSQL10";
repo.OpenFile(conn);
// Browse through structure
corporate = repo.GetModels().GetByName("Corporate");
bpm = corporate.GetPackages().GetByName("BPM");
bpm_vc = bpm.GetPackages().GetByName("BPM Value Circle)");
vc = bpm_vc.GetPackages().GetByName("Value Circle");
// Generate HTML Documentation
String guid = "" + vc.GetPackageGUID() + "";
String tmppath = "C:\\Users\\usjolb\\Desktop\\export";
String image = "PNG";
String template = "Value Circle";
String ext = ".htm";
repo.GetProjectInterface().RunHTMLReport(guid, tmppath, image, template, ext);
// Close connection to database
repo.CloseFile();
}
}
The connection string is easy to find by right clicking the project in the popup when starting EA.
We have a few models, my required package is in the "Corporate" model, then browsing through a few package directories until you got at the one you would be right clicking on when doing it yourself.
The tmppath is just to publish this locally (afterwards I have a scheduled bat-file that runs the java program and copy pastes the HTML files to our SharePoint).
The template is a copy of the default web template with a few modifications, called "Value Circle".
Hopefully it helps you, I would have been happy to find that kind of script when I was looking for it
