Categories
Fact Sheet Fusion v2

Installing Templates

Templates

Fact Sheet Fusion templates are based on the following Internet standards called XML and XSL (eXtensible Stylesheet Language) and XSLT (XSL Transformations).

The following is not a tutorial on XML or XSLT. For further information on these standards please see the World Wide Web Consortium’s website https://www.w3.org.

A Fact Sheet Fusion template consists of the following components:

  • Template Settings Document
  • Style Sheets
  • JavaScripts
  • Template interface images
  • XSLT documents

Here is a screen shot of a typical template folder:

Screen shot of a typical template folder structure
Screen shot of a typical template folder structure

Each of these elements are described below.

Template Settings document

The fsf_template_settings.xml document is an XML description of the template that contains all the settings and recommendations associated with a template. The template author provides this along with the template.

The Template Settings document must be called ‘fsf_template_settings.xml‘, UTF-8 encoded and well formed. Each Template must contain a unique name.

The following example Template Settings document content contains all available options:

<?xml version="1.0" encoding="utf-8"?>
<FSF_Template name="Lucid Mobile Template" version="1.0">
    <Author>Fact Sheet Fusion</Author>
    <Description>This template has been specifically designed to export fact sheets for the Lucid Mobile application. The output uses very simple HTML tags to enable translation of the content in to the Lucid mobile format. It contains no CSS or additional template files such as JavaScript or images. Please note: The Lucid Mobile application doesn't support within the fact sheet complex objects such as image, videos or tables. Any associated media with the fact sheet are output separately and associated with the entities in the corresponding Lucid key via the Media List export file.</Description>
    <URL>http://www.lucidcentral.org/fact_sheet_fusion/templates/Lucid_mobile</URL>
    <Settings>
        <Regular_Images>900</Regular_Images>
        <Thumbnail_Images>175</Thumbnail_Images>
        <Video format="webm">450</Video>
        <JavaScript_Entity_Array>false</JavaScript_Entity_Array>
        <MediaList>true</MediaList>
        <Index>false</Index>
        <Glossary>false</Glossary>
        <HTML>true</HTML>
        <PDFs>false</PDFs>
        <XML>false</XML>
    </Settings>
</FSF_Template>

For more information on template settings see the Template Settings dialog.

Style Sheets

Cascading Style Sheets (CSS) are the rules that define the look and formatting of document written in markup language (E.g. HTML based fact sheets). Style sheets save you from having to apply styles and formatting to every text element during data entry. A template can have one or more style sheets associated with it. They are normally located in the CSS folder and have a .css file extension.

Tip

If you define in-line styles within your Topic text this will override the templates style sheet. This is why the HTML editor within Fact Sheet Fusion limits these options (e.g. Selecting font types or editing options for in-line styles). Pasting content from MS Word is a common example where in-line styles will be copied to maintain the exact look within the Word document, however this isn't recommended as they override the style sheets. See Clean HTML option for further information on dealing with content pasted from MS Office applications.

JavaScripts

JavaScript is the programming language of the Web. JavaScript enables options and functionality not available in regular mark-up languages such as HTML. It is commonly used for interactive content, validation among many other uses.
Template JavaScripts are normally located in the js folder and have a file extension of .js.

Template Interface Images

Any images that are used in the template design and layout are normally stored with the fs_images folder. For example, a template may use an image for a banner across the top of the fact sheet. This would normally be located here. If you wish to customize an interface image it is recommended that you make a copy of the template (folder) and customize this new edition to preserve the original template. You should take note of the image dimensions and file name as these are often referenced in the template style sheet.

XSLT Documents

The XSLT documents are where all the hard work of determining how the content of the fact sheet should be output. A Fact Sheet Fusion template may be comprised of one or more XSLT documents. If the template supports the output of an Index and glossary then it will have a minimum of three templates (described below). Fact Sheet Fusion Template documents must be located in the ‘fs_template‘ folder.

template.xsl – This XSLT document is responsible for the Entity fact sheets. It may reference additional XLST documents.

index.xsl – This XSLT document is responsible for the Index page. It may reference additional XLST documents.

glossary.xsl – This XSLT document is responsible for the Glossary page. It may reference additional XLST documents.

The above three XSLT documents must be named as described. Additional referenced XSLT documents can be named as desired. Fact Sheet Fusion XSLT documents also supports additional Script languages such as C# and Visual Basic. For example:

