Page tree

MagicDraw 19.0 LTR SP3 Documentation


When you use -properties, other command actions are no longer necessary; the properties file contains the configuration information. The information in the properties file is the same as the information used in the command line.

Four parameters are needed to specify data for a report: project, output, template, and package. There are five more parameters called options, which are additional configuration information such as report, autoImage, imageFormat, recursive, and outputOnBlankField. All nine parameters are described in Generate - the Command to Generate Reports.

A properties file is a simple text file. You can create and maintain a properties file with any text editors (see the following example).

Properties file sample
#----main argument ----#
project = C:\\MagicDraw\\samples\\diagrams\\class diagram.mdzip
output = C:\\output\\output.rtf
template = Class Specification Report
package = java;Library System;magiclibrary;objects


#---- optional ----#
report = Built-in
autoImage = 1
imageFormat = png
recursive = false
outputOnBlankField = #NA

In the figure above, the command lines begin with a pound sign (#). The other lines contain key-value pairs. The key is on the left side of the equal sign, and the value is on the right. For instance, template is the key that corresponds to the value of the Class Specification Report.

The string representing the key and value in the properties file has a special character. The special character is an escape character. It must be used to prevent interpretation errors. Each escape character starts with a backslash.

Escape Sequence  Character
\n new line 
\t tab 
\bbackspace
\f form feed
\rreturn
\” “ (double quote)
\’‘ (single quote)
\\\ (backslash)
\uDDDDcharacter from the Unicode character
set (DDDD is four hex digits)

XML Properties File

J2SE version 1.5 and Report Wizard version 15.5 allow you to use XML files to load and save key-value pairs.

Properties DTD:

<?xml version="1.0" encoding="UTF-8"?>
<!-- DTD for properties -->
<!ELEMENT properties ( comment?, entry* ) >
<!ATTLIST properties version CDATA #FIXED "1.0">
<!ELEMENT comment (#PCDATA) >
<!ELEMENT entry (#PCDATA) >
<!ATTLIST entry key CDATA #REQUIRED>
Example
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPEproperties SYSTEM
"http://java.sun.com/dtd/properties.dtd">
<properties>
	<entry key = "project">C:\MagicDraw\samples\diagrams\class diagram.mdzip</entry>
	<entry key = "output">C:\\output\\output.rtf<\entry>
	<entry key = "template">Class Specification Report</entry>
	<entry key = "package">java;Library system;magiclibrary;objects</entry>
</properties>
  • No labels