< 上一课 | 下一课 >

课程 5:添加元素以生成报告

本课程说明如何添加 Ant 脚本元素以生成报告。

要添加元素:

  1. 将光标定位在右边的 </target> 标记前面并输入 <pu
  2. 在“添加元素”窗口中,双击 PublishUMLBIRTReport
  3. 对于 modelPath 属性的值,输入 SimpleUMLModel 模型的标准路径。 此值与您在前一课程中对 modelPath 属性输入的值相同。
  4. 对于 targetOutputFolder 属性的值,输入 C:\temp\antrpt
  5. 对于 targetOutputFile 属性的值,输入 MetricReport.html
  6. 对于 reportDesignFile 属性的值,输入 UML 模型度量报告报告设计文件的标准路径。 要查找该路径,执行下列步骤:
    1. 单击窗口 > 显示视图 > 其他,展开报告节点,然后双击报告资源管理器以打开“报告资源管理器”视图。
    2. 展开 UML 模型
    3. 右键单击 UML 模型度量报告;然后单击属性
    4. 复制从 file:/ 开始的完整 URL,然后单击取消
    5. 将该 URL 粘贴到 url_to_rptdesign_file 上。
  7. 删除 transform="id_of_transform_to_run_on_model"。一定要小心,不要删除右边的斜杠和括号(/>)。
  8. 其他属性仍然使用缺省值。
  9. 单击文件 > 保存以保存文件。

现在,Ant 脚本中应该包含下列元素。注意,您的部分属性值可能有所不同。

<project default="foo">
<target name="foo">
  <!-- ===================================================================
       	 modelPath: required parameter, fully qualified path(FQP) to the model to publish
       	 outputFolder: required parameter fully qualified path(FQP) to folder to publish to
       	 outputFilename: required parameter such as index.html
       =================================================================== -->         
      		<com.ibm.xtools.publish.CLModelPublish
          modelPath="C:\workspace\SimpleUMLModel\models\SimpleUMLModel.emx"
          outputFolder="C:\temp\antpub"
          	         	outputFilename="myPublishedModel.html"
          	         	overwriteExisting="true"
          	         	preview="false"
          	         	showIcons="true"
          						genDate = "false"
          	         	diagramImageFormat="gif"
          	         	detailLevel="full"
          	         	errorHandling="ignore"/>
	    
  <!-- ===================================================================
       	 modelPath: required parameter, fully qualified path(FQP) to the model to publish
       	 targetOutputFolder: required parameter, fully qualified path(FQP) to folder to publish to
       	 targetOutputFile: required parameter, file name of the report
       reportDesignFile: required parameter, a URL to a report design to run, see notes above for details
       =================================================================== -->         
      <com.ibm.ccl.erf.rsa.report.ic.ant.UMLBirtReportPublish 
          modelPath="C:\workspace\SimpleUMLModel\models\SimpleUMLModel.emx" 
          targetOutputFolder="C:\temp\antrpt" 
          targetOutputFile="MetricReport.html" 
          reportDesignFile="file:/C:/Program Files/IBM/SDPShared/plugins/com.ibm.ccl.erf.rsa.report.data/designs/umlModelMetrics.rptdesign" 
          	         	overwriteExisting="true"
          	         	autoShowPublishedOutput="false"
          errorHandling="ignore" 
          outputType="html"/>
	    
  </target></project>
< 上一课 | 下一课 >