Suppressing Content While Diverting it to a Standalone Page

Version

Date

Changes

1.0

2009-11-2

Initial version.

1.1

2009-11-2

Uploaded demo source files and WWH4 output.

Description

I'm moving our Publisher 2003 for FrameMaker production to ePublisher and am running into difficulties in recreating the functionality of some macro customizations that we made as a response to usability-test results.

Because of the structure of our Docbook-based DTD, our WWH4 output had some "wasted" topics that usability testing showed were slowing down readers' access to information (things like a topic containing only the title of the book that was used to generate the WWH, and copyright and trademark information -- legally necessary but not useful to information seekers).

In our Publisher 2003 template, copyright and trademark text is suppressed in the "main" flow of the WWH4 output, but collected and written to a separate "out-of-flow" file which is available from a footer link and opens in a separate window. The link changes for each book to point to the appropriate file containing specific copyright and trademark info for that book.

Constraints

For a variety of reasons, not least of which is that WWH is still not our primary delivery format, I cannot require our writers to make modifications to the FrameMaker source files. Therefore this solution will have to be entirely within the ePublisher stationery and depend upon existing paragraph stylenames.

The Challenge

In ePublisher, I need to be able to:

We author in Structured FrameMaker, and the relevant structure is something like the following:

<Manual>
 <Cover>
  <Booktitle>Book's Title</Booktitle>
  :
  <Copyright>(text inset)</Copyright>
 </Cover>
 :
</Manual>

Just to make things more interesting, the content of the Copyright element is an unstructured FrameMaker text inset with the following paragraph styles:

(The Booktitle element maps to paragraph style BookTitle, and in Publisher 2003 I use it to trigger the intialization of a global variable, set up the "out of flow" file, etc. In ePublisher it may be possible to disregard this paragraph style.)

The standard pop-up functionality based on paragraph styles comes close to what I need, but I have been unable to figure out how to store a URL, perhaps for use with wwhelp:Replacement, to access the "out of flow" file through .asp processing, or indeed how to write the content designated for pop-up treatment to a separate file.

My relevant Publisher 2003 macros are below. Hopefully this is enough to give the gist of what I need to duplicate. The double-slashed comments are an attempt to explain what's happening in each macro.

Existing Publisher 2003 Macro Code

// At the start of a run, define the global "out-of-flow" variable as empty
BZOnConvertAllStart
@SET_GLOBAL(var_OOFText,);

// At the beginning of each book, set up for "out-of-flow" processing
TitleofBook
// If the global "out-of-flow" variable is defined -- i.e. this is the second or
// subsequent book in the collection -- dump its content to a separate file using
// a custom .asp page that calls the "out-of-flow" variable
$COMMENT(set up for out-of-flow legal info);
@IF_EXISTS($GET_GLOBAL(var_OOFText);,
@SET_GLOBAL($GET_GLOBAL(var_bookLegal);title,$GET_GLOBAL(pagetitle););
@WRITE(overwrite, host, $OUTPUTDIR;$SEP;$GET_GLOBAL(var_bookLegal);,
$IMPORTANDEXPAND($SUPPORTDIR;$SEP;OutOfFlow.asp););
);

// Define a new filename to receive this book's legal text......
@SET_GLOBAL(var_bookLegal,legal-$PAGE(html,basename););\

// Clear the global "out-of-flow" variable
@SET_GLOBAL(var_OOFText,);\
@WRITELOG(OOF: Cleared var_OOFText, Set var_bookLegal to
$GET_GLOBAL(var_bookLegal););\

// We use the copyright info from the first book as a blanket statement for the collection:
// if this is the first book, map its legal info to a variable for the splash page
$IF_EXISTS($GET_GLOBAL(var_collLegal);,,
@SET_GLOBAL(var_collLegal,$GET_GLOBAL(var_bookLegal););\
@WRITELOG(OOF: =>=>=> Set var_collLegal = $GET_GLOBAL(var_collLegal););\
);

// One of the paragraph styles that contains legal info: append its content to "out-of-flow" variable
LegalHead1
@SET_GLOBAL(var_OOFText,$GET_GLOBAL(var_OOFText);

// One of the paragraph styles that contains legal info: append its content to "out-of-flow" variable
LegalHead3
// Also set the name of the file used for the collection-level copyright link to be displayed
// on the splash page
$COMMENT(SNPS mod: collection first book's copyright page
for use in Legal and trademark link. Using LegalHead3 as not
all books seem to use LegalHead1);
$IF_EXISTS($GET_GLOBAL(var_bookLegal);,,
@SET_GLOBAL(var_bookLegal,$PAGE(html,basename););
);
@SET_GLOBAL(var_OOFText,$GET_GLOBAL(var_OOFText);

// One of the paragraph styles that contains legal info: append its content to "out-of-flow" variable
LegalBodyRelative
@SET_GLOBAL(var_OOFText,$GET_GLOBAL(var_OOFText);

// One of the paragraph styles that contains legal info: append its content to "out-of-flow" variable
LegalIndentedRelative
@SET_GLOBAL(var_OOFText,$GET_GLOBAL(var_OOFText);


// Tidy up loose ends at the end of the run...
BZOnConvertAllEnd
// Dump the content of the "out-of-flow" variable from the last book in the
// collection to a separate file using a custom .asp page
$COMMENT(SNPS - finish writing last copyright file);
@IF_EXISTS($GET_GLOBAL(var_OOFText);,
@SET_GLOBAL($GET_GLOBAL(var_bookLegal);title,$GET_GLOBAL(pagetitle););
@WRITE(overwrite, host, $OUTPUTDIR;$SEP;$GET_GLOBAL(var_bookLegal);,
$IMPORTANDEXPAND($SUPPORTDIR;$SEP;OutOfFlow.asp););
,
);

// Generate a JavaScript file that defines the location of the collection-level
// HTML legal-info page
$COMMENT(write top-level legal path-definition file);
@WRITE(overwrite,host,$OUTPUTDIR;$SEP;legal.js,
var legal="../../../../$GET_GLOBAL(var_collLegal);"
);
@WRITELOG(********* WROTE legal.js with var
legal=$GET_GLOBAL(var_collLegal););

DevCenter/Projects/Suppress Content While Diverting it to a Standalone Page (last edited 2009-11-03 00:41:00 by CoryCarpenter)