Page tree

MagicDraw 19.0 LTR SP3 Documentation


To use the Import tool syntax


  1. To declare Import tool in the template, type #import ('import', 'com.nomagic.reportwizard.tools.ImportTool') in the document that you want to import its content to the report. The #import directive will load Import tool so that it can be accessed inside the template.
    • The first parameter 'import' is for identifying the alias of Import tool (in this case, 'import', but it can be named anything).
    • The second parameter 'com.nomagic.reportwizard.tools.ImportTool' has to be copied as it is (do not rename it). Otherwise, Import tool will not be loaded.
  2. To import any content from a child template, type the following in the document that you want to import its content to the report:    
  • $import.include('child.docx') to import a complete document at the current position of the template, and/or
  • $import.includeSection('child.docx', 'Section A') to include only the text contained in the named section of the document.


$import

This part names the alias assigned to Import tool when declaring it to the template.


$import.include(FileName)

FileName in $import.include(FileName) specifies the location of a file in the file system. FileName can be either an absolute or relative path to a file in the file system. The FileName parameter can be set either statically or dynamically. If the file is not found in the file system, FileName would be searched as an Attached File element in a MagicDraw project in the File property.


$import.includeSection(FileName, SectionName)

FileName in $import.includeSection(FileName, SectionName) functions the same as in the sub-section above. FileName can be either an absolute or relative path to a file in the file system. SectionName denotes a paragraph in the document named FileName, which is delimited by the #sectionBegin(SectionName) and #sectionEnd identifiers. The SectionName variable can also be set either statically or dynamically. If the file is not found in the file system, FileName would be searched as an Attached File element in a MagicDraw project in the File property.

Information

You can also use $attachedFile in the parameter of $import.include(FileName) and $import.includeSection(FileName, SectionName).

Related page

  • No labels