RK
As you know, we have implemented a feature to alow users to create a documentation for objects/models. It is implementated for ARIS Connect (SR16).
The content is stored as an HTML string in an aris attribute (images are stored on ADS). To be possible to use content of the attribute in reports we implemented an API (SR18) that loads images from ADS, transforms them to a byte array and includes it into the generated content. The API is implemented for models and objects and is described in the ARIS help (search for "HTMLAttribute"). .
Here is a simple example:
function main() {
var outputFile;
var model = ArisData.getSelectedModels()[0];
var attr;
attr = model.Attribute(Constants.AT_HTML_DOC, Context.getSelectedLanguage());
outputFile = Context.createOutputObject(Context.getSelectedFormat(), Context.getSelectedFile());
// here we use the string as a parameter for the function OutputFormattedText(),
// the second parameter must be set to false, to ensure that the report will show html content not a string representation of the attribute
outputFile.OutputFormattedText(getHTMLAttribute(model), false);
outputFile.WriteReport();
}
// this function provides content from the attribute
function getHTMLAttribute(item) {
var html = Context.getComponent("HTMLAttribute");
// in the backgroud we load all images, transform them to a byte array and
// include the array into the html string
str = html.getHTMLContent(item, Context.getSelectedLanguage(), false);
return str;
}
main();