<?xml version='1.0'?>
<xsl:stylesheet version='1.0' xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:local="urn:local" extension-element-prefixes="msxsl">
    <msxsl:script language="CSharp" implements-prefix="local">
        public string CopyrightYear()
        {
            return DateTime.Now.ToString("yyyy");
        }
    </msxsl:script>
    <xsl:template name="copyright">
        <!-- BEGIN COPYRIGHT -->
        <div class="copyright">
      Copyright &#169; <xsl:value-of select="local:CopyrightYear()" disable-output-escaping="yes"/>. All rights reserved.
    <div id="button-previousnext"></div>
    </div>
        <!-- END COPYRIGHT -->
    </xsl:template>
</xsl:stylesheet>

Testing a Template

If you have created your own template or customized an existing one you can test out the template either by trying to export via the Export dialog or by exporting your content as XML and loading one of the XML pages in Internet Explorer. Any errors in the template should be reported in the browser.

If you export your template via the Export dialog errors maybe reported via a message box (if serious) or logged to the Fact Sheet Fusion log file. Always check the log file if your template is not exporting the expected result. See the Fact Sheet Fusion log file for more information on this topic.

Categories
Fact Sheet Fusion v2

Template Settings

Template Settings dialog
Template Settings dialog

The Template settings dialog gives additional information about the selected template. The template author provides information about the features the template supports to help decide on the best export options.

As you can see in the example above the Recommended Settings section outlines image sizes and the supported features and formats of the template.

Tip

These are recommended settings, you can try additional options in the export dialog to see if you get a good result, for example a template may not have been designed specifically to support PDF output, but often the output will be acceptable.

If the template has an associated web page you may want to click on this to check what the template may look like and if there are any additional instructions or updates available.

View template folder

The View template folder button will open the selected template folder in Windows Explorer. This is useful if you like a template but wish to customize it. It is recommended that you make a copy of the template folder and customize this edition.

Note

If you copy a template for customizing you must edit the fsf_template_settings.xml file in your preferred text editor and adjust the name of the template to be unique.

Use recommended settings

This option will apply all the recommended settings to the export dialog. If applied these settings will override any previous related settings already made in the Export dialog. You will receive a warning message regarding this prior to the settings being applied.

Use Template Recommended Settings confirmation dialog
Use Template Recommended Settings confirmation dialog
Categories
Fact Sheet Fusion v2

Templates

Fact Sheet Fusion templates are based on the following Internet standards called XML and XSL (eXtensible Stylesheet Language) and XSLT (XSL Transformations).

The following is not a tutorial on XML or XSLT. For further information on these standards please see the World Wide Web Consortium’s website https://www.w3.org.

A Fact Sheet Fusion template consists of the following components:

  • Template Settings Document
  • Style Sheets
  • JavaScripts
  • Template interface images
  • XSLT documents

Here is an example of a screen shot of a typical template folder:

Screen shot of a typical template folder structure
Screen shot of a typical template folder structure

Each of these elements are described below.

Template Settings document

The fsf_template_settings.xml document is an XML description of the template that contains all the settings and recommendations associated with a template. The template author provides this along with the template.

The Template Settings document must be called ‘fsf_template_settings.xml‘, UTF-8 encoded and well formed. Each Template must contain a unique name.

The following example of a Template Settings document that illustrates all available options:

Fact Sheet Fusion
This template has been specifically designed to export fact sheets for the Lucid Mobile application. The output uses very simple HTML tags to enable translation of the content in to the Lucid mobile format. It contains no CSS or additional template files such as JavaScript or images. Please note: The Lucid Mobile application doesn’t support within the fact sheet complex objects such as image, videos or tables. Any associated media with the fact sheet are output separately and associated with the entities in the corresponding Lucid key via the Media List export file.

<?xml version="1.0" encoding="utf-8"?>
<FSF_Template name="Lucid Mobile Template" version="1.0">
    <Author>Fact Sheet Fusion</Author>
    <Description>This template has been specifically designed to export fact sheets for the Lucid Mobile application. The output uses very simple HTML tags to enable translation of the content in to the Lucid mobile format. It contains no CSS or additional template files such as JavaScript or images. Please note: The Lucid Mobile application doesn't support within the fact sheet complex objects such as image, videos or tables. Any associated media with the fact sheet are output separately and associated with the entities in the corresponding Lucid key via the Media List export file.</Description>
    <URL>http://www.lucidcentral.org/fact_sheet_fusion/templates/Lucid_mobile</URL>
    <Settings>
        <Regular_Images>900</Regular_Images>
        <Thumbnail_Images>175</Thumbnail_Images>
        <Video format="webm">450</Video>
        <JavaScript_Entity_Array>false</JavaScript_Entity_Array>
        <MediaList>true</MediaList>
        <Index>false</Index>
        <Glossary>false</Glossary>
        <HTML>true</HTML>
        <PDFs>false</PDFs>
        <XML>false</XML>
    </Settings>
