[Date Prev][Date Next] [Thread Prev][Thread Next]
[Date Index] [Thread Index] [New search]

Re: Books: parametric documents and FM-database interaction



At 09:29 AM 1/2/01 +1000, hedley_finger@myob.com.au wrote:

>Wolfgang Keller wrote:
>
> > Our systems [...] usually consist of a base system chosen from a small
>range
> > of standard products which is then customised to a certain extend.
> >
> > What I'm looking for is a cost-effective solution that allows me to
> > semi-automatically generate, for example, a technical description of
> > such a system. The current 'solution' is rather a problem, as it
> > consists of you-know-which so-called "text processor" and tedious,
> > time-consuming as well as error-prone copy-and-paste-and-reformat
> > (and time is _very_ critical for me/us).
> >
> > As I've already worked with Framemaker before, I know that Framemaker
> > has a feature called 'conditional text' that allows to parametrise
> > the content of a document dependant on the values of user-defined
> > variables.
>
>Another approach would be to keep all the information in a database and
>assemble the text for any custom instance by extracting the text from the
>database.
===================================================
Another approach would be to utilize UniMerge from Refined Reports
(retail price is ~ $600 for Windows platforms). UniMerge runs on
Windows and Sun Solaris platforms, and can even run on the Mac
If it has an added MS-DOS/Windows 9x interface.

I have a paper (PDF) entitled Database Publishing with UniMerge and
FrameMaker, which explains how it is done. However, that paper does
not cover how UniMerge can be used with FrameMaker to assemble
customized documents based on the content of database records,
where each such record describes a particular system configuration,
as Wofgang has described. This approach avoids the limitations and
of FrameMaker's conditional text feature, and has many other
advantages as well.

THE DATA RECORD
Let's say that a system can include a number of standard products (i.e.,
components), each of which can be customized in a frinite number of ways.
Thus, a particular system configuration would be defined by indicating (in 
fields of
the associated data record for that system configuration) which components
are included, and, for each such included component, which customization
features are incorporated. The presence of a component within a system
configuration is indicated by a field value of 1, and the presence of
of a particular custom feature within that component is also indicated
by a field value of 1 (the absence of a component or feature is indicated
by no value (null) or 0).

FRAMEMAKER TEXT INSET FILES FOR COMPONENTS
For each component, you must create a separate FrameMaker text inset file 
(saved in
MIF format) containing all the descriptive text, tables, and illustrations 
required
to describe that component. Such a text inset file can contain many separate
text insets (i.e., modules of text, tables, and illustrations), where each 
such text inset
(hereafter called a main flow text inset) is contained in a separately (and 
descriptively)
named text flow.

To add information about customized features in the main flow text insets,
you create additional text inset modules (hereafter called reference page
text insets) on descriptively named reference page text flows within the
same text inset file. A UniMerge conditional command of the following
form appears at the applicable places in the main flow text insets:

         IF (custom1 = "1")
(applicable imported-by-reference reference page text inset)
         END
Where custom1 is the field that indicates whether or not a particular
included custom feature is included. If the field value is 1, the reference
page text text inset will be included in the main flow text inset.

THE FRAMEMAKER MERGING TEMPLATE
Now, after creating the text inset file for each component,  you create
a FrameMaker master document file (saved as MIF), hereafter called the
merging template, which is used to produce the document for any system
configuration.

In the merging template, you include all the information that is common
to all configurations. At points in the common text where information must
be added for a particular included component, you specify a UniMerge
conditional command of the following form:

         IF (component1 = "1")
(applicable imported-by-reference main flow text inset from the text inset 
file for component1)
         END
Where component1 is the field that indicates whether or not a particular
component is included in the system configuration.
If the field value is 1, the main flow text inset (including any reference 
page text
insets for included custom features) will be included in the generated
document.

Note that the IF (component1 = "1") conditional command can appear at many
different locations within the merging template. At each such location, a
different main flow text inset is imported from the text inset file for
component1.

