To generate a report from the option specified in the properties file
generate -properties propertiesFileName
To generate an encrypted password for a server project
generate -generatepassword password
Anchor
Description
Description
Description
The Generate command creates a report document with a received set of information from arguments and parameters. The information will then be generated as a report document to the specified output file. By default, an argument is the specified data of the invoked parameters. If the -properties option is specified, the argument is the name of a properties file. A properties file contains other parameters, along with the specified data of each parameter.
Synopsis
Command
Function
-project projectFileName
Specifies the project path as a file name.
Note
title
Note
You can specify a project name and its branch after -project, for example:
Specifying the MyProject name alone means generating MyProject without specifying its branch.
Specifying MyProject##release means generating MyProject from the [release] branch.
Specifying MyProject##release##sp1 means generating MyProject from the [release] branch and [sp1] sub-branch.
-output outputFileName
Specifies the output file path as a file name.
-template templateName
Specifies a template name used to generate a report document.
Note
title
Note
The template must exist in the modeling tool prior to using this command, otherwise, an error will occur.
If the template name is not specified, the template specified in the Report Data (specified in the -report parameter) will be used instead.
-templatePath templatePath
Specifies a template path used to generate a report document. Both absolute and relative paths are allowed for this command. The specified template file must have proper structure as it has been added through the Report Wizard dialog.
Note
title
Note
If both -template and -templatePath are specified in the same command, the error will occur.
-package packageNameList
Specifies the name of one or more packages in a project to be included in the report. A semicolon must separate multiple package entries (;).
Warning
title
Warning: Duplicate qualified name
Do not enter a duplicate name of a root Model package or its immediate child package to the -package option.
-elementelementQualifiedNameList
Specifies the qualified name of one or more elements from a project to be included in a report. A semicolon must separate element entries (;).
-elementID
Specifies the element ID of one or more elements in a project to be included in the report. A semicolon must separate multiple element entries (;).
Note
title
Note
Element ID can be retrieved in:
Modeling tool element Specifications dialog under All Properties mode.
Velocity Template Language by calling $element.elementID for $element.
The element ID will be changed when the local project is added to a server. Please make sure the element ID is up-to-date.
[options]
Command-line options.
-properties propertiesFileName
Specifies the name of a properties file to utilize. Use only with -properties.
-generatepassword password
Generates an encrypted password to be used with a properties file.
Anchor
Options
Options
Options
The command line feature supports a set of options useful in adding additional configuration possibilities.
Command
Function
-report reportDataName|reportDataElementID
Specifies the name of a Report Data file or Report Data element.
Note
title
Note
The Report Data file must exist in the modeling tool prior to using this command, otherwise an error will occur.
The value for this command can be either a Report Data name or Report Data element ID.
If the -report parameter is not specified, the previous Report Data will be set and used instead.
-autoImage 0|1|2|3
Specifies how an image will be shown in a report document. The default value for this argument is 1.
0 – No resize.
1 – Fit image to paper (large only).
2 – Fit and rotate image (clockwise) to paper (large only).
3 – Fit and rotate image (counter-clockwise) to paper (large only)
-imageFormat jpg|png|svg|emf|wmf
Specifies an image format in a report document. The default value for this argument is jpg.
jpg – Joint Photographic Expert Group
png – Portable Network Graphics
svg – Scaling Vector Image
emf – Microsoft Windows Enhanced Metafile
wmf – Windows Metafile
-recursive true|false
Specifies how to select a package in a project. The default value for this argument is true.
true – Select the specified package and its recursive package.
false – Select only the specified package.
-includeAuxiliary true|false
Selects packages, including auxiliary packages. The default value is false.
-outputOnBlankField stringValue
Shows a string value in a blank field in a report document. The default value for this argument is “”.
-category categoryName
Specifies a template category.
-fields[name=value]
Specifies a variable.
-spassword encryptedPassword
Specifies an encrypted password to log on to the server. This option is available only in a properties file.
You can get encrypted password by entering this command below in command line prompt.
Specifies a serverAddress consisting of a scheme, userInfo, host, port, and path to connect and upload a generated report to a server (see Upload generated report to server).
Note
title
Note
In case the server has not been trusted, a message will be displayed in the command line, asking you to choose to accept or reject the server certificate.
-trustAll true|false
Trusts any certificate of the specific publishing server in -upload command. The default value is false.
If the value is true, the certificate will be trusted without asking any questions.
-overwrite true|false
Overwrites any previously generated files. The default value for this argument is true.
true – Overwrites all files automatically (removes any existing file before generating a report.)
false – If the file exists, the following prompt message will open:
Output file already exists.
Would you like to replace the existing file? [y][n]:
If you type ‘y’ or ‘yes’, the Report Wizard will generate a new report that replaces the previous one. If you type ‘n’ or ‘no’, the Report Wizard will not generate a report and terminate the process.
-pversion projectVersion
Specifies a server project version.
-ssl true|false
Specifies if a Secured Connection (SSL) is used. The default value is false.
true - Use Secured Connection (SSL)
false - Do not use Secured Connection (SSL)
-tag tagValue
An additional argument to generate reports from a server project by specifying a server project tag name. The tagValue is non-case sensitive. More than one project version may be returned from specifying one tag value. Hence, one report generation process may generate multiple reports. You cannot use this command with –pversion.
-incremental true|false
Specifies the incremental method. The default value is true.
true - The output report shall be generated by appending a new generated output file name with the incremental number.
false - The latest project version in the returned project collection. Use this command with -tag only.
-leaveprojectopen
Leaves the project open per property file after generating the report, in a series of report generation. The default value is false.
-loadmodule true|false
Loads all unloaded modules in a project. The default value is false.
true - All modules including unloaded modules are loaded while opening a project.
false - All modules except unloaded modules are loaded while opening a project.
-projectpassword projectPassword
Specifies a password for the protected Teamwork Cloud project. The password is required to open a protected Teamwork Cloud project for generating a report.
Anchor
UsingCommand
UsingCommand
Using command line
You can use the command line on Windows, Linux, or Unix.
To use the command line on Windows
Run a command line console. In the Console window, go to the local installation of the modeling tool's application.
Go to the plugins\com.nomagic.magicdraw.reportwizard folder, and type the command line there.
To use the command line on Linux or Unix
Run a terminal (command line console). In the Console window, go to the local installation of the modeling tool's application.
Go to the plugins\com.nomagic.magicdraw.reportwizard folder, and type the command line there.
See the following examples of command line on Windows and Linux or Unix respectively.
You can open multiple projects and generate multiple reports before the modeling tool shuts down. The generate command with the -properties option accepts multiple properties files as shown below.
Template, output, package, and project are the required data for each property file.
The following parameters are reset when finishing generating a report for each property file. Other parameter values affect subsequent property files, if there are no overridden values.
-project
-output
-template
-templatePath
-tag
-pVersion
-recursive
-category
-includeAuxiliary
Tip
title
Tip
When large-size projects need to be loaded and closed for many property files, it takes longer time to generate reports. In this case, you can use -leaveprojectopen as an option to reduce memory for loading each project when starting to generate a new report.