FrameMaker Plug-Ins, Structure, and Localization
By Doug Pearson, Localization / Application Development Engineer, ENLASO Corporation
The use of Structured FrameMaker both increases the possibilities for feature enhancement with plug-ins, and makes writing the plug-ins easier for the programmer creating them.
Plug-ins capitalize on Structured FrameMaker's ability to store document Metadata (through the use of elements and their attributes) in many ways.
Reducing the number of templates
For instance, a company that uses the same FrameMaker template for manuals involving many different products may need to modify the template slightly for each individual product. With structured FrameMaker, the product name can be stored in an attribute value. A FrameMaker plug-in can then read that name from the attribute and modify the template according to that value. For instance, the plug-in may place a different part number in the document footer or assign a different master page to the first page of the document.
Another challenge comes with template maintenance for localization projects. A plug-in to automatically localize templates means that only an English template needs to be maintained, as opposed to separate templates for each target language, as described below.
Automating formatting
On a sub-document level, FrameMaker plug-ins can be written to automate formatting that cannot be automated in the Frame 7 EDD (Element Definition Document). Table ruling and shading format overrides provide a good example. A table row element could be given an attribute that would control the shading or background color of all the cells in that table row. Since the EDD cannot control that characteristic, setting the attribute value would not change the appearance of the table. However, a FrameMaker plug-in could be written that would add a menu command to implement the table cell shading/color for all cells in table rows that use the appropriate attribute value. The user would only need to execute the command once per document (or, if the plug-in is written for the task, only once per book).
Automating repetitious tasks
FrameMaker plug-ins can be developed to perform frequently repeated tasks that are part of the localization process. One of the most time-consuming tasks is the necessity of template localization as mentioned above. Every time an English template is updated, either every target language template must be updated in exactly the same way, or the English template must be re-localized for every target language. The first option can quickly turn into a version control nightmare, while the second becomes prohibitively time-consuming if templates need to be maintained for multiple languages. But a FrameMaker plug-in can be written to implement all aspects of template localization including, changing tab stops, line spacing, font sizes/styles; and replacing text in variables, cross-reference formats, auto-number strings in paragraph styles, and on master/reference pages (including Frames displayed in the body, and the Index sorting strings).
Enhancing FrameMaker functionality
Another use of plug-ins is to add new features to FrameMaker or to enhance existing features. Structured FrameMaker supports not just structured documents but also entire structured books. However, the out-of-box application does not include the ability to generate structured book files (TOC, Index, etc.), only unstructured ones.
ENLASO has developed a customer-specific FrameMaker plug-in to generate structured book files that saves considerable publishing time on projects that require a fully-structured book, since publishers will not need to manually structure the generated files by use of a Conversion Table. Instead, generating those files becomes seamlessly automated. Although originally authored for a specific client's Structured Application, the algorithms used by these plug-ins can easily be modified to work with any other templates/EDDs/Structured Applications.
How Structured FrameMaker eases creation of plug-ins
One notable aspect of FrameMaker plug-in authoring is that the use of Structured FrameMaker allows for more-powerful plug-ins to be written more easily by the in-house developer. The presence of elements corresponding to specific, meaningful blocks of the FrameMaker document simplifies the process of writing code to locate or manipulate those blocks. Instead of implementing a complex search for a specific pattern of paragraph formats or text, the code to find an element can be much shorter and simpler to write. Attributes (metadata) associated with those elements can also be used by plug-ins to specify the nature of changes that the plug-in should make to the appropriate part of a document. This can still be accomplished in unstructured documents, with the use of custom markers, but the use of those makes both document authoring and plug-in coding more cumbersome. In some cases, a FrameMaker plug-in to perform a specific task for structured documents can be coded in half the time, or less, than a plug-in to perform the same task on unstructured documents.
The FDK (FrameMaker Development Kit) supplied by Adobe makes it possible to author plug-ins capable of manipulating any text, any properties, and any other objects in a FrameMaker document. This open-ended nature means that the FrameMaker application itself can be customized to do almost anything with documents that authors or publishers can conceive. Like ENLASO, your in-house developers can potentially create FrameMaker plug-ins that generate dramatic savings of thousands of hours and tens of thousands of dollars in publishing effort.
About the author of this article
Doug Pearson has been developing custom FrameMaker applications for ENLASO and its clients for nearly a decade. He is experienced in desktop publishing (especially FrameMaker), programming (especially C++), localization engineering, XML (and other forms of structured/hierarchical document design), single-source document design for multiple-format output, and in anticipating the needs of production staff throughout every stage of the publishing and localization process; these are all requirements for developing holistic, all-encompassing, custom solutions for a diverse collection of clients. Among his other accomplishments, he has developed dozens of plug-ins for both structured and non-structured versions of FrameMaker. He holds a BS in Electrical and Computer Engineering from the Johns Hopkins University.