The Content Management Server is supplied with HTML filter software with which files in many formats can be converted, including the images they contain, if desired.
For the Content Navigator, a conversion wizard is available with which the users can easily convert a resource file. This process generates additional files in NPS containing the content converted to HTML and, if applicable, also the images. For details on creating wizards see also section Wizards.
For converting files the wizards call procedures from the supplied Tcl
library share/script/cm/serverCmds/converterLib.tcl
. This
library also contains interface routines that call the Verity filter
application.
For converting an office document without subsequently generating files
in the CMS, the procedure nps::convertWithVerity
can be used
in a Tcl Shell. Example:
nps::convertWithVerity aWord.doc msAdvert /tmp/Converted
This converts the document aWord.doc
into the HTML file
/tmp/Konvertiert/msAdvert.html
and places the associated
images (if images images existed in the document) in the same directory.
To convert an office document and store it in the CMS as a folder (including images in this folder, if applicable) the following procedure can be used:
msOfficeConverter::_convert resourceId
As resourceId
the procedure expects the ID of a CMS file of
the resource type. Of this file the main content of the draft version is
converted. If the file does not have a draft version, it is created from
the relesed version.
In the draft version of the file to be converted, the fields
conversionResults
and lastConversion
need to
exist. These fields have the following tasks:
Field | Task |
---|---|
conversionResults |
This field is of the Linklist type. During conversion, links to additional files (usually links to images) are stored in this field. If a new main content is subsequently imported into the resource and the resource is converted once again, the files to which the links in the field point are deleted. |
lastConversion |
The field is of the date type. The conversion procedure stores the time of conversion in it. |
The procedure returns the ID of the folder created.