The IF conditional command can also be used to construct a table,
where a separate row (containing descriptive data) is provided for
each component included in the system configuration.

THE DATA MERGING OPERATION
The data merging operation is initiated from the DOS or UNIX command
line. The command specifies the filename of the merging template (MIF)
and the filename of the ASCII data file containing the record for the
system configuration for which a document is to be produced. This
command directs UniMerge to merge the named data file with the
merging template. During the merging operation, UniMerge reads
and executes each UniMerge command (e.g., conditional commands)
found in the merging template and the included text insets. The resulting
output is a fully formatted FrameMaker MIF file containing the completed
document.

THE ADVANTAGE OF USING TEXT INSETS
Text insets are the equivalent of SGML external text entities, which
can be incorporated by reference into many different documents.

Because they are imported by reference into the merging template,
they can be automatically updated in the merging template whenever
the source text inset file is changed.

Within a text inset file, each distinct module resides in a separate
and descriptively named text flow. Any such module can be
easily retrieved (i.e., imported) simply by specifying its text flow name.
Consequently, the set of text inset files for a project constitutes a
"library" of information modules having the same selective retrieval
capability that would be possible if these modules had been individually
stored in a database.

MORE ABOUT UNIMERGE CONDITIONAL (IF) COMMANDS
UniMerge conditional commands are very powerful. If an expression
is true, all contents below it (e.g., text insets, field values, static text)
down to the next ELSE or END command are merged (i.e., included
in the output). Here are some of the capabilities:

Conditional commands can include complex, intermixed Boolean
expressions. for example:
         IF ((A = "U) AND (B = "V")) OR (A = "Y") OR (B != "Z")
Where A, B, and C are fieldnames, and U, V, Y, and Z are constants.

Expressions can use the following comparison operators:
= (equal to) < (less than) > (greater than), >= (greater than or equal to),
<= (less than or equal to), = (equal to), and ! (not equal to)

Expressions can also contain arithmetic operators:
- (subtraction), + (addition), * (multiplication), / (division)
For example:
         IF ((A + B/C) > X)
where A, and B are fieldnames, and C and X are constants.

Expressions can be nested to any level, and may include ELSE
and ELSE IF command. For instance:
         IF (A = "U")
merge some text if A is equal to U
                 IF (B = "V")
merge some more text if A is equal to U and B is equal to V
                 ELSE IF (B = "X")
merge some more (and different) text if A is equal to U and B is equal to X
                 END
         ELSE IF (A = "G")
merge some different text if A is equal to G
         ELSE
merge some different text if A is not equal to U or G
         END
Where A and B are fieldnames, and U, V, X, and G are constants.

 From the foregoing, it is evident that the conditional command
is much more powerful than the FrameMaker conditional text
feature, permitting complex conditional relationships
to be easily implemented.

OTHER UNIMERGE COMMANDS AND FEATURES
UniMerge can execute a number of commands besides
conditional commands. Many of these commands
and features are described in my paper, Database
Publishing with UniMerge and FrameMaker.

The merging template and text insets can also specify fieldnames
in the text to be output. At merge time, these fieldnames are
replaced by their values in the data record(s) being merged. This
can provide a more flexible way than FrameMaker variables for
including configuration-dependent variable data in the
FrameMaker output.







====================
| Nullius in Verba |
====================
Dan Emory, Dan Emory & Associates
FrameMaker/FrameMaker+SGML Document Design & Database Publishing
Voice/Fax: 949-722-8971 E-Mail: danemory@primenet.com
10044 Adams Ave. #208, Huntington Beach, CA 92646
---Subscribe to the "Free Framers" list by sending a message to
majordomo@omsys.com with "subscribe framers" (no quotes) in the body.



** To unsubscribe, send a message to majordomo@omsys.com **
** with "unsubscribe framers" (no quotes) in the body.   **