Chapter 3. Using downCast

1. Basic operations
1.1. Choosing the source file
1.2. Choosing an XSLT processing sheet
1.3. Choosing the destination folder
1.4. Generating Word binary (.doc) files
1.5. The conversion process
1.6. Aborting a running conversion
2. Working with Configurations
2.1. What is a configuration?
2.2. Saving a configuration
2.3. Opening a configuration
2.4. A special configuration: preferences.plist
3. Logging
4. WordLink

1. Basic operations

This section describes basic operations for running downCast in GUI mode.

1.1. Choosing the source file

The source file should either be an XML file valid against the upCast DTD, or you should provide an XSLT processing sheet that transforms the source file to an XML file that then is valid against the upCast DTD (see Section 1.2, “Choosing an XSLT processing sheet”).

If the specified file is not a valid file, chances are that the conversion process does not succeed, though downCast will try to process the file anyway as far as possible.

Clicking the Browse… button next to the Source file text field brings up a file chooser dialog which lets you navigate through the folder structure of your mounted hard drive(s) or volumes. Select the file you want to convert and close the dialog by clicking OK.

You can also directly type in the name and access path of the source file you want to convert.

In doing so, to separate folder names, you must use the forward slash ('/') on Unix and Macintosh systems. On Windows machines, use the backslash ('\') character instead. The slashes will be converted to the appropriate, system specific separator character during file access.

1.2. Choosing an XSLT processing sheet

Note

This step is optional.

In case your source XML file does not conform to the upCast DTD, downCast has an XSLT processor built in to let you perform an appropriate transformation automatically to the source file. The result of that transformation is then processed by downCast - all at the mere click of a button.

Clicking the Browse… button next to the Pre-process with XSLT text field brings up a file chooser dialog which lets you navigate through the folder structure of your mounted hard drive(s) or volumes. Select the XSLT file you want to process the Source file with and close the dialog by clicking OK.

You can also directly type in the name and access path of the XSLT file you want to use.

In doing so, to separate folder names, you must use the forward slash ('/') on Unix and Macintosh systems. On Windows machines, use the backslash ('\') character instead. The slashes will be converted to the appropriate, system specific separator character during file access.

1.3. Choosing the destination folder

Next, choose the destination folder, i.e. the location where downCast will put its output file.

Clicking the Browse… button next to the Destination folder input field brings up a folder chooser dialog which lets you navigate through the folder structure of your hard drive(s). Select the folder you want downCast to put its result file into and close the dialog by clicking Choose Folder.

Note

The folder to be selected must be highlighted when you click Choose Folder.

You can also type in the path of the desired destination folder directly.

In doing so, to separate folder names, you must use the forward slash ('/') on Unix and Macintosh systems. On Windows machines, use the backslash ('\') character instead. The slashes will be converted to the appropriate, system specific separator character during file access.

1.4. Generating Word binary (.doc) files

When you are running under Windows and have installed WordLink properly, you can have the RTF file generated by downCast automatically post-processed into Word binary (.doc) format. Also in this process, all fields contained in the file will be updated with current contents.

Note

This option is only enabled when running the application on Windows platforms and if WordLink is installed and functional.

1.5. The conversion process

To start a conversion process, click the Start Conversion button.

The conversion process in downCast consists of up to three phases:

First, downCast optionally reads and pre-processes the source file with the specified XSLT processing sheet. Then it reads in the XML file and any linked CSS file. Finally, the export process is initiated and the resulting RTF file is generated. The exported file will have the name basefilename.rtf.

1.6. Aborting a running conversion

The progress window that is displayed during a conversion process provides a Cancel button. You can abort the conversion process at any time by clicking this button.

Note

The progress bar's dispaly is sluggish and it may take some time until it reacts to user input. This will be remedied in a future version.

2. Working with Configurations

2.1. What is a configuration?

A configuration in downCast consists of all settings you can make via the GUI. It describes the current state of the application and comprises the following areas:

  • current source file selection

  • current XSLT processing sheet file selection

  • current destination folder

2.2. Saving a configuration

To save the current configuration of downCast to disk, choose Save Configuration… from the File menu. This brings up a file chooser dialog that lets you select the location and the name of the file where the configuration will be stored. Click on Save to actually save the configuration.

Important

For consistency reasons, you should make sure that the file name has the extension .plist.

2.3. Opening a configuration

To open or reload a configuration you had previously saved, choose Open Configuration… from the File menu. In the file chooser dialog presented, choose the configuration you want to open.

2.4. A special configuration: preferences.plist

The preferences file preferences.plist, located in the Preferences folder, is a special configuration file that is saved every time you quit downCast, and that is automatically restored whenever you start downCast the next time.

For you, this means that the configuration of the downCast application is automatically preserved across single sessions.

This file is stored in the platform specific Preferences folder.

3. Logging

downCast relies on the log4java logging framework. Describing the configuration of this system is beyond the scope of this manual; for details, see the log4java project website.

The default configuration of the system is:

# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=INFO, A1

# A1 is set to be a RollingFileAppender.
log4j.appender.A1=org.apache.log4j.RollingFileAppender

# A1 Set options.
log4j.appender.A1.MaxFileSize=256KB
log4j.appender.A1.MaxBackupIndex=5
log4j.appender.A1.File=${de.infinityloop.application.logdir}/downcast.log
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{DATE} %-5p %x - %m%n

As you can see, downCast defines the property de.infinityloop.application.logdir to hold the platform specific directory for log files (less the trailing file separator character). This configuration file is found in the downCast distribution JAR at the following location: /de/infinityloop/downcast/resources/config/log4j.properties. If you need or want to change the logging behaviour of the product, you need to change this file in the distribution JAR.

Note

We recommend to remove the log4j.properties file completely when using upCast as a library and control logging completely from the host application's log4j configuration. When you remove the log4j.properties file from upcast.jar, upCast does not set up any logging.

You'll probably want to change the default configuration when using downCast as a library in a custom application, where you want it to write to a specific log or a stream. You may do this e.g. programmatically using the log4java API.

To view the contents of the logfile select View Log File from the File menu. This displays the current contents of the logfile in a new window at the time this window is opened.

If you want to save the contents of the logfile persistent to a different file, use the Save Text As… button at the bottom of the window.

Note

When you submit a bug report to infinity-loop or request technical support, please include the contents of the respective logfile along with the document itself in your e-mail. This might be valuable information for our technical support staff to track down your problem and assist you in finding a solution.

4. WordLink

If you're running upCast on Windows 95/98/2000/NT/XP and have a working installation of Word 97 or later, you can also convert to Microsoft Word binary (*.doc) files directly. For this to work, you need to install some additional software included in the downCast distribution. To do this, choose the ExtrasInstall WordLink command. After relaunching downCast, WordLink should be available and active. You can check this in the HelpSystem Information… window.

This additional software lets downCast remote-control the installed copy of the Word application for invisibly and automatically converting the generated RTF file to Word binary .doc format. Once installed, WordLink performs transparently in the background when needed.

Note

The WordLink feature is not available on Macintosh and Unix platforms. Therefore, when running on these platforms, the ExtrasInstall WordLink command will always be disabled.