</FSF_Template>

For more information on template settings see the Template Settings dialog.

Style Sheets

Cascading Style Sheets (CSS) are the rules that define the look and formatting of a document written in markup language (E.g. HTML based fact sheets). Style sheets save you from having to apply styles and formatting to every text element during data entry. A template can have one or more style sheets associated with it. They are normally located in the CSS folder and have a .css file extension.

Tip

If you define in-line styles within your Topic text this will override the templates style sheet. This is why the HTML editor within Fact Sheet Fusion limits these options (e.g. Selecting font types or editing options for in-line styles). Pasting content from MS Word is a common example where in-line styles are copied to maintain the exact look within the Word document, however this isn't recommended as these Word document styles override the style sheets. See Clean HTML option for further information on dealing with content pasted from MS Office applications.

JavaScripts

JavaScript is the programming language of the Web. JavaScript enables options and functionality not available in regular mark-up languages such as HTML. It is commonly used for interactive content, such as validation and many other uses.
Template JavaScripts are normally located in the js folder and have a file extension of .js.

Template Interface Images

Any images that are used in the template design and layout are normally stored with the fs_images folder. For example, a template may use an image for a banner across the top of the fact sheet. This would normally be located here. If you wish to customize an interface image it is recommended that you make a copy of the template (folder) and customize this new edition while preserving the original template. You should take note of the image dimensions and file name as these are often referenced in the template style sheet.

XSLT Documents

The XSLT documents are where all the hard work of determining how the content of the fact sheet should be output. A Fact Sheet Fusion template may be comprised of one or more XSLT documents. If the template supports the output of an Index and glossary then it will have a minimum of three templates (described below). Fact Sheet Fusion Template documents must be located in the ‘fs_template‘ folder.

template.xsl – This XSLT document is responsible for the Entity fact sheets. It may reference additional XLST documents.

index.xsl – This XSLT document is responsible for the Index page. It may reference additional XLST documents.

glossary.xsl – This XSLT document is responsible for the Glossary page. It may reference additional XLST documents.

The above three XSLT documents must be named as described. Additional referenced XSLT documents can be named as desired. Fact Sheet Fusion XSLT documents also supports additional Script languages such as C# and Visual Basic. For example, the following XSLT shows a simple C# procedure to get the current year for use in the copyright statement:

<?xml version='1.0'?>
<xsl:stylesheet version='1.0' xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:local="urn:local" extension-element-prefixes="msxsl">
    <msxsl:script language="CSharp" implements-prefix="local">
        public string CopyrightYear()
        {
            return DateTime.Now.ToString("yyyy");
        }
    </msxsl:script>
    <xsl:template name="copyright">
        <!-- BEGIN COPYRIGHT -->
        <div class="copyright">
      Copyright &#169; <xsl:value-of select="local:CopyrightYear()" disable-output-escaping="yes"/>. All rights reserved.
    <div id="button-previousnext"></div>
    </div>
        <!-- END COPYRIGHT -->
    </xsl:template>
</xsl:stylesheet>

Testing a Template

If you have created your own template or customized an existing one you can test out the template either by trying to export via the Export dialog or by exporting your content as XML and loading one of the XML pages in Internet Explorer. Any errors in the template should be reported in the browser.

If you export your template via the Export dialog errors maybe reported via a message box (if serious) or logged to the Fact Sheet Fusion log file. Always check the log file if your template is not exporting the expected result. See the Fact Sheet Fusion log file for more information on this topic.

Categories
Fact Sheet Fusion v2

Export – Template Options

Export Dialog Template tab
Export Dialog Template tab

The Template tab contains a minimum set of options required to begin exporting.

To begin with, select a fact sheet template from the drop down list. All installed templates will be listed within the drop down.

Template Settings

The template settings provide you details on the selected template. It also outlines the recommended settings for the template, which can be automatically applied.

Destination

Select a destination folder for your exported fact sheets. It is recommended that you choose an empty folder to ensure you can see exactly what is exported if you need to copy the fact sheets to a web server or some other destination. To select an export destination folder select the file browser button.

Warning:
 Exporting will overwrite any existing fact sheets or media of the same name in the destination folder.

