2013-11-21 57 views
0

我想通过uml生成html文档,所有工作都很好。我的问题是,我将附上所有报告:文档加速问题

<html> 
    <body> 
     //report 
    </body> 
</html> 

我该怎么做?

这是我的,我会附上acceleo报告模板:

[comment encoding = UTF-8 /] 
[module useCase('http://www.eclipse.org/uml2/3.0.0/UML')] 

[template public generateUseCase(uc : UseCase)] 
[comment @main/] 

[file (('useCases.html'), true)] 

<h1>UseCase: [uc.name/]</h1> 
[if (uc.ownedBehavior->notEmpty())] 
<h5>Part of Activity: [uc.ownedBehavior.name/]</h5> 
[/if] 
<h3>Extension Points:</h3> 
[if (uc.extensionPoint->isEmpty())] 
<p>No Extension Points</p> 
[/if] 
<ul> 
[for (e : ExtensionPoint | uc.extensionPoint)] 
<li>[e.name/]</li> 
[/for] 
</ul> 
[/file] 
[/template] 

回答

1

斯特凡诺,

它始终是可能的(adviseable)进行细分,你的模板。在这里,而不是在一个文件中追加为每一个新的用例,你遇到,你可以使用一个循环:

[template public generate(p : Package)] 
[comment @main/] 

[file (('useCases.html'), false)] 
<html> 
    <body> 
[for (uc : UseCase | p.eAllContents(UseCase))] 
    [generateUseCase(uc)/] 
[/for] 
    </body> 
</html> 
[/file] 
[/template] 

[template public generateUseCase(uc : UseCase)] 
<h1>UseCase: [uc.name/]</h1> 
[if (uc.ownedBehavior->notEmpty())] 
<h5>Part of Activity: [uc.ownedBehavior.name/]</h5> 
[/if] 
<h3>Extension Points:</h3> 
[if (uc.extensionPoint->isEmpty())] 
<p>No Extension Points</p> 
[/if] 
<ul> 
[for (e : ExtensionPoint | uc.extensionPoint)] 
<li>[e.name/]</li> 
[/for] 
</ul> 
[/template] 

请注意,使用“eAllContents”我在这里做的是远离效率,您可能需要手动改为转到您的用例列表。