One simple approach to setting up and using Property Mapper with DITA-FMx.
Let’s assume that your source files are written in English and you want to produce PDFs in English and in German (additional languages can be added by following a similar approach).
Also assume that you’re using a “book-build” INI file and component templates in your build process for generating FM book and chapter files. (If you’re not familiar with these terms, please read the DITA-FMx documentation.)
A good naming convention is to include the language code in the folder name. For example, your English output could be built in a folder named book-enu, and the German output in a folder named book-deu.
This is done so the path referencing the component templates folder is the same in all book-build INI files (“../component-templates”). If you are using language-specific (or build-specific) component templates, this folder would be in the book-build folder, but if you’re planning on sharing the component templates between languages (made possible with the Property Mapper plugin), it’s best to move it up a level.
Open the Book template file (or your main component template if it differs significantly from the template), and run the
command. This creates an XML file that contains all of the supported properties for all of the supported objects in that file.This file is generated in the same folder as the file it was created from. Copy it to your book-build folder and give it a name like propertymap-enu.xml.
The initial property map file will include all of the possible properties. To reduce complexity, your property map file should only include the property definitions for those properties that will change in your localized output. Specifically, those properties that contain localizable strings (such as cross-ref formats and autonumber prefixes for notes and warnings).
The property map file format is DITA. You can edit this file in a text editor or in FrameMaker (or another XML editor). Each property definition is contained within a dlentry element and property definitions for each supported object type are grouped within dl elements.
Just locate and delete those properties that you know you won’t be changing for the localized output.
You can test the property map file by running the
command. This command prompts for the property map file to apply. Keep in mind though that unless you modify a property from the default settings, nothing will appear to happen.You actually don’t want to run this on the English build, but it’s good to set it up to run, then comment it out. That way the proper settings will be in place when you copy the INI into the language-specific folders.
In the BookBuildOverrides section set the RunScript parameter to 1, set ScriptName to Pubs-Tools:PropertyMapper, and set ScriptArgs to the property map file name.
[BookBuildOverrides] ... RunScript=1 ScriptName=Pubs-Tools:PropertyMapper ScriptArgs=propertymap-enu.xml
If you are already running one or more publishing plugins, you’ll need to use the syntax to allow multiple scripts to run. The ScriptName and ScriptArgs values must start with a vertical bar character and use the vertical bar to separate the name and arguments for each plugin. The example below is one possible option.
[BookBuildOverrides] ... RunScript=1 ScriptName=|Pubs-Tools:PropertyMapper|Pubs-Tools:MiniToc ScriptArgs=|propertymap-enu.xml|%BOOKID%
If you need to apply multiple property maps to the same set of files, see the information on the Automation topic.
Run a book-build and check the console log file to make sure the plugin runs and applies the specified properties. Keep in mind that assuming you haven’t modified any of the properties, nothing will appear to have been done. Just verify that it seems to work before continuing.
Once you’ve verified this, you should disable the plugin for the English build; there’s no reason to run it when it’s not performing anything useful for the English build. If this is the only publishing plugin you’re running, just change the value of RunScript to 0. If you’re running other publishing plugins, make a copy of the ScriptName and ScriptArgs lines, and comment out the two copied lines. In the uncommented lines, remove the PropertyMapper name and args so it’s only running the other plugin(s).
If you’re using any publishing plugins or have scripts or include files that are referenced by the book-build INI file, you’ll likely need to update them for the new language after copying them into the new folder.
You can test the changes by running the Apply Property Map command on an open XML topic.