Export File Types

You can select one or more export formats for your fact sheets.

HTML

The fact sheets will be exported in Hyper Text Markup Language (HTML) format. The HTML export structure will look like that shown below, within the destination folder:

Assets
            \images
            \video
            \sound
            \pdf
            \other
css
js
fs_images

PDF

The fact sheets will be exported in Portable Document Format (PDF). All of the fact sheets and associated images are embedded within the PDF file, rather than being exported to a separate folder and referenced.

PDF Settings

PDF Output setting dialog
PDF Output setting dialog

There are a number of additional settings for PDF export. All settings will be saved automatically when the dialog is closed.

Paper size

All paper sizes supported by your operating system will be loaded into the paper size drop down list.

Paper orientation

The paper orientation can be set to either Portrait or Landscape.

Color mode

Output the PDF in either Color or Grey scale.

Output mode

Most templates have style definitions for how the fact sheet should look both on screen and in print. Normally if you are selecting to export to PDF you may prefer to select print definitions, rather than screen definitions, though the choice will depend on personal preference and the template design.

Output DPI

The output DPI you define depends on the quality you wish to print at. For example it is common for printers to support 300 DPI or higher, however it is not always necessary to output at this level to achieve a good print result. The higher the DPI output the larger the file size.

Compress PDF

If selected the PDF will be internally compressed using ZIP.

Page Margins

Allow you define the amount of empty space around the edge (margin) of the document.

XML

This option exports the fact sheets in eXtensible Markup Language (XML). The output folder structure will be the same as the HTML export.

Media Options

The media options defined in the Template tab are global in nature. They apply to all images associated with the fact sheets, glossary and index.

Tip

Exporting media is the most expensive computing operation of the export process. If media has already been exported, and the only changes made are to the text portion of the fact sheet (i.e. Topic text), export will be much faster if the skip media option is selected.

Force overwrite media

This option will cause the media to be output, even if it already exists in the destination folder.

Skip media export

Selecting this option will stop the media from being exported. This can be useful if you have already exported the media previously and have only changed the text of a fact sheet.

Scale regular images

If selected, you will need to define a preferred image size in pixels. During export, all images greater than this dimension will be resized. Non web friendly formats such as Bitmaps and TIFFs will be converted to the JPEG format.

Tip

Regular images are normally not shown directly in a fact sheet due to their size. They are usually accessed by clicking on the thumbnail version, which then opens the regular sized image for display. How the regular image is accessed and displayed depends on the export template you select.

Scale thumbnail images

If selected, you will need to define a preferred size for the thumbnail images. The images will be scaled to this dimension during the export process.

Note

Watermark options are not applied to thumbnail images.

Image compression

Image compression involves a balance between image quality and size, since the compression process discards image information. Less compression means a higher quality image, while selecting more compression can mean a small file size but pixelated, blurry images. For most purposes, a compression level between 60-90 will be suitable. Only image formats that support compression, such as JPEG, will have compression applied.

Below is an example of extreme compression (poor quality) vs low compression (high quality).

Low quality (extreme) image example

High quality image example

Very high compression, but low quality image example
File size: 2 Kilobytes.
Very low compression, but high quality image example
File size: 23 Kilobytes.

Both images are 200 pixels wide by 145 pixels high at 96 DPI (dots per inch).

Export Options

Fact Sheet Fusion uses a technique called multi-threading to perform the export tasks. This can be likened to breaking down the export job into hundreds (or thousands) of individual tasks, then employing multiple workers to perform these tasks at the same time. This is particularly useful under modern computer architecture that employs multiple CPU cores and large memory spaces. The number of threads (workers) has been limited to 100, even though normally many more threads are available. Any more and the export tasks may overwhelm the operating system, making it unresponsive to other tasks it might be doing, such as checking emails…

During the export process Fact Sheet Fusion will report the number of export jobs it has started and update the number that are remaining as it completes the export process, along with an estimated time to complete.

To begin the export process, click the Export button. Prior to the export beginning a minimum set of options need to defined, such as the export template, export destination and the export type (HTML, PDF and/or XML). If you have not met the minimum export requirements these options will be highlighted in the export dialog.

The screen shot above shows the Export process in action.
The screen shot above shows the Export process in action.

During export it is possible to abort the Export process. To do so, click the Abort button. Fact Sheet Fusion will confirm that you wish to abort before it stops all current export threads (workers).

Abort Export confirmation dialog
Abort Export confirmation dialog