简体   繁体   English

Enterprise Architect中带有图表“超链接”的文档?

[英]Documentation with Diagram “Hyperlinks” in Enterprise Architect?

I'm struggling to get all the required (and only the required) information into the documentation of my Enterprise Architect Project. 我正在努力将所有必需的(并且只有必需的)信息提供给我的Enterprise Architect项目的文档。 Precisely: we have modelled various requirements and displayed the source "standards" for these requirements in our diagrams by using the "hyperlink"-element out of the common toolbox. 准确地说:我们通过使用常用工具箱中的“超链接”元素,为我们的图表中的这些要求建模了各种要求并显示了源“标准”。 (This allows us to capture a title, the website where the documentation is found and a description of this documentation). (这允许我们捕获标题,找到文档的网站以及本文档的描述)。

Now this element is visible on the diagram, but not in the package-view of our model and it does not get generated in our word (docx) documentation. 现在这个元素在图上可见,但不在我们模型的包视图中,并且它不会在我们的单词(docx)文档中生成。

I can see that it should be possible to get this in the documentation, because a "Model Report" which basically prints everything does print the hyperlinks. 我可以看到应该可以在文档中得到这个,因为基本上打印所有内容的“模型报告”会打印超链接。 But I can't find what I have to select in my template (in the package-tree view, as a package field, element field or diagram field) in order to get this printed. 但我无法在模板中找到我要选择的内容(在包树视图中,作为包字段,元素字段或图表字段)以便打印。 I can't just use the model report since this basically dumps the whole database in the document and reverse-engineering this model report has proven too difficult for me. 我不能只使用模型报告,因为这基本上将整个数据库转储到文档中,并且反向工程化这个模型报告对我来说已经证明太难了。 Actually I would expect this to be in some kind of documentation for EA, but could not find such a thing with this level of detail... is there, is there a reproducible way of finding such things out in further cases? 实际上我希望这可以在EA的某种文档中找到,但是在这个详细程度上找不到这样的东西......是否有,在其他情况下是否有可重现的方法来找到这样的东西? (btw I'm using EA 11.0) (顺便说一句,我正在使用EA 11.0)

[sorry there were illustrations here, but I'm not allowed to upload them...] [抱歉这里有插图,但我不允许上传它们......]

As Geert has already noted, there is a difference between "proper" elements and diagram-only elements. 正如Geert已经指出的那样,“正确”元素和仅图表元素之间存在差异。 This is actually reflected in the document template editor, where there is an "Element" section inside the "Diagram" section. 这实际上反映了文档模板编辑器中,“图”一节的“元素”部分,在那里有。 This will produce output for all elements in the diagram, whether or not they are also in the project browser. 这将为图中的所有元素生成输出,无论它们是否也在项目浏览器中。

Here's an example of the information you can pull out of your hyperlinks. 以下是您可以从超链接中提取的信息示例。 Given a diagram with a hyperlink: 给出带有超链接的图表:

图

... and a template which outputs name, alias and hyperlink for each element in the diagram: ...以及为图中的每个元素输出名称,别名和超链接的模板:

模板

... EA will generate a document will the following contents: ...... EA将生成一份文件,内容如下:

文献

So if you want the hyperlink to result in a hyperlink in the document, use the HyperlinkAlias field. 因此,如果您希望超链接导致文档中的超链接,请使用HyperlinkAlias字段。

What might be a bit confusing is the fact that in addition to the Hyperlink element type in the Common diagram toolbox, EA allows you to create hyperlinks in regular elements (in the Element Properties dialog, Related tab: Files, which can be local files or web addresses). 可能有点令人困惑的是,除了Common Diagram工具箱中的Hyperlink元素类型之外,EA还允许您在常规元素中创建超链接(在“元素属性”对话框中,“相关”选项卡:“文件”,可以是本地文件或网址)。

In fact, I would recommend that you use those in your Requirement elements rather than diagram-only Hyperlinks if traceability is a priority in your model. 实际上,如果可追溯性是模型中的优先级,我建议您在Requirement元素中使用它们而不是仅使用图表的超链接。 The diagram-only Hyperlinks, on the other hand, give you a clearer visual. 另一方面,仅图表的超链接为您提供更清晰的视觉效果。

Selecting a subset of the elements in a diagram ("only the required information") is a little more involved and depends on how your model is structured. 选择图表中元素的子集(“仅需要的信息”)稍微复杂一些,取决于模型的结构。 Template fragments will get the job done, but you might be able to achieve your desired result by just using the filters in the document generation dialog. 模板片段将完成工作,但您可以通过在文档生成对话框中使用过滤器来实现所需的结果。

The hyperlink is an element that is stored in the same package as the diagram it is used on, it is just not visible in the project browser (similar to a note element). 超链接是一个元素,存储在与其使用的图表相同的包中,它在项目浏览器中不可见(类似于注释元素)。

There's a good chance that it doesn't have a name, so make sure you don't omit nameless elements. 它很可能没有名称,所以请确保不要省略无名元素。

So if you print all the element of the package containing the diagram then you should be able to print the hyperlink as well. 因此,如果您打印包含图表的包的所有元素,那么您也应该能够打印超链接。

In case that fails you might want to consider creating a template fragment based on an SQL query or a script. 如果失败,您可能需要考虑基于SQL查询或脚本创建模板片段。 Those offer lots of flexibility to print whatever you need, even if it is located in a different package. 它们提供了很大的灵活性,可以打印您需要的任何内容,即使它位于不同的包装中。

[Edited on 04.05.15 to reflect the comment by Uffe and provide a final solution] [编辑于04.05.15反映Uffe的评论并提供最终解决方案]

Ok, based on Geerts answer, using the following custom query fragment in the diagram section: 好的,根据Geerts的回答,使用图表部分中的以下自定义查询片段:

select 
    t_object.ea_guid as CLASSGUID, 
    t_object.Object_Type as CLASSTYPE, 
    t_object.Object_Id as OBJECTID, 
    t_object.name as HL_Name,
    t_object.Stereotype as HL_Stereotype,
    t_object.object_type as HL_Type,
    t_object.Alias as HL_Alias,
    Note as Notes
    --,t_object.*
from t_object
  left join t_diagramobjects on (t_object.Object_ID = t_diagramobjects.Object_ID)
  left join t_diagram on (t_diagram.Diagram_ID = t_diagramobjects.Diagram_ID)
where t_diagram.Diagram_ID = '#DIAGRAMID#'
  and t_object.Object_Type='Text'

I was able to get a list of the hyperlinks following the diagram, this is the fragment: 我能够得到图表后面的超链接列表,这是片段:

custom >
{HL_Alias}: {HL_Name}
{Notes}
< custom

The "Notes" can be printed by getting the attribute directly out of the t_object table. 可以通过直接从t_object表中获取属性来打印“Notes”。 Don't get confused as I was at first: the auto-completion on t_object and the results (t_object.*) DO NOT SHOW a Note-Attribute, but it does exist an when you write it into the query, it gets generated in the document. 不要像我最初那样感到困惑:t_object上的自动完成和结果(t_object。*)不要显示Note-Attribute,但它确实存在,当你将它写入查询时,它会在该文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM