PageBox: servlet running in sandbox on J2EE PageBox

for
Presentation FAQ Reference Customisation Runtime Forms Demo Math Verification Downloads Troubleshooting

Cuckoo Reference Guide

Audience

This document primarily targets Page Authors.

You will find here:

  1. How to use Cuckoo

  2. How to write Word documents for Cuckoo

Installation and use

  1. Open a Command window. Move to cuckoo_installation_dir\math\bin and run regsvr32 math.dll.

  2. Copy cuckoo.dot in your template directory.

  3. Start Word, open cuckoo.dot and select Tools | Macro | Visual Basic Editor. On the Visual Basic Editor, select Tools | References... Check the reference to the math dll:

Note:

You must also refer to Microsoft Scripting Runtime (WSH) and to Microsoft MSXML (3 or above) that you should have installed as written in the download page.

Create a new document using the cuckoo template.

You should see a toHTML button:

When you want to convert your document to HTML, click on the toHTML button. You should get this form:

Enter the full path of the file where you want to store your HTML document and of the Style directory file, then click save. Cuckoo starts the default browser to display the generated page.

The filename and style you entered are saved. The next time you click on the toHTML button, the filename and style fields are set with the former values. You just need to change them if needed.

The drive that you specify must exist and you must be able to write in the HTML document directory. Cuckoo creates the directory if it doesn't exist. You get warnings if the style sheets, cuckoo.xsl and cuckoo.css or if the Javascript file, cuckoo.js are not in the target directory. Then Cuckoo copies these files from the Style directory to the HTML document directory.

Name

Default

Purpose

Customizable

XSL file name

cuckoo.xsl

Used by MSXML to merge the converted document and the site file

Yes

CSS file name

cuckoo.css

Used to display the HTML page

Yes

JavaScript file

cuckoo.js

The delivered version only handles mouse overs

Yes

If you don’t set the File name, the HTML document has the same name as the Word document but with a .html extension. You don’t need to set the Style directory if cuckoo.xsl, cuckoo.css and cuckoo.js are already in the HTML document directory.

See the customization guide for a brief introduction of XSL and CSS and a description of the deliveries.

If you need to use names different of cuckoo.xsl, cuckoo.css and cuckoo.js , click on the Setting button. You should get this form:

You can set the XSL file name, the CSS file name and the JavaScript file. Those names are saved across Cuckoo sessions. You can switch the trace on or off. In that case a file log.txt is filled in the same directory as the XML and HTML file. You can also set different standard style names for Normal, Heading i , Comment Text and Title.

The latter feature is useful when you use a non-English version of Word and especially when you need to process an existing document. The screenshot above shows the appropriate setting for the French version of Word. In the same way the directory where images are saved (forImg_files in English, which is the default) can be set. In French the appropriate setting is forImg_fichiers (though a correct translation would be pourImg_fichiers.) To find the directory name for a given language create a Word document with an image, save this document as HTML and see in which directory the image is saved.

On the right side of the form you can define:

The latter feature is useful when you use a non-Latin version of Word. In this case your Word styles cannot be used as CSS class name as it is made by default: a CSS class name must be an ASCII string.

Caution:

Whatever modification you do except on the Custom Style mapping section, you must click on the Set button at the bottom to commit the change.

For Custom Style mapping:

  1. To add a custom style, enter the style name on the upper TextBox and click on the Add button

  2. To set the CSS class name, first select the style name with the ComboBox, then enter the class name on the lower TextBox and click on the Set button

  3. To delete a custom style, first select the style name with the ComboBox and then click on the Delete button.

Notes:

Tests

Tests with up to 550 headers and 2 MB files.

Cuckoo has been tested with:

We better support IE 5, IE 6, Mozilla and Netscape 6.2 because their implementation of DOM is better.

Reference

Bullet and numbering

Cuckoo supports nested bullets and numbering as you can see in the Installation Verification below.

You can also define paragraphs at the same level as a bullet/numbering. However you must use Word [indent] and not tabs.

As a rule don’t use tabs and blanks with Cuckoo:

Cuckoo identifies bullets and numbering but not the sort of bullet/numbering. It processes in the same way:

Or

  1. Alphabetic

  2. Numeric

You define the shape of your bullets in the CSS.

Images

Use Edit|Paste Special... to paste you image in the Word document.

When you are displayed the form below uncheck Float over text.

Notes:

With Word 97, images are in GIF format.

With Word 2000, images are in JPEG or GIF format.

You can also insert images with Insert|Picture|From File.

Styles

Inherited of English Normal.dot

Style

HTML translation

Title

<title/>

Heading 1

<h1/>

Heading 2

<h2/>

Heading 3

<h3/>

Heading 4

<h4/>

Heading 5

<h5/>

Heading 6

<h6/>

Normal

Ignored

Comment Text

In comments, doesn’t generate a class attribute

Other paragraph styles

<p class="paragraph_style"/>

Other character styles

<p class="paragraph_style"/> or

<font class="character_style"/>

If you use a non-English version of Word, your standard style names can be different. Then use the Setting macro described above to define a different mapping. Let's assume that your Heading 1 style is MyHeading1. On the Settings form you map MyHeading1 to Heading 1. Then when Cuckoo finds a MyHeading1 style, it will generate a <h1>...</h1>.

cuckoo.dot

  1. Only style name matters: feel free to change style definition

  2. test-style and test-style2 are there to check the installation. They are processed just like any other paragraph style

Style

HTML translation

Description

<meta name="Description"/>

Keywords

<meta name=" Keywords"/>

TableHeader

In tables only: to create <th> rather than <td>

InvisibleTable

In tables only: if the first paragraph of a table cell has this style then the table is rendered with cuckoo-itable style and the cells with cuckoo-itd style

Button

<input type=submit/>

CheckBox

<input type=checkbox/>

CheckBoxSet

<input type=checkbox checked/>

ComboBox

<select type=text/>

RadioButton

<input type=radio/>

RadioButtonSet

<input type=radio checked/>

TextBox

<input type=text/>

Horizontal

<hr />

Ditto

The text is copied ditto in the generated XML document

test-style

<p class="test-style"/> or

<font class="test-style">

test-style2

<p class="test-style2"/> or

<font class="test-style2">

test-style3

<p class="test-style3"/> or

<font class="test-style3">

You cannot name a style Hyperlink, Bookmark or bookmark.

Bookmarks

Cuckoo 0.1 and above support bookmarks.

You create and reference a bookmark for Cuckoo as you do normally in Word:

Hyperlinks

Cuckoo 0.1.1 and above support two kinds of hyperlinks:

Ditto

Cuckoo 0.2.2 support inserting XHTML tags in the document. When you click on the toHTML document the text of the paragraphs in Ditto style is copied ditto in the generated XML document.

Caution:

Character styles are ignored in a paragraph in Ditto style

You must use Latin characters.

You must insert well-formed XHTML. For instance insert:

<img src="polaris1.jpg" alt="Show Polaris1 image" />

and not

<IMG SRC="polaris1.jpg" ALT="Show Polaris1 image">

It is better to write the XHTML using lower case characters but the most important is to close the tag (/> and not > here). It is easy to forget especially with <img> and <br>.

The last trap is Word auto correction. For instance, in an English document Word converts " in “. It doesn’t a big difference for the reader but it is enough to prevent the generation of the HTML document. Use Ditto only when you have no other solution, for instance:

In these cases, use Copy | Paste from the tool that you used to produce that code... and double-check auto correction.

Contact:support@pagebox.net
©2001-2004 Alexis Grandemange. Last modified .